Index: tmp/trunk/org.txm.setups/README
===================================================================
--- tmp/trunk/org.txm.setups/README	(revision 0)
+++ tmp/trunk/org.txm.setups/README	(revision 728)
@@ -0,0 +1,59 @@
+README file of TXM setups project
+---------------------------------
+
+* Steps to build TXM setups
+
+- update version number in projects :
+  - rcpapplication.product : Overview
+  - rcpapplication.product : Branding
+  - plugin.xml : Overview
+- update splash.bmp with incrust_version_in_splash.sh script
+- update setups messages
+- update release message
+- run setSetupsVersion.sh script
+- Export products
+- run BuildAll.sh
+
+* File descriptions
+
+- 0.7.1beta1 : 0.7.1 environment backup
+- annonces : les annonces au format markdown, html, mail, etc. les formats mail & html sont gÃ©nÃ©rÃ©s par le script md2html2mail.sh
+- archs : les fichiers de setup organisÃ©s par architecture et OS
+- automatedBuild : EN TRAVAUX, doit permettre d'automatiser la construction des binaires Java en dehors d'Eclipse
+- exportRCP : les binaires Java
+- launch4j : exÃ©cutable pour enrober un .jar dans un .exe (utilisÃ© pour construire detectJVM.exe)
+- nsis : exÃ©cutable NSIS pour construire les setups Windows. ExÃ©cutÃ© sous Wine
+- shared : les fichiers de setups partagÃ©s entre les OS et par OS
+- TXM_0.7.1_Linux32 : regroupement des fichiers avant construction de Deb
+- TXM_0.7.1_Linux64 : regroupement des fichiers avant construction de Deb
+- TXM_0.7.1_MacOSX : regroupement des fichiers avant construction de package Mac
+- TXM_0.7.1_Win32 : regroupement des fichiers avant construction de NSIS
+- TXM_0.7.1_Win64 : regroupement des fichiers avant construction de NSIS
+- auth.txt : contient login+mdp pour envoyer les fichiers sur le serveur partagÃ© sans avoir Ã  saisir de mdp
+- BuildAll.sh : recupÃ¨re les fichiers partagÃ©s et construit tous les setups
+- buildCWBforAll.sh : obsolÃ¨te
+- deleteTXMBuilds.sh : supprime les binaires du dossier exportRCP
+- end.wav : musique jouÃ©e Ã  la fin de BuildAll.sh
+- extractDeb.sh : outil pour decompresser un fichier .deb, pratique pour le modifier
+- getSharedFiles.sh : rÃ©cupÃ¨re tous les fichiers partagÃ©s : textometrieR, scripts Groovy et R
+- launch4jconf.xml : conf pour launch4J
+- Linux32bit.sh : construit le setup Linux 32bit
+- Linux64bit.sh : construit le setup Linux 64bit
+- logs32 : logs d'erreur NSIS 32bit (Ã  cause d'un problÃ¨me avec Wine)
+- logs64 : logs d'erreur NSIS 64bit (Ã  cause d'un problÃ¨me avec Wine)
+- MacOSXIntel.sh : construit l'archive pour le setup MacOSX : la suite des opÃ©rations se dÃ©roule sur un Mac
+- md2html2mail.sh : convertit les fichiers .md vers un format txt (pour le mail) et en html
+- md5Digest.jar :  ??OLD: bougÃ© dans shared/portals?? livrÃ© dans le setup du Portail (gÃ©nÃ¨re un mdp md5)
+- Portals.sh : construit le setup pour portail
+- sendSetupsToSourceforge.sh : DÃ©pose les setups sur Sourceforge, il faut avoir configurÃ© une clÃ© publique
+- setSetupsVersion.sh : Met Ã  jour les numÃ©ros de version dans les scripts (nsis aussi)
+- SetupMessages_en.properties : tous les messages EN des setups 
+- SetupMessages_fr.properties : tous les messages FR des setups
+- TXM_0.7.1_Linux32.deb : setup Linux 32
+- TXM_0.7.1_Linux64.deb : setup Linux 64
+- TXM_0.7.1_MacOSX.zip : archive pour construire le setup Mac
+- TXM_0.7.1_Win32.exe : setup windows XP/Vista/Seven/8 32bit
+- TXM_0.7.1_Win64.exe : setup windows XP/Vista/Seven/8 64bit
+- VERSION : contient le numÃ©ro de version du setup courant, la valeur est utilisÃ©e un peu partout dans les scripts
+- Win32bit.sh : construit le setup windows 32
+- Win64bit.sh : construit le setup windows 64
Index: tmp/trunk/org.txm.setups/extractDeb.sh
===================================================================
--- tmp/trunk/org.txm.setups/extractDeb.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/extractDeb.sh	(revision 728)
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+if [ $# -ne 2 ]
+then
+  echo "Usage: ./extractDeb.sh *.deb dir"
+  exit 1
+fi
+
+if [ -d "$2" ]; then
+	echo "** extractDeb: outdir already exits: $2."
+	exit 1;
+fi
+
+if [ ! -f "$1" ]; then
+	echo "** extractDeb: deb file does not exits: $1."
+	exit 1;
+fi
+
+mkdir $2 &&
+dpkg-deb -x "$1" "$2" &&
+dpkg-deb -e "$1" "$2/DEBIAN"
+
+if [ $? != 0 ]; then
+	echo "** extractDeb: failed to extract deb file"
+	exit 1;
+fi

Property changes on: tmp/trunk/org.txm.setups/extractDeb.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/BuildWin64bit.sh
===================================================================
--- tmp/trunk/org.txm.setups/BuildWin64bit.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/BuildWin64bit.sh	(revision 728)
@@ -0,0 +1,84 @@
+VERSION=`cat VERSION`
+STEP=$1
+ARCH="64"
+ARCHCODE="x86_64"
+APP="TXM_${VERSION}_Win${ARCH}_installer"
+
+echo "Make dir"
+rm -rf "${APP}"
+mkdir "${APP}"
+
+# ensure JRE files are here
+if [ ! -d "shared/win/jre/bin" ]; then
+	echo "** $APP: JRE files are missing."
+	exit 1;
+fi
+
+echo "copy shared files: css, xsl, scripts, samples..."
+rsync -r  --exclude '.svn' "shared/all"/* "${APP}"
+
+if [ $? != 0 ]; then
+	echo "** ${APP}: copy Win shared files failed"
+	exit 1;
+fi
+
+echo "convert licence files encoding to Windows-1252"
+iconv -f utf8 -t WINDOWS-1252 shared/all/license_agreement_fr.txt > "$APP/license_agreement_fr.txt"
+iconv -f utf8 -t WINDOWS-1252 shared/all/license_agreement.txt > "$APP/license_agreement.txt"
+iconv -f utf8 -t WINDOWS-1252 shared/all/LICENSE_FR.TXT > "$APP/LICENSE_FR.TXT"
+iconv -f utf8 -t WINDOWS-1252 shared/all/LICENSE.TXT > "$APP/LICENSE.TXT"
+
+echo "copy win shared files: *.ico, TestPreInstall.jar..."
+rsync -r  --exclude '.svn' "shared/win"/* "${APP}"
+
+if [ $? != 0 ]; then
+	echo "** ${APP}: copy Win arch files failed"
+	exit 1;
+fi
+
+rm -f "exportRCP/win32.win32.${ARCHCODE}/TXM/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
+rm -f "exportRCP/win32.win32.${ARCHCODE}/TXM/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
+if [ $? != 0 ]; then
+	echo "** $APP: failed to remove p2 preferences"
+	exit 1;
+fi
+
+echo "copy eclipse arch dependent build"
+rsync -r  --exclude '.svn' "exportRCP/win32.win32.${ARCHCODE}/TXM" "${APP}"
+
+if [ $? != 0 ]; then
+	echo "** ${APP}: copy Win build files failed"
+	exit 1;
+fi
+
+#echo "copy cqp JNI libs near TXM executable"
+echo "copy CQP binary files"
+cp "../../org.txm.libs.cqp.win32/res/win64"/*.dll "${APP}/" &&
+cp "../../org.txm.libs.cqp.win32/res/win64"/*.dll "${APP}/TXM" &&
+cp "../../org.txm.libs.cqp.win32/res/win32"/* "${APP}/cwb/bin/win32" &&
+cp "../../org.txm.libs.cqp.win32/res/win64"/* "${APP}/cwb/bin"
+
+if [ $? != 0 ]; then
+	echo "** ${APP}: copy Win lib files failed"
+	exit 1;
+fi
+
+
+echo " clean"
+bash directoryCleaner.sh "$APP"
+if [ $? != 0 ]; then
+	echo "** $APP: failed to clean win64 setup $APP"
+	exit 1;
+fi
+
+echo "build executable"
+wine nsis/makensis.exe -V1 ${APP}/txm.nsi 2> logs64
+
+if [ ! -e "${APP}/${APP}.exe" ]; then
+	echo "** ${APP}/${APP}.exe : not builded"
+	gedit logs64
+	exit 1;
+fi
+
+chmod +x "${APP}/${APP}.exe"
+mv "${APP}/${APP}.exe" .

Property changes on: tmp/trunk/org.txm.setups/BuildWin64bit.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/PublishTXMUpdateSite.sh
===================================================================
--- tmp/trunk/org.txm.setups/PublishTXMUpdateSite.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/PublishTXMUpdateSite.sh	(revision 728)
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+echo "Sending RCP export to update site..."
+
+UPDATESITE="$HOME/workspace079/org.txm.setups/exportRCP/repository"
+# UPDATE THIS MOUNT PATH TO YOURS
+SERVERPATH="/run/user/1001/gvfs/sftp:host=vm-web-preprod.pun.ens-lyon.fr,user=mdecorde"
+DISTANTPATH="$SERVERPATH/textometrie/dist/main/"
+
+if [ "$1" = "" ] ; then
+	echo "You need to specify the update site level to update"
+	exit 1
+elif [[ $1 =~ alpha|beta|dev ]] ; then
+	echo "Uploading to the '$1' dist/main repository"
+	DISTANTPATH="$SERVERPATH/textometrie/dist/main/"
+else
+	echo "Uploading to the '$1' project update site repository"
+	DISTANTPATH="$SERVERPATH/textometrie/dist/"
+fi
+
+if [ ! -d "$UPDATESITE" ]; then
+	echo "** $UPDATESITE is missing."
+	exit 1;
+fi
+
+# DO IT !
+echo "ls" > pushFilesToPreprod.ftp
+echo "exit" > pushFilesToPreprod.ftp
+
+echo "Remove old files"
+rm -rf "$DISTANTPATH$1/"*
+if [ $? != 0 ]; then
+    echo "Could not delete files of $DISTANTPATH$1";
+    exit 1 ;
+fi
+
+echo "Copy new files"
+mkdir "$DISTANTPATH"
+mkdir "$DISTANTPATH$1"
+cp -rf "$UPDATESITE/"* "$DISTANTPATH$1"
+if [ $? != 0 ]; then
+    echo "Could not copy files of $UPDATESITE to $DISTANTPATH$1";
+    exit 1 ;
+fi
+
+echo "Rename commandes-succes.txt file"
+mv "$SERVERPATH/commandes-succes.txt" "$SERVERPATH/commandes.txt"
+if [ $? != 0 ]; then
+    echo "Could not rename commandes-succes.txt file";
+    exit 1 ;
+fi
+
+echo "$1 update site updated"

Property changes on: tmp/trunk/org.txm.setups/PublishTXMUpdateSite.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/PublishTESTTXMUpdateSite.sh
===================================================================
--- tmp/trunk/org.txm.setups/PublishTESTTXMUpdateSite.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/PublishTESTTXMUpdateSite.sh	(revision 728)
@@ -0,0 +1,36 @@
+#./updateTESTTXMUpdateSite.sh dev && ./updateTESTTXMUpdateSite.sh alpha && ./updateTESTTXMUpdateSite.sh beta && ./updateTESTTXMUpdateSite.sh
+
+echo "Sending RCP export to TEST update site..."
+
+UPDATESITE="/home/mdecorde/TEMP/updates"
+
+if [ "$1" = "" ]; then
+	echo "uploading to default test repository"
+elif [[ $1 =~ alpha|beta|dev ]]; then
+	echo "uploading to the '$1' test repository"
+else
+	echo "$1: invalid parameter"
+	exit 1;
+fi
+
+#moving to repository
+cd "exportRCP/repository"
+if [ $? != 0 ]; then
+	echo "** updateTESTTXMUpdateSites.sh : failed to find exportRCP/repository"
+	exit 1;
+fi
+
+mkdir "$UPDATESITE"
+rm -rf "$UPDATESITE/TXM$1"
+
+mkdir "$UPDATESITE/TXM$1" && 
+mkdir "$UPDATESITE/TXM$1/plugins" && 
+mkdir "$UPDATESITE/TXM$1/binary" && 
+mkdir "$UPDATESITE/TXM$1/features" && 
+cp -r * "$UPDATESITE/TXM$1"
+
+if [ $? != 0 ]; then
+	echo "** updateTESTTXMUpdateSites.sh : failed to update"
+	exit 1;
+fi
+

Property changes on: tmp/trunk/org.txm.setups/PublishTESTTXMUpdateSite.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/md5Digest.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/md5Digest.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/BuildLinux64bit.sh
===================================================================
--- tmp/trunk/org.txm.setups/BuildLinux64bit.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/BuildLinux64bit.sh	(revision 728)
@@ -0,0 +1,82 @@
+VERSION=`cat VERSION`
+STEP=$1
+ARCH="64"
+ARCHCODE="x86_64"
+APP="TXM_${VERSION}_Linux${ARCH}"
+
+rm -rf "$APP"
+mkdir "$APP"
+
+echo purge | sudo debconf-communicate txm
+echo purge | sudo debconf-communicate TXM
+
+# ensure postinst preinst ... rights
+chmod 644 shared/debian/DEBIAN/templates &&
+chmod 755 shared/debian/DEBIAN/config &&
+chmod 755 shared/debian/DEBIAN/postinst &&
+chmod 755 shared/debian/DEBIAN/postrm &&
+chmod 755 shared/debian/DEBIAN/preinst &&
+chmod 755 shared/debian/usr/bin/TXM*
+if [ $? != 0 ]; then
+	echo "** $APP: failed to set rights of postinst preinst ... files "
+	exit 1;
+fi
+
+# ensure JRE files are here
+if [ ! -d "shared/debian/usr/lib/TXM/jre/bin" ]; then
+	echo "** $APP: JRE files are missing."
+	exit 1;
+fi
+
+# copy debian shared files: INSTALL, R libs...
+rsync -r  --exclude '.svn' shared/debian/* "$APP"
+if [ $? != 0 ]; then
+	echo "** $APP: failed to get 'debian' shared files"
+	exit 1;
+fi
+
+# copy shared files: css, xsl, scripts, samples...
+rsync -r  --exclude '.svn' shared/all/* "$APP/usr/lib/TXM"
+if [ $? != 0 ]; then
+	echo "** $APP: failed to get shared files"
+	exit 1;
+fi
+
+# remove old profile that can contains unwanted repositories
+rm -f "exportRCP/linux.gtk.${ARCHCODE}/TXM/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
+rm -f "exportRCP/linux.gtk.${ARCHCODE}/TXM/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
+if [ $? != 0 ]; then
+	echo "** $APP: failed to remove p2 preferences"
+	exit 1;
+fi
+
+# copy eclise arch dependent build
+rsync -r  --exclude '.svn' "exportRCP/linux.gtk.${ARCHCODE}/TXM" "$APP/usr/lib"
+if [ $? != 0 ]; then
+	echo "** $APP: failed to get ${ARCH}bit binaries linux $ARCHCODE files"
+	exit 1;
+fi
+
+echo " clean"
+bash directoryCleaner.sh "$APP"
+if [ $? != 0 ]; then
+	echo "** $APP: failed to clean debian package $APP"
+	exit 1;
+fi
+
+# update po files
+echo "update po files"
+cd "$APP/DEBIAN"
+debconf-updatepo
+cd "../.."
+
+# build
+sudo fakeroot dpkg-deb --build "$APP"
+if [ $? != 0 ]; then
+	echo "** $APP: failed to build debian package $APP"
+	exit 1;
+fi
+
+rm -f "${APP}_installer.deb"
+mv $APP.deb ${APP}_installer.deb
+

Property changes on: tmp/trunk/org.txm.setups/BuildLinux64bit.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/BuildAll.sh
===================================================================
--- tmp/trunk/org.txm.setups/BuildAll.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/BuildAll.sh	(revision 728)
@@ -0,0 +1,29 @@
+#echo "get scripts"
+sh getSharedFiles.sh
+if [ $? != 0 ]; then
+	echo "** Failed to get shared files"
+	exit 1;
+fi
+
+echo "Linux64"
+sh Linux64bit.sh
+if [ $? != 0 ]; then
+	echo "** Failed to get build Linux64"
+	exit 1;
+fi
+
+echo "MacOSX"
+sh MacOSXIntel.sh
+if [ $? != 0 ]; then
+	echo "** Failed to get build Mac OS X"
+	exit 1;
+fi
+
+echo "Win64"
+sh Win64bit.sh
+if [ $? != 0 ]; then
+	echo "** Failed to get build Win64"
+	exit 1;
+fi
+
+#play end.wav

Property changes on: tmp/trunk/org.txm.setups/BuildAll.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/getSharedFiles.sh
===================================================================
--- tmp/trunk/org.txm.setups/getSharedFiles.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/getSharedFiles.sh	(revision 728)
@@ -0,0 +1,140 @@
+TOOLBOXDIRECTORY="$HOME/workspace079/org.txm.toolbox"
+SVNDIR="$HOME/SVN"
+SVNDOCTRUNK="$SVNDIR/TXMSVN/trunk/doc"
+SHARED="./shared"
+SHAREDALL="$SHARED/all"
+SCRIPTCOPYDIR="$SHAREDALL/scripts"
+
+echo "reset the shared/all directory..."
+rm -rf "$SHAREDALL" &&
+svn update
+
+if [ ! -d "$SCRIPTCOPYDIR" ]; then
+	echo "** Scripts copy: failed to reset the shared/all directory."
+	exit 1;
+fi
+
+IMPORTERPACKAGE=/src/groovy/org/txm/importer
+ALCESTE=$IMPORTERPACKAGE/alceste/alcesteLoader.groovy
+DISCOURS=$IMPORTERPACKAGE/discours/discoursLoader.groovy
+BFM=$IMPORTERPACKAGE/bfm/bfmLoader.groovy
+FRANTEXT=$IMPORTERPACKAGE/frantext/frantextLoader.groovy
+HYPERBASE=$IMPORTERPACKAGE/hyperbase/hyperbaseLoader.groovy
+TXT=$IMPORTERPACKAGE/txt/txtLoader.groovy
+XML=$IMPORTERPACKAGE/xml/xmlLoader.groovy
+FACTIVA=$IMPORTERPACKAGE/factiva/factivaLoader.groovy
+FACTIVATXT=$IMPORTERPACKAGE/factiva/factivamailLoader.groovy
+XMLTXM=$IMPORTERPACKAGE/xmltxm/xmltxmLoader.groovy
+TRANSCRIBER=$IMPORTERPACKAGE/transcriber/transcriberLoader.groovy
+TMX=$IMPORTERPACKAGE/tmx/tmxLoader.groovy
+DOC=$IMPORTERPACKAGE/doc/docLoader.groovy
+WTC=$IMPORTERPACKAGE/wtc/wtcLoader.groovy
+#LIMSI=$IMPORTERPACKAGE/limsi/limsiLoader.groovy
+
+echo $SCRIPTCOPYDIR
+
+mkdir "$SCRIPTCOPYDIR/import/"
+# get all xxxxLoader.groovy sccripts
+cp -v "$TOOLBOXDIRECTORY$ALCESTE" "$SCRIPTCOPYDIR/import/" && \
+cp -v "$TOOLBOXDIRECTORY$DISCOURS" "$SCRIPTCOPYDIR/import/" && \
+cp -v "$TOOLBOXDIRECTORY$BFM" "$SCRIPTCOPYDIR/import/" && \
+cp -v "$TOOLBOXDIRECTORY$FRANTEXT" "$SCRIPTCOPYDIR/import/" && \
+cp -v "$TOOLBOXDIRECTORY$HYPERBASE" "$SCRIPTCOPYDIR/import/" && \
+cp -v "$TOOLBOXDIRECTORY$TXT" "$SCRIPTCOPYDIR/import/" && \
+cp -v "$TOOLBOXDIRECTORY$XML" "$SCRIPTCOPYDIR/import/" && \
+cp -v "$TOOLBOXDIRECTORY$FACTIVA" "$SCRIPTCOPYDIR/import/" && \
+cp -v "$TOOLBOXDIRECTORY$FACTIVATXT" "$SCRIPTCOPYDIR/import/" && \
+cp -v "$TOOLBOXDIRECTORY$XMLTXM" "$SCRIPTCOPYDIR/import/" && \
+cp -v "$TOOLBOXDIRECTORY$TRANSCRIBER" "$SCRIPTCOPYDIR/import/" && \
+cp -v "$TOOLBOXDIRECTORY$DOC" "$SCRIPTCOPYDIR/import/" && \
+cp -v "$TOOLBOXDIRECTORY$TMX" "$SCRIPTCOPYDIR/import/" && \
+cp -v "$TOOLBOXDIRECTORY$WTC" "$SCRIPTCOPYDIR/import/"
+#cp -v "$TOOLBOXDIRECTORY$LIMSI" "$SCRIPTCOPYDIR/import/"
+
+if [ $? != 0 ]; then
+	echo "** Loader scripts copy: copy failed"
+	exit 1;
+fi
+
+#copy Macros
+mkdir "$SCRIPTCOPYDIR/macro/"
+mkdir "$SCRIPTCOPYDIR/macro/org/"
+mkdir "$SCRIPTCOPYDIR/macro/org/txm/"
+#mkdir "$SCRIPTCOPYDIR/macro/org/txm/annotation/"
+
+rsync -r --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/macro/" "$SCRIPTCOPYDIR/macro/org/txm/macro" &&
+#rsync -r --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/importer/europress/" "$SCRIPTCOPYDIR/macro" &&
+#rsync -r --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/annotation/" "$SCRIPTCOPYDIR/macro/org/txm/annotation" &&
+#rsync -r --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/importer/transcription/" "$SCRIPTCOPYDIR/macro/org/txm/importer/transcription"
+if [ $? != 0 ]; then
+	echo "** Macros copy failed"
+	exit 1;
+fi
+
+#copy Groovy samples scripts
+mkdir "$SCRIPTCOPYDIR/samples/groovy"
+mkdir "$SCRIPTCOPYDIR/samples/groovy/org" &&
+mkdir "$SCRIPTCOPYDIR/samples/groovy/org/txm" &&
+mkdir "$SCRIPTCOPYDIR/samples/groovy/org/txm/export" &&
+mkdir "$SCRIPTCOPYDIR/samples/groovy/org/txm/functions" && 
+mkdir "$SCRIPTCOPYDIR/samples/groovy/org/txm/importer" &&
+mkdir "$SCRIPTCOPYDIR/samples/groovy/org/txm/sw" &&
+#mkdir "$SCRIPTCOPYDIR/samples/groovy/org/txm/tal" &&
+rsync -r  --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/export"/* "$SCRIPTCOPYDIR/samples/groovy/org/txm/export" && 
+rsync -r  --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/functions"/* "$SCRIPTCOPYDIR/samples/groovy/org/txm/functions" &&
+rsync -r  --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/importer"/* "$SCRIPTCOPYDIR/samples/groovy/org/txm/importer" &&
+rsync -r  --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/sw"/* "$SCRIPTCOPYDIR/samples/groovy/org/txm/sw" &&
+rsync -r  --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/tal"/* "$SCRIPTCOPYDIR/samples/groovy/org/txm/tal" &&
+if [ $? != 0 ]; then
+	echo "** Groovy samples copy failed"
+	exit 1;
+fi
+
+#copy R samples scripts
+rsync -r  --exclude '.svn' "$TOOLBOXDIRECTORY/src/R/"* "$SCRIPTCOPYDIR/samples/R"
+if [ $? != 0 ]; then
+	echo "** R samples copy failed"
+	exit 1;
+fi
+
+# copy XSL files
+rsync -r  --exclude '.svn' "$TOOLBOXDIRECTORY/res/org/txm/xml/xsl/"* "$SHAREDALL/xsl"
+if [ $? != 0 ]; then
+	echo "** Loader xsl copy: copy failed"
+	exit 1;
+fi
+
+# copy CSS files
+
+rsync -r --exclude '.svn' "$TOOLBOXDIRECTORY/res/org/txm/css/txm.css" "$SHAREDALL/css/" &&
+rsync -r --exclude '.svn' "$TOOLBOXDIRECTORY/res/org/txm/css/tmx.css" "$SHAREDALL/css/" &&  
+rsync -r --exclude '.svn' "$TOOLBOXDIRECTORY/res/org/txm/css/doc.css" "$SHAREDALL/css/" && 
+rsync -r --exclude '.svn' "$TOOLBOXDIRECTORY/res/org/txm/css/transcriber.css" "$SHAREDALL/css/"
+if [ $? != 0 ]; then
+	echo "** css copy failed"
+	exit 1;
+fi
+
+# copy TXM documentation files files
+svn update "${SVNDOCTRUNK}"
+cp -f "${SVNDOCTRUNK}/user manuals/txm-manual-fr.pdf" "$SHAREDALL/doc/Manuel de TXM 0.7 FR.pdf"
+if [ $? != 0 ]; then
+	echo "** TXM REFMAN copy failed"
+	exit 1;
+fi
+
+chmod -R +r "$SHAREDALL"/*
+find "$SHAREDALL" -type d -exec chmod +rx {} \;
+
+# remove dev scripts
+rm -f "$SCRIPTCOPYDIR/samples/groovy/ReleaseFunctionsValidation.groovy"
+rm -f "$SCRIPTCOPYDIR/samples/groovy/ReleaseLoadersValidation.groovy"
+rm -rf "$SCRIPTCOPYDIR/samples/groovy/org/txm/setup"
+rm -rf "$SCRIPTCOPYDIR/samples/groovy/org/txm/i18n"
+rm -rf "$SCRIPTCOPYDIR/samples/groovy/org/txm/svn"
+rm -f "$SCRIPTCOPYDIR/samples/groovy/org/txm/AntTest.groovy"
+rm -f "$SCRIPTCOPYDIR/samples/groovy/org/txm/Build.java"
+rm -f "$SCRIPTCOPYDIR/samples/groovy/org/txm/Build2.java"
+rm -f "$SCRIPTCOPYDIR/samples/groovy/org/txm/Build3.groovy"
+
+echo "** Shared files copy: success !"

Property changes on: tmp/trunk/org.txm.setups/getSharedFiles.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/md2html2mail.sh
===================================================================
--- tmp/trunk/org.txm.setups/md2html2mail.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/md2html2mail.sh	(revision 728)
@@ -0,0 +1,46 @@
+#!/bin/bash
+VERSION=`cat VERSION`
+root="annonces"
+
+function toHTML {
+	source=$1
+	output=$2
+	title=$3
+
+	rm $output
+	echo '<?xml version="1.0" encoding="UTF-8"?>' >> "$output"
+	echo "<!DOCTYPE html>" >> "$output"
+	echo "<html>" >> "$output"
+	echo " <head>" >> "$output"
+	echo '  <meta charset="utf-8" />' >> "$output"
+	echo "  <title>title</title>" >> "$output"
+	echo " </head>" >> "$output"
+	echo " <body>" >> "$output"
+	echo "  <h1>$title</h1>" >> "$output"
+	markdown $source >> "$output"
+	echo " </body>" >> "$output"
+	echo "</html>" >> "$output"
+}
+
+source="${root}/mail.md/${VERSION}_fr.md"
+output="${root}/welcome.html/welcome_${VERSION}_fr.html"
+toHTML $source $output "Bienvenue dans TXM $VERSION"
+
+source="${root}/readme.md/${VERSION}beta_fr.md"
+output="${root}/welcome.html/welcome_${VERSION}beta_fr.html"
+toHTML $source $output "Bienvenue dans TXM $VERSION beta"
+rm $output
+
+source="${root}/readme.md/${VERSION}_en.md"
+output="${root}/welcome.html/welcome_${VERSION}_en.html"
+toHTML $source $output "Welcome in TXM $VERSION"
+     
+source="${root}/readme.md/${VERSION}beta_en.md"
+output="${root}/welcome.html/welcome_${VERSION}beta_en.html"
+toHTML $source $output "Welcome in TXM $VERSION beta"
+
+source="${root}/readme.md/${VERSION}_ru.md"
+output="${root}/welcome.html/welcome_${VERSION}_ru.html"
+toHTML $source $output "Welcome in TXM $VERSION"
+
+groovy MD2Mail.groovy

Property changes on: tmp/trunk/org.txm.setups/md2html2mail.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/SetupMessages_en.properties
===================================================================
--- tmp/trunk/org.txm.setups/SetupMessages_en.properties	(revision 0)
+++ tmp/trunk/org.txm.setups/SetupMessages_en.properties	(revision 728)
@@ -0,0 +1,28 @@
+# EN EN EN EN EN
+# Message pour lance le desinstalleur de TXM
+UninstallWindows=TXM is already installed on this machine.\n\nClick `OK` to uninstall the previous version first (TXM corpora will NOT be removed).\nOr click `Cancel` to abort this installation.\nPlease ensure that no TXM is running during the installation process.
+
+# pas montrÃ© pour Windows, puisque dÃ©jÃ  desinstallÃ©.
+InfosTitle=For your information
+InfosText=If TXM is already installed on this machine, it will first be removed by this installer (TXM corpora will NOT be removed).\nClose the window to cancel installation.
+
+# message pour Windows si l'architecture de l'OS et de TXM ne correspondent pas
+ErrorArch32=This setup is for 32bit systems but your system seems to be 64bit. Please download and install the 64bit version of TXM for this machine. Continue to install anyway?
+ErrorArch64=This setup is for 64bit systems but your system seems to be 32bit. Please download and install the 32bit version of TXM for this machine. Continue to install anyway?
+
+#Page d'accueil
+WelcomeTitle=Welcome to TXM setup
+WelcomeText=TXM is provided to you free of charge. In return, in the spirit of open-source software development, you are invited to participate in its improvement. To do this, you don't have to be a software developer, you can:\n * send us your publications or course materials related to your use of TXM;\n * suggest corrections or improvements;\n * translate in your language the interface or documentation;\n * Setup a research project involving TXM adaptation and use;\n * etc.\n\n See the 'Contribute' page on the TXM users' wiki: https://groupes.renater.fr/wiki/txm-users/public/contribuer \n\n Don't hesitate to contact us for more information at 'textometrie AT groupes.renater DOT fr'.
+
+# pas montrÃ© pour windows, puisque R est livrÃ© avec
+InstallRLibrariesTitle=Option - install needed R packages automatically: 'RSvgDevice', 'Rserve', 'rgl', 'factomineR' et 'textometrieR'.
+InstallRLibrariesText=If you don't select that option, please install these packages manually before using TXM\n (for details, see the page http://sourceforge.net/apps/mediawiki/txm/index.php?title=Build_the_toolbox_or_the_application#Install_R_yourself)
+
+#diffÃ©rent pour chaque OS puisque contient des dÃ©tails techniques
+FinishTitle=Installation done
+FinishTextWindows=The installation is done. A 'TXM' entry has been added to the 'Start' menu.
+FinishTextLinux=The installation is done. A 'TXM' entry has been added to the dashboard.
+FinishTextMac=You can start TXM with the 'TXM.app' file found in the "Applications" / "TXM" directory.
+
+#install TreeTagger
+InstallTreeTagger=If you want to automatically tag and lemmatize your corpora with the TreeTagger software during import, you need to follow additional installation instructions given in the "Help > Install TreeTagger" menu.

Property changes on: tmp/trunk/org.txm.setups/SetupMessages_en.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/RunPackageMaker
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/RunPackageMaker	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/RunPackageMaker	(revision 728)
@@ -0,0 +1,7 @@
+say start building package
+
+cd /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS
+
+./PackageMaker -d "/Users/admin/Desktop/TXM_0.7_Mac64/BUILDPKG.pmdoc/" -p /Users/admin/Desktop/ -i org.txm --out "/Users/admin/Desktop/TXM_0.7_Mac64/TXM_0.7_Mac64.pkg"
+
+say done
Index: tmp/trunk/org.txm.setups/shared/mac/intro_fr.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/intro_fr.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/intro_fr.txt	(revision 728)
@@ -0,0 +1,4 @@
+
+Si TXM est dŽjˆ installŽ sur cette machine, cet installeur le supprimera pour commencer (les corpus existants ne seront pas supprimŽs). 
+
+Pour annuler l'installation, vous pouvez fermer cette fen�tre.

Property changes on: tmp/trunk/org.txm.setups/shared/mac/intro_fr.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/readme_fr.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/readme_fr.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/readme_fr.txt	(revision 728)
@@ -0,0 +1,11 @@
+
+TXM vous est fourni gracieusement. En contre-partie, dans l'esprit du logiciel libre, vous �tes invitŽ ˆ participer ˆ son amŽlioration. Pour cela, vous n'�tes pas obligŽ d'�tre dŽveloppeur informatique, vous pouvez :
+ * transmettre vos publications ou supports de cours ;
+ * proposer des corrections ou amŽliorations ;
+ * traduire l'interface ou la documentation ;
+ * monter un projet pour adapter TXM ˆ vos besoins ;
+ * etc.
+
+ Voir la rubrique 'Contribuer' du wiki des utilisateurs de TXM : https://groupes.renater.fr/wiki/txm-users/public/contribuer 
+
+ N'hŽsitez pas ˆ nous contacter pour de plus amples informations : 'textometrie AT groupes.renater DOT fr'.

Property changes on: tmp/trunk/org.txm.setups/shared/mac/readme_fr.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/._.DS_Store
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/._.DS_Store
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/02opt-contents.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/02opt-contents.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/02opt-contents.xml	(revision 728)
@@ -0,0 +1 @@
+<pkg-contents spec="1.12"><f n="opt" o="mdecorde" g="staff" p="16877" pt="/Users/mdecorde/Desktop/TXM_0.8.0_MacOSX/opt" m="false" t="file"><f n="local" o="mdecorde" g="staff" p="16877"><f n="lib" o="mdecorde" g="staff" p="16877"><f n="libasprintf.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libasprintf.dylib" o="mdecorde" g="staff" p="33188"/><f n="libbz2.1.0.6.dylib" o="mdecorde" g="staff" p="33188"/><f n="libbz2.1.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libbz2.1.dylib" o="mdecorde" g="staff" p="33188"/><f n="libbz2.dylib" o="mdecorde" g="staff" p="33188"/><f n="libexpat.1.dylib" o="mdecorde" g="staff" p="33188"/><f n="libexpat.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgettextlib-0.19.3.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgettextlib.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgettextpo.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgettextpo.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgettextsrc-0.19.3.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgettextsrc.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgio-2.0.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgio-2.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libglib-2.0.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libglib-2.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgmodule-2.0.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgmodule-2.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgobject-2.0.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgobject-2.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgthread-2.0.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgthread-2.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libhistory.5.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libhistory.5.1.dylib" o="mdecorde" g="staff" p="33188"/><f n="libhistory.5.2.dylib" o="mdecorde" g="staff" p="33188"/><f n="libhistory.6.1.dylib" o="mdecorde" g="staff" p="33188"/><f n="libhistory.6.2.dylib" o="mdecorde" g="staff" p="33188"/><f n="libhistory.6.3.dylib" o="mdecorde" g="staff" p="33188"/><f n="libhistory.6.dylib" o="mdecorde" g="staff" p="33188"/><f n="libiconv.2.dylib" o="mdecorde" g="staff" p="33188"/><f n="libiconv.dylib" o="mdecorde" g="staff" p="33188"/><f n="libintl.8.dylib" o="mdecorde" g="staff" p="33188"/><f n="libintl.dylib" o="mdecorde" g="staff" p="33188"/><f n="liblzma.5.dylib" o="mdecorde" g="staff" p="33188"/><f n="liblzma.dylib" o="mdecorde" g="staff" p="33188"/><f n="libncurses.5.dylib" o="mdecorde" g="staff" p="33188"/><f n="libpcre.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libpcre.1.dylib" o="mdecorde" g="staff" p="33188"/><f n="libpcre.dylib" o="mdecorde" g="staff" p="33188"/><f n="libpcrecpp.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libpcrecpp.dylib" o="mdecorde" g="staff" p="33188"/><f n="libpcreposix.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libpcreposix.dylib" o="mdecorde" g="staff" p="33188"/><f n="libreadline.5.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libreadline.5.1.dylib" o="mdecorde" g="staff" p="33188"/><f n="libreadline.5.2.dylib" o="mdecorde" g="staff" p="33188"/><f n="libreadline.6.1.dylib" o="mdecorde" g="staff" p="33188"/><f n="libreadline.6.2.dylib" o="mdecorde" g="staff" p="33188"/><f n="libreadline.6.3.dylib" o="mdecorde" g="staff" p="33188"/><f n="libreadline.6.dylib" o="mdecorde" g="staff" p="33188"/></f></f></f></pkg-contents>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/02opt-contents.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/03opt-contents.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/03opt-contents.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/03opt-contents.xml	(revision 728)
@@ -0,0 +1 @@
+<pkg-contents spec="1.12"><f n="opt" o="mdecorde" g="staff" p="16877" pt="/Users/mdecorde/Desktop/TXM_0.8.0_MacOSX/opt" m="false" t="file"><f n="local" o="mdecorde" g="staff" p="16877"><f n="lib" o="mdecorde" g="staff" p="16877"><f n="libasprintf.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libasprintf.dylib" o="mdecorde" g="staff" p="33188"/><f n="libbz2.1.0.6.dylib" o="mdecorde" g="staff" p="33188"/><f n="libbz2.1.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libbz2.1.dylib" o="mdecorde" g="staff" p="33188"/><f n="libbz2.dylib" o="mdecorde" g="staff" p="33188"/><f n="libexpat.1.dylib" o="mdecorde" g="staff" p="33188"/><f n="libexpat.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgettextlib-0.19.3.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgettextlib.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgettextpo.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgettextpo.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgettextsrc-0.19.3.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgettextsrc.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgio-2.0.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgio-2.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libglib-2.0.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libglib-2.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgmodule-2.0.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgmodule-2.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgobject-2.0.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgobject-2.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgthread-2.0.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libgthread-2.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libhistory.5.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libhistory.5.1.dylib" o="mdecorde" g="staff" p="33188"/><f n="libhistory.5.2.dylib" o="mdecorde" g="staff" p="33188"/><f n="libhistory.6.1.dylib" o="mdecorde" g="staff" p="33188"/><f n="libhistory.6.2.dylib" o="mdecorde" g="staff" p="33188"/><f n="libhistory.6.3.dylib" o="mdecorde" g="staff" p="33188"/><f n="libhistory.6.dylib" o="mdecorde" g="staff" p="33188"/><f n="libiconv.2.dylib" o="mdecorde" g="staff" p="33188"/><f n="libiconv.dylib" o="mdecorde" g="staff" p="33188"/><f n="libintl.8.dylib" o="mdecorde" g="staff" p="33188"/><f n="libintl.dylib" o="mdecorde" g="staff" p="33188"/><f n="liblzma.5.dylib" o="mdecorde" g="staff" p="33188"/><f n="liblzma.dylib" o="mdecorde" g="staff" p="33188"/><f n="libncurses.5.dylib" o="mdecorde" g="staff" p="33188"/><f n="libpcre.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libpcre.1.dylib" o="mdecorde" g="staff" p="33188"/><f n="libpcre.dylib" o="mdecorde" g="staff" p="33188"/><f n="libpcrecpp.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libpcrecpp.dylib" o="mdecorde" g="staff" p="33188"/><f n="libpcreposix.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libpcreposix.dylib" o="mdecorde" g="staff" p="33188"/><f n="libreadline.5.0.dylib" o="mdecorde" g="staff" p="33188"/><f n="libreadline.5.1.dylib" o="mdecorde" g="staff" p="33188"/><f n="libreadline.5.2.dylib" o="mdecorde" g="staff" p="33188"/><f n="libreadline.6.1.dylib" o="mdecorde" g="staff" p="33188"/><f n="libreadline.6.2.dylib" o="mdecorde" g="staff" p="33188"/><f n="libreadline.6.3.dylib" o="mdecorde" g="staff" p="33188"/><f n="libreadline.6.dylib" o="mdecorde" g="staff" p="33188"/></f></f></f></pkg-contents>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/03opt-contents.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/01applications-contents.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/01applications-contents.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/01applications-contents.xml	(revision 728)
@@ -0,0 +1 @@
+<pkg-contents spec="1.12"/>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/01applications-contents.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/.directory
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/.directory	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/.directory	(revision 728)
@@ -0,0 +1,5 @@
+[Dolphin]
+Timestamp=2012,12,5,13,43,40
+
+[Settings]
+HiddenFilesShown=true
Index: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/03opt.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/03opt.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/03opt.xml	(revision 728)
@@ -0,0 +1 @@
+<pkgref spec="1.12" uuid="C9430B90-0E4D-4544-91D0-4DD88C69213C"><config><identifier>org.txm.txm078.opt.pkg</identifier><version>1.0</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true" mod="true">opt</installFrom><installTo mod="true">/opt</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>installTo.path</mod><mod>installFrom.path</mod><mod>parent</mod><mod>installTo</mod></config><contents><file-list>03opt-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/03opt.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/01applications.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/01applications.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/01applications.xml	(revision 728)
@@ -0,0 +1 @@
+<pkgref spec="1.12" uuid="010E4888-F605-4E8A-BAA6-15FAE49B744F"><config><identifier>org.txm.txm071.Applications.pkg</identifier><version>1.0</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true" mod="true">Applications</installFrom><installTo mod="true">/Applications</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>installTo</mod><mod>installFrom.path</mod><mod>scripts.preinstall.isRelativeType</mod><mod>identifier</mod><mod>parent</mod><mod>installTo.path</mod><mod>scripts.postinstall.isRelativeType</mod><mod>installFrom.isRelativeType</mod></config><scripts><preinstall relative="true" mod="true">CLEAN</preinstall><postinstall relative="true" mod="true">INSTALL</postinstall></scripts><contents><component id="org.eclipse.eclipse" path="/Users/mdecorde/Desktop/TXM_0.8.0_MacOSX/Applications/TXM/.main.app" version="4.4"/><component id="appified.mdecorde.TXM" path="/Users/mdecorde/Desktop/TXM_0.8.0_MacOSX/Applications/TXM/TXM.app" version="0.1"/><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/01applications.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/index.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/index.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/index.xml	(revision 728)
@@ -0,0 +1 @@
+<pkmkdoc spec="1.12"><properties><title>TXM 0.8.0</title><build>/Users/mdecorde/Desktop/TXM_0.8.0_MacOSX.pkg</build><organization>org.txm</organization><userSees ui="both"/><min-target os="3"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><contents><choice title="Applications" id="choice110" starts_selected="true" starts_enabled="false" starts_hidden="true"><pkgref id="org.txm.txm071.Applications.pkg"/></choice><choice title="R packages" id="choice129" tooltip="install R packages needed: 'Rserve', 'lattice', 'cluster', 'scatterplot3d', 'factomineR' and 'textometry'." description="If you don't select that option, please install these packages manually before using TXM. See FAQ: https://groupes.renater.fr/wiki/txm-users/public/faq#installation_mac_os_x_le_moteur_de_statistique_r_ne_demarre_pas" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.txm.txm078.rlibs.pkg"/></choice><choice title="opt" id="choice123" starts_selected="true" starts_enabled="false" starts_hidden="true"><pkgref id="org.txm.txm078.opt.pkg"/></choice></contents><resources bg-scale="proportional" bg-align="center"><locale lang="fr"><resource relative="true" mod="true" type="background">background.jpg</resource><resource relative="true" mod="true" type="license">Applications/TXM/license_agreement_fr.txt</resource><resource relative="true" mod="true" type="readme">readme_fr.txt</resource><resource relative="true" mod="true" type="welcome">intro_fr.txt</resource><resource relative="true" mod="true" type="conclusion">finish_fr.txt</resource></locale><locale lang="en"><resource relative="true" mod="true" type="background">background.jpg</resource><resource relative="true" mod="true" type="license">Applications/TXM/license_agreement.txt</resource><resource relative="true" mod="true" type="readme">readme_en.txt</resource><resource relative="true" mod="true" type="welcome">intro_en.txt</resource><resource relative="true" mod="true" type="conclusion">finish_en.txt</resource></locale></resources><flags/><item type="file">01applications.xml</item><item type="file">02rlibs.xml</item><item type="file">03opt.xml</item><mod>properties.title</mod><mod>properties.systemDomain</mod></pkmkdoc>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/index.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/02rlibs-contents.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/02rlibs-contents.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/02rlibs-contents.xml	(revision 728)
@@ -0,0 +1 @@
+<pkg-contents spec="1.12"><f n="rlibs.R" o="mdecorde" g="staff" p="33188" pt="/Users/mdecorde/Desktop/TXM_0.8.0_MacOSX/Applications/TXM/R/rlibs.R" m="false" t="file"/></pkg-contents>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/02rlibs-contents.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/03rlibs-contents.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/03rlibs-contents.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/03rlibs-contents.xml	(revision 728)
@@ -0,0 +1 @@
+<pkg-contents spec="1.12"><f n="rlibs.R" o="mdecorde" g="staff" p="33188" pt="/Users/mdecorde/Desktop/TXM_0.8.0_MacOSX/Applications/TXM/R/rlibs.R" m="false" t="file"/></pkg-contents>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/03rlibs-contents.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/02rlibs.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/02rlibs.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/02rlibs.xml	(revision 728)
@@ -0,0 +1 @@
+<pkgref spec="1.12" uuid="627D63FB-F669-4740-A45E-20CCE6883109"><config><identifier>org.txm.txm078.rlibs.pkg</identifier><version>1.0</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true" mod="true">Applications/TXM/R/rlibs.R</installFrom><installTo mod="true">/Applications/TXM/R</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>installTo.path</mod><mod>installFrom.path</mod><mod>parent</mod><mod>installTo</mod></config><contents><file-list>02rlibs-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pmdoc/02rlibs.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libglib-2.0.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libglib-2.0.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgthread-2.0.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgthread-2.0.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgobject-2.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgobject-2.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libpcreposix.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libpcreposix.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgettextlib.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgettextlib.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgio-2.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgio-2.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libiconv.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libiconv.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libexpat.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libexpat.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgettextpo.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgettextpo.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libreadline.5.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libreadline.5.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libreadline.5.1.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libreadline.5.1.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libasprintf.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libasprintf.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libreadline.5.2.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libreadline.5.2.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libreadline.6.1.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libreadline.6.1.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgmodule-2.0.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgmodule-2.0.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libreadline.6.2.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libreadline.6.2.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libreadline.6.3.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libreadline.6.3.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libpcre.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libpcre.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libpcrecpp.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libpcrecpp.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libbz2.1.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libbz2.1.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libbz2.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libbz2.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgettextlib-0.19.3.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgettextlib-0.19.3.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libhistory.6.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libhistory.6.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/liblzma.5.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/liblzma.5.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgobject-2.0.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgobject-2.0.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgio-2.0.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgio-2.0.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libglib-2.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libglib-2.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgthread-2.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgthread-2.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libpcreposix.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libpcreposix.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libintl.8.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libintl.8.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libiconv.2.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libiconv.2.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libexpat.1.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libexpat.1.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgettextpo.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgettextpo.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgettextsrc-0.19.3.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgettextsrc-0.19.3.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libasprintf.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libasprintf.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libncurses.5.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libncurses.5.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libpcre.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libpcre.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libreadline.6.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libreadline.6.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libpcre.1.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libpcre.1.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgmodule-2.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgmodule-2.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgettextsrc.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libgettextsrc.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libbz2.1.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libbz2.1.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libpcrecpp.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libpcrecpp.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libbz2.1.0.6.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libbz2.1.0.6.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libhistory.5.0.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libhistory.5.0.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/liblzma.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/liblzma.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libhistory.5.1.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libhistory.5.1.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libhistory.6.1.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libhistory.6.1.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libhistory.5.2.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libhistory.5.2.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libhistory.6.2.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libhistory.6.2.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libintl.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libintl.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libhistory.6.3.dylib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/opt/local/lib/libhistory.6.3.dylib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/INSTALL
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/INSTALL	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/INSTALL	(revision 728)
@@ -0,0 +1,159 @@
+#!/bin/sh
+
+vercomp () {
+    echo "test $1 $2"
+    if [[ $1 == $2 ]]
+    then
+        return 0
+    fi
+    local IFS=.
+    local i ver1=($1) ver2=($2)
+    # fill empty fields in ver1 with zeros
+    for ((i=${#ver1[@]}; i<${#ver2[@]}; i++))
+    do
+        ver1[i]=0
+    done
+    for ((i=0; i<${#ver1[@]}; i++))
+    do
+        if [[ -z ${ver2[i]} ]]
+        then
+            ver2[i]=0
+        fi
+        if ((10#${ver1[i]} > 10#${ver2[i]}))
+        then
+            return 0
+        fi
+        if ((10#${ver1[i]} < 10#${ver2[i]}))
+        then
+            return 1
+        fi
+    done
+    return 0
+}
+
+# messages en and fr
+SAY_STARTINSTALL_EN="starting post installation"
+SAY_INSTALLR_EN="installing R and R dependancies"
+SAY_CREATESTAMP_EN="creating STAMP"
+SAY_SETFILERIGHTS_EN="setting file rights"
+SAY_DONE_EN="Done"
+
+SAY_STARTINSTALL_FR="DÃ©but de la post-installation de TXM"
+SAY_INSTALLR_FR="Installation de R et ses dÃ©pendances"
+SAY_CREATESTAMP_FR="CrÃ©ation du fichier STAMP"
+SAY_SETFILERIGHTS_FR="RÃ©glage des droits de fichiers"
+SAY_DONE_FR="Installation terminÃ©e"
+
+if [ $LANG = "fr_FR.UTF-8" ];then
+	SAY_STARTINSTALL=$SAY_STARTINSTALL_FR
+	SAY_INSTALLR=$SAY_INSTALLR_FR
+	SAY_CREATESTAMP=$SAY_CREATESTAMP_FR
+	SAY_SETFILERIGHTS=$SAY_SETFILERIGHTS_FR
+	SAY_DONE=$SAY_DONE_FR
+else
+	SAY_STARTINSTALL=$SAY_STARTINSTALL_EN
+	SAY_INSTALLR=$SAY_INSTALLR_EN
+	SAY_CREATESTAMP=$SAY_CREATESTAMP_EN
+	SAY_SETFILERIGHTS=$SAY_SETFILERIGHTS_EN
+	SAY_DONE=$SAY_DONE_EN
+fi
+
+OSVERSION=`sw_vers -productVersion`
+echo "MAC OS X Version is : $OSVERSION"
+vercomp $OSVERSION "10.7"
+if [ $? != 0 ];then
+	java -version
+	if [ $? != 0 ];then
+		echo "** TXM postinstall: failed to install: java is missing."
+		exit 1
+	fi
+fi
+
+say $SAY_STARTINSTALL
+echo "** TXM postinstall: start post installation"
+TXMINSTALLDIR="/Applications/TXM"
+
+# remove "try(library(textometrieR))" from .Rprofile if any
+if [ -f "$HOME/.Rprofile" ]; then
+	echo "Removing 'try(library(textometrieR))' from old .Rprofile"
+	sed "s/try(library(textometrieR))//g" "$HOME/.Rprofile" > "$HOME/.Rprofile2" &&
+	mv -f "$HOME/.Rprofile2" "$HOME/.Rprofile"
+	if [ $? != 0 ];then
+		echo "** TXM postinstall: failed to fix old '.Rprofile' file."
+		exit 1
+	fi
+fi
+
+say $SAY_INSTALLR
+if [ ! -d "/usr/local/lib/tcl8" ]; then
+	installer -pkg "$TXMINSTALLDIR/R/tcltk-8.5.5-x11.pkg" -allowUntrusted -target /
+	if [ $? != 0 ]; then
+			echo "** TXM install: installation of tcltk failed. Aborting."
+			exit 1;
+	fi
+else 
+	echo "Skipping tcl8 installation"
+fi
+
+if [ ! -d "/usr/local/share/texinfo" ]; then
+	installer -pkg "$TXMINSTALLDIR/R/texinfo-6.1-0.pkg" -allowUntrusted -target /
+	if [ $? != 0 ]; then
+			echo "** TXM install: installation of texinfo failed. Aborting."
+			exit 1;
+	fi
+else 
+	echo "Skipping Texinfo installation"
+fi
+
+if [ ! -d "/opt/X11/bin" ]; then
+	installer -pkg "$TXMINSTALLDIR/R/XQuartz.pkg" -allowUntrusted -target /
+	if [ $? != 0 ]; then
+			echo "** TXM install: installation of XQuartz failed. Aborting."
+			exit 1;
+	fi
+else 
+	echo "Skipping XQartz installation"
+fi
+
+tar xzf "$TXMINSTALLDIR/R/R.tar.gz" -C "$TXMINSTALLDIR/R"
+if [ $? != 0 ]; then
+		echo "** TXM install: failed to extract R binaries. Aborting."
+		exit 1;
+fi
+
+say $SAY_CREATESTAMP
+echo "** TXM postinstall: create STAMP file"
+# Create STAMP
+touch "$TXMINSTALLDIR/STAMP"
+
+if [ $? != 0 ];then
+	echo "** TXM postinstall: failed to create STAMP file."
+	exit 1
+fi
+
+say $SAY_SETFILERIGHTS
+echo "** TXM postinstall: set rights"
+# Set executable files
+chmod -R +rx "$TXMINSTALLDIR/cwb/bin"
+chmod +x "$TXMINSTALLDIR"/TXM/plugins/CQP.macosx*/res/macosx/*
+
+chmod -R +r "$TXMINSTALLDIR"
+chmod +rx "$TXMINSTALLDIR/TXM.app/Contents/MacOS/TXM"
+chmod -R +rx /opt/local/lib
+
+echo "sudo chown -R $USER $TXMINSTALLDIR"
+sudo chown -R "$USER" "$TXMINSTALLDIR"
+
+if [ $? != 0 ];then
+	echo "** TXM postinstall: failed to set permissions."
+	exit 1
+fi
+
+#check created directories
+if [ ! -d "/opt/local/lib" ]; then
+	echo "** TXM postinstall: failed to create /opt/local/lib directory. User has not enough rights?"
+	exit 1
+fi
+
+say $SAY_DONE
+echo "** TXM postinstall: Done"
Index: tmp/trunk/org.txm.setups/shared/mac/rlibs_en.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/rlibs_en.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/rlibs_en.txt	(revision 728)
@@ -0,0 +1,3 @@
+Option - install needed R packages automatically: 'Rserve', 'rgl', 'FactoMineR' and 'textometry'.
+If you don't select that option, please install these packages manually before using TXM
+ (for details, see the page https://groupes.renater.fr/wiki/txm-info/public/preparation_env_dev_manuel#r)

Property changes on: tmp/trunk/org.txm.setups/shared/mac/rlibs_en.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pkgproj
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pkgproj	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/BUILDPKG.pkgproj	(revision 728)
@@ -0,0 +1,1499 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>PACKAGES</key>
+	<array>
+		<dict>
+			<key>PACKAGE_FILES</key>
+			<dict>
+				<key>DEFAULT_INSTALL_LOCATION</key>
+				<string>/</string>
+				<key>HIERARCHY</key>
+				<dict>
+					<key>CHILDREN</key>
+					<array>
+						<dict>
+							<key>CHILDREN</key>
+							<array>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>80</integer>
+									<key>PATH</key>
+									<string>Applications/TXM</string>
+									<key>PATH_TYPE</key>
+									<integer>1</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>3</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+							</array>
+							<key>GID</key>
+							<integer>80</integer>
+							<key>PATH</key>
+							<string>Applications</string>
+							<key>PATH_TYPE</key>
+							<integer>0</integer>
+							<key>PERMISSIONS</key>
+							<integer>509</integer>
+							<key>TYPE</key>
+							<integer>1</integer>
+							<key>UID</key>
+							<integer>0</integer>
+						</dict>
+						<dict>
+							<key>CHILDREN</key>
+							<array>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>80</integer>
+									<key>PATH</key>
+									<string>Application Support</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Automator</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Documentation</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Extensions</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Filesystems</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Frameworks</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Input Methods</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Internet Plug-Ins</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>LaunchAgents</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>LaunchDaemons</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>PreferencePanes</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Preferences</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>80</integer>
+									<key>PATH</key>
+									<string>Printers</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>PrivilegedHelperTools</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>QuickLook</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>QuickTime</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Screen Savers</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Scripts</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Services</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Widgets</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+							</array>
+							<key>GID</key>
+							<integer>0</integer>
+							<key>PATH</key>
+							<string>Library</string>
+							<key>PATH_TYPE</key>
+							<integer>0</integer>
+							<key>PERMISSIONS</key>
+							<integer>493</integer>
+							<key>TYPE</key>
+							<integer>1</integer>
+							<key>UID</key>
+							<integer>0</integer>
+						</dict>
+						<dict>
+							<key>CHILDREN</key>
+							<array>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Shared</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>1023</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+							</array>
+							<key>GID</key>
+							<integer>80</integer>
+							<key>PATH</key>
+							<string>Users</string>
+							<key>PATH_TYPE</key>
+							<integer>0</integer>
+							<key>PERMISSIONS</key>
+							<integer>493</integer>
+							<key>TYPE</key>
+							<integer>1</integer>
+							<key>UID</key>
+							<integer>0</integer>
+						</dict>
+					</array>
+					<key>GID</key>
+					<integer>0</integer>
+					<key>PATH</key>
+					<string>/</string>
+					<key>PATH_TYPE</key>
+					<integer>0</integer>
+					<key>PERMISSIONS</key>
+					<integer>493</integer>
+					<key>TYPE</key>
+					<integer>1</integer>
+					<key>UID</key>
+					<integer>0</integer>
+				</dict>
+				<key>PAYLOAD_TYPE</key>
+				<integer>0</integer>
+				<key>VERSION</key>
+				<integer>4</integer>
+			</dict>
+			<key>PACKAGE_SCRIPTS</key>
+			<dict>
+				<key>POSTINSTALL_PATH</key>
+				<dict>
+					<key>PATH</key>
+					<string>INSTALL</string>
+					<key>PATH_TYPE</key>
+					<integer>1</integer>
+				</dict>
+				<key>PREINSTALL_PATH</key>
+				<dict>
+					<key>PATH</key>
+					<string>CLEAN</string>
+					<key>PATH_TYPE</key>
+					<integer>1</integer>
+				</dict>
+				<key>RESOURCES</key>
+				<array/>
+			</dict>
+			<key>PACKAGE_SETTINGS</key>
+			<dict>
+				<key>AUTHENTICATION</key>
+				<integer>1</integer>
+				<key>CONCLUSION_ACTION</key>
+				<integer>0</integer>
+				<key>IDENTIFIER</key>
+				<string>org.txm</string>
+				<key>NAME</key>
+				<string>TXM</string>
+				<key>OVERWRITE_PERMISSIONS</key>
+				<false/>
+				<key>VERSION</key>
+				<string>0.8.0</string>
+			</dict>
+			<key>UUID</key>
+			<string>B3537FD7-A0A7-4961-A28B-1EF5E91B357D</string>
+		</dict>
+		<dict>
+			<key>PACKAGE_FILES</key>
+			<dict>
+				<key>DEFAULT_INSTALL_LOCATION</key>
+				<string>/</string>
+				<key>HIERARCHY</key>
+				<dict>
+					<key>CHILDREN</key>
+					<array>
+						<dict>
+							<key>CHILDREN</key>
+							<array/>
+							<key>GID</key>
+							<integer>80</integer>
+							<key>PATH</key>
+							<string>Applications</string>
+							<key>PATH_TYPE</key>
+							<integer>0</integer>
+							<key>PERMISSIONS</key>
+							<integer>509</integer>
+							<key>TYPE</key>
+							<integer>1</integer>
+							<key>UID</key>
+							<integer>0</integer>
+						</dict>
+						<dict>
+							<key>CHILDREN</key>
+							<array>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>80</integer>
+									<key>PATH</key>
+									<string>Application Support</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Automator</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Documentation</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Extensions</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Filesystems</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Frameworks</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Input Methods</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Internet Plug-Ins</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>LaunchAgents</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>LaunchDaemons</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>PreferencePanes</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Preferences</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>80</integer>
+									<key>PATH</key>
+									<string>Printers</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>PrivilegedHelperTools</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>QuickLook</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>QuickTime</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Screen Savers</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Scripts</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Services</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Widgets</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>493</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+							</array>
+							<key>GID</key>
+							<integer>0</integer>
+							<key>PATH</key>
+							<string>Library</string>
+							<key>PATH_TYPE</key>
+							<integer>0</integer>
+							<key>PERMISSIONS</key>
+							<integer>493</integer>
+							<key>TYPE</key>
+							<integer>1</integer>
+							<key>UID</key>
+							<integer>0</integer>
+						</dict>
+						<dict>
+							<key>CHILDREN</key>
+							<array/>
+							<key>GID</key>
+							<integer>0</integer>
+							<key>PATH</key>
+							<string>opt</string>
+							<key>PATH_TYPE</key>
+							<integer>1</integer>
+							<key>PERMISSIONS</key>
+							<integer>493</integer>
+							<key>TYPE</key>
+							<integer>3</integer>
+							<key>UID</key>
+							<integer>0</integer>
+						</dict>
+						<dict>
+							<key>CHILDREN</key>
+							<array>
+								<dict>
+									<key>CHILDREN</key>
+									<array/>
+									<key>GID</key>
+									<integer>0</integer>
+									<key>PATH</key>
+									<string>Shared</string>
+									<key>PATH_TYPE</key>
+									<integer>0</integer>
+									<key>PERMISSIONS</key>
+									<integer>1023</integer>
+									<key>TYPE</key>
+									<integer>1</integer>
+									<key>UID</key>
+									<integer>0</integer>
+								</dict>
+							</array>
+							<key>GID</key>
+							<integer>80</integer>
+							<key>PATH</key>
+							<string>Users</string>
+							<key>PATH_TYPE</key>
+							<integer>0</integer>
+							<key>PERMISSIONS</key>
+							<integer>493</integer>
+							<key>TYPE</key>
+							<integer>1</integer>
+							<key>UID</key>
+							<integer>0</integer>
+						</dict>
+					</array>
+					<key>GID</key>
+					<integer>0</integer>
+					<key>PATH</key>
+					<string>/</string>
+					<key>PATH_TYPE</key>
+					<integer>0</integer>
+					<key>PERMISSIONS</key>
+					<integer>493</integer>
+					<key>TYPE</key>
+					<integer>1</integer>
+					<key>UID</key>
+					<integer>0</integer>
+				</dict>
+				<key>PAYLOAD_TYPE</key>
+				<integer>0</integer>
+				<key>VERSION</key>
+				<integer>4</integer>
+			</dict>
+			<key>PACKAGE_SETTINGS</key>
+			<dict>
+				<key>AUTHENTICATION</key>
+				<integer>1</integer>
+				<key>CONCLUSION_ACTION</key>
+				<integer>0</integer>
+				<key>IDENTIFIER</key>
+				<string>org.txm.opt</string>
+				<key>LOCATION</key>
+				<integer>0</integer>
+				<key>NAME</key>
+				<string>opt</string>
+				<key>OVERWRITE_PERMISSIONS</key>
+				<false/>
+				<key>VERSION</key>
+				<string>1.0</string>
+			</dict>
+			<key>TYPE</key>
+			<integer>0</integer>
+			<key>UUID</key>
+			<string>6127A458-0607-4497-A91D-96CDF072C670</string>
+		</dict>
+	</array>
+	<key>PROJECT</key>
+	<dict>
+		<key>PROJECT_COMMENTS</key>
+		<dict>
+			<key>NOTES</key>
+			<data>
+			PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBIVE1M
+			IDQuMDEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvVFIvaHRtbDQv
+			c3RyaWN0LmR0ZCI+CjxodG1sPgo8aGVhZD4KPG1ldGEgaHR0cC1l
+			cXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7
+			IGNoYXJzZXQ9VVRGLTgiPgo8bWV0YSBodHRwLWVxdWl2PSJDb250
+			ZW50LVN0eWxlLVR5cGUiIGNvbnRlbnQ9InRleHQvY3NzIj4KPHRp
+			dGxlPjwvdGl0bGU+CjxtZXRhIG5hbWU9IkdlbmVyYXRvciIgY29u
+			dGVudD0iQ29jb2EgSFRNTCBXcml0ZXIiPgo8bWV0YSBuYW1lPSJD
+			b2NvYVZlcnNpb24iIGNvbnRlbnQ9IjE1MDQuODEiPgo8c3R5bGUg
+			dHlwZT0idGV4dC9jc3MiPgpwLnAxIHttYXJnaW46IDAuMHB4IDAu
+			MHB4IDAuMHB4IDAuMHB4OyBsaW5lLWhlaWdodDogMTQuMHB4OyBm
+			b250OiAxMi4wcHggSGVsdmV0aWNhOyBjb2xvcjogIzAwMDAwMDsg
+			LXdlYmtpdC10ZXh0LXN0cm9rZTogIzAwMDAwMH0Kc3Bhbi5zMSB7
+			Zm9udC1rZXJuaW5nOiBub25lfQo8L3N0eWxlPgo8L2hlYWQ+Cjxi
+			b2R5Pgo8cCBjbGFzcz0icDEiPjxzcGFuIGNsYXNzPSJzMSI+VFhN
+			IDAuNy44IGluc3RhbGxlciBmb3IgTWFjIE9TIFggMTAuMTArPC9z
+			cGFuPjwvcD4KPC9ib2R5Pgo8L2h0bWw+Cg==
+			</data>
+		</dict>
+		<key>PROJECT_PRESENTATION</key>
+		<dict>
+			<key>BACKGROUND</key>
+			<dict>
+				<key>ALIGNMENT</key>
+				<integer>6</integer>
+				<key>BACKGROUND_PATH</key>
+				<dict>
+					<key>PATH</key>
+					<string>TXM_pkg.png</string>
+					<key>PATH_TYPE</key>
+					<integer>1</integer>
+				</dict>
+				<key>CUSTOM</key>
+				<integer>1</integer>
+				<key>SCALING</key>
+				<integer>0</integer>
+			</dict>
+			<key>INSTALLATION TYPE</key>
+			<dict>
+				<key>HIERARCHIES</key>
+				<dict>
+					<key>INSTALLER</key>
+					<dict>
+						<key>LIST</key>
+						<array>
+							<dict>
+								<key>DESCRIPTION</key>
+								<array/>
+								<key>OPTIONS</key>
+								<dict>
+									<key>HIDDEN</key>
+									<true/>
+									<key>STATE</key>
+									<integer>1</integer>
+								</dict>
+								<key>PACKAGE_UUID</key>
+								<string>B3537FD7-A0A7-4961-A28B-1EF5E91B357D</string>
+								<key>REQUIREMENTS</key>
+								<array/>
+								<key>TITLE</key>
+								<array/>
+								<key>TOOLTIP</key>
+								<array/>
+								<key>TYPE</key>
+								<integer>0</integer>
+								<key>UUID</key>
+								<string>384D8B62-F3D8-450C-87CD-B1EB8A9772C6</string>
+							</dict>
+							<dict>
+								<key>DESCRIPTION</key>
+								<array/>
+								<key>OPTIONS</key>
+								<dict>
+									<key>HIDDEN</key>
+									<true/>
+									<key>STATE</key>
+									<integer>1</integer>
+								</dict>
+								<key>PACKAGE_UUID</key>
+								<string>6127A458-0607-4497-A91D-96CDF072C670</string>
+								<key>REQUIREMENTS</key>
+								<array/>
+								<key>TITLE</key>
+								<array/>
+								<key>TOOLTIP</key>
+								<array/>
+								<key>TYPE</key>
+								<integer>0</integer>
+								<key>UUID</key>
+								<string>43EAC435-8830-47F0-AF3F-EF8CD9934D39</string>
+							</dict>
+						</array>
+						<key>REMOVED</key>
+						<dict/>
+					</dict>
+				</dict>
+				<key>INSTALLATION TYPE</key>
+				<integer>0</integer>
+				<key>MODE</key>
+				<integer>1</integer>
+			</dict>
+			<key>INSTALLATION_STEPS</key>
+			<array>
+				<dict>
+					<key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+					<string>ICPresentationViewIntroductionController</string>
+					<key>INSTALLER_PLUGIN</key>
+					<string>Introduction</string>
+					<key>LIST_TITLE_KEY</key>
+					<string>InstallerSectionTitle</string>
+				</dict>
+				<dict>
+					<key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+					<string>ICPresentationViewReadMeController</string>
+					<key>INSTALLER_PLUGIN</key>
+					<string>ReadMe</string>
+					<key>LIST_TITLE_KEY</key>
+					<string>InstallerSectionTitle</string>
+				</dict>
+				<dict>
+					<key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+					<string>ICPresentationViewLicenseController</string>
+					<key>INSTALLER_PLUGIN</key>
+					<string>License</string>
+					<key>LIST_TITLE_KEY</key>
+					<string>InstallerSectionTitle</string>
+				</dict>
+				<dict>
+					<key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+					<string>ICPresentationViewDestinationSelectController</string>
+					<key>INSTALLER_PLUGIN</key>
+					<string>TargetSelect</string>
+					<key>LIST_TITLE_KEY</key>
+					<string>InstallerSectionTitle</string>
+				</dict>
+				<dict>
+					<key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+					<string>ICPresentationViewInstallationTypeController</string>
+					<key>INSTALLER_PLUGIN</key>
+					<string>PackageSelection</string>
+					<key>LIST_TITLE_KEY</key>
+					<string>InstallerSectionTitle</string>
+				</dict>
+				<dict>
+					<key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+					<string>ICPresentationViewInstallationController</string>
+					<key>INSTALLER_PLUGIN</key>
+					<string>Install</string>
+					<key>LIST_TITLE_KEY</key>
+					<string>InstallerSectionTitle</string>
+				</dict>
+				<dict>
+					<key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+					<string>ICPresentationViewSummaryController</string>
+					<key>INSTALLER_PLUGIN</key>
+					<string>Summary</string>
+					<key>LIST_TITLE_KEY</key>
+					<string>InstallerSectionTitle</string>
+				</dict>
+			</array>
+			<key>INTRODUCTION</key>
+			<dict>
+				<key>LOCALIZATIONS</key>
+				<array>
+					<dict>
+						<key>LANGUAGE</key>
+						<string>English</string>
+						<key>VALUE</key>
+						<dict>
+							<key>PATH</key>
+							<string>intro_en.txt</string>
+							<key>PATH_TYPE</key>
+							<integer>1</integer>
+						</dict>
+					</dict>
+					<dict>
+						<key>LANGUAGE</key>
+						<string>French</string>
+						<key>VALUE</key>
+						<dict>
+							<key>PATH</key>
+							<string>intro_fr.txt</string>
+							<key>PATH_TYPE</key>
+							<integer>1</integer>
+						</dict>
+					</dict>
+				</array>
+			</dict>
+			<key>LICENSE</key>
+			<dict>
+				<key>KEYWORDS</key>
+				<dict/>
+				<key>LOCALIZATIONS</key>
+				<array>
+					<dict>
+						<key>LANGUAGE</key>
+						<string>English</string>
+						<key>VALUE</key>
+						<dict>
+							<key>PATH</key>
+							<string>readme_en.txt</string>
+							<key>PATH_TYPE</key>
+							<integer>1</integer>
+						</dict>
+					</dict>
+					<dict>
+						<key>LANGUAGE</key>
+						<string>French</string>
+						<key>VALUE</key>
+						<dict>
+							<key>PATH</key>
+							<string>readme_fr.txt</string>
+							<key>PATH_TYPE</key>
+							<integer>1</integer>
+						</dict>
+					</dict>
+				</array>
+				<key>MODE</key>
+				<integer>0</integer>
+			</dict>
+			<key>README</key>
+			<dict>
+				<key>LOCALIZATIONS</key>
+				<array/>
+			</dict>
+			<key>SUMMARY</key>
+			<dict>
+				<key>LOCALIZATIONS</key>
+				<array>
+					<dict>
+						<key>LANGUAGE</key>
+						<string>English</string>
+						<key>VALUE</key>
+						<dict>
+							<key>PATH</key>
+							<string>finish_en.txt</string>
+							<key>PATH_TYPE</key>
+							<integer>1</integer>
+						</dict>
+					</dict>
+					<dict>
+						<key>LANGUAGE</key>
+						<string>French</string>
+						<key>VALUE</key>
+						<dict>
+							<key>PATH</key>
+							<string>finish_fr.txt</string>
+							<key>PATH_TYPE</key>
+							<integer>1</integer>
+						</dict>
+					</dict>
+				</array>
+			</dict>
+			<key>TITLE</key>
+			<dict>
+				<key>LOCALIZATIONS</key>
+				<array>
+					<dict>
+						<key>LANGUAGE</key>
+						<string>English</string>
+						<key>VALUE</key>
+						<string>TXM</string>
+					</dict>
+				</array>
+			</dict>
+		</dict>
+		<key>PROJECT_REQUIREMENTS</key>
+		<dict>
+			<key>LIST</key>
+			<array>
+				<dict>
+					<key>BEHAVIOR</key>
+					<integer>3</integer>
+					<key>DICTIONARY</key>
+					<dict>
+						<key>IC_REQUIREMENT_CPU_ARCHITECTURE_FAMILY</key>
+						<integer>2</integer>
+						<key>IC_REQUIREMENT_CPU_INTEL_ARCHITECTURE_TYPE</key>
+						<integer>2</integer>
+						<key>IC_REQUIREMENT_CPU_MINIMUM_CPU_CORES_COUNT</key>
+						<integer>1</integer>
+						<key>IC_REQUIREMENT_CPU_MINIMUM_FREQUENCY</key>
+						<integer>866666</integer>
+						<key>IC_REQUIREMENT_CPU_POWERPC_ARCHITECTURE_TYPE</key>
+						<integer>0</integer>
+					</dict>
+					<key>IC_REQUIREMENT_CHECK_TYPE</key>
+					<integer>0</integer>
+					<key>IDENTIFIER</key>
+					<string>fr.whitebox.Packages.requirement.cpu</string>
+					<key>MESSAGE</key>
+					<array/>
+					<key>NAME</key>
+					<string>Processor</string>
+					<key>STATE</key>
+					<true/>
+				</dict>
+				<dict>
+					<key>BEHAVIOR</key>
+					<integer>3</integer>
+					<key>DICTIONARY</key>
+					<dict>
+						<key>IC_REQUIREMENT_RAM_MINIMUM_SIZE_INDEX</key>
+						<integer>1</integer>
+					</dict>
+					<key>IC_REQUIREMENT_CHECK_TYPE</key>
+					<integer>0</integer>
+					<key>IDENTIFIER</key>
+					<string>fr.whitebox.Packages.requirement.ram</string>
+					<key>MESSAGE</key>
+					<array/>
+					<key>NAME</key>
+					<string>Installed RAM</string>
+					<key>STATE</key>
+					<true/>
+				</dict>
+				<dict>
+					<key>BEHAVIOR</key>
+					<integer>3</integer>
+					<key>DICTIONARY</key>
+					<dict>
+						<key>IC_REQUIREMENT_OS_DISK_TYPE</key>
+						<integer>0</integer>
+						<key>IC_REQUIREMENT_OS_DISTRIBUTION_TYPE</key>
+						<integer>0</integer>
+						<key>IC_REQUIREMENT_OS_MINIMUM_VERSION</key>
+						<integer>101000</integer>
+					</dict>
+					<key>IC_REQUIREMENT_CHECK_TYPE</key>
+					<integer>1</integer>
+					<key>IDENTIFIER</key>
+					<string>fr.whitebox.Packages.requirement.os</string>
+					<key>MESSAGE</key>
+					<array/>
+					<key>NAME</key>
+					<string>Operating System</string>
+					<key>STATE</key>
+					<true/>
+				</dict>
+				<dict>
+					<key>BEHAVIOR</key>
+					<integer>3</integer>
+					<key>DICTIONARY</key>
+					<dict>
+						<key>IC_REQUIREMENT_DISKSPACE_MINIMUM_SIZE_UNIT</key>
+						<integer>0</integer>
+						<key>IC_REQUIREMENT_DISKSPACE_MINIMUM_SIZE_VALUE</key>
+						<integer>500</integer>
+					</dict>
+					<key>IC_REQUIREMENT_CHECK_TYPE</key>
+					<integer>1</integer>
+					<key>IDENTIFIER</key>
+					<string>fr.whitebox.Packages.requirement.diskspace</string>
+					<key>MESSAGE</key>
+					<array/>
+					<key>NAME</key>
+					<string>Available Disk Space</string>
+					<key>STATE</key>
+					<true/>
+				</dict>
+			</array>
+			<key>POSTINSTALL_PATH</key>
+			<dict/>
+			<key>PREINSTALL_PATH</key>
+			<dict/>
+			<key>RESOURCES</key>
+			<array/>
+			<key>ROOT_VOLUME_ONLY</key>
+			<true/>
+		</dict>
+		<key>PROJECT_SETTINGS</key>
+		<dict>
+			<key>ADVANCED_OPTIONS</key>
+			<dict/>
+			<key>BUILD_FORMAT</key>
+			<integer>0</integer>
+			<key>BUILD_PATH</key>
+			<dict>
+				<key>PATH</key>
+				<string>..</string>
+				<key>PATH_TYPE</key>
+				<integer>1</integer>
+			</dict>
+			<key>EXCLUDED_FILES</key>
+			<array>
+				<dict>
+					<key>PATTERNS_ARRAY</key>
+					<array>
+						<dict>
+							<key>REGULAR_EXPRESSION</key>
+							<false/>
+							<key>STRING</key>
+							<string>.DS_Store</string>
+							<key>TYPE</key>
+							<integer>0</integer>
+						</dict>
+					</array>
+					<key>PROTECTED</key>
+					<true/>
+					<key>PROXY_NAME</key>
+					<string>Remove .DS_Store files</string>
+					<key>PROXY_TOOLTIP</key>
+					<string>Remove ".DS_Store" files created by the Finder.</string>
+					<key>STATE</key>
+					<true/>
+				</dict>
+				<dict>
+					<key>PATTERNS_ARRAY</key>
+					<array>
+						<dict>
+							<key>REGULAR_EXPRESSION</key>
+							<false/>
+							<key>STRING</key>
+							<string>.pbdevelopment</string>
+							<key>TYPE</key>
+							<integer>0</integer>
+						</dict>
+					</array>
+					<key>PROTECTED</key>
+					<true/>
+					<key>PROXY_NAME</key>
+					<string>Remove .pbdevelopment files</string>
+					<key>PROXY_TOOLTIP</key>
+					<string>Remove ".pbdevelopment" files created by ProjectBuilder or Xcode.</string>
+					<key>STATE</key>
+					<true/>
+				</dict>
+				<dict>
+					<key>PATTERNS_ARRAY</key>
+					<array>
+						<dict>
+							<key>REGULAR_EXPRESSION</key>
+							<false/>
+							<key>STRING</key>
+							<string>CVS</string>
+							<key>TYPE</key>
+							<integer>1</integer>
+						</dict>
+						<dict>
+							<key>REGULAR_EXPRESSION</key>
+							<false/>
+							<key>STRING</key>
+							<string>.cvsignore</string>
+							<key>TYPE</key>
+							<integer>0</integer>
+						</dict>
+						<dict>
+							<key>REGULAR_EXPRESSION</key>
+							<false/>
+							<key>STRING</key>
+							<string>.cvspass</string>
+							<key>TYPE</key>
+							<integer>0</integer>
+						</dict>
+						<dict>
+							<key>REGULAR_EXPRESSION</key>
+							<false/>
+							<key>STRING</key>
+							<string>.svn</string>
+							<key>TYPE</key>
+							<integer>1</integer>
+						</dict>
+						<dict>
+							<key>REGULAR_EXPRESSION</key>
+							<false/>
+							<key>STRING</key>
+							<string>.git</string>
+							<key>TYPE</key>
+							<integer>1</integer>
+						</dict>
+						<dict>
+							<key>REGULAR_EXPRESSION</key>
+							<false/>
+							<key>STRING</key>
+							<string>.gitignore</string>
+							<key>TYPE</key>
+							<integer>0</integer>
+						</dict>
+					</array>
+					<key>PROTECTED</key>
+					<true/>
+					<key>PROXY_NAME</key>
+					<string>Remove SCM metadata</string>
+					<key>PROXY_TOOLTIP</key>
+					<string>Remove helper files and folders used by the CVS, SVN or Git Source Code Management systems.</string>
+					<key>STATE</key>
+					<true/>
+				</dict>
+				<dict>
+					<key>PATTERNS_ARRAY</key>
+					<array>
+						<dict>
+							<key>REGULAR_EXPRESSION</key>
+							<false/>
+							<key>STRING</key>
+							<string>classes.nib</string>
+							<key>TYPE</key>
+							<integer>0</integer>
+						</dict>
+						<dict>
+							<key>REGULAR_EXPRESSION</key>
+							<false/>
+							<key>STRING</key>
+							<string>designable.db</string>
+							<key>TYPE</key>
+							<integer>0</integer>
+						</dict>
+						<dict>
+							<key>REGULAR_EXPRESSION</key>
+							<false/>
+							<key>STRING</key>
+							<string>info.nib</string>
+							<key>TYPE</key>
+							<integer>0</integer>
+						</dict>
+					</array>
+					<key>PROTECTED</key>
+					<true/>
+					<key>PROXY_NAME</key>
+					<string>Optimize nib files</string>
+					<key>PROXY_TOOLTIP</key>
+					<string>Remove "classes.nib", "info.nib" and "designable.nib" files within .nib bundles.</string>
+					<key>STATE</key>
+					<true/>
+				</dict>
+				<dict>
+					<key>PATTERNS_ARRAY</key>
+					<array>
+						<dict>
+							<key>REGULAR_EXPRESSION</key>
+							<false/>
+							<key>STRING</key>
+							<string>Resources Disabled</string>
+							<key>TYPE</key>
+							<integer>1</integer>
+						</dict>
+					</array>
+					<key>PROTECTED</key>
+					<true/>
+					<key>PROXY_NAME</key>
+					<string>Remove Resources Disabled folders</string>
+					<key>PROXY_TOOLTIP</key>
+					<string>Remove "Resources Disabled" folders.</string>
+					<key>STATE</key>
+					<true/>
+				</dict>
+				<dict>
+					<key>SEPARATOR</key>
+					<true/>
+				</dict>
+			</array>
+			<key>NAME</key>
+			<string>TXM_0.8.0_MacOSX_installer</string>
+		</dict>
+	</dict>
+	<key>SHARED_GLOBAL_DATA</key>
+	<dict>
+		<key>IC_REQUIREMENT_JAVASCRIPT_SHARED_SOURCE_CODE</key>
+		<string></string>
+	</dict>
+	<key>TYPE</key>
+	<integer>0</integer>
+	<key>VERSION</key>
+	<integer>2</integer>
+</dict>
+</plist>
Index: tmp/trunk/org.txm.setups/shared/mac/finish_en.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/finish_en.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/finish_en.txt	(revision 728)
@@ -0,0 +1,4 @@
+
+You can start TXM with the 'TXM.app' file found in the "Applications" / "TXM" directory.
+
+If you want to automatically tag and lemmatize your corpora with the TreeTagger software during import, you need to follow additional installation instructions given in the "Help > Install TreeTagger" menu.

Property changes on: tmp/trunk/org.txm.setups/shared/mac/finish_en.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/rlibs_fr.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/rlibs_fr.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/rlibs_fr.txt	(revision 728)
@@ -0,0 +1,2 @@
+Option - installer les packages R automatiquement : 'Rserve', 'rgl', 'FactoMineR' et 'textometry'.
+Si vous ne sŽlectionnez pas cette option, merci d'installer ces packages avant d'utiliser TXM (pour plus de dŽtails, voir la page https://groupes.renater.fr/wiki/txm-info/public/preparation_env_dev_manuel#r)

Property changes on: tmp/trunk/org.txm.setups/shared/mac/rlibs_fr.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/CLEAN
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/CLEAN	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/CLEAN	(revision 728)
@@ -0,0 +1,37 @@
+#!/bin/sh
+echo "** TXM preinstall: remove /Applications/TXM"
+if [ ! -f "/Applications/TXM" ]; then
+	sudo rm -rf /Applications/TXM
+	if [ $? != 0 ];then
+		echo "** TXM preinstall: failed to delete /Applications/TXM"
+		exit 1
+	fi
+fi
+
+echo "Backuping previous preferences if any: $HOME/.txm/configuration/.settings/org.txm.rcpapplication.prefs"
+if [ -f "$HOME/.txm/configuration/.settings/org.txm.rcpapplication.prefs" ]; then
+	echo "Found preference file: $HOME/.txm/configuration/.settings/org.txm.rcpapplication.prefs"
+	rm -f "/tmp/org.txm.rcpapplication.prefs"
+	cp "$HOME/.txm/configuration/.settings/org.txm.rcpapplication.prefs" "/tmp/org.txm.rcpapplication.prefs"
+	if [ $? != 0 ]; then
+		echo "Failed to copy old preference file in /tmp/org.txm.rcpapplication.prefs"
+	fi
+fi
+
+echo "Backuping previous preferences if any: $HOME/TXM/.txm/configuration/.settings/org.txm.rcpapplication.prefs"
+if [ -f "$HOME/TXM/.txm/configuration/.settings/org.txm.rcpapplication.prefs" ]; then
+	echo "Found preference file: $HOME/TXM/.txm/configuration/.settings/org.txm.rcpapplication.prefs"
+	rm -f "/tmp/org.txm.rcpapplication.prefs"
+	cp "$HOME/TXM/.txm/configuration/.settings/org.txm.rcpapplication.prefs" "/tmp/org.txm.rcpapplication.prefs"
+	if [ $? != 0 ]; then
+		echo "Failed to copy old preference file in /tmp/org.txm.rcpapplication.prefs"
+	fi
+fi
+
+if [ ! -f "$HOME/TXM/.txm" ]; then
+	sudo rm -rf "$HOME/TXM/.txm"
+	if [ $? != 0 ];then
+		echo "** TXM preinstall: failed to delete $HOME/TXM/.txm"
+		exit 1
+	fi
+fi
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/mac/CLEAN
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/mac/finish_fr.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/finish_fr.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/finish_fr.txt	(revision 728)
@@ -0,0 +1,4 @@
+
+TXM se lance par le fichier "TXM.app" situŽ dans le rŽpertoire "Applications" / "TXM".
+
+Si vous souhaitez Žtiqueter et lemmatiser automatiquement vos corpus avec le logiciel TreeTagger lors de l'import, vous devez suivre les instructions d'installation supplŽmentaires fournies dans le menu "Aide > Installer TreeTagger".

Property changes on: tmp/trunk/org.txm.setups/shared/mac/finish_fr.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/TestPreInstall.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/TestPreInstall.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/YesNoDialog.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/YesNoDialog.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/R/XQuartz.pkg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/R/XQuartz.pkg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/R/tcltk-8.5.5-x11.pkg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/R/tcltk-8.5.5-x11.pkg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/R/texinfo-6.1-0.pkg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/R/texinfo-6.1-0.pkg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/GetProxyConfiguration.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/GetProxyConfiguration.jar
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/TXM.app/Contents/._Info.plist
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/TXM.app/Contents/._Info.plist
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/TXM.app/Contents/MacOS/TXM
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/TXM.app/Contents/MacOS/TXM	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/TXM.app/Contents/MacOS/TXM	(revision 728)
@@ -0,0 +1,186 @@
+#!/bin/sh
+# This script launch TXM in the right directory and with the right TXM.ini file
+
+echo "Prepare redirections in $HOME/TXMPostInstallOutputLogs.txt and $HOME/TXMPostInstallErrorLogs.txt files"
+
+LOGFILESMSG=", see $HOME/TXMPostInstallOutputLogs.txt and $HOME/TXMPostInstallErrorLogs.txt output and error messages files."
+
+exec 3>$HOME/TXMPostInstallOutputLogs.txt
+exec 4>$HOME/TXMPostInstallErrorLogs.txt
+
+echo "$HOME is '$HOME'"
+
+if [ ! -d "$HOME" ]; then
+	echo "TXM: Impossible to access user home directory ($HOME). Aborting"
+	exit 1
+fi
+
+echo "Creating all necessary directories"
+
+DIR="$HOME/TXM"
+echo "DIR='$DIR'"
+if [ ! -d "$DIR" ]; then
+	mkdir "$DIR"
+fi
+if [ ! -d "$DIR" ]; then
+	zenity --info --text="TXM: Impossible to access '$DIR' directory. Aborting$LOGFILESMSG"
+	echo "TXM: Impossible to access '$DIR' directory. Aborting$LOGFILESMSG"
+	exit 1
+fi
+
+DIR="$HOME/TXM/.txm"
+echo "DIR='$DIR'"
+if [ ! -d "$DIR" ]; then
+	mkdir "$DIR"
+fi
+if [ ! -d "$DIR" ]; then
+	zenity --info --text="TXM: Impossible to access '$DIR' directory. Aborting$LOGFILESMSG"
+	echo "TXM: Impossible to access '$DIR' directory. Aborting$LOGFILESMSG"
+	exit 1
+fi
+LOGFILES=", see log files $HOME/TXMPostInstallLogs.txt and $HOME/TXMPostInstallErrorLogs.txt."
+
+vercomp () {
+    echo "test $1 $2"
+    if [[ $1 == $2 ]]
+    then
+        return 0
+    fi
+    local IFS=.
+    local i ver1=($1) ver2=($2)
+    # fill empty fields in ver1 with zeros
+    for ((i=${#ver1[@]}; i<${#ver2[@]}; i++))
+    do
+        ver1[i]=0
+    done
+    for ((i=0; i<${#ver1[@]}; i++))
+    do
+        if [[ -z ${ver2[i]} ]]
+        then
+            ver2[i]=0
+        fi
+        if ((10#${ver1[i]} > 10#${ver2[i]}))
+        then
+            return 0
+        fi
+        if ((10#${ver1[i]} < 10#${ver2[i]}))
+        then
+            return 1
+        fi
+    done
+    return 0
+}
+
+
+echo "TXM: looking at the last TXM install date from the /usr/lib/TXM/STAMP file"
+
+if [ ! -f "/Applications/TXM/STAMP" ]; then
+	echo "TXM: Impossible to access '/Applications/TXM/STAMP' file. Aborting$LOGFILESMSG"
+	exit 1
+fi
+
+STAMP=`stat -t %Y%m%d "/Applications/TXM/STAMP" | cut -d\  -f11`
+
+if [ $? != 0 ]; then
+    echo "TXM: Can't find STAMP file /Applications/TXM/STAMP $LOGFILES"
+    exit 1 ;
+fi
+
+echo "TXM: if .txm folder does not contain the STAMP file, its a new install."
+if [ ! -e "$HOME/TXM/.txm/$STAMP" ]; then
+
+	echo "New TXM install: it's the first launch after the installation"
+	if [ -f "/tmp/org.txm.rcpapplication.prefs" ]; then
+		rm -f "/tmp/org.txm.rcpapplication.prefs" # remove previous preference files if any
+	fi
+
+	echo "Backing up previous TXM 0.7.6 preferences if any..."
+	if [ -f "$HOME/.txm/configuration/.settings/org.txm.rcpapplication.prefs" ]; then
+		echo "Found preference file: $HOME/.txm/configuration/.settings/org.txm.rcpapplication.prefs"
+		cp -f "$HOME/.txm/configuration/.settings/org.txm.rcpapplication.prefs" "/tmp/org.txm.rcpapplication.prefs"
+		if [ $? != 0 ]; then
+  			echo "Failed to copy old preference file in /tmp/org.txm.rcpapplication.prefs"
+		fi
+	fi
+
+	echo "Backing up previous TXM 0.7.7 preferences if any..."
+	if [ -f "$HOME/.txm/data/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.txm.rcpapplication.prefs" ]; then
+		echo "Found preference file: $HOME/.txm/data/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.txm.rcpapplication.prefs"
+		cp -f "$HOME/.txm/data/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.txm.rcpapplication.prefs" "/tmp/org.txm.rcpapplication.prefs"
+		if [ $? != 0 ]; then
+  			echo "Failed to copy old preference file in /tmp/org.txm.rcpapplication.prefs"
+		fi
+	fi
+
+	echo "TXM: Installing up to date TXM directories."
+	rm -rf "$HOME/TXM/.txm"
+	if [ -d "$HOME/TXM/.txm" ]; then
+	    zenity --info --text="TXM: Failed to remove $HOME/TXM/.txm directory$LOGFILESMSG"
+	    echo "TXM: Failed to remove $HOME/TXM/.txm directory$LOGFILESMSG"
+	    exit 1 ;
+	fi
+
+    mkdir "$HOME/TXM/.txm"
+	mkdir "$HOME/TXM/.txm/user"
+	mkdir "$HOME/TXM/.txm/data"
+
+    if [ ! -d "$HOME/TXM/.txm" ]; then
+		echo "TXM: Impossible to access '$HOME/TXM/.txm' directory. Aborting$LOGFILESMSG"
+		exit 1
+    fi
+
+    echo "TXM: getting '/Applications/TXM/TXM.ini' and set write permission of '$HOME/TXM/.txm/TXM.ini'"
+    cp /Applications/TXM/.main.app/Contents/MacOS/TXM.ini "$HOME/TXM/.txm/TXM.ini" &&
+    chmod +w "$HOME/TXM/.txm/TXM.ini";
+    
+    if [ $? != 0 ]; then
+       	echo "TXM: Can't launch TXM: failed to set TXM.ini file$LOGFILESMSG"
+        exit 1
+    fi
+
+    echo "TXM: creating the $HOME/TXM/.txm/$STAMP install STAMP file."
+    touch "$HOME/TXM/.txm/$STAMP"
+
+    if [ $? != 0 ]; then
+		echo "TXM: Can't launch TXM: failed to create the $HOME/TXM/.txm/$STAMP install STAMP file$LOGFILESMSG"
+        exit 1
+    fi
+fi
+
+#) 1>&3 2>&4
+
+# don't exec TXM if problem occurs
+if [ $? != 0 ]; then
+    echo "TXM: An error occurred. Aborting$LOGFILESMSG";
+    exit 1 ;
+fi
+
+TXMINIARGSVM=""
+TXMINIARGS=""
+STARTVMARGS=0
+while read i ; do 	
+	if [ $STARTVMARGS == 1 ]; then
+ 		TXMINIARGSVM="$TXMINIARGSVM $i" ;
+	else
+		TXMINIARGS="$TXMINIARGS $i" ;
+	fi
+	
+	if [ $i == "-vmargs" ]; then
+ 	   STARTVMARGS=1
+	fi
+done < "$HOME/TXM/.txm/TXM.ini"; 
+
+echo "TXM INI ARGS = $TXMINIARGS"
+echo "TXM INI VM ARGS = $TXMINIARGSVM"
+
+OSVERSION=`sw_vers -productVersion`
+
+vercomp $OSVERSION "10.7"
+
+if [ $? != 0 ];then
+	echo "TXM: Running TXM for Mac OS X $OSVERSION with the binary launcher..."
+	open /Applications/TXM/.main.app --args -run --launcher.ini "$HOME/TXM/.txm/TXM.ini" -data "$HOME/TXM/.txm/data" -user "$HOME/TXM/.txm/user" -install "/Applications/TXM" &
+else
+	echo "TXM: Running TXM for Mac OS X $OSVERSION with the JAR launcher..."
+	/Applications/TXM/jre/Contents/Home/bin/java -Djava.library.path="$(echo  /Applications/TXM/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_*/eclipse_*.so)" -XX:MaxPermSize=256m -XstartOnFirstThread $TXMINIARGSVM -jar "$(echo /Applications/TXM/TXM/plugins/org.eclipse.equinox.launcher_*.jar)" -os macosx -ws cocoa -arch x86_64 -showsplash -run -data "$HOME/TXM/.txm/data" -user  "$HOME/TXM/.txm/user" -install "/Applications/TXM/TXM"
+fi
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/TXM.app/Contents/Info.plist
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/TXM.app/Contents/Info.plist	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/TXM.app/Contents/Info.plist	(revision 728)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>CFBundlePackageType</key><string>APPL</string><key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
+
+    <key>CFBundleName</key>                      <string>TXM</string>
+<key>CFBundleIconFile</key>		<string>TXM logo.icns</string>
+    <key>CFBundleExecutable</key>                <string>TXM</string>
+    <key>CFBundleIdentifier</key> <string>appified.mdecorde.TXM</string>
+
+    <key>CFBundleVersion</key>            <string>0.1</string>
+    <key>CFBundleGetInfoString</key>      <string>0.1 appified by mdecorde at Lun  6 mai 2013 17:37:42 CEST</string>
+    <key>CFBundleShortVersionString</key> <string>0.1</string>
+
+</dict></plist>
Index: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/TXM.app/Contents/Resources/TXM logo.icns
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/Applications/TXM/TXM.app/Contents/Resources/TXM logo.icns
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/intro_en.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/intro_en.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/intro_en.txt	(revision 728)
@@ -0,0 +1,8 @@
+
+If TXM is already installed on this machine, it will first be removed by this installer (TXM corpora will NOT be removed).
+
+Close the window to cancel installation.
+
+TXM will install R Packages, this default behavior can be changed during installation.
+
+Minimum requirements: MAC OS X 10.6
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/mac/intro_en.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/TXM_pkg.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/TXM_pkg.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/mac/get_opt_local_lib_files.sh
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/get_opt_local_lib_files.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/get_opt_local_lib_files.sh	(revision 728)
@@ -0,0 +1,25 @@
+cp -f /opt/local/lib/libglib-2.0.0.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libglib-2.0.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libhistory.5.0.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libhistory.5.1.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libhistory.5.2.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libhistory.6.1.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libhistory.6.2.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libhistory.6.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libiconv.2.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libiconv.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libintl.8.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libncurses.5.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libpcre.0.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libpcre.1.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libpcre.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libpcrecpp.0.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libpcrecpp.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libpcreposix.0.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libpcreposix.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libreadline.5.0.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libreadline.5.1.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libreadline.5.2.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libreadline.6.1.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libreadline.6.2.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
+cp -f /opt/local/lib/libreadline.6.dylib /Users/mdecorde/Desktop/TXM_0.7.7_MacOSX/opt/local/lib
Index: tmp/trunk/org.txm.setups/shared/mac/README
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/README	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/README	(revision 728)
@@ -0,0 +1,14 @@
+Applications -> contient ce qui sera dÃ©posÃ© dans /Applications
+BUILDPKG.pmdoc -> contient toute la conf de build du setup
+background.jpg -> image de fond du setup
+CLEAN -> appelÃ© en dÃ©but de procÃ©dure d'install : supprime les dossiers d'isntall de TXM
+finish_en.txt -> message de fin EN
+finish_fr.txt -> message de fin FR
+INSTALL -> appelÃ© en fi nde procÃ©dure d'install : install R, install libs pour R, crÃ©Ã© STAMP, set droits de fichier, crÃ©Ã© dossiers de conf de TXM
+intro_en.txt -> message d'accueil EN
+intro_fr.txt -> message d'accueil FR
+readme_en.txt -> licence EN
+readme_fr.txt -> licence FR
+rlibs_en.txt -> message pour l'install des libs R EN
+rlibs_fr.txt -> message pour l'install des libs R FR
+RunPackageMaker -> script pour construire le setup, cassÃ© en ce moment...
Index: tmp/trunk/org.txm.setups/shared/mac/readme_en.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/mac/readme_en.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/mac/readme_en.txt	(revision 728)
@@ -0,0 +1,11 @@
+
+TXM is provided to you free of charge. In return, in the spirit of open-source software development, you are invited to participate in its improvement. To do this, you don't have to be a software developer, you can:
+ * send us your publications or course materials related to your use of TXM;
+ * suggest corrections or improvements;
+ * translate in your language the interface or documentation;
+ * Setup a research project involving TXM adaptation and use;
+ * etc.
+
+ See the 'Contribute' page on the TXM users' wiki: https://groupes.renater.fr/wiki/txm-users/public/contribuer 
+
+ Don't hesitate to contact us for more information at 'textometrie AT groupes.renater DOT fr'.

Property changes on: tmp/trunk/org.txm.setups/shared/mac/readme_en.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/mac/background.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/mac/background.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/debian/DEBIAN/templates.en
===================================================================
--- tmp/trunk/org.txm.setups/shared/debian/DEBIAN/templates.en	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/debian/DEBIAN/templates.en	(revision 728)
@@ -0,0 +1,39 @@
+Template: TXM/showinfos
+Type: note
+Description:For your information
+ .
+  If TXM is already installed on this machine, it will first be removed by this installer (TXM corpora will NOT be removed).
+   Close the window to cancel installation.
+ .
+ Minimum requirements: Ubuntu 14.04
+
+Template: TXM/showwelcome
+Type: note
+Description:Welcome to TXM setup
+ .
+  TXM is provided to you free of charge. In return, in the spirit of open-source software development, you are invited to participate in its improvement. To do this, you don't have to be a software developer, you can:
+  * send us your publications or course materials related to your use of TXM;
+  * suggest corrections or improvements;
+  * translate in your language the interface or documentation;
+  * Setup a research project involving TXM adaptation and use;
+  * etc.
+  .
+  See the 'Contribute' page on the TXM users' wiki: https://groupes.renater.fr/wiki/txm-users/public/contribuer 
+  .
+  Don't hesitate to contact us for more information at 'textometrie AT groupes.renater DOT fr'.
+
+Template: TXM/askr
+Type: boolean
+Default: true
+Description:Option - install needed R packages automatically: 'Rserve', 'lattice', 'cluster', 'scatterplot3d', 'FactoMineR' and 'textometry'.
+ .
+  If you don't select that option, please install these packages manually before using TXM
+  (for details, see the page https://groupes.renater.fr/wiki/txm-info/public/preparation_env_dev_manuel#r)
+
+Template: TXM/finish
+Type: note
+Description:Installation done
+ .
+  The installation is done. A 'TXM' entry has been added to the dashboard.
+ .
+  If you want to automatically tag and lemmatize your corpora with the TreeTagger software during import, you need to follow additional installation instructions given in the "Help > Install TreeTagger" menu.
Index: tmp/trunk/org.txm.setups/shared/debian/DEBIAN/control
===================================================================
--- tmp/trunk/org.txm.setups/shared/debian/DEBIAN/control	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/debian/DEBIAN/control	(revision 728)
@@ -0,0 +1,18 @@
+Package: txm
+Version: 0.8.0
+Section: base
+Priority: optional
+Architecture: all
+Installed-Size: 250000
+Depends: zenity, po-debconf, libwebkitgtk-1.0-0, debconf, libc6 (>= 2.15), libgtk2-perl, libblas3, libbz2-1.0, libcairo2, libgfortran3, libglib2.0-0, libgomp1, libjpeg8, liblapack3, liblzma5, libpango-1.0-0, libpangocairo-1.0-0, libpaper-utils, libpcre3, libpng12-0|libpng16, libreadline6, libtiff5, libx11-6, libxt6, tcl8.5, tk8.5, ucf, unzip, xdg-utils, zip, zlib1g
+Maintainer: TXM team <textometrie@ens-lyon.fr>
+Source: txm-src
+License: GPL-2+
+Vcs-Svn: https://svn.code.sf.net/p/txm/code/trunk
+Vcs-Browser: https://sourceforge.net/p/txm/code/HEAD/tree
+Homepage: http://textometrie.ens-lyon.fr
+Description: Analyse textomÃ©trique de corpus textuels
+ Analyse statistique et documentaire de corpus textuels structurÃ©s, annotÃ©s et multimÃ©dia compatible Unicode / XML / TEI, basÃ© sur le moteur de recherche plein texte CQP et l'environnement statistique R.
+ .
+ .
+ Avertissement : les corpus prÃ©-existants d'un TXM dÃ©jÃ  prÃ©sent sur la machine seront automatiquement rÃ©cupÃ©rÃ©s lors de l'installation.
Index: tmp/trunk/org.txm.setups/shared/debian/DEBIAN/postinst
===================================================================
--- tmp/trunk/org.txm.setups/shared/debian/DEBIAN/postinst	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/debian/DEBIAN/postinst	(revision 728)
@@ -0,0 +1,46 @@
+#!/bin/bash
+# Source debconf library.
+#. /usr/share/debconf/confmodule
+
+TXMINSTALLDIR="/usr/lib/TXM"
+
+# create txm group
+cat /etc/group | grep txm
+if [ $? != 0 ]; then
+	sudo groupadd txm
+	if [ $? != 0 ]; then
+		echo "** TXM install: failed to create 'txm' group" >&2
+	exit 1;
+fi
+fi
+
+# set 'txm' group to TXM install files
+sudo chgrp -R txm /usr/lib/TXM
+if [ $? != 0 ]; then
+	echo "** TXM install: failed to set the 'txm' group to TXM install files" >&2
+	exit 1;
+fi
+
+# and add 'txm' group to the current SUDO_USER
+for user in `users`
+do
+	sudo usermod -a -G txm $user
+	
+	if [ $? != 0 ]; then
+		echo "usermod -a -G txm $user"
+		echo "** TXM install: failed to set 'txm' group to $user" >&2
+	exit 1;
+fi
+done
+
+
+# create stamp file
+touch "$TXMINSTALLDIR/STAMP"
+if [ $? != 0 ]; then
+	echo "** TXM install: Failed to create install TIMESTAMP file : $TXMINSTALLDIR/STAMP" >&2
+	exit 1;
+fi
+
+#db_stop
+echo "** TXM install: done, type TXM& in a terminal to launch the application"
+exit 0

Property changes on: tmp/trunk/org.txm.setups/shared/debian/DEBIAN/postinst
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/debian/DEBIAN/postrm
===================================================================
--- tmp/trunk/org.txm.setups/shared/debian/DEBIAN/postrm	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/debian/DEBIAN/postrm	(revision 728)
@@ -0,0 +1,5 @@
+# Source debconf library.
+. /usr/share/debconf/confmodule
+
+# Remove my changes to the db.
+db_purge

Property changes on: tmp/trunk/org.txm.setups/shared/debian/DEBIAN/postrm
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/debian/DEBIAN/preinst
===================================================================
--- tmp/trunk/org.txm.setups/shared/debian/DEBIAN/preinst	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/debian/DEBIAN/preinst	(revision 728)
@@ -0,0 +1,4 @@
+#!/bin/bash
+TXMINSTALLDIR="/usr/lib/TXM"
+
+rm -rf "$TXMINSTALLDIR"

Property changes on: tmp/trunk/org.txm.setups/shared/debian/DEBIAN/preinst
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/debian/DEBIAN/templates.fr
===================================================================
--- tmp/trunk/org.txm.setups/shared/debian/DEBIAN/templates.fr	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/debian/DEBIAN/templates.fr	(revision 728)
@@ -0,0 +1,35 @@
+Template: TXM/showinfos
+Type: note
+Description:Pour votre information
+ .
+  Si TXM est dÃ©jÃ  installÃ© sur cette machine, cet installeur le supprimera pour commencer (les corpus existants ne seront pas supprimÃ©s). Pour annuler l'installation, vous pouvez fermer cette fenÃªtre.
+
+Template: TXM/showwelcome
+Type: note
+Description:BIENVENUE DANS L'INSTALLEUR DE TXM
+ .
+  TXM vous est fourni gracieusement. En contre-partie, dans l'esprit du logiciel libre, vous Ãªtes invitÃ© Ã  participer Ã  son amÃ©lioration. Pour cela, vous n'Ãªtes pas obligÃ© d'Ãªtre dÃ©veloppeur informatique, vous pouvez :
+  * transmettre vos publications ou supports de cours ;
+  * proposer des corrections ou amÃ©liorations ;
+  * traduire l'interface ou la documentation ;
+  * monter un projet pour adapter TXM Ã  vos besoins ;
+  * etc.
+  .
+  Voir la rubrique 'Contribuer' du wiki des utilisateurs de TXM : https://groupes.renater.fr/wiki/txm-users/public/contribuer 
+  .
+  N'hÃ©sitez pas Ã  nous contacter pour de plus amples informations : 'textometrie AT groupes.renater DOT fr'.
+
+Template: TXM/askr
+Type: boolean
+Default: true
+Description:Option - installer les packages R automatiquement : 'Rserve', 'lattice', 'cluster', 'scatterplot3d', 'FactoMineR' et 'textometry'.
+ .
+  Si vous ne sÃ©lectionnez pas cette option, merci d'installer ces packages avant d'utiliser TXM (pour plus de dÃ©tails, voir la page https://groupes.renater.fr/wiki/txm-info/public/preparation_env_dev_manuel#r)
+
+Template: TXM/finish
+Type: note
+Description:Installation terminÃ©e.
+ .
+  L'installation s'est correctement terminÃ©e. Une entrÃ©e "TXM" a Ã©tÃ© ajoutÃ©e au tableau de bord. terminal
+ .
+  Si vous souhaitez Ã©tiqueter et lemmatiser automatiquement vos corpus avec le logiciel TreeTagger lors de l'import, vous devez suivre les instructions d'installation supplÃ©mentaires fournies dans le menu "Aide > Installer TreeTagger".
Index: tmp/trunk/org.txm.setups/shared/debian/DEBIAN/config
===================================================================
--- tmp/trunk/org.txm.setups/shared/debian/DEBIAN/config	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/debian/DEBIAN/config	(revision 728)
@@ -0,0 +1,16 @@
+#!/bin/sh -e
+# Source debconf library.
+. /usr/share/debconf/confmodule
+
+echo "START CONFIG 0:$0 1:$1 2:$2" >&2
+
+db_title "TXM 0.8.0 installer"
+db_input critical TXM/showinfos || true
+db_go # shows questions
+db_input critical TXM/showwelcome || true
+db_go # shows questions
+#db_input critical TXM/askr || true
+#db_go # shows questions
+
+db_stop
+echo "END CONFIG" >&2
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/debian/DEBIAN/config
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/debian/DEBIAN/copyright
===================================================================
--- tmp/trunk/org.txm.setups/shared/debian/DEBIAN/copyright	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/debian/DEBIAN/copyright	(revision 728)
@@ -0,0 +1,23 @@
+Format : http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Name: txm
+Maintainer: TXM team <textometrie@ens-lyon.fr>
+Upstream-Name: txm
+Source : https://sourceforge.net/projects/txm/
+
+Copyright: Copyright Â© 2010-2017 ENS de Lyon. Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of Nice Sophia Antipolis, University of Paris 3.
+License: GPL-2+
+ The TXM platform is free software: you can redistribute it
+ and/or modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation,
+ either version 2 of the License, or (at your option) any
+ later version.
+ 
+ The TXM platform 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 General Public License for more
+ details.
+ 
+ You should have received a copy of the GNU General 
+ Public License along with the TXM platform. If not, see 
+ http://www.gnu.org/licenses.
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/debian/DEBIAN/templates
===================================================================
--- tmp/trunk/org.txm.setups/shared/debian/DEBIAN/templates	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/debian/DEBIAN/templates	(revision 728)
@@ -0,0 +1,65 @@
+Template: TXM/showinfos
+Type: note
+Description:CORPORA BACKUP
+ .
+ If TXM is already installed on this machine, it will first be removed by this installer (your personal TXM corpora will be preserved and transfered to the new version).
+
+Template: TXM/showwelcome
+Type: note
+Description:WELCOME TO TXM SETUP
+ .
+ TXM being developed as open-source software and distributed for free, your contribution is important for its communautary development to continue. To do so, you do not have to be software developer. For instance, you can:
+ .
+ * send us your publication references or documentation showing your use of TXM;
+ .
+ * report new bugs you might find in TXM by sending a mail to the txm-open mailing list: https://lists.sourceforge.net/lists/listinfo/txm-open (after checking that the bug is not already listed in the TXM bug tracker: http://forge.cbp.ens-lyon.fr/redmine/projects/txm/issues?query_id=24). If you read French, you can also add a report in the French users wiki directly: https://groupes.renater.fr/wiki/txm-users/public/retours_de_bugs_logiciel
+ .
+ * help us translate the user interface or documentation in other languages
+ .
+ * share with the community of users your course materials, as well as sample corpora analyzed with TXM
+ .
+ * invite your fellow developers to adapt TXM to your needs and share with us these developments. In its core (Java and C programming: for professional developers) or at its periphery (Groovy language or XSL style sheets scripting: much more accessible)
+ .
+ * set up a research project using TXM (eg ANR, DFG, ERC, NEH) for which we can advise you in the customization of the software
+ .
+ * make proposals for improving the documentation and TXM dissemination
+ .
+ * add a link from your website to the home page of the TextomÃ©trie project http://textometrie.ens-lyon.fr
+ .
+ Please contact us at 'textometrie AT ens-lyon.fr' for further information.
+ .
+ .
+
+Template: TXM/askr
+Type: boolean
+Default: true
+Description:Install automatically the R packages for me: 'Rserve', 'lattice', 'cluster', 'scatterplot3d', 'FactoMineR' and 'textometry'.
+ .
+ If you don't select that option, please install these packages manually before using TXM
+ (for details, see the https://groupes.renater.fr/wiki/txm-info/public/preparation_env_dev_manuel#r)
+
+Template: TXM/finish
+Type: note
+Description:THANK YOU
+ .
+ The installation is done. You need to run TXM once to finalize TXM installation.
+ .
+ If this is the first time you install TXM on this machine, you need to quit your Ubuntu session and reconnect before using TXM.
+ .
+ Online updates are only available from the second launch of TXM.
+ .
+ If you want to automatically lemmatize your corpora with the TreeTagger software during the import process, you need to follow additional installation instructions provided in the "Help > Install TreeTagger" menu.
+ .
+ To launch TXM, navigate to the 'Installed Applications' section in the Launchpad and double-click on TXM application icon (right-click on TXM icon in the Dock and select 'Keep in Dock' to add direct access). An alternate way to launch TXM is to type 'TXM&' in a terminal (without the quotes)
+ .
+ For further information about using TXM:
+ .
+ * Read TXM manual online -> http://txm.sourceforge.net/doc/manual/manual1.xhtml
+ .
+ * Download TXM PDF manual for printing -> http://sourceforge.net/projects/txm/files/documentation/Manuel%20de%20TXM%200.7%20FR.pdf/download
+ .
+ * Participate to TXM users community wiki and mailing list -> https://groupes.renater.fr/wiki/txm-users
+ .
+ * Get in touch with TXM team -> mailto:textometrie@ens-lyon.fr
+ .
+ Thank you for installing TXM
Index: tmp/trunk/org.txm.setups/shared/debian/usr/share/lintian/overrides/txm
===================================================================
--- tmp/trunk/org.txm.setups/shared/debian/usr/share/lintian/overrides/txm	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/debian/usr/share/lintian/overrides/txm	(revision 728)
@@ -0,0 +1,2 @@
+txm binary: arch-independent-package-contains-binary-or-object
+txm binary: unstripped-binary-or-object
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/debian/usr/share/doc/txm/changelog.gz
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/debian/usr/share/doc/txm/changelog.gz
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/debian/usr/share/doc/txm/copyright
===================================================================
--- tmp/trunk/org.txm.setups/shared/debian/usr/share/doc/txm/copyright	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/debian/usr/share/doc/txm/copyright	(revision 728)
@@ -0,0 +1,23 @@
+Format : http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Name: txm
+Maintainer: TXM team <textometrie@ens-lyon.fr>
+Upstream-Name: txm
+Source : https://sourceforge.net/projects/txm/
+
+Copyright: Copyright Â© 2010-2017 ENS de Lyon. Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of Nice Sophia Antipolis, University of Paris 3.
+License: GPL-2+
+ The TXM platform is free software: you can redistribute it
+ and/or modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation,
+ either version 2 of the License, or (at your option) any
+ later version.
+ 
+ The TXM platform 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 General Public License for more
+ details.
+ 
+ You should have received a copy of the GNU General 
+ Public License along with the TXM platform. If not, see 
+ http://www.gnu.org/licenses.
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/debian/usr/share/applications/TXM debug.desktop
===================================================================
--- tmp/trunk/org.txm.setups/shared/debian/usr/share/applications/TXM debug.desktop	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/debian/usr/share/applications/TXM debug.desktop	(revision 728)
@@ -0,0 +1,20 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Application
+Name=TXM 0.8.0 Debug
+Version=0.8.0
+GenericName=Textual data analysis software
+GenericName[cn]= æ–‡æœ¬åˆ†æž�è½¯ä»¶
+GenericName[de]=Textanalysesoftware
+GenericName[fr]=Logiciel d'analyse de donnÃ©es textuelles
+GenericName[ru]=ÐŸÑ€Ð¾Ð³Ñ€Ð°Ð¼Ð¼Ð° Ð´Ð»Ñ� Ð°Ð½Ð°Ð»Ð¸Ð·Ð° Ñ‚ÐµÐºÑ�Ñ‚Ð¾Ð² 
+GenericName[oc]=TextomÃ¨tria
+Comment=Textometry: Quantitative and qualitative analysis of textual data
+Comment[cn]=TextomÃ©trie, å®šé‡�å’Œå®šæ€§åˆ†æž�çš„æ•°å­—æ–‡æœ¬è¯­æ–™åº“
+Comment[de]=Textometrie, quantitative und qualitative Analyse von elektronischen Textkorpora
+Comment[fr]=TextomÃ©trie, analyse quantitative et qualitative de donnÃ©es textuelles
+Comment[ru]=Ñ‚ÐµÐºÑ�Ñ‚Ð¾Ð¼ÐµÑ‚Ñ€Ð¸Ñ�, ÐºÐ¾Ð»Ð¸Ñ‡ÐµÑ�Ñ‚Ð²ÐµÐ½Ð½Ñ‹Ð¹ Ð¸ ÐºÐ°Ñ‡ÐµÑ�Ñ‚Ð²ÐµÐ½Ð½Ñ‹Ð¹ Ð°Ð½Ð°Ð»Ð¸Ð· Ñ†Ð¸Ñ„Ñ€Ð¾Ð²Ñ‹Ñ… ÐºÐ¾Ñ€Ð¿ÑƒÑ�Ð¾Ð² Ñ‚ÐµÐºÑ�Ñ‚Ð¾Ð² 
+Icon=/usr/share/TXM/TXM.png
+Exec=/usr/bin/TXM
+Terminal=true
+Categories=Sciences;Education;Science;
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/debian/usr/share/applications/TXM.desktop
===================================================================
--- tmp/trunk/org.txm.setups/shared/debian/usr/share/applications/TXM.desktop	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/debian/usr/share/applications/TXM.desktop	(revision 728)
@@ -0,0 +1,20 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Application
+Name=TXM 0.8.0
+Version=0.8.0
+GenericName=Textual data analysis software
+GenericName[cn]= æ–‡æœ¬åˆ†æž�è½¯ä»¶
+GenericName[de]=Textanalysesoftware
+GenericName[fr]=Logiciel d'analyse de donnÃ©es textuelles
+GenericName[ru]=ÐŸÑ€Ð¾Ð³Ñ€Ð°Ð¼Ð¼Ð° Ð´Ð»Ñ� Ð°Ð½Ð°Ð»Ð¸Ð·Ð° Ñ‚ÐµÐºÑ�Ñ‚Ð¾Ð² 
+GenericName[oc]=TextomÃ¨tria
+Comment=Textometry: Quantitative and qualitative analysis of textual data
+Comment[cn]=TextomÃ©trie, å®šé‡�å’Œå®šæ€§åˆ†æž�çš„æ•°å­—æ–‡æœ¬è¯­æ–™åº“
+Comment[de]=Textometrie, quantitative und qualitative Analyse von elektronischen Textkorpora
+Comment[fr]=TextomÃ©trie, analyse quantitative et qualitative de donnÃ©es textuelles
+Comment[ru]=Ñ‚ÐµÐºÑ�Ñ‚Ð¾Ð¼ÐµÑ‚Ñ€Ð¸Ñ�, ÐºÐ¾Ð»Ð¸Ñ‡ÐµÑ�Ñ‚Ð²ÐµÐ½Ð½Ñ‹Ð¹ Ð¸ ÐºÐ°Ñ‡ÐµÑ�Ñ‚Ð²ÐµÐ½Ð½Ñ‹Ð¹ Ð°Ð½Ð°Ð»Ð¸Ð· Ñ†Ð¸Ñ„Ñ€Ð¾Ð²Ñ‹Ñ… ÐºÐ¾Ñ€Ð¿ÑƒÑ�Ð¾Ð² Ñ‚ÐµÐºÑ�Ñ‚Ð¾Ð² 
+Icon=/usr/share/TXM/TXM.png
+Exec=/usr/bin/TXM
+Terminal=false
+Categories=Sciences;Education;Science;
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/debian/usr/share/TXM/TXM.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/debian/usr/share/TXM/TXM.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/debian/usr/lib/TXM/install.bash
===================================================================
--- tmp/trunk/org.txm.setups/shared/debian/usr/lib/TXM/install.bash	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/debian/usr/lib/TXM/install.bash	(revision 728)
@@ -0,0 +1,209 @@
+#!/bin/bash
+TXMINSTALLDIR="/usr/lib/TXM"
+ARCHIVEPATH=`readlink -f "$1"`
+
+USEZENITY=true
+# X11 tests
+if [ ${DISPLAY:-foobartxtm} == foobartxm ] ; then 
+	echo "use shell" ; 
+	USEZENITY=false;
+else 
+	echo "try to use display '$DISPLAY'" ; 
+	xprop -root >/dev/null &>/dev/null # pour lancer la commande sans afficher de sortie 
+	if [ $? != 0 ];then
+		echo "use shell"
+		USEZENITY=false;
+	else
+		echo "use zenity"
+	fi
+fi 
+
+function question() {
+# $1: message
+# $2: ok message
+# $3: cancel message
+if ( $USEZENITY ) ; then
+	echo "** TXM install : Question: $1"
+	zenity --question --text="$1" --ok-label="$2" --cancel-label="$3";
+	return $?
+else
+	echo "** TXM install : Question: $1"
+	echo "$2 OR $3 = Y OR n ?"
+	read LINE
+	if [ "$LINE" = "Y" ];then
+		return 0;
+	else
+		return 1;
+	fi
+fi
+} 
+
+function error() {
+# $1: message
+echo "** TXM install : Error: $1";
+if ( $USEZENITY ) ; then
+	zenity --error --text="$1";
+fi
+} 
+
+echo "use zenity : $USEZENITY"
+
+# Test usage
+USAGE="** TXMinstall: usage: install.sh <Install source directory>"
+if [ $# != 1 ]; then
+	echo "$USAGE"
+	exit 1;
+fi
+
+# Test if java exists
+java -version
+if [ $? != 0 ]; then
+	echo "** TXM install: Could not find java. Aborting."
+	exit 1;
+fi
+
+# Test if TestArchi.jar exists
+if [ ! -f "$ARCHIVEPATH/TestPreInstall.jar" ]; then
+	echo "** TXM install: TestArchi.jar is missing $ARCHIVEPATH/TestPreInstall.jar. Can't continue the installation."
+	exit 1;
+fi
+
+# Test is javaversion os and arch match to the setup
+java -jar "$ARCHIVEPATH/TestPreInstall.jar" 1.6.0 i386 Linux
+if [ $? != 0 ]; then
+	echo "** TXM install: It seems that TXM setup is not appropriate for your system. Still continue ?"
+	echo "Type Y to continue and n to stop installation. Y/n ?"
+	read LINE
+	if [ "$LINE" = "n" ];then
+		exit 1
+	fi
+fi
+
+# Test if ARCHIVEPATH exists
+if [ ! -d "$ARCHIVEPATH" ]; then
+	echo "** TXM install: archive $ARCHIVEPATH does not exist or is not a directory. Can't continue the installation."
+	exit 1;
+fi
+
+
+
+# License agreement
+question "`cat $TXMINSTALLDIR/license.txt`" "I agree" "Cancel"
+if [ $? != 0 ];then
+	echo "** TXM install: abort"
+	exit 1;
+fi
+
+echo "** TXM install: This script will now delete and create the 'TXM' directory in the directory ($TXMINSTALLDIR), create a link to the TXM binary and install R if it is not already installed."
+echo "** TXM install: Continue ? (Y/n)"
+
+read LINE
+if [ "$LINE" = "Y" ];then
+	echo ""
+else
+	echo "** TXM install: abort"
+	exit;
+fi
+
+# install R & packages
+echo "** TXM install: Install R packages"
+if [ `which R` ];then 
+	echo ""
+else
+	aptitude install r-base
+fi 
+
+sudo R --no-save < "$TXMINSTALLDIR/R/rlibs.R"
+
+if [ $? != 0 ]; then
+	error "** TXM install: R packages installation failed. Aborting."
+	exit 1;
+fi
+
+echo "** TXM install: Removing $TXMINSTALLDIR..."
+		rm -rf "$TXMINSTALLDIR"
+		if [ $? != 0 ]; then
+			echo "** TXM install: error in 'rm -rf $TXMINSTALLDIR', aborting."
+			exit 1 ;
+		fi
+
+# create TXM install dir
+mkdir "$TXMINSTALLDIR"
+if [ $? != 0 ]; then
+	echo "** TXM install: creation of directory TXMINSTALLDIR '$TXMINSTALLDIR' failed. Aborting."
+	exit 1;
+fi
+
+# copy archive
+echo "** TXM install: Copy files into TXM install directory"
+cp -rf "$ARCHIVEPATH"/* "$TXMINSTALLDIR"
+if [ $? != 0 ]; then
+	echo "** TXM install: TXMinstallation files copy failed. Aborting."
+	exit 1;
+fi
+
+# create launcher
+echo "** TXM install: create the TXM launcher"
+rm -fv "/usr/local/bin/TXM"
+rm -fv "/usr/bin/TXM" && \
+cp "$ARCHIVEPATH/TXMexec" "/usr/bin" && \
+mv "/usr/bin/TXMexec" "/usr/bin/TXM"
+
+if [ $? != 0 ]; then
+	echo "** TXM install: Failed to create TXM launcher. Aborting."
+	exit 1;
+fi
+
+echo "** TXM install: Create preferences file"
+optExec="cqi_server_path_to_executable"
+pathToCqp="$TXMINSTALLDIR/cwb/bin/cqpserver"
+optInit="cqi_server_path_to_init_file"
+pathToInit="$TXMINSTALLDIR/cwb/cqpserver.init"
+optPathToR="r_path_to_executable"
+pathToR=`which R`
+optPathToTT="TREETAGGER_INSTALL_PATH"
+pathToTT="$TXMINSTALLDIR/treetagger"
+optPathToTTMod="TREETAGGER_MODELS_PATH"
+pathToTTMod="$TXMINSTALLDIR/treetagger/models"
+
+# create STAMP
+touch "$TXMINSTALLDIR/STAMP"
+
+# set executable files
+chmod +x "$TXMINSTALLDIR/TXM"
+chmod +x "$TXMINSTALLDIR/cwb/bin"/*
+
+# set preferences
+PREF_FILE="$TXMINSTALLDIR/install.prefs"
+touch "$PREF_FILE"
+echo $optExec"="$pathToCqp >> "$PREF_FILE"
+echo $optInit"="$pathToInit >> "$PREF_FILE"
+echo $optPathToR"="$pathToR >> "$PREF_FILE"
+echo $optPathToTT"="$pathToTT >> "$PREF_FILE"
+echo $optPathToTTMod"="$pathToTTMod >> "$PREF_FILE"
+# set tools' default options
+echo "ca_show_individuals=true" >> "$PREF_FILE"
+echo "ca_show_variables=false" >> "$PREF_FILE"
+echo "ca_quality_display=.00" >> "$PREF_FILE"
+echo "ca_mass_display=###.00" >> "$PREF_FILE"
+echo "ca_dist_display=#.00" >> "$PREF_FILE"
+echo "ca_contrib_display=###.00" >> "$PREF_FILE"
+echo "ca_cos2_display=.00" >> "$PREF_FILE"
+echo "ca_coord_display=#.00" >> "$PREF_FILE"
+echo "cooc_scoreformat=E00" >> "$PREF_FILE"
+echo "cooc_minfreq=2" >> "$PREF_FILE"
+echo "cooc_mincount=2" >> "$PREF_FILE"
+echo "diag_max_value=20" >> "$PREF_FILE"
+echo "lt_fmin=2" >> "$PREF_FILE"
+echo "r_file_transfert=false" >> "$PREF_FILE"
+
+touch "$TXMINSTALLDIR/STAMP"
+
+if [ $? != 0 ]; then
+	error "** TXM install: Failed to create install TIMESTAMP file : $TXMINSTALLDIR/STAMP"
+	exit 1;
+fi
+
+echo "** TXM install: done, type TXM& in a terminal to launch the application"
+
+exit 0
Index: tmp/trunk/org.txm.setups/shared/debian/usr/lib/TXM/install.prefs
===================================================================
--- tmp/trunk/org.txm.setups/shared/debian/usr/lib/TXM/install.prefs	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/debian/usr/lib/TXM/install.prefs	(revision 728)
@@ -0,0 +1,77 @@
+cqi_server_path_to_cqplib=/usr/lib/TXM/cwb/bin
+cqi_server_path_to_executable=/usr/lib/TXM/cwb/bin/cqpserver
+cqi_server_path_to_init_file=/usr/lib/TXM/cwb/cqpserver.init
+r_path_to_executable=/usr/lib/TXM/R/bin/R
+r_file_transfert=false
+treetagger_install_path=/usr/lib/treetagger
+treetagger_models_path=/usr/lib/treetagger/models
+
+charts_engine_name=jfreechart_charts_engine
+charts_engine_output_format=JFreeChart/Java2D
+
+auto_update_editor=true
+
+ca_show_individuals=true
+ca_show_variables=false
+ca_quality_display=0.00
+ca_mass_display=0.00
+ca_dist_display=0.00
+ca_contrib_display=0.00
+ca_cos2_display=0.00
+ca_coord_display=0.00
+ca_lt_fmin=10
+ca_lt_vmax=200
+
+cah_display_2d=3D
+cah_default_method=ward
+cah_default_metric=euclidean
+cah_default_ncluster=2
+
+conc_n_lines_per_page=100
+conc_left_context_size=8
+conc_right_context_size=12
+
+cooc_scoreformat=E00
+cooc_minfreq=2
+cooc_minscore=2
+cooc_mincount=2
+cooc_maxleft=10
+cooc_minleft=0
+cooc_minright=0
+cooc_maxright=10
+
+diag_max_value=20
+diag_partssort=false
+
+export_colseparator=;
+export_txtseparator="
+export_encoding=UTF-8
+export_show=false
+
+log_level=OFF
+log_console=false
+log_file=false
+
+lt_fmin=2
+
+metadata_encoding=UTF-8
+metadata_colseparator=,
+metadata_txtseparator="
+
+progression_monochrome=false
+progression_cumulative=true
+progression_repeatvalues=false
+progression_bandemultiplier=1.0
+progression_monostyle=true
+
+specif_bars=true
+specif_curves=false
+specif_transpose=false
+specif_monochrome=false
+specif_banalite=2
+specif_fmin=1
+specif_maxscore=1000
+
+ui_locale=en
+
+auto_update=true
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/debian/usr/lib/TXM/install.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/debian/usr/lib/TXM/TXM.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/debian/usr/lib/TXM/TXM.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/debian/usr/bin/TXM
===================================================================
--- tmp/trunk/org.txm.setups/shared/debian/usr/bin/TXM	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/debian/usr/bin/TXM	(revision 728)
@@ -0,0 +1,146 @@
+# This script launches TXM in the right directory and with the right TXM.ini file
+UBUNTU_MENUPROXY=0
+
+echo "TXM: Preparing redirections in $HOME/TXMPostInstallOutputLogs.txt and $HOME/TXMPostInstallErrorLogs.txt files."
+
+LOGFILESMSG=", see $HOME/TXMPostInstallOutputLogs.txt and $HOME/TXMPostInstallErrorLogs.txt output and error messages files."
+
+exec 3>$HOME/TXMPostInstallOutputLogs.txt
+exec 4>$HOME/TXMPostInstallErrorLogs.txt
+
+(
+echo "TXM: $HOME is '$HOME'"
+
+if [ ! -d "$HOME" ]; then
+	zenity --info --text="TXM: Impossible to access user home directory ($HOME). Aborting"
+	echo "TXM: Impossible to access user home directory ($HOME). Aborting"
+	exit 1
+fi
+
+echo "TXM: Creating all necessary directories."
+
+TXMHOME="$HOME/TXM"
+echo "TXMHOME='$TXMHOME'"
+if [ ! -d "$TXMHOME" ]; then
+	mkdir "$TXMHOME"
+fi
+if [ ! -d "$TXMHOME" ]; then
+	zenity --info --text="TXM: Impossible to access '$TXMHOME' directory. Aborting$LOGFILESMSG"
+	echo "TXM: Impossible to access '$TXMHOME' directory. Aborting$LOGFILESMSG"
+	exit 1
+fi
+
+DOTTXMHOME="$TXMHOME/.txm"
+echo "DOTTXMHOME='$DOTTXMHOME'"
+if [ ! -d "$DOTTXMHOME" ]; then
+	mkdir "$DOTTXMHOME"
+fi
+if [ ! -d "$DOTTXMHOME" ]; then
+	zenity --info --text="TXM: Impossible to access '$DOTTXMHOME' directory. Aborting$LOGFILESMSG"
+	echo "TXM: Impossible to access '$DOTTXMHOME' directory. Aborting$LOGFILESMSG"
+	exit 1
+fi
+
+echo "TXM: looking at the last TXM install date from the /usr/lib/TXM/STAMP file."
+
+if [ ! -r "/usr/lib/TXM/STAMP" ]; then
+	zenity --info --text="TXM: Impossible to access '/usr/lib/TXM/STAMP' file. Aborting$LOGFILESMSG"
+	echo "TXM: Impossible to access '/usr/lib/TXM/STAMP' file. Aborting$LOGFILESMSG"
+	exit 1
+fi
+
+STAMP=`stat -c %Y "/usr/lib/TXM/STAMP"`
+
+if [ $? != 0 ]; then
+    zenity --info --text="TXM: Impossible to get status of '/usr/lib/TXM/STAMP' file. Aborting$LOGFILESMSG"
+    echo "TXM: Impossible to get status of '/usr/lib/TXM/STAMP' file. Aborting$LOGFILESMSG"
+    exit 1
+fi
+
+echo "TXM: if .txm folder does not contain the $STAMP flag file, its a new install."
+if [ ! -e "$HOME/TXM/.txm/$STAMP" ]; then
+
+	echo "New TXM install: it's the first launch after the installation."
+	if [ -f "/tmp/org.txm.rcpapplication.prefs" ]; then
+		rm -f "/tmp/org.txm.rcpapplication.prefs" # remove previous preference files if any
+	fi
+
+	echo "Backing up previous TXM 0.7.6 preferences if any..."
+	if [ -f "$HOME/.txm/configuration/.settings/org.txm.rcpapplication.prefs" ]; then
+		echo "Found preference file: $HOME/.txm/configuration/.settings/org.txm.rcpapplication.prefs"
+		cp -f "$HOME/.txm/configuration/.settings/org.txm.rcpapplication.prefs" "/tmp/org.txm.rcpapplication.prefs"
+		if [ $? != 0 ]; then
+  			echo "Failed to copy old preference file in /tmp/org.txm.rcpapplication.prefs"
+		fi
+	fi
+
+	echo "Backing up previous TXM 0.7.7 preferences if any..."
+	if [ -f "$HOME/.txm/data/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.txm.rcpapplication.prefs" ]; then
+		echo "Found preference file: $HOME/.txm/data/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.txm.rcpapplication.prefs"
+		cp -f "$HOME/.txm/data/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.txm.rcpapplication.prefs" "/tmp/org.txm.rcpapplication.prefs"
+		if [ $? != 0 ]; then
+  			echo "Failed to copy old preference file in /tmp/org.txm.rcpapplication.prefs"
+		fi
+	fi
+
+	echo "TXM: Installing up to date TXM directories."
+	rm -rf "$HOME/TXM/.txm"
+	if [ -d "$HOME/TXM/.txm" ]; then
+	    zenity --info --text="TXM: Failed to remove $HOME/TXM/.txm directory$LOGFILESMSG"
+	    echo "TXM: Failed to remove $HOME/TXM/.txm directory$LOGFILESMSG"
+	    exit 1 ;
+	fi
+
+    mkdir "$HOME/TXM/.txm"
+    if [ ! -d "$HOME/TXM/.txm" ]; then
+		echo "TXM: Impossible to access '$HOME/TXM/.txm' directory. Aborting$LOGFILESMSG"
+		exit 1
+    fi
+    
+	mkdir "$HOME/TXM/.txm/user"
+	if [ ! -d "$HOME/TXM/.txm/user" ]; then
+		echo "TXM: Impossible to access '$HOME/TXM/.txm/user' directory. Aborting$LOGFILESMSG"
+		exit 1
+    fi
+    
+	mkdir "$HOME/TXM/.txm/data"
+    if [ ! -d "$HOME/TXM/.txm/data" ]; then
+		echo "TXM: Impossible to access '$HOME/TXM/.txm/data' directory. Aborting$LOGFILESMSG"
+		exit 1
+    fi
+    
+    mkdir "$HOME/TXM/.txm/configuration"
+    if [ ! -d "$HOME/TXM/.txm/configuration" ]; then
+		echo "TXM: Impossible to access '$HOME/TXM/.txm/configuration' directory. Aborting$LOGFILESMSG"
+		exit 1
+    fi
+
+    echo "TXM: getting '/usr/lib/TXM/TXM.ini' and setting write permissions to '$HOME/TXM/.txm/TXM.ini'"
+    cp "/usr/lib/TXM/TXM.ini" "$HOME/TXM/.txm/TXM.ini" &&
+    chmod +w "$HOME/TXM/.txm/TXM.ini"
+	
+    if [ $? != 0 ]; then
+        zenity --info --text="TXM: Can't launch TXM: failed to set TXM.ini file$LOGFILESMSG"
+        echo "TXM: Can't launch TXM: failed to set TXM.ini file$LOGFILESMSG"
+        exit 1
+    fi
+
+    echo "TXM: creating the $HOME/TXM/.txm/$STAMP flag file."
+    touch "$HOME/TXM/.txm/$STAMP"
+
+    if [ $? != 0 ]; then
+        zenity --info --text="TXMLaunch: Can't launch TXM: failed to create the $HOME/TXM/.txm/$STAMP install STAMP file$LOGFILESMSG"
+		echo "TXM: Can't launch TXM: failed to create the $HOME/TXM/.txm/$STAMP install STAMP file$LOGFILESMSG"
+        exit 1
+    fi
+fi
+
+) 1>&3 2>&4
+
+# don't exec TXM if problem occurs
+if [ $? != 0 ]; then
+    echo "TXM: An error occurred. Aborting$LOGFILESMSG";
+    exit 1 ;
+fi
+
+UBUNTU_MENUPROXY=0 exec /usr/lib/TXM/TXM -run --launcher.ini "$HOME/TXM/.txm/TXM.ini" -data "$HOME/TXM/.txm/data" -user "$HOME/TXM/.txm/user" -install "/usr/lib/TXM"

Property changes on: tmp/trunk/org.txm.setups/shared/debian/usr/bin/TXM
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/portals/LICENSE.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/LICENSE.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/LICENSE.txt	(revision 728)
@@ -0,0 +1,87 @@
+GNU GENERAL PUBLIC LICENSE
+
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.  
+51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification follow.
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. 
+    b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. 
+    c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) 
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, 
+    b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, 
+    c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) 
+
+The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+END OF TERMS AND CONDITIONS

Property changes on: tmp/trunk/org.txm.setups/shared/portals/LICENSE.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/fr_accessAndConfirmation.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/fr_accessAndConfirmation.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/fr_accessAndConfirmation.txt	(revision 728)
@@ -0,0 +1,42 @@
+Portail BFM - Confirmation de votre inscription
+Madame, Monsieur,
+
+Une demande d'accÃ¨s Ã  la Base de FranÃ§ais MÃ©diÃ©val a Ã©tÃ© formulÃ©e sur 
+le portail %1$s avec l'adresse mail 
+%2$s.
+
+Les informations associÃ©es Ã  cette demande sont les suivantes :
+
+ - Nom : %3$s
+ - PrÃ©nom : %4$s
+ - Institution : %5$s
+ - TÃ©l : %6$s
+ - Statut : %7$s
+ - Identifiant : %8$s
+ - Mail : %2$s
+
+Si vous souhaitez modifier certaines de ces informations, merci de 
+contacter l'administrateur du portail (%9$s) pour lui 
+indiquer les corrections Ã  effectuer.
+
+Par la suite, vous pourrez Ã©galement corriger certaines informations 
+dans votre espace 'Mon profil' du portail, une fois connectÃ©.
+
+Cette demande d'accÃ¨s est associÃ©e Ã  la crÃ©ation du compte utilisateur 
+'%8$s'. Pour pouvoir valider la crÃ©ation de ce compte, 
+merci de cliquer sur le lien suivant 
+%10$s
+(ce lien est valable 24h) pour associer dÃ©finitivement cette adresse 
+mail avec ce compte. Une fois cette association Ã©tablie, vous pourrez 
+vous connecter et l'administrateur pourra alors valider le compte.
+L'accÃ¨s Ã  la base vous sera alors signifiÃ© par un mail de 
+l'administrateur.
+
+Si vous n'Ãªtes pas Ã  l'origine de cette demande d'accÃ¨s Ã  la BFM, 
+merci d'avertir l'administrateur du portail %11$s (%9$s) 
+pour lui indiquer un abus de l'usage de votre mail de sorte Ã  ce qu'il 
+puisse annuler cette inscription. Dans ce cas, merci de ne pas cliquer 
+sur le lien de confirmation de la demande de crÃ©ation de compte.
+
+Cordialement, 
+l'Ã©quipe %11$s

Property changes on: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/fr_accessAndConfirmation.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/en_lostPassword.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/en_lostPassword.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/en_lostPassword.txt	(revision 728)
@@ -0,0 +1,7 @@
+You, or someone else, has requested an email with a password recovery link 
+associated to this email address for account %1$s of the %2$s portal
+If you agree with that, please click on the following link
+to confirm the sending of those informations
+
+To continue, follow this link: %3$s
+Otherwise please ignore this email or signal an abuse to %4$s.

Property changes on: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/en_lostPassword.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/en_updateMail.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/en_updateMail.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/en_updateMail.txt	(revision 728)
@@ -0,0 +1,8 @@
+TXM - Update your account mail
+You, or someone else, has requested to update the email for 
+account %1$s of the %2$s portal. If you agree with that, 
+please click on the following link to confirm the sending 
+of those informations.
+
+To continue, follow this link: %3$s
+Otherwise please ignore this email or signal an abuse to %4$s.

Property changes on: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/en_updateMail.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/en_confirmation.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/en_confirmation.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/en_confirmation.txt	(revision 728)
@@ -0,0 +1,8 @@
+your account %1$s hasbeen created with the email address '%2$s'.
+To continue the registration, please click on the following link
+ %3$s (available 24h) to associate your account with your mail.
+
+If you're not the origine of the access ... contact the admin %4$s 
+(%5$s) 
+
+Thx, %4$s team

Property changes on: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/en_confirmation.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/fr_lostPassword.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/fr_lostPassword.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/fr_lostPassword.txt	(revision 728)
@@ -0,0 +1,14 @@
+Portail BFM - RÃ©cupÃ©ration de votre mot de passe
+Madame, Monsieur,
+
+Une demande d'envoi d'un mail de rÃ©cupÃ©ration de mot de passe de
+votre compte '%1$s' a Ã©tÃ© formulÃ©e sur le portail %2$s.
+
+Si cela vous convient, veuillez cliquer sur le lien suivant pour 
+continuer : %3$s
+
+Sinon veuillez simplement ignorer ce mail. Vous pouvez aussi signaler
+un abus auprÃ¨s de l'administrateur : %4$s
+
+Cordialement, 
+l'Ã©quipe BFM
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/fr_lostPassword.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/fr_updateMail.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/fr_updateMail.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/fr_updateMail.txt	(revision 728)
@@ -0,0 +1,6 @@
+TXM - Mise Ã  jour de l'email de votre compte
+Vous ou quelqu'un d'autre a demandÃ© la mise Ã  jour de votre email
+de votre compte %1$s sur le portail %2$s. Si cela vous convient, 
+veuillez cliquer sur le lien suivant pour continuer : %3$s
+Sinon veuillez simplement ignorer ce mail. Vous pouvez aussi signaler
+un abus auprÃ¨s de l'administrateur : %4$s

Property changes on: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/fr_updateMail.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/en_accessAndConfirmation.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/en_accessAndConfirmation.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/en_accessAndConfirmation.txt	(revision 728)
@@ -0,0 +1,33 @@
+EN EN EN EN EN
+
+Une demande d'accÃ¨s Ã  la Base de FranÃ§ais MÃ©diÃ©val a Ã©tÃ© formulÃ©e sur le portail
+portail (%1$s) avec l'adresse mail %2$s
+
+Les informations associÃ©es Ã  cette demande sont les suivantes :
+
+ - Nom : %3$s
+ - PrÃ©nom : %4$s
+ - Institution : %5$s
+ - TÃ©l : %6$s
+ - Statut : %7$s
+ - Identifiant : %8$s
+ - Mail : %2$s
+
+Si vous souhaitez modifier certaines de ces informations, merci de contacter 
+l'administrateur du portail (%9$s) pour lui indiquer les corrections Ã  effectuer.
+Par la suite, vous pourrez Ã©galement corriger certaines informations dans votre espace 
+'informations personnelles' du portail un fois connectÃ©.
+
+Cette demande d'accÃ¨s est associÃ©e Ã  la crÃ©ation du compte utilisateur '%8$s'.
+Pour pouvoir valider la crÃ©ation de ce compte, merci de cliquer sur le lien suivant %10$s
+(ce lien est valable 24h) pour associer dÃ©finitivement cette adresse mail avec ce compte.
+Une fois cette association Ã©tablie, vous pourrez vous connecter et l'administrateur pourra alors valider le compte.
+L'accÃ¨s Ã  la base vous sera alors signifiÃ© par un mail de l'administrateur.
+
+Si vous n'Ãªtes pas Ã  l'origine de cette demande d'accÃ¨s Ã  la BFM, merci d'avertir 
+l'administrateur du portail %11$s (%9$s) pour lui indiquer un abus de l'usage de votre mail 
+de sorte Ã  ce qu'il puisse annuler cette inscription. Dans ce cas, merci de ne pas 
+cliquer sur le lien de confirmation de la demande de crÃ©ation de compte.
+
+Cordialement, 
+l'Ã©quipe %11$s

Property changes on: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/en_accessAndConfirmation.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/fr_confirmation.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/fr_confirmation.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/fr_confirmation.txt	(revision 728)
@@ -0,0 +1,19 @@
+Madame, Monsieur,
+
+Votre compte %1$s a Ã©tÃ© crÃ©Ã© avec l'adresse mail '%2$s'.
+Pour pouvoir valider la crÃ©ation de ce compte, merci de cliquer sur le 
+lien suivant %3$s (ce lien est valable 24h) pour associer 
+dÃ©finitivement cette adresse mail avec ce compte.
+
+Tant que cette association n'aura pas Ã©tÃ© Ã©tablie, le compte ne sera 
+pas accessible.
+
+Si vous n'Ãªtes pas Ã  l'origine de cette demande d'accÃ¨s Ã  la BFM, 
+merci d'avertir l'administrateur du portail %4$s 
+(%5$s) pour lui indiquer un abus de l'usage de votre mail
+de sorte Ã  ce qu'il puisse annuler cette inscription. Dans ce cas,
+merci de ne pas cliquer sur le lien de confirmation de la demande 
+de crÃ©ation de compte.
+
+Cordialement, 
+l'Ã©quipe %4$s

Property changes on: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/mails/fr_confirmation.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/users/userdemo.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/users/userdemo.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/users/userdemo.xml	(revision 728)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?><user firstname="firstname" institution="" lastname="lastname" login="demo" mail="mail@mail.fr" md5="fe01ce2a7fbac8fafaed7c982a04e229" phone="" status="">
+<profiles>
+<profile name="Simple"/>
+</profiles>
+<permissions/>
+</user>

Property changes on: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/users/userdemo.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Simple.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Simple.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Simple.xml	(revision 728)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<profile name="Simple">
+	<messages> 
+		<message subject="[Portail TXM] Bienvenue"> 
+			Le profil "Simple" vous a Ã©tÃ© attribuÃ©.
+		</message> 
+	</messages>
+	<entity path="/DISCOURS">
+		<permission value="TxmAllPermission"/>
+        <permission value="TsQueryPermission" not="true"/>
+	</entity>
+	<entity path="/GRAAL">
+		<permission value="TxmAllPermission"/>
+        <permission value="TsQueryPermission" not="true"/>
+	</entity>
+</profile>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Simple.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Discours.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Discours.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Discours.xml	(revision 728)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<profile name="Discours">
+	<messages> 
+		<message subject="[Portail TXM] Bienvenue "> 
+			Le profil "Discours" vous a Ã©tÃ© attribuÃ©
+		</message> 
+	</messages>
+	<entity path="/DISCOURS">
+		<permission value="TxmAllPermission"/>
+        <permission value="TsQueryPermission" not="true"/>
+	</entity>
+</profile>

Property changes on: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Discours.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Empty.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Empty.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Empty.xml	(revision 728)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<profile name="Empty">
+</profile>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Empty.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Newbe.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Newbe.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Newbe.xml	(revision 728)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<profile name="Newbe">
+	<messages> 
+		<message subject="[Portail TXM] Bienvenue "> 
+			Le profil temporaire vous a Ã©tÃ© attribuÃ©.
+		</message> 
+	</messages>
+    <entity path="/DISCOURS">
+        <permission value="TxmAllPermission"/>	
+		<permission value="CreateSubcorpusPermission" not="true"/>
+		<permission value="CreatePartitionPermission" not="true"/>
+		<permission value="TsQueryPermission" not="true"/>
+		<permission value="BiblioPermission" not="true"/>
+    </entity>
+        <entity path="/GRAAL">
+        <permission value="TxmAllPermission"/>	
+		<permission value="CreateSubcorpusPermission" not="true"/>
+		<permission value="CreatePartitionPermission" not="true"/>
+		<permission value="TsQueryPermission" not="true"/>
+		<permission value="BiblioPermission" not="true"/>
+    </entity>
+</profile>

Property changes on: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Newbe.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Admin.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Admin.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Admin.xml	(revision 728)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<profile name="Admin"><!-- no need to fill this prolfile -->
+</profile>

Property changes on: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Admin.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Anonymous.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Anonymous.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Anonymous.xml	(revision 728)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<profile name="Anonymous">
+	<messages> 
+		<message subject="[Portail TXM] Bienvenue"> 
+			[ne devrait pas Ãªtre envoyer, veuillez contacter l'administrateur du portail]
+		</message> 
+	</messages>
+    <entity path="/DISCOURS">
+        <permission value="TxmAllPermission"/>	
+		<permission value="CreateSubcorpusPermission" not="true"/>
+		<permission value="CreatePartitionPermission" not="true"/>
+		<permission value="TsQueryPermission" not="true"/>
+		<permission value="BiblioPermission" not="true"/>
+    </entity>
+</profile>

Property changes on: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/data/profiles/Anonymous.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/txmweb.conf
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/txmweb.conf	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/txmweb.conf	(revision 728)
@@ -0,0 +1,25 @@
+## The ToolBox configuration file
+txm.properties=C:\Users\<user>\.TXMWEB\txm\textometrie.properties
+homePageDir=html/Home.html
+
+mail.protocol=
+mail.host=
+mail.user=
+mail.password=
+mail.contact=
+
+default_admin_pass=098f6bcd4621d373cade4e832627b4f6
+
+portal_name=TXM
+portal_longname=Textometrie
+
+nomail=true
+noinscription=true
+
+showPublicPages=false
+showPrivatePages=true
+
+allow_multiple_account_per_mail=true
+default_locale=fr
+
+REMOTECTRLCODE=ERFIH3EZ2R5943U50A435JZ5R0ZEITERT
Index: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/textometrie.properties
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/textometrie.properties	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/textometrie.properties	(revision 728)
@@ -0,0 +1,19 @@
+cqi_server_mode=true
+cqi_server_path_to_cqplib=C:\Program Files\TXM\cwb\bin\
+cqi_server_path_to_executable=C:\Program Files\TXM\cwb\bin\win32\cqpserver.exe
+# for 32bit OS please use next line
+#cqi_server_path_to_executable=C:\Program Files\TXM\cwb\bin\cqpserver.exe
+cqi_server_path_to_init_file=C:\Program Files\TXM\cwb\cqpserver.init
+cqi_server_path_to_cqplib=C:\Program Files\TXM\cwb\bin\
+cqi_server_path_to_registry=C:\Users\<user>\TXM/registry
+r_path_to_executable=C:\Program Files\TXM\R\bin\R.exe
+
+r_file_transfert=false
+
+user_txm_home=C:\Users\<user>\.TXMWEB\txm
+install_dir=C:\Users\<user>\TXM
+workspace_location=C:\Users\<user>\TXM\workspaces\default.xml
+log_directory=C:\Users\<user>\.TXMWEB\txm\
+log_in_file=true
+log_in_console=true
+log_level=INFO

Property changes on: tmp/trunk/org.txm.setups/shared/portals/.TXMWEB/txm/textometrie.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/ANNOUNCE.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/ANNOUNCE.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/ANNOUNCE.txt	(revision 728)
@@ -0,0 +1,80 @@
+TXM Portail 0.6.1
+
+
+Nous avons le trÃ¨s grand plaisir de vous annoncer la disponibilitÃ©
+d'une nouvelle application issue de la plateforme TXM appelÃ©e
+'TXM WEB'.
+Il s'agit d'une nouvelle variante, par rapport au logiciel habituel
+pour Windows, Mac et Linux, qui s'installe sur Linux en mode serveur
+pour Internet, c'est Ã  dire que les utilisateurs de TXM peuvent y
+accÃ©der en ligne - ou sur le rÃ©seau local d'une Ã©quipe - Ã  partir de
+n'importe quelle machine Ã©quipÃ©e d'un simple navigateur web (comme
+Firefox).
+Cette variante offre donc la possibilitÃ© de mettre en ligne tout corpus
+manipulÃ© par TXM et d'y accÃ©der instantanÃ©ment en groupe (entre
+collÃ¨gues ou avec des Ã©tudiants) Ã  travers des contrÃ´les d'accÃ¨s
+paramÃ©trables.
+Elle s'adresse principalement aux personnes ayant un minimum de
+compÃ©tences pour installer un logiciel sur Linux et procÃ©der Ã 
+certains rÃ©glages de fichiers.
+
+*Installer TXM WEB*
+Vous trouverez sur le site logiciel Sourceforge habituel de TXM une
+archive contenant le logiciel ainsi que les matÃ©riaux nÃ©cessaires pour
+installer et tester rapidement TXM WEB dans votre propre serveur
+d'application Tomcat ou Ã©quivalent sur une machine Linux :
+https://sourceforge.net/projects/txm/files/software/TXM%20WEB
+
+*Tester TXM WEB*
+Vous pouvez d'ores et dÃ©jÃ  tester un exemple de portail TXM WEB
+(sans avoir Ã  en installer un vous-mÃªme) en accÃ©dant Ã  l'adresse suivante :
+http://portal.textometrie.org/demo?locale=fr
+Ce portail comprend les corpus de test habituels.
+Contactez nous si vous souhaitez pouvoir y tester, en accÃ¨s restreint,
+un extrait de vos corpus (que vous manipulez dÃ©jÃ  dans TXM en version
+poste local).
+
+*PrÃ©sentation rapide des fonctionnalitÃ©s*
+- contrÃ´les d'accÃ¨s : pour rÃ©pondre Ã  certaines exigences en termes de
+confidentialitÃ© et de maÃ®trise de la propriÃ©tÃ© intellectuelle, il est
+possible de contrÃ´ler au texte prÃ¨s les fonctionnalitÃ©s et leurs
+paramÃ¨tres pour chaque utilisateur
+- gestion de comptes utilisateurs : pour accÃ©der Ã  des ressources Ã 
+accÃ¨s restreint, les utilisateurs accÃ¨dent Ã  TXM WEB en se connectant
+grÃ¢ce Ã  un compte utilisateur. Ce compte est crÃ©Ã© soit par
+auto-inscription et validation, soit par un utilisateur particulier
+appelÃ© 'administrateur du portail'. Ce dernier dispose de diffÃ©rents
+outils lui permettant de crÃ©er facilement les comptes et de
+communiquer Ã  l'aide de messages et de mails
+- gestion des corpus : TXM WEB peut charger tout corpus TXM au format
+   binaire
+- TXM WEB offre un accÃ¨s ergonomique Ã  toutes les fonctionnalitÃ©s
+habituelles de TXM : Ã©dition, concordances, index, lexique,
+rÃ©fÃ©rences, coocccurrences, spÃ©cificitÃ©s, AFC (sauf la progression dans
+cette version)
+- TXM WEB offre Ã©galement des fonctionnalitÃ©s originales :
+-- sÃ©lection de textes par facettage (croisement de mÃ©tadonnÃ©es) pour
+    construire un sous-corpus
+-- contextes : une autre prÃ©sentation des concordances avec de larges
+    contextes.
+-- bibliographies des textes : chaque texte d'un corpus dispose d'une
+    fiche bibliographique complÃ¨te
+-- TIGER Search : TXM WEB est la premiÃ¨re application Ã  offrir une
+interface d'accÃ¨s au moteur de recherche d'annotations syntaxiques
+TIGER Search (qui a Ã©tÃ© intÃ©grÃ© Ã  TXM)
+
+*Retours de bug de cette version beta*
+Merci de faire vos retours via la liste de diffusion 'txm-users' :
+https://listes.cru.fr/sympa/info/txm-users
+- bugs connus :
+-- les messages de l'application en FR et EN sont en cours de finalisation
+
+*Participez*
+TXM WEB est diffusÃ© avec la mÃªme licence open-source que TXM. Vous
+pouvez donc Ã  tout moment participer Ã  son dÃ©veloppement. Cela
+est rÃ©alisable de diffÃ©rentes faÃ§ons :
+- en dÃ©veloppant de nouvelles fonctionnalitÃ©s ou de nouvelles interfaces
+- en documentant les fonctionnalitÃ©s ou en traduisant l'interface ou
+la documentation
+
+Serge et Matthieu.

Property changes on: tmp/trunk/org.txm.setups/shared/portals/ANNOUNCE.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/INSTALL_Linux_EN.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/INSTALL_Linux_EN.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/INSTALL_Linux_EN.txt	(revision 728)
@@ -0,0 +1,250 @@
+====== Install a TXM Portal / Installer un portail TXM ======
+
+Thanks: Giancarlo Luxardo for helping us writing this tutorial and for testing TXM portal
+
+===== System Requirements =====
+
+The minimum requirements for installing and running the TXM portal version 0.6.1 are as follows:
+  * Linux server (the portal is known to run on Ubuntu Server 12.04 LTS, other distributions may also be used)
+  * 32-bit or 64-bit architecture
+  * at least 2 GB of memory available to every instance of the TXM portal running on the server
+  * at least 50 GB of available disk space
+  * Java Runtime Environment version 6 or later (OpenJDK recommended)
+  * Tomcat version 6 or later
+
+You need to have root access on this machine.
+
+The Java architecture may be checked by one of the following commands:
+<code>
+java -version
+update-java-alternatives -l
+</code>
+
+
+===== Configuring Tomcat =====
+
+==== Methods ====
+
+There are at least two methods to download and install Tomcat:
+
+  * using a binary distribution provided by the Apache Web site
+  * using a repository package (for Tomcat 6, the useful Debian packages are: tomcat6, tomcat6-admin)
+
+==== Installation directories ====
+
+In the following, it is assumed that a repository package has been used.
+
+In this case, the following directories are created for Tomcat 6:
+  * /usr/share/tomcat6/
+  * /etc/tomcat6/
+  * /var/lib/tomcat6/
+  * /var/log/tomcat6/
+
+The owner of these directories is the tomcat6 user.
+
+==== Environment ====
+
+You should not need to configure the CATALINA_HOME variable.
+
+==== Security ====
+
+Add the folowing lines between the '<tomcat-users>' and '</tomcat-users>' lines in the '/etc/tomcat6/tomcat-users.xml' file:
+<code>
+<role rolename="manager-gui"/>
+<role rolename="manager-status"/>
+<user username="admin" password="password" roles="manager-gui,manager-status"/>
+</code>
+
+The Tomcat password is initially in plain text. It will be encrypted in a next step.
+
+==== Deployment with Tomcat7: configure WAR file size ====
+
+If you are using Tomcat 7, edit the <nowiki>'$TOMCAT7/webapps/manager/WEB-INF/web.xml'</nowiki> file as follows:
+<code>
+<multipart-config>
+<max-request-size>524288000</max-request-size>
+<file-size-threshold>0</file-size-threshold>
+</multipart-config>
+</code>
+
+Throughout the rest of the document it is assumed that Tomcat 6 is used.
+
+==== Starting and Stopping Tomcat ====
+
+Tomcat is normally configured to start automatically at boot time.
+
+Tomcat 6 may be started and stopped using the tomcat service:
+<code>
+service tomcat6 start
+service tomcat6 stop
+service tomcat6 restart
+</code>
+
+===== Testing Tomcat =====
+
+Tomcat is by default configured to run on the 8080 port.
+
+According to your host name (possibly 'localhost'), open the following URL in a web browser: [[http://host:8080]]
+
+
+You should see the following message:
+<code>
+It works !
+
+If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!
+</code>
+
+
+If you have installed the Tomcat admin package, you should also see the Tomcat manager: [[http://host:8080/manager/html]]
+
+
+===== Downloading the TXM portal=====
+
+Go to:
+  * [[http://sourceforge.net/projects/txm/files/software/TXM%20portal]]
+  * and get the relevant archive file. The same archive is valid for the 32-bit and 64-bit architectures.
+
+Also download the latest TXM desktop version from: [[http://sourceforge.net/projects/txm/files/software/TXM]]
+
+(in this case choose the specific 32-bit and 64-bit architecture).
+
+===== Installing the TXM portal =====
+
+Decompress the TXM portal archive to a local directory, e.g.:
+
+  * unzip -l TXM_Portal_x.x.zip
+  * Copy the '.TXMWEB' directory, found under this local directory, to the Tomcat home directory:<code>cp -r TXM_Portal_x.x/.TXMWEB/ /usr/share/tomcat6 </code>
+  * Make sure that the tomcat6 user owns the '.TXMWEB' directory, e.g.:
+    * chown -R tomcat6.tomcat6 .TXMWEB/
+    * ls -l /usr/share/tomcat6/.TXMWEB/<code>total 4
+drwxr-xr-x 5 tomcat6 tomcat6 4096 Jul 9 11:12 txm</code>
+  * Install the TXM desktop (this step is required in order to install the CWB search engine and the R statistics engine), e.g.: <code>dpkg -i TXM_x.x.x_Linux64.deb</code>
+
+TXM should be installed under: <code>/usr/lib/TXM</code>
+
+
+Run the TXM desktop to complete the installation process, the TXM local directories should be created under:
+<code>
+/home/<user>/TXM
+</code>
+
+If your Linux system does not include a desktop environment, you need to enable X11 forwarding (-X option with ssh) to an X11 server on a client machine (e.g.: XQuartz on the Mac OS X, Cygwin/X on Microsoft Windows).
+
+Make sure that the subdirectories are accessible for read & write rights to the tomcat6 group:
+  * /usr/lib/TXM
+  * /home/<user>/TXM
+
+===== Configuring the TXM portal =====
+
+The TXM configuration is done with parameters files. They are stored in the '/usr/share/tomcat6/.TXMWEB/txm/' directory.
+Configure TXM Toolbox parameters in the 'textometrie.properties' file[modifier]
+
+Make sure that the following parameters are valid:
+<code>
+cqi_server_path_to_cqplib=/usr/lib/TXM/cwb/bin/
+cqi_server_path_to_executable=/usr/lib/TXM/cwb/bin/cqpserver
+cqi_server_path_to_init_file=/usr/lib/TXM/cwb/cqpserver.init
+r_path_to_executable=/usr/bin/R
+</code>
+
+Then, replace the <user> with your login
+<code>
+install_dir=/home/<user>/TXM
+cqi_server_path_to_registry=/usr/share/tomcat6/.TXMWEB/txm/registry/
+workspace_location=/home/<user>/TXM/workspaces/default.xml
+user_txm_home=/usr/share/tomcat6/.TXMWEB/txm/
+log_directory=/usr/share/tomcat6/.TXMWEB/txm/logs/
+</code>
+
+Configure TXM portal parameters in the 'txmweb.conf' file[modifier]
+<code>
+txm.properties = /usr/share/tomcat6/.TXMWEB/txm/textometrie.properties
+default_admin_pass=<encrypted-password>
+portal_address=http://<host>:8080/txm/
+</code>
+
+You need to define the TXM administrator password. It must be encrypted with the MD5 algorithm.
+
+You can use the 'makePassword.jar' file, found in the TXM portal archive, to generate the password, e.g.:
+<code>
+java -jar makePassword.jar <mypassword>
+</code>
+
+Note: for other configuration parameters, please refer to the TXM portal admin manual.
+
+===== Encrypting the Tomcat password =====
+
+It is recommended to encrypt the password previously written in the '/etc/tomcat6/tomcat-users.xml' file.
+
+Run once again the 'makePassword.jar' file:
+<code>
+java -jar makePassword.jar <tomcat-password>
+</code>
+
+Replace the previous password with the result.
+
+Edit the '/etc/tomcat6/server.xml' file, look for the <Realm> element and add the following attribute:
+<code>
+digest="md5"
+</code>
+
+Restart the Tomcat service.
+
+===== Deploying the TXM portal in Tomcat =====
+
+  * Connect to Tomcat manager with [[http://localhost:8080/manager/html]] URL
+  * In the "upload" field put the path to the 'txm.war' file
+  * Clic "Deploy". A message at the top of the page will confirm success or failure.
+
+If you cannot use a Web browser, you can deploy the 'txm.war' on the server with the following procedure:
+<code>
+$MANAGERURL = <host>:8080/manager/html
+$APPNAME = txm
+$WARPATH = <path-to-the war-file>
+
+wget "$MANAGERURL/undeploy?path=/$APPNAME" -O â€“ -q
+wget "$MANAGERURL/deploy?deployPath=/$APPNAME&deployConfig=&deployWar=file:$WARPATH" -O â€“ -q
+</code>
+
+===== Running the TXM portal =====
+
+In a Web browser, go to: [[http://host:8080/txm ]]
+
+You can now see and use the sample corpora (DISCOURS, GRAAL). You have all the rights to analyze/access them but not the 'subcorpus' and 'partition' building rights.
+
+The sample 'demo' account will give you full rights on them.
+
+The 'admin' account (with the configured password) gives access to the admin interface : add corpus, create profiles, create account, associate profile to account, etc...
+
+See the TXM portal admin manual : [[https://txm.svn.sourceforge.net/svnroot/txm/trunk/doc]]
+
+
+===== Troubleshooting =====
+
+If an error message such as â€œTBX: not initializedâ€� or â€œCould not initialize Toolboxâ€� appears, check the Tomcat logs for further diagnostic information.
+
+
+===== FURTHER DOCUMENTATION =====
+
+  * TXM portal administrator guide (in French): [[https://txm.svn.sourceforge.net/svnroot/txm/trunk/doc/Manuel%20de%20reference%20TXMWEB%20Admin%200.6.1_FR.odt]]
+  * TXM documentation directory: [[https://txm.svn.sourceforge.net/svnroot/txm/trunk/doc]]
+
+===== FURTHER SETUP STEPS =====
+
+In the administrator's guide, you'll find:
+  * to add new users: see section 2.2a
+  * to personalize user profiles: see section 2.4.5
+  * to add a new corpus: see section 1.2
+  * to personalize HTML pages: see section 1.6
+  * to enable and personalize portal mails: see section 1.8
+  * to enable user subscription: see section 2.3.4
+  * to add a TIGERSearch corpus index: (to be documented)
+  * enable R commands: see wiki
+
+===== FURTHER DEVELOPMENT DOCUMENTATION =====
+
+Develop TXM WEB:
+  * install DEVELOPMENT ENVIRONMENT: [[https://sourceforge.net/apps/mediawiki/txm/index.php?title=Build_the_toolbox_or_the_application#TXM-WEB_:_GWT_web_application]]
+  * developer guide: [[https://txm.svn.sourceforge.net/svnroot/txm/trunk/doc/Manuel%20de%20reference%20TXMWEB%20Dev%200.3_FR.odt]]
+  * TXM WEB deploy: TXMWEB: Test War
+  * develop the TXM Toolbox: [[https://sourceforge.net/apps/mediawiki/txm/index.php?title=Build_the_toolbox_or_the_application#Toolbox_:_the_core]]

Property changes on: tmp/trunk/org.txm.setups/shared/portals/INSTALL_Linux_EN.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/INSTALL_Windows_FR.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/INSTALL_Windows_FR.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/INSTALL_Windows_FR.txt	(revision 728)
@@ -0,0 +1,164 @@
+Installation d'un portail TXM sur Windows (XP et 7)
+-----------------------------------------
+
+*Définition du répertoire utilisateur et du
+répertoire des applications sous Windows XP et Windows 7*
+
+Sous Windows XP :
+- le répertoire utilisateur est de la forme
+'C:\Documents and Settings\<identifiant>'
+- le répertoire des applications est de la forme
+'C:\Program Files\<application>'
+
+Sous Windows 7 :
+- le répertoire utilisateur est de la forme
+'C:\Users\<identifiant>'
+- le répertoire des applications est de la forme
+'C:\Programs\<application>'
+
+Dans la suite de ce tutoriel, nous utiliserons désormais
+systématiquement la désignation Windows 7. Merci de reformuler
+selon Windows XP si nécessaire.
+
+*installer une JVM*
+Si nécessaire, installer Java (>= 1.6, sinon installer une version inférieure de Tomcat)
+Une JDK est préférable à une JRE (Tomcat offrira plus de services)
+Par exemple à la page http://www.oracle.com/technetwork/java
+suivre le lien 'Java SE'.
+
+*configurer l'accès à la JVM* (optionnel)
+Si une JDK est installée, la variable JAVA_HOME sera définie
+automatiquement et utilisée par Tomcat.
+Si une JRE est installée, la variable JRE_HOME sera définie
+automatiquement et utilisée par Tomcat.
+Si ce n'est pas le cas, il faut : 
+1- aller dans "Ordinateur" > "Propriétés" > "Avancées" et
+sélectionner "Variables d'environnement"
+2- ajouter la variable JAVA_HOME en pointant le
+dossier 'C:\Programs\Java\jdk'
+
+*télécharger Tomcat*
+Le site de Tomcat est http://tomcat.apache.org.
+Pour Windows, télécharger la version '32-bit Windows zip'
+à partir de http://tomcat.apache.org/download-70.cgi.
+
+*installer Tomcat*
+Dézipper l'archive, par exemple dans 'C:\Programs'
+Cela crée le répertoire 'C:\Programs\apache-tomcat-7.0.32'.
+- Attention en Windows 7 : il faut donner tous les droits
+d'accès à l'utilisateur courant au dossier de Tomcat
+
+*configurer Tomcat*
+1) environnement (optionnel)
+Si vous utiliser le script de lancement 'bin\startup.bat'
+du répertoire Tomcat, il n'est pas nécessaire de configurer
+la variable CATALINA_HOME
+(elle sera calculée automatiquement par le script de lancement).
+
+2) securité (obligatoire)
+Ajouter les lignes suivantes entre les lignes '<tomcat-users>'
+et '</tomcat-users>' du fichier 'conf\tomcat-users.xml'
+(vous pouvez personnaliser le paramètre password ;-)) :
+
+<role rolename="manager-gui"/>
+<role rolename="manager-status"/>
+<user username="admin" password="monMotDePasse" roles="manager-gui,manager-status"/>
+
+3) déploiement sous Tomcat7 : configuration de la taille limite du WAR
+Editer le fichier $TOMCAT7/webapps/manager/WEB-INF/web.xml comme ceci : 
+    <multipart-config>
+      <!-- 50MB max and now 500MB -->
+      <max-file-size>524288000</max-file-size>
+      <max-request-size>524288000</max-request-size>
+      <file-size-threshold>0</file-size-threshold>
+    </multipart-config>
+
+*lancer Tomcat*
+Lancer le script 'bin\startup.bat', par exemple par un double-clic.
+
+*accéder à Tomcat*
+Ouvrir l'adresse 'http://localhost:8080' dans un navigateur.
+Si une page contenant l'image d'un petit "matou" s'affiche
+en mentionnant notamment la phrase suivante :
+"If you're seeing this, you've successfully installed Tomcat. Congratulations!"
+Vous avez terminé votre installation de Tomcat.
+En cas de problème, vous pouvez consulter le site de Tomcat ou la
+page http://www.jmdoudoux.fr/java/dej/chap-tomcat.htm.
+
+*arrêter Tomcat*
+Quand vous en aurez terminé avec le portail TXM et Tomcat, vous pourrez
+arrêter Tomcat en appelant le script 'bin\shutdown.bat'.
+Pour chaque lancement du portail TXM, il faudra lancer Tomcat au préalable.
+Si vous souhaitez configurer Tomcat comme un service Windows, il faut
+plutôt télécharger et installer le fichier 'Windows Service Installer'
+à partir du site de Tomcat.
+
+*télécharger TXM*
+A la page https://sourceforge.net/projects/txm/files/software/TXM%20portal,
+suivre le lien 'TXM_portal_0.5.0beta1_Win32.zip'.
+
+*installer TXM*
+Dézipper l'archive, par exemple dans 'C:\Programs'
+Cela crée le répertoire 'C:\Programs\TXM-portal-0.5.0'.
+Copier le répertoire ".TXMWEB" qui s'y trouve dans
+votre répertoire utilisateur 'C:\Users\<identifiant>'.
+
+Pour installer le moteur de recherche et le moteur statistique R,
+le plus simple est d'installer une version bureau de TXM pour Windows.
+Pour cela, à la page https://sourceforge.net/projects/txm/files/software/TXM/0.7.0,
+suivre le lien 'TXM_0.7_Win32.exe' puis lancer l'installeur.
+
+Lancer ce TXM une première fois pour finaliser la configuration
+des corpus de démonstration.
+
+Puis, copier les fichiers *.dll (les librairies dynamiques)
+du répertoire d'installation de TXM 'C:\Programs\TXM\TXM'
+vers le répertoire 'bin' de Tomcat.
+
+*configurer le portail TXM*
+La configuration se passe au niveau des fichiers
+du répertoire C:\Users\<login>\.TXMWEB\txmdemo
+
+1) configurer les paramètres de la Toolbox dans le fichier 'textometrie.properties' :
+Il faut s'assurer que les paramètres suivants pointent bien vers les fichiers de l'installation de TXM
+- cqi_server_path_to_executable : C:\Programs\TXM\cwb\bin\cqpserver
+- cqi_server_path_to_cqplib : C:\Programs\TXM\cwb\bin\
+- cqi_server_path_to_init_file : C:\Programs\TXM\cwb\bin\cqpserver.init
+- r_path_to_executable : C:\Programs\TXM\R\bin
+Il faut ensuite remplacer les "<identifiant>" par votre identifiant de compte Windows
+- cqi_server_path_to_registry : C:\Users\<identifiant>\TXM\registry
+- user_txm_home : C:\Users\<identifiant>\.TXMWEB\txmdemo
+- install_dir : C:\Users\<identifiant>\TXM
+- workspace_location : C:\Users\<identifiant>\TXM\workspaces\default.xml
+- log_directory : C:\Users\<identifiant>\.TXMWEB\txmdemo\
+
+2) configurer les paramètres de l'application portail dans le fichier 'txmweb.conf'
+Comme précédement, il faut remplacer les "<identifiant>"
+- txm.properties : C:\Users\<identifiant>\.TXMWEB\txmdemo\textometrie.properties
+- il faut définir le mot de passe de l'administrateur du portail. Le mot de passe doit 
+  être crypté en md5. Pour cela, vous pouvez utiliser l'exécutable 'md5Digest.jar' 
+  (double clic) du dossier d'instalation.
+
+Note: pour les autres configurations du portail, veuillez vous référer au manuel 
+      administrateur du portail, voir ci-dessous)
+
+*Déployer l'application dans Tomcat*
+- lancer le manager d'application de Tomcat en accédant à
+  l'adresse 'http://localhost:8080/manager/html' avec un navigateur
+- saisir dans le champ "Choisir le fichier WAR à téléverser" le chemin du fichier 'txmdemo.war'
+- cliquer sur "Déployer". Un message situé en haut de la page confirmera le bon déploiement de l'application
+
+*Lancer et tester le portail*
+- Se connecter à l'adresse http://localhost:8080/txmdemo
+- vous avez alors un accès public au corpus DISCOURS avec
+  tous les droits sauf sous-corpus et partition
+- le compte prédéfini 'demo' de mot de passe 'demo' donne
+  un accès total au corpus DISCOURS après authentification
+- le compte 'admin' avec le mot de passe que vous avez
+  configuré vous donne accès à l'interface complète
+  d'administration du portail (lien 'Administrer') :
+  ajouter les corpus, créer les profils, associer les
+  profils aux utilisateurs, etc.
+  Voir la documentation complète dans le manuel de
+  l'administrateur du portail :
+https://txm.svn.sourceforge.net/svnroot/txm/trunk/doc/Manuel%20de%20reference%20TXMWEB%20Admin%200.3_FR.odt

Property changes on: tmp/trunk/org.txm.setups/shared/portals/INSTALL_Windows_FR.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/README.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/portals/README.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/portals/README.txt	(revision 728)
@@ -0,0 +1,14 @@
+TXM portal v0.6.1
+
+This archive contains:
+ * J2EE portal WAR file: WAR to deploy with Tomcat
+ * LICENSE.txt: property and usage declaration file
+ * INSTALL_Linux_EN.txt: Linux installation instructions
+ * INSTALL_Windows_FR.txt: Windows installation instructions
+ * makePassword.jar: MD5 password encryption utility
+ * doc directory:
+   * Manuel de reference TXMWEB Admin X.X_FR.pdf: portal administrator manual
+   * Manuel de reference TXMWEB Dev X.X_FR.pdf: portal ..~~**(Developper)**~~.. manual
+ * ANNOUNCE.txt: release details
+ * README.txt: this file
+ 
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/portals/README.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/portals/makePassword.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/portals/makePassword.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/samples/VOEUX.txm
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/samples/VOEUX.txm
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/samples/graal.txm
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/samples/graal.txm
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/doc/Manuel de TXM 0.7 FR.pdf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/doc/Manuel de TXM 0.7 FR.pdf
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teifrantext-xmlw.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teifrantext-xmlw.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teifrantext-xmlw.xsl	(revision 728)
@@ -0,0 +1,92 @@
+<?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"/>
+
+  <!--<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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teifrantext-xmlw.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-corpusakkadien-xmlw_syllabes.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-corpusakkadien-xmlw_syllabes.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-corpusakkadien-xmlw_syllabes.xsl	(revision 728)
@@ -0,0 +1,108 @@
+<?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>
+
+  <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:choose>
+    </xsl:attribute>
+    <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:choose>
+    </xsl:attribute>    
+    <xsl:apply-templates/>
+  </word>
+</xsl:template>
+
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-corpusakkadien-xmlw_syllabes.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-perseustreebank-xmlw.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-perseustreebank-xmlw.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-perseustreebank-xmlw.xsl	(revision 728)
@@ -0,0 +1,73 @@
+<?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>
+  
+
+  <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-perseustreebank-xmlw.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xtz-corpusakkadien-translit.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xtz-corpusakkadien-translit.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xtz-corpusakkadien-translit.xsl	(revision 728)
@@ -0,0 +1,204 @@
+<?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: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"/>
+			</head>
+			<body>
+				<a class="txm-page" title="1"/>
+				<div class="metadata-page">
+					<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>
+							</tr>
+						</xsl:for-each>
+					</table>
+					<br/>
+					<br/>
+				</div>
+				<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/>
+		</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: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>
+		</xsl:choose>
+	</xsl:template>
+	
+	<xsl:template match="@*|processing-instruction()|comment()">
+
+	</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="//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:choose>
+		<span>
+			<xsl:call-template name="addClass"/>
+			<xsl:apply-templates/>
+		</span>
+	</xsl:template>
+	
+	
+	
+	<!-- 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: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: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:text>&#xa;</xsl:text>
+			<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>-->
+					<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>                                
+		
+		<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:choose>
+				<xsl:when test="descendant::txm:ana">
+					<xsl:for-each select="descendant::txm:ana">
+						<xsl:value-of select="concat(substring(@type,2),': ',.,' ; ')"/>				
+					</xsl:for-each>
+					<xsl:value-of select="concat('translit : ',descendant::txm:form)"/>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:for-each select="@*">
+						<xsl:value-of select="concat(name(),': ',.,' ; ')"/>				
+					</xsl:for-each>
+					<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:template>
+	
+	
+	                <xsl:template match="//txm:form">
+	                		<xsl:value-of select="."/>
+                </xsl:template>
+                
+	
+	
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xtz-corpusakkadien-translit.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teip5-teibfm.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teip5-teibfm.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teip5-teibfm.xsl	(revision 728)
@@ -0,0 +1,365 @@
+<?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>
+  
+
+  <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
+    |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
+    |tei:list[ancestor::tei:p|ancestor::tei:ab]|tei:lg[child::tei:lg|ancestor::tei:sp]
+    |tei:p[ancestor::tei:sp]|tei:performance
+    |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)]
+    |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
+    |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)]
+    |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)]
+    |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>
+
+<!-- Partie gÃ©nÃ©rale : on copie les Ã©lÃ©ments, les attributs, le texte, les commentaires, on supprime mes prrocessing intstructions -->
+
+<!--  <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="@*|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">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="processing-instruction()"/>
+
+<!-- On ne touche pas au teiHeader -->
+  
+  <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 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>
+
+<!-- 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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teip5-teibfm.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xtz.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xtz.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xtz.xsl	(revision 728)
@@ -0,0 +1,301 @@
+<?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: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="/">
+                	<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/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/>
+		</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: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="@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>
+				</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>
+				</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)]">
+		<xsl:variable name="editionpagetype">
+			<xsl:choose>
+				<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: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: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>-->
+					<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>
+		<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: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:text> </xsl:text>
+						</xsl:if>
+					</xsl:for-each>
+				</xsl:when>
+				<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"/>                                
+	</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: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:if>
+                                		<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>
+                                		<xsl:choose>
+                                			<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>                                				
+                                			</xsl:otherwise>
+                                		</xsl:choose>
+                                		<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: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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xtz.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/filter-out-p.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/filter-out-p.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/filter-out-p.xsl	(revision 728)
@@ -0,0 +1,46 @@
+<?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>
+  
+
+  <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/filter-out-p.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/identity.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/identity.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/identity.xsl	(revision 728)
@@ -0,0 +1,11 @@
+<!-- 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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/identity.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teifrantext-teibfm.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teifrantext-teibfm.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teifrantext-teibfm.xsl	(revision 728)
@@ -0,0 +1,363 @@
+<?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>
+  
+
+  <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
+    |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
+    |tei:list[ancestor::tei:p|ancestor::tei:ab]|tei:lg[child::tei:lg|ancestor::tei:sp]
+    |tei:p[ancestor::tei:sp]|tei:performance
+    |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)]
+    |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
+    |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)]
+    |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)]
+    |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>
+
+<!-- Partie gÃ©nÃ©rale : on copie les Ã©lÃ©ments, les attributs, le texte, les commentaires, on supprime mes prrocessing intstructions -->
+
+<!--  <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="@*|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">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="processing-instruction()"/>
+
+<!-- On ne touche pas au teiHeader -->
+  
+  <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 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>
+
+<!-- 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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teifrantext-teibfm.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/concordance_mot-pivot.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/concordance_mot-pivot.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/concordance_mot-pivot.xsl	(revision 728)
@@ -0,0 +1,301 @@
+ï»¿<?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:output method="text" encoding="UTF-8" indent="no" />
+
+	<xsl:strip-space elements="*" />
+
+	<xsl:param name="cx" select="30"/>
+	<!-- vary this value to change the size of the context -->
+	
+	<xsl:param name="ntTypes">cat</xsl:param>
+	<!-- non-terminal pivot features to show -->
+	
+	<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"/>
+	<!-- Lezius' lookup key -->
+
+	<xsl:key name="idkey-reverse" match="edge" use="@idref"/>
+	<!-- reverse lookup key -->
+
+	<xsl:template match="/">
+		
+		<!--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>
+		
+		<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>
+	
+		<xsl:text>RightCxInsideSnt&#x09;RightCxOutsideSnt&#x0D;&#x0A;</xsl:text>
+
+		<xsl:for-each select=".//match">
+
+			<!-- only treat match nodes -->
+
+			<!-- first column: print sentence ID -->
+
+			<xsl:value-of select="ancestor::s/@id" />
+
+			<!-- next, verify that pivot is a terminal node -->
+
+			<xsl:variable name="pivot-var" select="./variable[@name='#pivot']" />
+
+			<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:when>
+
+				<xsl:otherwise><xsl:text>&#x09;Query error: #pivot is not a terminal node</xsl:text></xsl:otherwise>
+
+			</xsl:choose>
+
+			<xsl:text>&#x0d;&#x0a;</xsl:text>
+
+		</xsl:for-each>
+
+	</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" />
+
+		<!-- Next stage, write the word in the pivot -->
+
+		<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>
+		
+		<!-- Next stage, write the lexical string contained in the parent NT node -->
+
+		<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: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: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: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: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>
+
+				<!-- 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: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: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: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: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: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: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>
+
+
+
+	<xsl:template match="nt" mode="output">
+
+		<!-- 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:variable>
+
+		<!-- create a copy of terminals, with an attribute "in-pivot='True'" -->
+
+		<xsl:variable name="new-terminals">
+
+			<xsl:for-each select="ancestor::s//t">
+
+				<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:attribute name="in-pivot">True</xsl:attribute>
+					</xsl:if>
+					<xsl:apply-templates select="@*" mode="copy"/>
+
+				</xsl:copy>
+
+			</xsl:for-each>
+
+		</xsl:variable>
+
+		<!-- $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="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])">
+
+				<!-- print the word -->
+				
+				<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:otherwise><xsl:text>[</xsl:text><xsl:apply-templates select="." mode="output" /><xsl:text>]</xsl:text></xsl:otherwise>
+
+				</xsl:choose>
+
+			</xsl:if>
+
+		</xsl:for-each>
+
+	</xsl:template>
+
+	<xsl:template match="@*" mode="copy">
+		<!-- returns a copy of all attribute nodes -->
+		<xsl:copy />
+	</xsl:template>	
+
+	<xsl:template match="t" mode="get-terminals">
+
+		<xsl:copy-of select="." />
+
+	</xsl:template>
+
+	<xsl:template match="nt" mode="get-terminals">
+
+		<xsl:for-each select="edge">
+
+			<xsl:apply-templates select="key('idkey', @idref)" mode="get-terminals" />
+	
+		</xsl:for-each>
+
+	</xsl:template>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/concordance_mot-pivot.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-corpusakkadien-xmlw_syllabes-cuneiform.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-corpusakkadien-xmlw_syllabes-cuneiform.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-corpusakkadien-xmlw_syllabes-cuneiform.xsl	(revision 728)
@@ -0,0 +1,168 @@
+<?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>
+
+  <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()='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="{@refSyllabaire}" 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:if test="following-sibling::*[local-name()='g']">-</xsl:if>
+        </xsl:for-each>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:attribute>
+    <xsl:attribute name="no-unclear">
+      <xsl:choose>
+        <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>
+        </xsl:otherwise>
+      </xsl:choose>
+    </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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-corpusakkadien-xmlw_syllabes-cuneiform.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-page-split.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-page-split.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-page-split.xsl	(revision 728)
@@ -0,0 +1,193 @@
+<?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:
+
+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"/>
+
+  <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="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:matching-substring>
+				<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:matching-substring>
+				<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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-page-split.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teiperseus-xmlw.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teiperseus-xmlw.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teiperseus-xmlw.xsl	(revision 728)
@@ -0,0 +1,57 @@
+<?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>
+  
+
+  <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teiperseus-xmlw.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teicorpustextgrid-xmlw.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teicorpustextgrid-xmlw.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teicorpustextgrid-xmlw.xsl	(revision 728)
@@ -0,0 +1,82 @@
+<?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: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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teicorpustextgrid-xmlw.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teibrown-xmlw.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teibrown-xmlw.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teibrown-xmlw.xsl	(revision 728)
@@ -0,0 +1,135 @@
+<?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>
+  
+
+  <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:choose>
+				<xsl:when test="@decls='A'">PRESS: REPORTAGE</xsl:when>
+				<xsl:when test="@decls='B'">PRESS: EDITORIAL</xsl:when>
+				<xsl:when test="@decls='C'">PRESS: REVIEWS</xsl:when>
+				<xsl:when test="@decls='D'">RELIGION</xsl:when>
+				<xsl:when test="@decls='E'">SKILL AND HOBBIES</xsl:when>
+				<xsl:when test="@decls='F'">POPULAR LORE</xsl:when>
+				<xsl:when test="@decls='G'">BELLES-LETTRES</xsl:when>
+				<xsl:when test="@decls='H'">MISCELLANEOUS: GOVERNMENT AND HOUSE ORGANS</xsl:when>
+				<xsl:when test="@decls='J'">LEARNED</xsl:when>
+				<xsl:when test="@decls='K'">FICTION: GENERAL</xsl:when>
+				<xsl:when test="@decls='L'">FICTION: MYSTERY</xsl:when>
+				<xsl:when test="@decls='M'">FICTION: SCIENCE</xsl:when>
+				<xsl:when test="@decls='N'">FICTION: ADVENTURE</xsl:when>
+				<xsl:when test="@decls='P'">FICTION: ROMANCE</xsl:when>
+				<xsl:when test="@decls='R'">HUMOR</xsl:when>				
+			</xsl:choose>
+		</xsl:attribute>
+		<xsl:apply-templates/>
+		</xsl:copy>
+	</xsl:template>
+
+<xsl:template match="@type|@pos">
+	<xsl:attribute name="type">
+		<xsl:value-of select="translate(.,' *','_')"></xsl:value-of>
+	</xsl:attribute>
+</xsl:template>
+	
+	<xsl:template match="tei:mw">
+		<w xmlns="http://www.tei-c.org/ns/1.0">
+			<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:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teibrown-xmlw.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xtz-cuneiform.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xtz-cuneiform.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xtz-cuneiform.xsl	(revision 728)
@@ -0,0 +1,327 @@
+<?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: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"/>
+			</head>
+			<body>
+				<a class="txm-page" title="1"/>
+				<div class="metadata-page">
+					<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>
+							</tr>
+						</xsl:for-each>
+					</table>
+					<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>
+-->				
+			</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/>
+		</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: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">
+		<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:choose>
+		<span>
+			<xsl:call-template name="addClass"/>
+			<xsl:apply-templates/>
+		</span>
+	</xsl:template>
+	
+	
+	
+	<!-- 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: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: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:text>&#xa;</xsl:text>
+			<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>-->
+					<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>                                
+		
+		<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:choose>
+				<xsl:when test="descendant::txm:ana">
+					<xsl:for-each select="descendant::txm:ana">
+						<xsl:value-of select="concat(substring(@type,2),': ',.,' ; ')"/>				
+					</xsl:for-each>
+					<xsl:value-of select="concat('translit : ',descendant::txm:form)"/>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:for-each select="@*">
+						<xsl:value-of select="concat(name(),': ',.,' ; ')"/>				
+					</xsl:for-each>
+					<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: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 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;')">
+	                					<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:value-of select="codepoints-to-string(.)"/>
+	                		<!--<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>
+
+	<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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xtz-cuneiform.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/filter-out-sp.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/filter-out-sp.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/filter-out-sp.xsl	(revision 728)
@@ -0,0 +1,46 @@
+<?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>
+  
+
+  <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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/filter-out-sp.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teitextgrid-xmlw-posttok.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teitextgrid-xmlw-posttok.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teitextgrid-xmlw-posttok.xsl	(revision 728)
@@ -0,0 +1,142 @@
+<?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">
+
+  <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>
+  
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/> 
+
+  <!-- By default, copy all attributes, comments, processing instructions and text nodes -->
+
+  <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: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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teitextgrid-xmlw-posttok.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tite/tite-acdc.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tite/tite-acdc.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tite/tite-acdc.xsl	(revision 728)
@@ -0,0 +1,81 @@
+<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="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="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="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="cols">
+  <milestone unit="cols">
+    <xsl:apply-templates 
+	select="@*|*|text()|comment()|processing-instruction"/>  
+  </milestone>
+</xsl:template>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tite/tite-acdc.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tite/tite-to-tei.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tite/tite-to-tei.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tite/tite-to-tei.xsl	(revision 728)
@@ -0,0 +1,147 @@
+<?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: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: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="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="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="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="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 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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tite/tite-to-tei.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/teislides.css
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/teislides.css	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/teislides.css	(revision 728)
@@ -0,0 +1,319 @@
+/* teislides.css */
+
+body
+{
+    background: white;
+    font-family: Helvetica;
+    font-size: 24pt; 
+    color: black;
+}
+
+table,tr,td {
+    font-size: 20pt; 
+}
+.label {
+   font-weight: bold;
+   background-color: #AAAAAA;
+}
+
+
+p {
+  margin-top: 10px;
+  margin-bottom: 10px;
+  }
+
+li {
+   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.docAuthor {
+    padding: 12pt;
+    font-size: 34pt;
+    color: green;
+}
+
+div.docDate {
+    padding: 12pt;
+    font-size:34pt;
+    color: blue;
+}
+
+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;
+}
+
+
+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;
+}
+
+tt.url {
+    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;
+    }
+
+
+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;
+}
+
+address
+{
+    font-style:  normal;
+    font-family: cursive;
+    letter-spacing: .1em;
+    font-size: x-small;
+}
+
+a:link
+{
+    color:  blue;
+}
+
+
+a:visited
+{
+    color:  navy;
+}
+
+
+a:active
+{
+    color:  purple;
+    background: yellow;
+}
+
+
+a:hover
+{
+    color:  blue;
+    background:     silver;
+}
+
+.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;
+
+	      }
+
+div.slidebottom-text {
+      font-style: italic;
+      font-size: 12pt;
+      float: right;
+}
+div.slidebottom-image {
+      float: left;
+}
+div.slidebottom {
+      clear:both;
+      height: 2%;
+      margin-top: 10pt;
+      border-top: 2px;
+      border-left: 0;
+      border-bottom: 0;
+      border-right: 0;
+	      }
+
+div.slidetop {
+      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%;
+}
+div.xref {
+    height: 10%;
+    float: right;
+    font-size: 12pt;
+    font-weight: bold;
+    margin-bottom: 12pt;
+}
+
+span.bottomright{
+    float: right;
+    margin-top:0;
+    margin-bottom: 8pt;
+}
+
+
+
+li.slidetoc {
+ display: inline;
+}	      
+
+li.slidetoc:before {
+  content: " * ";
+  font-style: italic;
+}
+
+
+
+img.simple {
+	   border-style: none;
+	   }
+img.inline {
+	   border-style: none;
+	   }
+img.right {
+	   float:right
+	   }
+img.left {
+	   float:left
+	   }
+.button {
+    font-family: Symbol;
+    padding: 2px;
+    font-weight: bold;
+    border-style: outset;
+    background: blue; 
+    color: white ;
+}
+a.xreflink:link {
+		        text-decoration: none;		 	    
+	    }		 
+a.xreflink:visited {
+		        text-decoration: none;		 	    
+	    }		 
+
+span.ident {
+    color: teal
+}
+
+
+div.pre_verbatim{
+    white-space: pre ;
+	border-style: solid ;
+	border-width: 1pt;
+	border-color: yellow;
+	border-style: inset;
+        background-color: #ffffcc;
+}
+
+strong { color: green;
+	font-weight: normal; 
+}
+
+
+dt {
+   font-weight: bold;
+   }
+
+tr.Odd {
+       }
+tr.Even {
+	background-color: #DDDDDD;
+	}
+
+/* generic <hi> */
+span.hi {
+   font-weight: bold;
+}
+/* verbatim display */
+span.element {
+ font-weight: bold;
+ color: blue;
+}
+
+span.attribute {
+    color: green;
+}
+span.attributevalue {
+    color: magenta;
+}
+span.comment {
+    color: orange;
+    font-style:italic;
+}
+span.namespace {
+    color: red;
+}

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/teislides.css
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub-print.css
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub-print.css	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub-print.css	(revision 728)
@@ -0,0 +1,78 @@
+/* 
+** Copyright 2008 TEI Consortium
+
+$Id: tei-print.css 6500 2009-06-05 12:24:45Z rahtz $
+
+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
+
+*/
+
+@import url(stylesheet.css);
+
+/* elements */
+
+  /* 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;
+}
+
+a:visited {
+   color:inherit;
+}
+
+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
+      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 */
+   }
+
+div.pre_eg, pre.eg {
+   page-break-inside:avoid;
+}
+
+
+td {
+   font-size: 10pt;
+}
+
+td.maintext, td.maintext p {
+   font-family: Helvetica, Arial, sans-serif;
+}
+   
+/* classes */
+
+.plain {
+   font-family: Helvetica, Arial, sans-serif;
+}
+
+div.pagebreak {
+    page-break-before: always;
+}
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub-print.css
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub3/build-to.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub3/build-to.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub3/build-to.xml	(revision 728)
@@ -0,0 +1,120 @@
+<?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"/>
+
+  <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>
+</project>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub3/build-to.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub3/tei-to-epub3.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub3/tei-to-epub3.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub3/tei-to-epub3.xsl	(revision 728)
@@ -0,0 +1,885 @@
+<?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:
+
+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.
+</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;
+}
+img.fullpage {
+position: absolute;
+height: </xsl:text>
+            <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:choose>
+                        <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">
+                          <xsl:text>pagefacs</xsl:text>
+                          <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"/>
+                          <xsl:text>-audio</xsl:text>
+                        </xsl:attribute>
+                      </xsl:if>
+                      <xsl:attribute name="id">
+                        <xsl:text>page</xsl:text>
+                        <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">
+                            <xsl:text>section</xsl:text>
+                            <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">
+                            <xsl:text>section</xsl:text>
+                            <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">
+                          <xsl:text>pagefacs</xsl:text>
+                          <xsl:number level="any"/>
+                        </xsl:attribute>
+                        <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: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:text>section</xsl:text>
+                            <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:text>section</xsl:text>
+                            <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: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])"/>
+                        </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])"/>
+                              </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">
+		      font-family: serif; 
+		      height:860;          
+		      font-size:30pt; 
+		      font-weight: bold;
+		      padding-top: 15pt;
+		      margin: 12pt;
+		      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: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>
+
+      </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="epubSpineHook"/>
+  <xsl:template name="epubManifestHook"/>
+  <xsl:template name="processTEIHook"/>
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub3/tei-to-epub3.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/i18n.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/i18n.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/i18n.xml	(revision 728)
@@ -0,0 +1,2072 @@
+<?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>
+
+  <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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/i18n.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/txt/build-to.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/txt/build-to.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/txt/build-to.xml	(revision 728)
@@ -0,0 +1,75 @@
+<?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>
+
+  <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="cleanup" unless="debug">  
+    <delete dir="${outputTempDir}"/>
+  </target>
+
+</project>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/txt/build-to.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/txt/tei-to-text.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/txt/tei-to-text.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/txt/tei-to-text.xsl	(revision 728)
@@ -0,0 +1,113 @@
+<?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">
+
+  <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/ 
+
+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.
+</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:output method="text"/>
+   <xsl:param name="makeCSV">false</xsl:param>
+   <xsl:variable name="q">"</xsl:variable>
+
+   <xsl:template match="/">
+     <xsl:apply-templates select="tei:preflight(*)"/>
+   </xsl:template>
+
+   <xsl:template match="teiHeader"/>
+
+   <xsl:template match="figDesc"/>
+
+   <xsl:template match="gap/desc"/>
+
+   <xsl:template match="choice">
+     <xsl:apply-templates select="*[1]"/>
+   </xsl:template>
+
+   <xsl:template match="speaker"/>
+
+   <xsl:template match="facsimile"/>
+
+   <!-- 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: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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/txt/tei-to-text.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docbook/build-from.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docbook/build-from.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docbook/build-from.xml	(revision 728)
@@ -0,0 +1,62 @@
+<?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"/>
+
+  <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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docbook/build-from.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/fo/to.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/fo/to.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/fo/to.xsl	(revision 728)
@@ -0,0 +1,54 @@
+<?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: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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/fo/to.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/html/to.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/html/to.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/html/to.xsl	(revision 728)
@@ -0,0 +1,75 @@
+<?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="../../../xhtml2/tei.xsl"/>
+
+  <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/ 
+
+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.
+</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: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>
+
+  <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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/html/to.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/html/from.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/html/from.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/html/from.xsl	(revision 728)
@@ -0,0 +1,55 @@
+<?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="../../../tools/html2tei.xsl"/>
+
+  <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/ 
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/html/from.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/dtd/to.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/dtd/to.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/dtd/to.xsl	(revision 728)
@@ -0,0 +1,54 @@
+<?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: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:
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/dtd/to.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/rdf/to.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/rdf/to.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/rdf/to.xsl	(revision 728)
@@ -0,0 +1,56 @@
+<?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:import href="../../../rdf/tei2rdf.xsl"/>
+
+  <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/ 
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/rdf/to.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/latex/to.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/latex/to.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/latex/to.xsl	(revision 728)
@@ -0,0 +1,54 @@
+<?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: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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/latex/to.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/epub3/cover-template.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/epub3/cover-template.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/epub3/to.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/epub3/to.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/epub3/to.xsl	(revision 728)
@@ -0,0 +1,48 @@
+<?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:
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/epub3/to.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/epub3/cover.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/epub3/cover.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/txt/to.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/txt/to.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/txt/to.xsl	(revision 728)
@@ -0,0 +1,54 @@
+<?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"/>
+
+  <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/ 
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/txt/to.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docbook/from.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docbook/from.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docbook/from.xsl	(revision 728)
@@ -0,0 +1,714 @@
+<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/ 
+
+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.
+</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: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="ackno">
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="acronym">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="address">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="affiliation">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="anchor">
+ <anchor>
+   <xsl:call-template name="ID"/>
+ </anchor>
+</xsl:template>
+
+<xsl:template match="appendix">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="application">
+ <ident type="application" >
+   <xsl:apply-templates/>
+ </ident>
+</xsl:template>
+
+<xsl:template match="info|artheader|articleinfo"/>
+
+<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="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="attribution">
+  <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="authorblurb">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="authorgroup">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="bibliodiv">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="bibliography">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="bibliomisc">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="bibliomixed">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="blockquote">
+  <q>  
+    <xsl:apply-templates/>
+  </q>
+</xsl:template>
+
+<xsl:template match="chapter">
+  <div>  
+    <xsl:call-template name="ID"/>
+    <xsl:apply-templates/>
+  </div>
+</xsl:template>
+
+<xsl:template match="citation">
+  <cit>  
+    <xsl:apply-templates/>
+  </cit>
+</xsl:template>
+
+<xsl:template match="computeroutput">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="copyright">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="email">
+  <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="entry">
+  <cell>
+    <xsl:apply-templates/>
+  </cell>
+</xsl:template>
+
+<xsl:template match="example">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="figure">
+  <figure>
+    <xsl:apply-templates/>
+    <figDesc></figDesc>
+  </figure>
+</xsl:template>
+
+<xsl:template match="foreignphrase">
+  <foreign><xsl:apply-templates/></foreign>
+</xsl:template>
+
+<xsl:template match="imageobject">
+  <graphic url="{imagedata/@fileref}"/>
+</xsl:template>
+
+<xsl:template match="imagedata">
+</xsl:template>
+
+<xsl:template match="inlinemediaobject|mediaobject">
+
+ <xsl:apply-templates/>
+
+</xsl:template>
+
+<xsl:template match="issuenum">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="itemizedlist">
+  <list  type="unordered">
+    <xsl:apply-templates/>
+  </list>
+</xsl:template>
+
+<xsl:template match="keyword">
+  <term>
+    <xsl:call-template name="Lang"/>
+    <xsl:apply-templates/>
+  </term>
+</xsl:template>
+
+<xsl:template match="keywordset">
+  <keywords scheme="adhoc">
+    <xsl:apply-templates/>
+  </keywords>
+</xsl:template>
+
+<xsl:template match="link">
+  <ref target="#{@linkend}">
+    <xsl:apply-templates/>
+  </ref>
+</xsl:template>
+
+<xsl:template match="listitem">
+  <item >
+    <xsl:apply-templates/>
+  </item>
+</xsl:template>
+
+<xsl:template match="literal">
+  <code rend="{@role}">
+    <xsl:apply-templates/>
+  </code>
+</xsl:template>
+
+<xsl:template match="literallayout">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="note">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="orderedlist">
+  <list  type="ordered">
+    <xsl:apply-templates/>
+  </list>
+</xsl:template>
+
+<xsl:template match="orgname">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="othercredit">
+  <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="productname">
+ <ident rend="productname">
+   <xsl:apply-templates/>
+ </ident>
+</xsl:template>
+
+<xsl:template match="pubdate">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="quote">
+  <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="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="table">
+  <table>
+    <xsl:apply-templates/>
+  </table>
+</xsl:template>
+
+<xsl:template match="tbody">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="tgroup">
+  <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="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="ulink">
+ <ref target="{@url}" >
+   <xsl:apply-templates/>
+ </ref>
+</xsl:template>
+
+<xsl:template match="userinput">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="volumenum">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="warning">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="wordasword">
+ <w>
+  <xsl:apply-templates/>
+ </w>
+</xsl:template>
+
+<xsl:template match="xref">
+  <ptr target="#{@linkend}" type="{@role}" />
+</xsl:template>
+
+<xsl:template match="programlisting">
+  <eg>
+    <xsl:apply-templates/>
+  </eg>
+</xsl:template>
+
+<xsl:template match="firstname">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="jobtitle">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<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>
+
+<xsl:template match="term">
+  <term>
+    <xsl:apply-templates/>
+  </term>
+</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="varlistentry">
+    <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="varlistentry/term">
+  <label>
+    <xsl:apply-templates/>
+  </label>
+</xsl:template>
+
+<!-- more -->
+
+<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="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="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="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="type">
+  <hi rend="Type">
+  <xsl:apply-templates/>
+  </hi>
+</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="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>
+
+
+<!-- catch all -->
+
+<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"/>
+      </xsl:attribute>
+    </xsl:if>
+</xsl:template>
+
+<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:template name="ID">
+    <xsl:if test="@id">
+      <xsl:attribute name="xml:id">
+	<xsl:value-of select="@id"/>
+      </xsl:attribute>
+    </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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docbook/from.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/p4/from.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/p4/from.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/p4/from.xsl	(revision 728)
@@ -0,0 +1,798 @@
+<?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>
+
+         <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/ 
+
+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.
+</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 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="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:when>
+	    <xsl:otherwise>
+	      <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: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:attribute>
+  </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:attribute>
+  </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:attribute>
+      </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:attribute>
+  </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 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: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 -->
+  
+
+ <!-- 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>
+
+ <!-- word key -->
+  <xsl:template match="entryFree/@key">
+    <xsl:attribute name="sortKey">
+      <xsl:value-of select="."/>
+    </xsl:attribute>
+  </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>
+
+ <!-- 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"/>
+
+  <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="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>
+
+
+  <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: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:attribute>
+    </xsl:if>
+  </xsl:template>
+
+  <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: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: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: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: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: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: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:attribute>
+	</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: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: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: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:attribute>
+    </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: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"/>  
+
+<!-- assorted atts -->
+
+  <xsl:template match="gi/@TEI">  	 
+    <xsl:if test=".='yes'">
+      <xsl:attribute name="scheme">TEI</xsl:attribute>
+    </xsl:if>
+  </xsl:template>
+
+  <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>
+
+<!-- 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>
+
+
+<!-- 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="@orig|@reg"/>
+
+<!-- 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="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>
+
+<!-- found in Perseus -->
+
+  <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>
+
+  <xsl:template match="letter">
+    <floatingText type="letter">
+      <body>
+	<xsl:apply-templates 
+	    select="*|@*|processing-instruction()|comment()|text()"/>
+      </body>
+    </floatingText>
+  </xsl:template>
+
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/p4/from.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/ibooks/cover-template.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/ibooks/cover-template.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/ibooks/to.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/ibooks/to.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/ibooks/to.xsl	(revision 728)
@@ -0,0 +1,48 @@
+<?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:
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/ibooks/to.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/ibooks/cover.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/ibooks/cover.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/odt/template.odt
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/odt/template.odt
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/odt/to.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/odt/to.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/odt/to.xsl	(revision 728)
@@ -0,0 +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: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:
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/odt/to.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/odt/from.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/odt/from.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/odt/from.xsl	(revision 728)
@@ -0,0 +1,51 @@
+<?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: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/ 
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/odt/from.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/tei-fo.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/tei-fo.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/tei-fo.xsl	(revision 728)
@@ -0,0 +1,56 @@
+<?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: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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/tei-fo.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/html5/to.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/html5/to.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/html5/to.xsl	(revision 728)
@@ -0,0 +1,56 @@
+<?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: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>
+
+         <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/ 
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/html5/to.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/csv/plugin.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/csv/plugin.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/csv/plugin.xml	(revision 728)
@@ -0,0 +1,32 @@
+<plugin>
+	<extension plugin-id="pl.psnc.dl.ege.root" point-id="XslConverter" id="CSVtoTEIconverter">
+		<parameter id="class" value="pl.psnc.dl.ege.MultiXslConverter"/>
+		<parameter id="name" value="CSV to TEI"/>
+		<parameter id="xsluri" value="profiles/default/csv/from.xsl" />
+		<parameter id="iMimeType" value="text/csv" />
+		<parameter id="iFormat" value="csv" />
+		<parameter id="iDescription" value="Comma-Separated Values (.csv)" />
+		<parameter id="iType" value="spreadsheet" />		
+		<parameter id="oMimeType" value="text/xml" />
+		<parameter id="oFormat" value="TEI" />
+		<parameter id="oDescription" value="TEI P5 XML Document" />		
+		<parameter id="oType" value="text" />
+		<parameter id="visibility" value="true" />
+		<parameter id="cost" value="9" />
+	</extension>
+	<extension plugin-id="pl.psnc.dl.ege.root" point-id="XslConverter" id="TEItoCSVconverter">
+		<parameter id="class" value="pl.psnc.dl.ege.MultiXslConverter"/>
+		<parameter id="name" value="TEI to CSV"/>
+		<parameter id="xsluri" value="profiles/default/csv/to.xsl" />
+		<parameter id="iMimeType" value="text/xml" />
+		<parameter id="iFormat" value="TEI" />
+		<parameter id="iDescription" value="TEI P5 XML Document" />
+		<parameter id="iType" value="text" />		
+		<parameter id="oMimeType" value="text/csv" />
+		<parameter id="oFormat" value="csv" />
+		<parameter id="oDescription" value="Comma-Separated Values (.csv)" />		
+		<parameter id="oType" value="spreadsheet" />
+		<parameter id="visibility" value="true" />
+		<parameter id="cost" value="11" />
+	</extension>
+</plugin>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/csv/plugin.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/csv/to.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/csv/to.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/csv/to.xsl	(revision 728)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<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">
+
+  <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/ 
+
+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.
+</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: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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/csv/to.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/csv/from.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/csv/from.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/csv/from.xsl	(revision 728)
@@ -0,0 +1,133 @@
+<?xml version="1.0"?>
+
+<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"
+	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'"/>
+
+  <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/ 
+
+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.
+</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
+
+<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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/csv/from.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/epub/cover.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/epub/cover.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/epub/cover-template.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/epub/cover-template.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/epub/to.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/epub/to.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/epub/to.xsl	(revision 728)
@@ -0,0 +1,48 @@
+<?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:
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/epub/to.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/oddhtml/to.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/oddhtml/to.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/oddhtml/to.xsl	(revision 728)
@@ -0,0 +1,65 @@
+<?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">
+
+    <!-- import base conversion style -->
+
+    <xsl:import href="../../../odds2/odd2html.xsl"/>
+
+  <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/ 
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/oddhtml/to.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docx/default-functions.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docx/default-functions.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docx/default-functions.xsl	(revision 728)
@@ -0,0 +1,117 @@
+<?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">
+
+    
+    <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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docx/default-functions.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docx/template.docx
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docx/template.docx
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docx/template_orig.docx
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docx/template_orig.docx
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docx/to.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docx/to.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docx/to.xsl	(revision 728)
@@ -0,0 +1,392 @@
+<?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: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>
+
+    
+    <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:
+
+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.
+</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>
+
+    <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>
+
+    <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>
+
+
+    <!-- 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>
+
+  <xsl:template match="tei:affiliation">
+      <w:r>
+        <w:br/>
+      </w:r>   
+     <xsl:apply-templates/>
+  </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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docx/to.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docx/from.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docx/from.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docx/from.xsl	(revision 728)
@@ -0,0 +1,77 @@
+<?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: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:
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/docx/from.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/lite/to.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/lite/to.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/lite/to.xsl	(revision 728)
@@ -0,0 +1,56 @@
+<?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:import href="../../../odds2/odd2lite.xsl"/>
+
+  <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/ 
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/lite/to.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/relaxng/to.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/relaxng/to.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/relaxng/to.xsl	(revision 728)
@@ -0,0 +1,65 @@
+<?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">
+
+    <!-- import base conversion style -->
+
+    <xsl:import href="../../../odds2/odd2relax.xsl"/>
+
+  <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/ 
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/profiles/default/relaxng/to.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/figures.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/figures.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/figures.xsl	(revision 728)
@@ -0,0 +1,472 @@
+<?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:
+
+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.
+</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: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: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: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"/>
+            </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: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:attribute>
+      </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:attribute>
+               </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:text>url(</xsl:text>
+            <xsl:if test="not(starts-with($File,'./'))">
+               <xsl:value-of select="$graphicsPrefix"/>
+            </xsl:if>
+            <xsl:value-of select="$File"/>
+            <xsl:if test="not(contains($File,'.'))">
+               <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:template match="tei:binaryObject">
+    <external-graphic>
+      <xsl:attribute name="src">
+	<xsl:text>url('data:image/auto;base64,</xsl:text>
+	<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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/figures.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/tei-makecolspec.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/tei-makecolspec.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/tei-makecolspec.xsl	(revision 728)
@@ -0,0 +1,139 @@
+<?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:
+
+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.
+</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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/tei-makecolspec.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/textstructure.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/textstructure.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/textstructure.xsl	(revision 728)
@@ -0,0 +1,1442 @@
+<?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:
+
+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.
+</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>
+
+  <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>
+
+  <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>
+         <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>
+               <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: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:when>
+                  <xsl:otherwise>
+                     <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">
+               <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: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"/>
+         </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>
+
+  <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/textstructure.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/textcrit.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/textcrit.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/textcrit.xsl	(revision 728)
@@ -0,0 +1,90 @@
+<?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 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/ 
+
+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.
+</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>
+	 <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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/textcrit.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/corpus.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/corpus.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/corpus.xsl	(revision 728)
@@ -0,0 +1,55 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/corpus.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/teiCustom.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/teiCustom.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/teiCustom.xsl	(revision 728)
@@ -0,0 +1,58 @@
+<?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>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/teiCustom.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/transcr.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/transcr.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/transcr.xsl	(revision 728)
@@ -0,0 +1,59 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/transcr.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/tei-param.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/tei-param.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/tei-param.xsl	(revision 728)
@@ -0,0 +1,858 @@
+<?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:
+
+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.
+</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>
+  </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"/>
+  </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: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: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: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: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: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: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:attribute>
+      <xsl:attribute name="start-indent">
+         <xsl:value-of select="$exampleMargin"/>
+      </xsl:attribute>
+      <xsl:attribute name="space-before">
+         <xsl:value-of select="$spaceAroundTable"/>
+      </xsl:attribute>
+      <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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/tei-param.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/tei.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/tei.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/tei.xsl	(revision 728)
@@ -0,0 +1,93 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/tei.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/drama.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/drama.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/drama.xsl	(revision 728)
@@ -0,0 +1,243 @@
+<?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:
+
+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.
+</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"/>
+               </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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/drama.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/namesdates.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/namesdates.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/namesdates.xsl	(revision 728)
@@ -0,0 +1,55 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/namesdates.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/tagdocs.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/tagdocs.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/tagdocs.xsl	(revision 728)
@@ -0,0 +1,61 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/tagdocs.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/verse.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/verse.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/verse.xsl	(revision 728)
@@ -0,0 +1,55 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/verse.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/core.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/core.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/core.xsl	(revision 728)
@@ -0,0 +1,1339 @@
+<?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:
+
+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.
+      </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>
+                  <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>
+
+  <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: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: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>
+
+  <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>
+              </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>
+
+  <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>
+            <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:attribute>
+            <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: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: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>
+
+  <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">
+         <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: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: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: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: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
+				  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"/>
+            </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:choose>
+            <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:when>
+            <xsl:otherwise>
+               <xsl:value-of select="$betweenStarts"/>
+            </xsl:otherwise>
+         </xsl:choose>
+      </xsl:attribute>
+      <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>
+      <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>
+         </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>
+         </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>
+         </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>
+         </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>
+
+   <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="makeSpan">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/core.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/header.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/header.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/header.xsl	(revision 728)
@@ -0,0 +1,109 @@
+<?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:
+
+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.
+</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>
+                  <xsl:otherwise>
+                     <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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/header.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/linking.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/linking.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/linking.xsl	(revision 728)
@@ -0,0 +1,131 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/fo2/linking.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/html5/textstructure.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/html5/textstructure.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/html5/textstructure.xsl	(revision 728)
@@ -0,0 +1,14 @@
+<?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:template match="front|body|back">
+    <div class="tei_{local-name()}">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/html5/textstructure.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/html5/build-to.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/html5/build-to.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/html5/build-to.xml	(revision 728)
@@ -0,0 +1,80 @@
+<?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>
+
+ 
+  <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="cleanup" unless="debug">  
+    <delete dir="${outputTempDir}"/>
+  </target>
+
+</project>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/html5/build-to.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/html5/tei.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/html5/tei.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/html5/tei.xsl	(revision 728)
@@ -0,0 +1,33 @@
+<?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: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="@*|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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/html5/tei.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/html5/microdata.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/html5/microdata.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/html5/microdata.xsl	(revision 728)
@@ -0,0 +1,34 @@
+<?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: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: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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/html5/microdata.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/marginals/marginals.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/marginals/marginals.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/marginals/marginals.xsl	(revision 728)
@@ -0,0 +1,107 @@
+<?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:
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/marginals/marginals.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/lists/lists.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/lists/lists.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/lists/lists.xsl	(revision 728)
@@ -0,0 +1,183 @@
+<?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:
+
+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.
+</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>
+                <xsl:when test="string-length($type) &gt; 0">
+                    <xsl:value-of select="$type"/>
+                </xsl:when>
+                
+                <!-- try to figure it out by looking at the corresponding numbering file -->
+                <xsl:otherwise>
+                    
+                    <!-- 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>
+                            <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:otherwise>
+                        </xsl:choose>
+                    </xsl:variable>
+                    
+                    <!-- 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>
+                            <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: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"/>
+                    <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: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="$numfmt='bullet'">unordered</xsl:when>
+                        <xsl:otherwise>ordered</xsl:otherwise>
+                    </xsl:choose>
+                </xsl:otherwise>
+            </xsl:choose>
+        </xsl:attribute>
+    </xsl:template>
+    
+    
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/lists/lists.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/templates/tei-templates.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/templates/tei-templates.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/templates/tei-templates.xsl	(revision 728)
@@ -0,0 +1,138 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/templates/tei-templates.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/graphics/graphics.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/graphics/graphics.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/graphics/graphics.xsl	(revision 728)
@@ -0,0 +1,186 @@
+<?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:
+
+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.
+</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="number($n)">
+				  <xsl:value-of select="($n * 100) + $c"/>
+				</xsl:when>
+				<xsl:otherwise>
+				  <xsl:text>100</xsl:text>
+				  <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">
+						 <!-- 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:attribute>
+					 <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:attribute>
+				 </xsl:otherwise>
+			 </xsl:choose>
+
+				 <!-- 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: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:attribute>
+                </xsl:otherwise>
+            </xsl:choose>
+            
+        </a:blip>
+    </xsl:template>
+    
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/graphics/graphics.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/utils/utility-templates.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/utils/utility-templates.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/utils/utility-templates.xsl	(revision 728)
@@ -0,0 +1,127 @@
+<?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:
+
+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.
+</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 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="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="identifyChange">
+      <xsl:param name="who"/>
+      <xsl:attribute name="resp">
+	<xsl:text>#</xsl:text>
+	<xsl:value-of select="translate($who,' ','_')"/>
+      </xsl:attribute>
+    </xsl:template>
+
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/utils/utility-templates.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/wordsections/wordsections.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/wordsections/wordsections.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/wordsections/wordsections.xsl	(revision 728)
@@ -0,0 +1,125 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/wordsections/wordsections.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/toc.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/toc.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/toc.xsl	(revision 728)
@@ -0,0 +1,213 @@
+<?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:
+
+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.
+</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 ] }
+
+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>
+
+        <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/toc.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/fields.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/fields.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/fields.xsl	(revision 728)
@@ -0,0 +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:
+
+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.
+</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>
+	    <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/fields.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/tests/test-toc-scenario.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/tests/test-toc-scenario.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/tests/test-toc-scenario.xml	(revision 728)
@@ -0,0 +1,14 @@
+<?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>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/tests/test-toc-scenario.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario.xsl	(revision 728)
@@ -0,0 +1,66 @@
+<?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>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario-result.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario-result.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario-result.xml	(revision 728)
@@ -0,0 +1,22 @@
+<?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>
+</s:report>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario-result.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario-result.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario-result.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario-result.html	(revision 728)
@@ -0,0 +1,52 @@
+<?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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/dynamic/tests/xspec/test-toc-scenario-result.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/pass0/pass0.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/pass0/pass0.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/pass0/pass0.xsl	(revision 728)
@@ -0,0 +1,132 @@
+<?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
+					 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:
+
+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.
+</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: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>
+
+  
+  <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:if test="$debug='true'">
+	       <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>
+	     </xsl:if>
+	     <xsl:value-of select="$new"/>
+	   </xsl:when>
+	   <xsl:otherwise>
+	     <xsl:value-of select="$old"/>
+	   </xsl:otherwise>
+         </xsl:choose>
+      </xsl:attribute>
+  </xsl:template>
+  
+
+  <xsl:template
+      match="w:r[w:instrText][normalize-space(w:instrText)='']" mode="pass0"/>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/pass0/pass0.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/docxtotei.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/docxtotei.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/docxtotei.xsl	(revision 728)
@@ -0,0 +1,496 @@
+<?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
+					  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="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:
+
+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.
+</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>
+
+	  <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: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'))"/>
+
+	<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>
+         <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: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>
+
+    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
+      <desc>
+	Creating a gloss list
+      </desc>
+   </doc>
+
+    <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 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>
+	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: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>
+
+				        <!-- 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>
+
+   <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"/>
+	    </xsl:when>
+	    <xsl:otherwise>
+	      <xsl:value-of
+		  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: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[.='Normal (Web)']" mode="pass2"/>
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/docxtotei.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/paragraphs/paragraphs.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/paragraphs/paragraphs.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/paragraphs/paragraphs.xsl	(revision 728)
@@ -0,0 +1,291 @@
+<?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:
+
+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.
+</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: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: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: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: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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/paragraphs/paragraphs.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/parameters.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/parameters.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/parameters.xsl	(revision 728)
@@ -0,0 +1,96 @@
+<?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:
+
+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.
+</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>
+
+    <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/parameters.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/pass2/pass2.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/pass2/pass2.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/pass2/pass2.xsl	(revision 728)
@@ -0,0 +1,458 @@
+<?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:
+
+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.
+</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"/>
+
+            <xsl:when test="parent::*/text()">
+                <xsl:value-of select="."/>
+            </xsl:when>
+	    <xsl:when test="parent::tei:hi[count(*)=1]">
+	      <xsl:value-of select="."/>
+
+	    </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>
+
+    <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>
+
+    <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 .=' ']
+		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: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: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="w:bookmarkStart" mode="pass2">
+       <anchor>
+        <xsl:attribute name="xml:id">
+            <xsl:value-of select="substring(@w:name,2)"/>
+        </xsl:attribute>
+	</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>
+
+    <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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/pass2/pass2.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/tables/tables.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/tables/tables.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/tables/tables.xsl	(revision 728)
@@ -0,0 +1,585 @@
+<?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:
+
+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.
+</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="$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: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
+				      parent::w:ftr">
+			                        <xsl:text>none</xsl:text>
+		                      </xsl:when>
+		                      <xsl:when test="not($tableBorders)">
+					<!-- if really no info on borders, default 
+					     to all (? is this really what we want?) -->
+					<xsl:text>all</xsl:text>
+		                      </xsl:when>
+		                      <xsl:otherwise>
+					<xsl:for-each select="$tableBorders">
+					  <xsl:choose>
+					    <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' 
+							    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' 
+							    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') 
+							    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') 
+							    and not(w:bottom/@w:val='single') 
+							    and w:right/@w:val='single' 
+							    and w:left/@w:val='single'">sides</xsl:when>
+					    <xsl:otherwise>
+					      <!-- start guessing -->
+					      <xsl:variable name="sideBorders">
+						<xsl:choose>
+						  <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> 
+						  <xsl:otherwise>false</xsl:otherwise>
+						</xsl:choose>
+					      </xsl:variable>
+					      <xsl:choose>
+						<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>
+						</xsl:otherwise>
+					      </xsl:choose>
+					    </xsl:otherwise>
+					  </xsl:choose>
+					</xsl:for-each>
+		                      </xsl:otherwise>
+		                   </xsl:choose>
+		                </xsl:attribute>
+		                <xsl:attribute name="colsep">
+		                   <xsl:choose>
+		                      <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:choose>
+		                      <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:attribute>
+							 </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:text>0</xsl:text>
+				                                      </xsl:when>
+				                                      <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: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:text>0</xsl:text>
+				                                      </xsl:when>
+				                                      <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:text>1</xsl:text>
+				                                      </xsl:when>
+				                                      <xsl:otherwise>
+				                                         <xsl:text>0</xsl:text>
+				                                      </xsl:otherwise>
+				                                   </xsl:choose>
+			                                 </xsl:attribute>
+			                                 <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:text>1</xsl:text>
+				                                      </xsl:when>
+				                                      <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: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:text>0</xsl:text>
+				                                      </xsl:when>
+				                                      <xsl:when test="not(ancestor::w:tbl/w:tblPr/w:tblBorders)          and ancestor::w:ftr">
+				                                         <xsl:text>0</xsl:text>
+				                                      </xsl:when>
+				                                      <xsl:otherwise>
+				                                         <xsl:text>1</xsl:text>
+				                                      </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:choose>
+			      <xsl:when test="w:p/w:pPr/w:jc">
+				<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:text> background-color(</xsl:text>
+				<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:attribute>
+			  </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:text>c</xsl:text>
+		                      <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: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:attribute>
+		                   </xsl:if>
+		                   <xsl:if test="w:tcPr/w:gridSpan">
+		                      <xsl:attribute name="namest">
+			                        <xsl:text>c</xsl:text>
+			                        <xsl:value-of select="$COLPOS"/>
+		                      </xsl:attribute>
+		                      <xsl:attribute name="nameend">
+			                        <xsl:text>c</xsl:text>
+			                        <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:choose>
+			                           <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:otherwise>
+			                        </xsl:choose>
+		                      </xsl:attribute>
+		                   </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:attribute>
+				   </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: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>
+
+	  <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: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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/tables/tables.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/maths/maths.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/maths/maths.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/maths/maths.xsl	(revision 728)
@@ -0,0 +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:
+
+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.
+</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>
+
+    
+    <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>
+    
+
+    
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/maths/maths.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/textruns/textruns.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/textruns/textruns.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/textruns/textruns.xsl	(revision 728)
@@ -0,0 +1,643 @@
+<?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:
+
+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.
+</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>
+
+    <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:template match="w:r">
+      <xsl:call-template name="processTextrun"/>
+    </xsl:template>
+
+
+   <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;')"/>
+	     </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: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: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: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:position[number(@w:val)&gt;2]">
+	  <n>superscript</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:strike">
+	  <n>strikethrough</n>
+	</xsl:if>
+
+	<xsl:if test="w:rPr/w:dstrike">
+	  <n>strikedoublethrough</n>
+	</xsl:if>
+
+	<xsl:if test="w:rPr/w:u[@w:val='single']">
+	  <n>underline</n>
+	</xsl:if>
+
+	<xsl:if test="w:rPr/w:u[@w:val='wave']">
+	  <n>underwavyline</n>
+	</xsl:if>
+
+	<xsl:if test="w:rPr/w:u[@w:val='double']">
+	  <n>underdoubleline</n>
+	</xsl:if>
+
+	<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>
+
+	<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: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: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:text>isoStyle</xsl:text>
+		</xsl:attribute>
+	      </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:text>:</xsl:text>
+		  <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: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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/from/textruns/textruns.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/misc/check-docx-and-annotate.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/misc/check-docx-and-annotate.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/misc/check-docx-and-annotate.xsl	(revision 728)
@@ -0,0 +1,286 @@
+<?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: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"/>
+                </xsl:call-template>
+            </xsl:attribute>
+        </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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/misc/check-docx-and-annotate.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/misc/checkword.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/misc/checkword.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/misc/checkword.xsl	(revision 728)
@@ -0,0 +1,74 @@
+<?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: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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/misc/checkword.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/build-to.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/build-to.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/build-to.xml	(revision 728)
@@ -0,0 +1,147 @@
+<?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"/>
+
+  <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>
+
+  <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="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="cleanup" unless="debug">
+    <delete dir="${outputTempDir}"/>
+  </target>
+
+  <target name="dist"
+	  depends="setup,odd,notodd,transform,nocoverpages,coverpages,zip,cleanup"/>
+
+
+</project>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/build-to.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/build-from.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/build-from.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/build-from.xml	(revision 728)
@@ -0,0 +1,87 @@
+<?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"/>
+
+  <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="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="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="cleanup" unless="debug">
+    <delete dir="${outputTempDir}"/>
+  </target>
+
+</project>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/build-from.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/graphics/fixgraphics.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/graphics/fixgraphics.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/graphics/fixgraphics.xsl	(revision 728)
@@ -0,0 +1,95 @@
+<?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:
+
+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.
+</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: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:for-each>
+	           </xsl:attribute>
+	        </xsl:if>
+      </xsl:copy>
+  </xsl:template>
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/graphics/fixgraphics.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/graphics/listgraphics.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/graphics/listgraphics.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/graphics/listgraphics.xsl	(revision 728)
@@ -0,0 +1,105 @@
+<?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:
+
+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.
+</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:output method="text"/>
+  <xsl:param name="DIR"/>
+  <xsl:param name="ORIG">.</xsl:param>
+
+  <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 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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/graphics/listgraphics.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/identity/identity.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/identity/identity.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/identity/identity.xsl	(revision 728)
@@ -0,0 +1,59 @@
+<?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">
+
+    <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/ 
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/identity/identity.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/verbatim/tei-docx-verbatim.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/verbatim/tei-docx-verbatim.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/verbatim/tei-docx-verbatim.xsl	(revision 728)
@@ -0,0 +1,119 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/verbatim/tei-docx-verbatim.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/verbatim/verbatim.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/verbatim/verbatim.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/verbatim/verbatim.xsl	(revision 728)
@@ -0,0 +1,603 @@
+<?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:
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/verbatim/verbatim.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/maths/mml2omml.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/maths/mml2omml.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/maths/mml2omml.xsl	(revision 728)
@@ -0,0 +1,3722 @@
+<?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"/>
+
+
+  <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>
+-->
+
+  <!-- %%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: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>
+
+  <!-- %%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"/>
+
+      <!-- Add local Variable as you add new post processing tasks -->
+
+    <!-- 1. Remove any unwanted characters -->
+    <xsl:variable name="sCharStrip">
+         <xsl:value-of select="translate($sInput, 'â�¢â€‹', '')"/>
+      </xsl:variable>
+
+      <!-- 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 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="."/>
+
+      <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: 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)]">
+
+    <!-- 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, 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 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)"/>
+
+      <!--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>
+
+  <!-- %%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 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>
+
+      <!--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>
+
+      <!--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>
+
+      <!-- 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>
+
+      <!--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-->
+
+    <!--Find index of current node-->
+    <xsl:variable name="nndBeforeFirst" select="count($ndTokenFirst/preceding-sibling::*)"/>
+
+      <!--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::*)"/>
+
+      <xsl:variable name="cndRun" select="$nndBeforeLim - $nndBeforeFirst"/>
+
+      <!--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>
+
+      <!--The beginning and ending of the current run has been established. Now we should open a run element-->
+      <xsl:choose>
+
+        <!--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>
+
+          <!--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>
+
+            <!--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>
+
+      <!--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: 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: 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: 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: 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">
+
+	   <!-- 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: 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>
+
+  <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">
+                  <xsl:choose>
+                     <xsl:when test="$fBar=0">noBar</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>
+
+  <!-- %%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>
+
+  <!-- %%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>
+                     <xsl:otherwise>
+                        <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>
+
+  <!-- %%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>
+
+      <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>
+
+      <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 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>
+
+
+  <!-- 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. -->
+
+  <!-- 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>
+
+  <!-- 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: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>
+
+      <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: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>
+
+
+  <!-- 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"/>
+            </xsl:attribute>
+         </pos>
+         <vertJc>
+            <xsl:attribute name="m:val">
+               <xsl:value-of select="$vertJc"/>
+            </xsl:attribute>
+         </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? -->
+
+        <!-- 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>
+
+
+  <!-- %%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: 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 
+			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:attribute>
+               </begChr>
+            </xsl:if>
+
+            <!-- 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 = '|'"/>
+
+               <!-- 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:attribute>
+                  </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"/>
+                  </xsl:attribute>
+               </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: 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 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: 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"/>
+
+      <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>
+
+                     <!-- 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 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>
+
+               <!-- 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 
+				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>
+
+                           <!-- 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 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>
+
+  <!-- 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')                       
+			 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')               
+			 and (not($ndCur/@rowlines) or $ndCur/@rowlines='' or $ndCur/@rowlines='none')                       
+			 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>
+
+  <!-- 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: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="."/>
+
+      <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="''"/>
+
+      <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 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>
+
+  <!-- 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>
+
+  <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>
+
+  <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>
+
+
+  <!-- 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="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>
+
+
+  <!-- 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>
+
+  <!-- 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 
+
+              <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>
+
+            <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: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: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: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>
+
+            <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 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>
+
+      <!-- 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="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: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:attribute>
+         </chr>
+         <limLoc>
+            <xsl:attribute name="m:val">
+               <xsl:choose>
+                  <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:text>subSup</xsl:text>
+                  </xsl:when>
+               </xsl:choose>
+            </xsl:attribute>
+         </limLoc>
+         <grow>
+            <xsl:attribute name="m:val">
+               <xsl:value-of select="'on'"/>
+            </xsl:attribute>
+         </grow>
+         <subHide>
+            <xsl:attribute name="m:val">
+               <xsl:choose>
+                  <xsl:when test="$sMathmlType='mover' or                       $sMathmlType='msup'">
+                     <xsl:text>on</xsl:text>
+                  </xsl:when>
+                  <xsl:otherwise>
+                     <xsl:text>off</xsl:text>
+                  </xsl:otherwise>
+               </xsl:choose>
+            </xsl:attribute>
+         </subHide>
+         <supHide>
+            <xsl:attribute name="m:val">
+               <xsl:choose>
+                  <xsl:when test="$sMathmlType='munder' or                       $sMathmlType='msub'">
+                     <xsl:text>on</xsl:text>
+                  </xsl:when>
+                  <xsl:otherwise>
+                     <xsl:text>off</xsl:text>
+                  </xsl:otherwise>
+               </xsl:choose>
+            </xsl:attribute>
+         </supHide>
+      </naryPr>
+  </xsl:template>
+
+  <xsl:template name="mathrRpHook"/>
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/maths/mml2omml.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/maths/omml2mml.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/maths/omml2mml.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/maths/omml2mml.xsl	(revision 728)
@@ -0,0 +1,1819 @@
+<?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">
+	<!-- %% Global Definitions -->
+
+	<!-- Every single unicode character that is recognized by OMML as an operator -->
+	<xsl:variable name="sOperators"
+                 select="concat(      '!&#34;#&amp;()+,-./:',           ';&lt;=&gt;?@[\]^_{',           '|}~Â¡Â¦Â¬Â¯Â°Â±Â²Â³Â·Â¹Â¿',           'Ã—Ã·Ì€Ì�Ì‚ÌƒÌ„Ì…Ì†Ì‡ÌˆÌ‰',           'ÌŠÌ‹ÌŒÌ�ÌŽÌ�Ì�Ì‘Ì’Ì“Ì”Ì•',           'Ì–Ì—Ì˜Ì™ÌšÌ›ÌœÌ�ÌžÌŸÌ Ì¡',           'Ì¢Ì£Ì¤Ì¥Ì¦Ì§Ì¨Ì©ÌªÌ«Ì¬Ì­',           'Ì®Ì¯Ì°Ì±Ì²Ì³Ì´ÌµÌ¶Ì·Ì¸Ì¿',           'â€€â€�â€‚â€ƒâ€„â€…â€†â€‰â€Šâ€�â€’â€“',           'â€”â€–â€ â€¡â€¢â€¤â€¥â€¦â€²â€³â€´â€¼',           'â�€â�„â�Žâ��â��â�—â�¡â�¢â�£â�°â�´â�µ',           'â�¶â�·â�¸â�¹â�ºâ�»â�¼â�½â�¾â‚€â‚�â‚‚',           'â‚ƒâ‚„â‚…â‚†â‚‡â‚ˆâ‚‰â‚Šâ‚‹â‚Œâ‚�â‚Ž',           'âƒ�âƒ‘âƒ’âƒ“âƒ”âƒ•âƒ–âƒ—âƒ˜âƒ™âƒšâƒ›',           'âƒœâƒ�âƒžâƒŸâƒ âƒ¡âƒ¤âƒ¥âƒ¦âƒ§âƒ¨âƒ©',           'âƒªâ…€à¡¢â†�â†‘â†’â†“â†”â†•â†–â†—â†˜â†™',           'â†šâ†›â†œâ†�â†žâ†Ÿâ† â†¡â†¢â†£â†¤â†¥',           'â†¦â†§â†¨â†©â†ªâ†«â†¬â†­â†®â†¯â†°â†±',           'â†²â†³â†¶â†·â†ºâ†»â†¼â†½â†¾â†¿â‡€â‡�',           'â‡‚â‡ƒâ‡„â‡…â‡†â‡‡â‡ˆâ‡‰â‡Šâ‡‹â‡Œâ‡�',           'â‡Žâ‡�â‡�â‡‘â‡’â‡“â‡”â‡•â‡–â‡—â‡˜â‡™',           'â‡šâ‡›â‡œâ‡�â‡žâ‡Ÿâ‡ â‡¡â‡¢â‡£â‡¤â‡¥',           'â‡¦â‡§â‡¨â‡©â‡³â‡´â‡µâ‡¶â‡·â‡¸â‡¹â‡º',           'â‡»â‡¼â‡½â‡¾â‡¿âˆ€âˆ�âˆ‚âˆƒâˆ„âˆ†âˆ‡',           'âˆˆâˆ‰âˆŠâˆ‹âˆŒâˆ�âˆ�âˆ�âˆ‘âˆ’âˆ“âˆ”',           'âˆ•âˆ–âˆ—âˆ˜âˆ™âˆšâˆ›âˆœâˆ�âˆ£âˆ¤âˆ¥',           'âˆ¦âˆ§âˆ¨âˆ©âˆªâˆ«âˆ¬âˆ­âˆ®âˆ¯âˆ°âˆ±',           'âˆ²âˆ³âˆ´âˆµâˆ¶âˆ·âˆ¸âˆ¹âˆºâˆ»âˆ¼âˆ½',           'âˆ¾â‰€â‰�â‰‚â‰ƒâ‰„â‰…â‰†â‰‡â‰ˆâ‰‰â‰Š',           'â‰‹â‰Œâ‰�â‰Žâ‰�â‰�â‰‘â‰’â‰“â‰”â‰•â‰–',           'â‰—â‰˜â‰™â‰šâ‰›â‰œâ‰�â‰žâ‰Ÿâ‰ â‰¡â‰¢',           'â‰£â‰¤â‰¥â‰¦â‰§â‰¨â‰©â‰ªâ‰«â‰¬â‰­â‰®',           'â‰¯â‰°â‰±â‰²â‰³â‰´â‰µâ‰¶â‰·â‰¸â‰¹â‰º',           'â‰»â‰¼â‰½â‰¾â‰¿âŠ€âŠ�âŠ‚âŠƒâŠ„âŠ…âŠ†',           'âŠ‡âŠˆâŠ‰âŠŠâŠ‹âŠŒâŠ�âŠŽâŠ�âŠ�âŠ‘âŠ’',           'âŠ“âŠ”âŠ•âŠ–âŠ—âŠ˜âŠ™âŠšâŠ›âŠœâŠ�âŠž',           'âŠŸâŠ âŠ¡âŠ¢âŠ£âŠ¥âŠ¦âŠ§âŠ¨âŠ©âŠªâŠ«',           'âŠ¬âŠ­âŠ®âŠ¯âŠ°âŠ±âŠ²âŠ³âŠ´âŠµâŠ¶âŠ·',           'âŠ¸âŠ¹âŠºâŠ»âŠ¼âŠ½â‹€â‹�â‹‚â‹ƒâ‹„â‹…',           'â‹†â‹‡â‹ˆâ‹‰â‹Šâ‹‹â‹Œâ‹�â‹Žâ‹�â‹�â‹‘',           'â‹’â‹“â‹”â‹•â‹–â‹—â‹˜â‹™â‹šâ‹›â‹œâ‹�',           'â‹žâ‹Ÿâ‹ â‹¡â‹¢â‹£â‹¤â‹¥â‹¦â‹§â‹¨â‹©',           'â‹ªâ‹«â‹¬â‹­â‹®â‹¯â‹°â‹±â‹²â‹³â‹´â‹µ',           'â‹¶â‹·â‹¸â‹¹â‹ºâ‹»â‹¼â‹½â‹¾â‹¿âŒ…âŒ†',           'âŒˆâŒ‰âŒŠâŒ‹âŒœâŒ�âŒžâŒŸâŒ¢âŒ£âŒ©âŒª',           'âŒ½âŒ¿âŽ°âŽ±â�œâ��â�žâ�Ÿâ� â”‚â”œâ”¤',           'â”¬â”´â–�â–ˆâ–’â– â–¡â–­â–²â–³â–´â–µ',           'â–¶â–·â–¸â–¹â–¼â–½â–¾â–¿â—€â—�â—‚â—ƒ',           'â—„â—…â—Šâ—‹â—¦â—«â—¬â—¸â—¹â—ºâ—»â—¼',           'â—½â—¾â—¿â˜…â˜†â�²â�³âŸ‘âŸ’âŸ“âŸ”âŸ•',           'âŸ–âŸ—âŸ˜âŸ™âŸšâŸ›âŸœâŸ�âŸžâŸŸâŸ âŸ¡',           'âŸ¢âŸ£âŸ¤âŸ¥âŸ¦âŸ§âŸ¨âŸ©âŸªâŸ«âŸ°âŸ±',           'âŸ²âŸ³âŸ´âŸµâŸ¶âŸ·âŸ¸âŸ¹âŸºâŸ»âŸ¼âŸ½',           'âŸ¾âŸ¿â¤€â¤�â¤‚â¤ƒâ¤„â¤…â¤†â¤‡â¤ˆâ¤‰',           'â¤Šâ¤‹â¤Œâ¤�â¤Žâ¤�â¤�â¤‘â¤’â¤“â¤”â¤•',           'â¤–â¤—â¤˜â¤™â¤šâ¤›â¤œâ¤�â¤žâ¤Ÿâ¤ â¤¡',           'â¤¢â¤£â¤¤â¤¥â¤¦â¤§â¤¨â¤©â¤ªâ¤«â¤¬â¤­',           'â¤®â¤¯â¤°â¤±â¤²â¤³â¤´â¤µâ¤¶â¤·â¤¸â¤¹',           'â¤ºâ¤»â¤¼â¤½â¤¾â¤¿â¥€â¥�â¥‚â¥ƒâ¥„â¥…',           'â¥†â¥‡â¥ˆâ¥‰â¥Šâ¥‹â¥Œâ¥�â¥Žâ¥�â¥�â¥‘',           'â¥’â¥“â¥”â¥•â¥–â¥—â¥˜â¥™â¥šâ¥›â¥œâ¥�',           'â¥žâ¥Ÿâ¥ â¥¡â¥¢â¥£â¥¤â¥¥â¥¦â¥§â¥¨â¥©',           'â¥ªâ¥«â¥¬â¥­â¥®â¥¯â¥°â¥±â¥²â¥³â¥´â¥µ',           'â¥¶â¥·â¥¸â¥¹â¥ºâ¥»â¥¼â¥½â¥¾â¥¿â¦€â¦‚',           'â¦ƒâ¦„â¦…â¦†â¦‡â¦ˆâ¦‰â¦Šâ¦‹â¦Œâ¦�â¦Ž',           'â¦�â¦�â¦‘â¦’â¦“â¦”â¦•â¦–â¦—â¦˜â¦™â¦š',           'â¦¶â¦·â¦¸â¦¹â§€â§�â§„â§…â§†â§‡â§ˆâ§Ž',           'â§�â§�â§‘â§’â§“â§”â§•â§–â§—â§˜â§™â§š',           'â§›â§Ÿâ§¡â§¢â§£â§¤â§¥â§¦â§«â§´â§µâ§¶',           'â§·â§¸â§¹â§ºâ§»â§¼â§½â§¾â§¿â¨€â¨�â¨‚',           'â¨ƒâ¨„â¨…â¨†â¨‡â¨ˆâ¨‰â¨Šâ¨‹â¨Œâ¨�â¨Ž',           'â¨�â¨�â¨‘â¨’â¨“â¨”â¨•â¨–â¨—â¨˜â¨™â¨š',           'â¨›â¨œâ¨�â¨žâ¨Ÿâ¨ â¨¡â¨¢â¨£â¨¤â¨¥â¨¦',           'â¨§â¨¨â¨©â¨ªâ¨«â¨¬â¨­â¨®â¨¯â¨°â¨±â¨²',           'â¨³â¨´â¨µâ¨¶â¨·â¨¸â¨¹â¨ºâ¨»â¨¼â¨½â¨¾',           'â¨¿â©€â©�â©‚â©ƒâ©„â©…â©†â©‡â©ˆâ©‰â©Š',           'â©‹â©Œâ©�â©Žâ©�â©�â©‘â©’â©“â©”â©•â©–',           'â©—â©˜â©™â©šâ©›â©œâ©�â©žâ©Ÿâ© â©¡â©¢',           'â©£â©¤â©¥â©¦â©§â©¨â©©â©ªâ©«â©¬â©­â©®',           'â©¯â©°â©±â©²â©³â©´â©µâ©¶â©·â©¸â©¹â©º',           'â©»â©¼â©½â©¾â©¿âª€âª�âª‚âªƒâª„âª…âª†',           'âª‡âªˆâª‰âªŠâª‹âªŒâª�âªŽâª�âª�âª‘âª’',           'âª“âª”âª•âª–âª—âª˜âª™âªšâª›âªœâª�âªž',           'âªŸâª âª¡âª¢âª£âª¤âª¥âª¦âª§âª¨âª©âªª',           'âª«âª¬âª­âª®âª¯âª°âª±âª²âª³âª´âªµâª¶',           'âª·âª¸âª¹âªºâª»âª¼âª½âª¾âª¿â«€â«�â«‚',           'â«ƒâ«„â«…â«†â«‡â«ˆâ«‰â«Šâ«‹â«Œâ«�â«Ž',           'â«�â«�â«‘â«’â«“â«”â«•â«–â«—â«˜â«™â«š',           'â«›â«œâ«�â«žâ«Ÿâ« â«¢â«£â«¤â«¥â«¦â«§',           'â«¨â«©â«ªâ««â«¬â«­â«®â«¯â«°â«²â«³â«´',           'â«µâ«¶â«·â«¸â«¹â«ºâ«»â«¼â«½â«¾â«¿â¬„',           'â¬†â¬‡â¬Œâ¬�ã€”ã€•ã€–ã€—ã€˜ã€™ï¼�ï¼†',           'ï¼ˆï¼‰ï¼‹ï¼Œï¼�ï¼Žï¼�ï¼šï¼›ï¼œï¼�ï¼ž',           'ï¼Ÿï¼ ï¼»ï¼¼ï¼½ï¼¾ï¼¿ï½›ï½œï½�')"/>
+
+	  <!-- 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>
+
+	  <!-- 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 -->
+	<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>
+
+	  <!-- %%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: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>
+
+	  <!-- 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>
+
+		    <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="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: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 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 -->
+
+		<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>
+
+		    <!-- 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>
+			<!-- 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: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: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: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		
+	-->
+	<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: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: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: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: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: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>
+
+	  <!-- %%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: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.
+	-->
+	<xsl:template name="CreateMathMLFracProp">
+		    <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>
+
+	  <!-- %%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>
+
+			      <!-- 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"/>
+					          </xsl:attribute>
+					          <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: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>
+
+	  <!-- %%Template match m:d
+
+		Process a delimiter. 
+	-->
+	<xsl:template match="m:d">
+		    <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:attribute>
+			      </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"/>
+				        </xsl:attribute>
+			      </xsl:if>
+
+			      <!-- 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 = ','"/>
+
+				        <!-- OMML default: | -->
+				<xsl:when test="not(m:dPr[1]/m:sepChr/@m:val)">
+					          <xsl:attribute name="separators">
+						            <xsl:value-of select="'|'"/>
+					          </xsl:attribute>
+				        </xsl:when>
+
+				        <xsl:otherwise>
+					          <xsl:attribute name="separators">
+						            <xsl:value-of select="m:dPr[1]/m:sepChr/@m:val"/>
+					          </xsl:attribute>
+				        </xsl:otherwise>
+			      </xsl:choose>
+
+			      <!-- 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>
+
+	  <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: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>
+						<!-- numbers don't care -->
+						<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>
+
+				        <!-- 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'"/>
+
+					          <!-- 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:attribute>
+					          </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: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>
+
+	  <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>
+
+	  <!-- %%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: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>
+
+						<!-- 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>
+
+						            <!-- 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>
+
+						            <!-- 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>
+
+	  <!-- %%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: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>
+
+				<!-- 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>
+
+					          <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 -->
+				<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>
+
+				        <!-- 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>
+
+	  <!-- %%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: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>
+
+			      <!-- 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>
+
+	  <!-- %%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: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>
+
+
+	  <!-- %%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: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.  
+	-->
+	<xsl:template name="SReplaceOperWithMinus">
+		    <xsl:param name="sToParse" select="''"/>
+
+		    <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.
+	-->
+	<xsl:template name="SReplaceNumWithZero">
+		    <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)"/>
+
+		    <!-- 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>
+
+		    <!-- 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>
+
+	  <!-- 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="$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: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:attribute>
+					          </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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/maths/omml2mml.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/functions.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/functions.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/functions.xsl	(revision 728)
@@ -0,0 +1,242 @@
+<?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:
+
+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.
+</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>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"/>
+
+        <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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/functions.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/variables.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/variables.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/variables.xsl	(revision 728)
@@ -0,0 +1,80 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/utils/variables.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/relationships.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/relationships.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/relationships.xsl	(revision 728)
@@ -0,0 +1,266 @@
+<?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"/>
+
+    <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/ 
+
+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.
+</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>
+
+        <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>
+            <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>
+    
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/relationships.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/comments.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/comments.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/comments.xsl	(revision 728)
@@ -0,0 +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:
+
+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.
+</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:when>
+		  <xsl:otherwise>
+		    <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>
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/comments.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/headers.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/headers.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/headers.xsl	(revision 728)
@@ -0,0 +1,117 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/headers.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/content-types.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/content-types.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/content-types.xsl	(revision 728)
@@ -0,0 +1,183 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/content-types.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/numbering-definition.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/numbering-definition.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/numbering-definition.xsl	(revision 728)
@@ -0,0 +1,965 @@
+<?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:
+
+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.
+</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>
+
+        <xsl:result-document href="{concat($wordDirectory,'/word/numbering.xml')}">
+            <w:numbering>
+
+                <!-- 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>
+
+
+                <!-- unordered lists -->
+		<xsl:call-template name="defineUnorderedLists"/>
+
+                <!-- ordered lists -->
+		<xsl:call-template name="defineOrderedLists"/>
+
+
+                <!-- 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: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: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>
+
+                <!-- for headlines -->
+                <w:num w:numId="1">
+                    <w:abstractNumId w:val="1"/>
+                </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>
+
+                <!-- 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: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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/numbering-definition.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/endnotes.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/endnotes.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/endnotes.xsl	(revision 728)
@@ -0,0 +1,138 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/endnotes.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/footnotes.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/footnotes.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/footnotes.xsl	(revision 728)
@@ -0,0 +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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/footnotes.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/settings.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/settings.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/settings.xsl	(revision 728)
@@ -0,0 +1,138 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/settings.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/footers.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/footers.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/footers.xsl	(revision 728)
@@ -0,0 +1,110 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/footers.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/application.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/application.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/application.xsl	(revision 728)
@@ -0,0 +1,195 @@
+<?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:
+
+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.
+</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:template name="write-docxfile-docprops-core">
+        <xsl:variable name="now" select="tei:whatsTheDate()"/>
+
+        <xsl:variable name="coreFile">
+            <xsl:value-of select="$wordDirectory"/>
+            <xsl:text>/docProps/core.xml</xsl:text>
+        </xsl:variable>
+
+        <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: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: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: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"/>
+                            </xsl:attribute>
+                            <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>
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/docxfiles/application.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/graphics/graphics.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/graphics/graphics.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/graphics/graphics.xsl	(revision 728)
@@ -0,0 +1,464 @@
+<?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
+					 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/ 
+
+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.
+</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>
+
+
+    <xsl:key name="W" match="image" use="@url"/>
+    <xsl:key name="H" match="image" use="@url"/>
+
+    <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: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">
+				    <xsl:choose>
+				      <xsl:when test="$isofreestanding='true'">
+					<xsl:text>rId</xsl:text>
+					<xsl:value-of
+					    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: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'
+					      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'
+				      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"/>
+			    </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"/>
+			    </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>
+
+	  </xsl:otherwise>
+	</xsl:choose>
+    </xsl:template>
+    
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/graphics/graphics.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/wordsections/wordsections.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/wordsections/wordsections.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/wordsections/wordsections.xsl	(revision 728)
@@ -0,0 +1,164 @@
+<?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:
+
+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.
+</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>
+            <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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/wordsections/wordsections.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/drama/drama.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/drama/drama.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/drama/drama.xsl	(revision 728)
@@ -0,0 +1,143 @@
+<?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
+					 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/ 
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/drama/drama.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/dynamic/dynamic.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/dynamic/dynamic.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/dynamic/dynamic.xsl	(revision 728)
@@ -0,0 +1,143 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/dynamic/dynamic.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/teitodocx.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/teitodocx.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/teitodocx.xsl	(revision 728)
@@ -0,0 +1,2388 @@
+<?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.
+
+        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/ 
+
+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.
+</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: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: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)"/>
+	      </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>
+		    </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: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:attribute name="valign">
+                <xsl:choose>
+                  <xsl:when test="@valign='middle'">center</xsl:when>
+                  <xsl:otherwise>
+                    <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>
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/teitodocx.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/odds/tagdocs.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/odds/tagdocs.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/odds/tagdocs.xsl	(revision 728)
@@ -0,0 +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: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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/odds/tagdocs.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/placeholders.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/placeholders.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/placeholders.xsl	(revision 728)
@@ -0,0 +1,205 @@
+<?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"/>
+
+    <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/ 
+
+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.
+</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" select="$styleToPassOn"/>
+            <xsl:with-param name="pPr" select="$pPr"/>
+            <xsl:with-param name="nop" select="$nop"/>
+        </xsl:call-template>
+    </xsl:template>
+
+    <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>
+
+    <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="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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/placeholders.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/maths/maths.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/maths/maths.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/maths/maths.xsl	(revision 728)
@@ -0,0 +1,168 @@
+<?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:
+
+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.
+</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:for-each select="key('IMAGEDATA',1)">
+		    <xsl:if test="generate-id()=$me">
+		      <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: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:choose>
+		<xsl:when test="$isofreestanding='true'">
+		  <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: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:otherwise>
+	      </xsl:choose>
+            </xsl:attribute>
+	</xsl:copy>
+    </xsl:template>
+    
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/maths/maths.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/lists/lists.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/lists/lists.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/lists/lists.xsl	(revision 728)
@@ -0,0 +1,231 @@
+<?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="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/ 
+
+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.
+</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>
+
+    <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"/>
+
+        <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="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">
+				<xsl:choose>
+				  <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:variable name="abstractNumId"
+						    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"/>
+                                </xsl:attribute>
+                            </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:variable>
+				<xsl:for-each select="key('OL',1)">
+				  <xsl:if test="$CurrentList=generate-id(.)">
+				    <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>
+
+    <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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/lists/lists.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/templates/default.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/templates/default.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/templates/default.xml	(revision 728)
@@ -0,0 +1,48 @@
+<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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/docx/to/templates/default.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xsd/build-to.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xsd/build-to.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xsd/build-to.xml	(revision 728)
@@ -0,0 +1,72 @@
+<?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"/>
+    
+</project>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xsd/build-to.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/corpus.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/corpus.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/corpus.xsl	(revision 728)
@@ -0,0 +1,51 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/corpus.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/linking.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/linking.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/linking.xsl	(revision 728)
@@ -0,0 +1,191 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/linking.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/transcr.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/transcr.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/transcr.xsl	(revision 728)
@@ -0,0 +1,58 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/transcr.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/tei-param.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/tei-param.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/tei-param.xsl	(revision 728)
@@ -0,0 +1,638 @@
+<?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">
+
+   <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:
+
+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.
+</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>
+
+
+  <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="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"/>
+
+   <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="layout" type="string">
+      <desc>
+Logo graphics file
+</desc>
+   </doc>
+   <xsl:param name="latexLogo"/>
+
+   <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>
+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="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}
+\usepackage{framed}
+</xsl:text>
+<xsl:text>
+\definecolor{shadecolor}{gray}{0.95}
+\usepackage{longtable}
+\usepackage[normalem]{ulem}
+\usepackage{fancyvrb}
+\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>
+\def\Gin@extensions{.pdf,.png,.jpg,.mps,.tif}
+</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>
+  \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>
+
+   </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 making a table, what width must be constrained to fit,
+as a proportion of the page width.
+</desc>
+   </doc>
+   <xsl:param name="tableMaxWidth">0.85</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="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>
+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}
+
+\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}}
+\newcolumntype{P}[1]{){\arraybackslash}p{#1}}
+\newcolumntype{B}[1]{){\arraybackslash}b{#1}}
+\newcolumntype{M}[1]{){\arraybackslash}m{#1}}
+\definecolor{label}{gray}{0.75}
+\DeclareRobustCommand*{\xref}{\hyper@normalise\xref@}
+\def\xref@#1#2{\hyper@linkurl{#2}{#1}}
+\def\Div[#1]#2{\section*{#2}}
+\begingroup
+\catcode`\_=\active
+\gdef_#1{\ensuremath{\sb{\mathrm{#1}}}}
+\endgroup
+\mathcode`\_=\string"8000
+\catcode`\_=12\relax
+</xsl:text>
+   </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 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 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}}
+
+</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}%
+  \hspace{-0.75in}{\bfseries\fontsize{16pt}{18pt}\selectfont#2}%
+  }{}
+      </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 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}
+\renewcommand\small{\@setfontsize\small{9pt}{11pt}\abovedisplayskip 8.5\p@ plus3\p@ minus4\p@
+\belowdisplayskip \abovedisplayskip
+\abovedisplayshortskip \z@ plus2\p@
+\belowdisplayshortskip 4\p@ plus2\p@ minus2\p@
+\def\@listi{\leftmargin\leftmargini
+               \topsep 2\p@ plus1\p@ minus1\p@
+               \parsep 2\p@ plus\p@ minus\p@
+               \itemsep 1pt}
+}
+\makeatother
+\fvset{frame=single,numberblanklines=false,xleftmargin=5mm,xrightmargin=5mm}
+\fancyhf{} 
+\setlength{\headheight}{14pt}
+\fancyhead[LE]{\bfseries\leftmark} 
+\fancyhead[RO]{\bfseries\rightmark} 
+\fancyfoot[RO]{}
+\fancyfoot[CO]{\thepage}
+\fancyfoot[LO]{\TheID}
+\fancyfoot[LE]{}
+\fancyfoot[CE]{\thepage}
+\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>
+
+   <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>
+
+  
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/tei-param.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/tei.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/tei.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/tei.xsl	(revision 728)
@@ -0,0 +1,172 @@
+<?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:
+
+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.
+</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: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 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-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>
+
+
+  <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;',' '), 
+		  '\\','\\textbackslash '),
+		  '\{','\\{'),
+		  '\}','\\}'),
+		  '~','\\textasciitilde ')"/>
+  </xsl:function>
+
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/tei.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/drama.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/drama.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/drama.xsl	(revision 728)
@@ -0,0 +1,193 @@
+<?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:
+
+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.
+</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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/drama.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/figures.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/figures.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/figures.xsl	(revision 728)
@@ -0,0 +1,412 @@
+<?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:
+
+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.
+</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
+			  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} 
+      \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>}
+     \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 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>
+		</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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/figures.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/namesdates.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/namesdates.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/namesdates.xsl	(revision 728)
@@ -0,0 +1,65 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/namesdates.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/tagdocs.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/tagdocs.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/tagdocs.xsl	(revision 728)
@@ -0,0 +1,360 @@
+<?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:
+
+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.
+</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 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>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>
+
+  <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 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 name="egXMLStartHook"/>
+   <xsl:template name="egXMLEndHook"/>
+
+   <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 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='specChild']">
+      <xsl:apply-templates/>
+   </xsl:template>
+
+   <xsl:template match="tei:seg[@rend='specChildModule']">
+    \item[<xsl:apply-templates/>]
+   </xsl:template>
+
+   <xsl:template match="tei:seg[@rend='specChildElements']">
+      <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='parent']">
+      <xsl:apply-templates/>
+   </xsl:template>
+
+   <xsl:template match="tei:hi[@rend='showmembers1']">
+      <xsl:apply-templates/>
+   </xsl:template>
+
+   <xsl:template match="tei:hi[@rend='showmembers2']">
+      <xsl:apply-templates/>
+   </xsl:template>
+
+   <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>
+\end{reflist}  </xsl:text>
+   </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>
+\end{sansreflist}  </xsl:text>
+   </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>
+\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:template match="tei:div[@type='refdoc']/tei:head"/>
+
+   <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: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-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='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 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>
+
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/tagdocs.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/verse.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/verse.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/verse.xsl	(revision 728)
@@ -0,0 +1,67 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/verse.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/textstructure.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/textstructure.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/textstructure.xsl	(revision 728)
@@ -0,0 +1,393 @@
+<?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:
+
+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.
+</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}{%
+    \def\DivI{\section}
+    \def\DivII{\subsection}
+    \def\DivIII{\subsubsection}
+    \def\DivIV{\paragraph}
+    \def\DivV{\subparagraph}
+    \def\DivIStar[#1]#2{\section*{#2}}
+    \def\DivIIStar[#1]#2{\subsection*{#2}}
+    \def\DivIIIStar[#1]#2{\subsubsection*{#2}}
+    \def\DivIVStar[#1]#2{\paragraph*{#2}}
+    \def\DivVStar[#1]#2{\subparagraph*{#2}}
+}{%
+    \def\DivI{\chapter}
+    \def\DivII{\section}
+    \def\DivIII{\subsection}
+    \def\DivIV{\subsubsection}
+    \def\DivV{\paragraph}
+    \def\DivIStar[#1]#2{\chapter*{#2}}
+    \def\DivIIStar[#1]#2{\section*{#2}}
+    \def\DivIIIStar[#1]#2{\subsection*{#2}}
+    \def\DivIVStar[#1]#2{\subsubsection*{#2}}
+    \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;
+      \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>
+
+  <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>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.
+
+  </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: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:text>
+   </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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/textstructure.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/textcrit.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/textcrit.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/textcrit.xsl	(revision 728)
@@ -0,0 +1,72 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/textcrit.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/core.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/core.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/core.xsl	(revision 728)
@@ -0,0 +1,866 @@
+<?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:
+
+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.
+</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>
+
+  <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: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}
+\noindent\obeylines\obeyspaces </xsl:text>
+	           <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}
+\obeylines\obeyspaces </xsl:text>
+	           <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>
+
+  <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>
+
+  <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>
+\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>
+\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"/>
+
+  <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 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 &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>
+         <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 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 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 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 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 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 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>
+
+  <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="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>
+
+
+  <xsl:template name="Text">
+      <xsl:param name="words"/>
+      <xsl:value-of select="tei:escapeChars($words)"/>
+  </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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/core.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/header.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/header.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/header.xsl	(revision 728)
@@ -0,0 +1,87 @@
+<?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:
+
+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.
+</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>
+
+  <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/latex2/header.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/relaxng/build-to.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/relaxng/build-to.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/relaxng/build-to.xml	(revision 728)
@@ -0,0 +1,91 @@
+<?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"/>
+
+  <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>
+
+</project>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/relaxng/build-to.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tei-print.css
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tei-print.css	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tei-print.css	(revision 728)
@@ -0,0 +1,78 @@
+/* 
+** Copyright 2008 TEI Consortium
+
+$Id: tei-print.css 6500 2009-06-05 12:24:45Z rahtz $
+
+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
+
+*/
+
+@import url(tei.css);
+
+/* elements */
+
+  /* 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;
+}
+
+a:visited {
+   color:inherit;
+}
+
+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
+      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 */
+   }
+
+div.pre_eg, pre.eg {
+   page-break-inside:avoid;
+}
+
+
+td {
+   font-size: 10pt;
+}
+
+td.maintext, td.maintext p {
+   font-family: Helvetica, Arial, sans-serif;
+}
+   
+/* classes */
+
+.plain {
+   font-family: Helvetica, Arial, sans-serif;
+}
+
+div.pagebreak {
+    page-break-before: always;
+}
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tei-print.css
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/html/build-to.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/html/build-to.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/html/build-to.xml	(revision 728)
@@ -0,0 +1,79 @@
+<?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>
+
+ <target name="dist" depends="setup,odd,notodd,transform,cleanup"/>
+
+  <target name="cleanup" unless="debug">  
+    <delete dir="${outputTempDir}"/>
+  </target>
+
+</project>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/html/build-to.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tei.css
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tei.css	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tei.css	(revision 728)
@@ -0,0 +1,1294 @@
+/* 
+** Copyright 2011 TEI Consortium
+
+$Id: tei.css 10179 2012-03-25 14:46:46Z rahtz $
+
+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
+
+*/
+
+
+/* main layout */
+
+body.simple {
+   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.pagetable {
+   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;
+}
+
+#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;
+}
+
+#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;
+}
+
+
+/* now the layers of the header */
+
+/* the main title */
+div.stdheader {
+      border-bottom: 1pt solid black;
+}
+
+#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;
+}
+
+/* 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;
+}
+
+.bannerright {
+   position : absolute;
+   right : 5px;
+   color: #FFFFFF;
+   font-family : Arial, Helvetica, sans-serif;
+   font-size : 0.8em;
+   font-weight : bold;
+   text-decoration: none;
+}
+
+/* section headings */
+#hdr h1 { color: red; }
+h1 {
+   font-weight: bold;
+   font-size: 2em;
+   line-height: 34pt;
+}
+
+h2 {
+   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;
+}
+
+
+h1.maintitle {
+   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;
+}
+
+h2.institution {
+   margin-left: 100px;
+   font-family: Arial,Helvetica,sans-serif;
+}
+
+h2.department {
+   margin-left: 100px;
+   font-family: Arial,Helvetica,sans-serif;
+}
+
+h2.subtitle {
+   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.8em;
+}
+
+
+
+/* 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.8em;
+}
+
+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-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;
+}
+
+.skiplinks{
+   font-family: arial, sans-serif;
+   color: #FFFFFF;
+   font-weight : bold;
+   font-size : 0.8em;
+   text-decoration: none;
+   padding-right : 15px;
+}
+
+.tocontent{
+   color : #000066;
+   display : none;
+}
+
+.hide{
+   display : none;
+}
+
+.framestdlink {
+   color: red;
+   font-size: smaller;
+   font-weight: bold;
+}
+
+a:hover
+{
+   text-decoration: underline;
+}
+
+a.navbar:link
+{
+   color: #FFFFFF;
+   text-decoration: none;
+}
+
+a.navbar:visited
+{
+   color: #FFFFFF;
+   text-decoration: none;
+}
+
+a.navbar:hover {
+   color: #FFFFFF;
+   text-decoration: underline;
+}
+
+
+/* for use when making pages using a table */
+td.hdr2 {
+   color: #000000;
+   background-color : #99CCFF;
+}
+td.hdr3 {
+   background-color : #AD06BC;
+   border: 1pt solid #000000;
+}
+
+td.sidetext {
+   border-right: 1pt solid #000000;
+}
+td.maintext p {
+   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;
+}
+
+table.wovenodd td,p.wovenodd {
+   background-color: #FFFFFF;
+}
+
+/* an inner <text>, eg inside a <q> */
+div.innertext {
+   margin: 6pt;
+   border: 1pt solid red;
+}
+/* literal code */
+
+div.cdata {
+    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;
+}
+
+div.egXML_valid {
+    background-color: #f7f9f6;
+    border-color: #c5d8bb;
+    }
+div.egXML_feasible {
+    background-color: #fff9f3;
+    border-color: #ffe1ad;
+    }
+div.egXML_invalid {
+    border-color: #ffe7e8 ;
+    background-color:  #fdbbac;
+    }
+
+
+/* table of contents */
+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-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; 
+}
+
+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;    
+}
+
+p.toclist1 {
+   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;    
+}
+
+p.toclist3 {
+   margin-left: 2em; 
+   text-indent: -1.5em;
+   font-size: small;    
+}
+
+span.toclist-this {
+   color: red;
+}
+
+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;
+}
+div.noteBody {
+  display:inline;
+}
+
+div.note {
+   margin-left: 1em; 
+   margin-bottom: 4pt; 
+   text-indent: -1em;
+}
+
+span.noteLabel {
+    font-style: italic;
+}
+span.noteNumber:before {
+    content: "[";
+}
+span.noteNumber:after {
+    content: "]. ";
+}
+
+span.note {
+    font-size: smaller;
+}
+/* images */
+img.display {
+   margin-top: 10pt;
+   margin-bottom: 10pt;
+   display: block;
+}
+.caption {
+   font-style: italic;
+}
+span.caption {
+   display: block;
+}
+
+.floatimage {
+   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;
+}
+/* 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;
+}
+.docImprint {
+    display: block;
+   font-style: italic;    
+}
+.docDate {
+   font-style: italic;    
+}
+.docTitle {
+    display: block;
+    margin-top: 6pt;
+    font-weight: bold;
+    margin-bottom: 18pt;
+}
+.docAuthor {
+    font-style: italic;
+}
+
+.byline {
+    display: block;
+}   
+
+div.dateline{
+   text-align: right;
+}
+/* verse */
+div.lg {
+   margin-left: 10px;
+   margin-bottom: 10px;
+}
+
+div.signed {
+    text-align:left;
+}
+div.l {
+    text-align:left;
+    margin-left: 1em;
+}
+div.epigraph {
+    margin: 20pt;
+}
+div.numbering {
+    float:left; 
+    font-size:smaller; 
+    width: 2em;
+}
+
+div.linenumber { }
+
+div.indent1 {
+   margin-left: 1em;
+}
+div.indent2 {
+   margin-left: 2em;
+}
+div.indent3 {
+   margin-left: 3em;
+}
+div.indent4 {
+   margin-left: 4em;
+}
+div.indent5 {
+   margin-left: 5em;
+}
+div.indent6 {
+   margin-left: 6em;
+}
+
+/* general purpose block aligns */
+.centerbold {
+    text-align:center;
+    font-weight: bold;
+}
+.center {
+    text-align:center;
+}
+.right {
+    text-align:right;
+}
+.left {
+    text-align:left;
+}
+
+/* misc inline*/
+
+span.foreign {
+    font-style: italic;
+}
+
+.plain {
+   text-decoration: none;
+}
+
+p.box {
+   border: 1pt solid #000000;
+}
+
+.small {
+   font-size: small;
+}
+
+td.label {
+   font-weight: bold;
+   background-color: #AAAAAA;
+}
+tr.label td {
+   font-weight: bold;
+   background-color: #AAAAAA;
+}
+
+span.label {
+    font-weight: bold;
+}
+
+h5 {    
+   font-size: 100%;
+}
+h6 {    
+   font-size: 100%;
+}
+
+div.tocFront {
+   border-bottom: 1pt solid #000000;
+}
+div.tocBack {
+   border-bottom: 1pt solid #000000;
+}
+div.tocBody {
+   border-bottom: 1pt solid #000000;
+}
+/* a listBibl rend='labels' */
+div.listBibl {
+	     margin-top: 6pt;
+	     margin-bottom: 6pt;
+}
+div.bibl {
+   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;
+}
+
+span.biblLabel {
+    font-weight: bold;
+    margin-right: 1em;
+}
+
+/* a <bibl> inside a <cit> */
+div.citbibl:before {
+    content: "(";
+}
+div.citbibl:after {
+    content: ")";
+}
+div.citbibl {
+   text-align:right;
+   font-size: smaller;
+}
+/* a <quote> inside a <cit> */
+div.citquote {
+   margin-left: 10pt;
+   margin-right: 10pt;
+}
+
+/* gloss lists with bold labels */
+dt {
+   font-weight: bold;
+}
+div.blockquote {
+   margin: 10pt;
+}
+
+/* generic <hi> */
+span.hi {
+   font-weight: bold;
+}
+
+/* from drama */
+/* speeches in drama */
+div.p-in-sp {
+    margin-left: 1em;
+    }
+div.sp {
+    margin-top: 4pt;
+}
+div.spProse {
+    text-indent: -1em;
+    margin-left: 1em;
+}
+div.speaker {
+    font-weight: bold;
+}
+span.speaker {
+    font-style: italic;
+}
+
+span.actor {  
+	   font-style:italic;
+}
+span.camera {
+ font-style: italic;
+}
+span.caption {
+ font-style: italic;
+}
+span.role {
+ font-style: italic;
+}
+span.set {
+ font-style: italic;
+}
+span.sound {
+ font-style: italic;
+}
+span.stage {
+ font-style: italic;
+}
+span.tech {
+ font-style: italic;
+}
+span.view {
+ font-style: italic;
+}
+span.mentioned {
+   font-style: italic;
+}
+span.nextLink {
+   font-style: italic;
+}
+span.previousLink {
+   font-style: italic;
+}
+span.upLink {
+   font-style: italic;
+}
+p, div.p {
+ margin-top: 0.3em;
+}
+/* bibl */
+span.titlem {
+    font-style: italic;
+}
+span.titlej {
+    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;
+}
+
+div.floatingText_back {
+    border-top: solid black 1pt;
+}
+div.floatingText_front {
+    border-top: solid black 1pt;
+}
+div.floatingText {
+    margin: 6pt;
+    border: solid black 1pt;
+}
+div.pagebreak,span.pagebreak {
+    display: block;
+    color: grey;
+    float: right;
+}
+span.element {
+    font-weight: bold;
+    color: black;
+}
+span.unclear {
+    font-weight: bold;
+}
+span.wordtypeNN, span.wordtypeNNS {
+    color: green;
+    }
+span.wordtypeVVD,span.wordtypeVVN,span.wordtypeVVN,span.wordtypeVVZ,span.wordtypeVVG, span.wordtypeVV {
+    color: red;
+    }
+
+li.headless {
+    display: none;
+}
+span.hi {
+    font-weight: bold;
+}
+
+div.footer {
+    border-top: solid black 1pt;
+}
+
+div.stdfooter {
+    border-top: solid black 1pt;
+    border-bottom: solid black 1pt;
+}
+
+div.altfigure {
+    border-top: solid black 1pt;
+    border-bottom: solid black 1pt;
+}
+
+table.table, table.table tr, table.table td {
+    border: solid black 1pt;
+}
+table.table td {
+    padding: 1ex 1ex 1ex 1ex;
+}
+p.mainAuthor {
+    display: block;
+    margin: 1ex 0ex 1ex 0ex;
+}
+p.mainEditor {
+    display: block;
+    margin: 1ex 0ex 1ex 0ex;
+}
+
+/* ODD-specific styles */
+/* tables for reference display */
+table.wovenodd {
+    width: 100%;
+    clear: both;
+}
+td.wovenodd-col1 {
+    width:15%;
+    vertical-align: top;
+}
+td.wovenodd-col2 {
+    width:85%;
+}
+table.wovenodd tr td {
+    border: 1px solid #555;
+    padding:1%;
+}
+table.wovenodd {
+    border-spacing:0px;
+    border-collapse:collapse;
+}
+table.wovenodd tr td {
+    border-spacing:0px;
+}
+table.wovenodd tr {
+    border-spacing:0px;
+    border-collapse:collapse;
+}
+table.wovenodd tr td table.attList {
+    border-spacing:0px;
+    border:none;
+}
+table.wovenodd tr td table.attList tr {
+    border-spacing:0px;
+    border:none;
+}
+table.wovenodd tr td table.attList tr td {
+    border-spacing:0px;
+    border:none;
+}
+table.attList {
+    table-layout: fixed;
+    width: 100%;
+    margin: 0pt;
+    padding: 0pt;
+}
+td.odd_label {
+    vertical-align: top;
+    width: 10%;
+    font-weight: bold;
+}
+td.odd_value {
+    vertical-align: top;
+    width: 90%;
+}
+table.attDef {
+    table-layout: fixed;
+    width: 100%;
+}
+table.attDef td.odd_label {
+    width: 10%;
+    vertical-align: top;
+    font-weight: normal;
+}
+table.attDef td.odd_value {
+    vertical-align: top;
+    width: 90%;
+}
+table.attList  td.odd_label:before {
+    content: "@";
+}
+table.attDef  td.odd_label:before {
+    content: "";
+}
+table.valList  td.odd_label:before {
+    content: "";
+}
+table.valList {
+    table-layout: fixed;
+    width: 100%;
+}
+table.valList td.odd_label {
+    width: 10%;
+    vertical-align: top;
+    font-style: normal;
+    font-weight: normal;
+}
+table.valList td.odd_value {
+    vertical-align: top;
+    width: 90%;
+}
+table.specDesc td.Attribute {
+    font-weight: bold;
+    vertical-align: top;
+}
+table.specDesc {
+    margin-left: 1em;
+}
+td p {
+    margin-top: 0pt;
+    margin-bottom: 2pt;
+}
+
+div.cdata {
+    white-space: pre;
+    clear:both;
+}
+
+span.tag:before {
+     
+}
+span.tag:after {
+     
+}
+span.gi,span.tag {
+}
+span.att {
+     
+}
+span.att:before {
+    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-file, span.ident-ns {
+    font-style: italic;
+}
+
+button.displayRelaxButton {
+    margin-right: 2px;
+    margin-top: 2px;
+    font-size: 70%;
+    float: right;
+    cursor: pointer;
+}
+pre.RNG_XML {
+	    display: none;
+	    }
+
+span.RNG_XML {
+	    display: none;
+	    }
+
+/* pretty printing of XML */
+td.classSpec, td.macroSpec {
+    font-weight: bold;
+}
+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_class:link,a.link_odd_class:visited {
+
+}
+span.element {
+    font-weight: bold;
+    color: black;
+}
+td.elementSpec,span.elementname {
+    font-weight: bold;
+    color: #222288;
+}
+span.highlightelementname {
+    color: red;
+}
+
+span.attribute {
+    color: #222288;
+}
+span.attributevalue {
+    color: black;
+}
+span.comment {
+    color: black;
+    font-style:italic;
+}
+span.namespace {
+    color: #222288;
+}
+/* pretty print rnc */
+span.rnc_nc {
+    color: #006400;
+}
+span.rnc_decl {
+    color: green;
+}
+span.rnc_prefix {
+    color: blue;
+}
+span.rnc_param {
+    color: gray;
+}
+span.rnc_atom {
+    color: yellow;
+}
+span.rnc_annot {
+    color: #FF8040;
+}
+span.rnc_comment {
+    color: #FF00FF;
+}
+span.rnc_annot {
+    color: #00FFFF;
+}
+span.rnc_type {
+    color: purple;
+}
+span.rnc_keyword {
+    color: teal;
+}
+span.defaultVal {
+    font-weight: bold;
+}
+span.required {
+    font-weight: bold;
+}
+div.moduleSpec {
+    padding: 1px;
+    margin: 1px;
+    background-color: #C0C0C0;
+    color:inherit;
+    clear:right;
+}
+span.moduleSpecHead {
+    font-style: italic;
+}
+ul.specList li {
+    list-style: none;
+}
+span.specList-macroSpec {
+    font-weight: bold;
+}
+span.specList-elementSpec {
+    font-weight: bold;
+}
+span.specList-elementSpec:before {
+    content: "<";
+     
+}
+span.specList-elementSpec:after {
+    content: ">";
+     
+}
+span.specList-classSpec {
+    font-weight: bold;
+}
+span.specName {
+    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;
+}
+#azindex p {
+    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;
+}
+.index li {
+    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;
+}
+li.showall, li.showall a:visited,li.showall a:link {
+    width: 10em;
+}
+* html .index li {
+    margin: 0.2em 0.2em;
+}
+ul.index li a:hover {
+    background-color: #93D1E4;
+    color: #fff;
+    text-decoration: underline;
+}
+div.atozwrapper {
+   float: left;
+   width: 70%;
+}
+div.atoz {    
+   clear: left;
+   float: left;
+}    
+#byMod {
+   margin-top: 12px;
+   clear: left;
+}
+ul.atoz {
+    list-style: none;
+    text-align:left;
+    margin: 2px;
+    padding: 2px;
+    background-color: #eef;
+    color:inherit;
+}
+.atoz li {
+    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;
+}
+/* End of A - Z styles */
+div.specChildren {
+    margin: 0em;
+    padding: 0em;
+}
+span.specChildModule {
+    font-weight: bold;
+}
+div.specChild {
+    margin-bottom: 4pt;
+    margin-left: 25px;
+    text-indent: -30px;
+}
+span.emptySlash:after {
+    content: "/";
+}
+/* status notation */
+.status_deprecated:after {
+    content: " (deprecated)";
+    color: red;
+}
+.status_changed:after {
+    content: " (changed)";
+    color: blue;
+}
+.status_unstable:after {
+    content: " (unstable)";
+    color: orange;
+}
+.status_deprecated {
+    border: solid red 1pt;
+}
+.status_changed {
+    border: solid blue 1pt;
+}
+.status_unstable {
+    border: solid orange 1pt;
+}
+/* <hi> rend values */
+span.typewriter{
+    font-family: monospace;
+}
+span.normalweight{
+}
+span.smallcaps{
+    font-variant: small-caps;
+}
+span.bold{
+    font-weight: bold;
+}
+span.italic{
+    font-style:italic;
+}
+span.capsall{
+    text-transform: uppercase;
+}
+span.strikethrough{
+    text-decoration: line-through;
+}
+span.strikedoublethrough{
+    text-decoration: line-through;
+}
+span.underline{
+    text-decoration: underline;
+}
+span.underwavyline{
+    text-decoration-line: underline;
+    text-decoration-style: wavy;
+}
+span.underdoubleline{
+    text-decoration: underline;
+}
+span.superscript {
+    vertical-align: top;
+    font-size: 70%;
+}
+span.subscript {
+    vertical-align: bottom;
+    font-size: 70%;
+}
+span.numberParagraph:before {
+    content:"[";
+}
+span.numberParagraph:after {
+    content:"] ";
+}
+span.numberParagraph {
+    font-size: smaller;
+    color: grey;
+}

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tei.css
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/msdescription.css
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/msdescription.css	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/msdescription.css	(revision 728)
@@ -0,0 +1,638 @@
+/* original from Matthew Driscoll for editing
+   
+   edited by Sebastian Rahtz March 2009
+   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
+}
+msDesc>msIdentifier {
+    display: block;
+    font-size: 26pt;
+    line-height: 28pt;
+    color: #ad1010
+}
+msIdentifier country {
+    display: none
+}
+msIdentifier settlement {
+    display: none
+}
+msIdentifier repository {
+    display: none
+}
+msIdentifier altIdentifier {
+    display: none
+}
+msName[type="nickname"]:before {
+    content: "(\201C"
+}
+msName[type="nickname"]:after {
+    content: "\201D)"
+}
+head, msContents, history, additional, seal {
+    padding-top: 3pt;
+    padding-bottom: 2pt;
+    display: block
+}
+physDesc, supportDesc, objectDesc, layoutDesc, decoDesc, sealDesc {
+    display: block;
+    margin-bottom: 4pt;
+}
+physDesc:before {
+    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%
+}
+
+head {
+    font-size: 16pt;
+    line-height: 19pt
+}
+title {
+    display: inline;
+}
+head title {
+    font-style: italic
+}
+head>title:after {
+    content: ". "
+}
+head>origPlace:after {
+    content: ", "
+}
+head>origDate:after {
+    content: "."
+}
+head>textLang:after {
+    content: "."
+}
+head note {
+    display: block;
+    padding-top: 10pt;
+    font-size: 13pt
+}
+msItem[n]:before {
+    font-weight: 600;
+    content: attr(n) ". "
+}
+msContents:before {
+    content: "Contents:";
+    font-weight: 600;
+    font-variant: small-caps;
+    font-size: 120%
+}
+msItem {
+    display: block;
+    margin-left: 10pt
+}
+msItem>msItem {
+    display: block;
+    margin-left: 15pt
+}
+msItem[n]>locus:before {
+    content: "("
+}
+msItem[n]>locus:after {
+    content: ")"
+}
+msItem>title {
+    font-weight: 600;
+    font-size: 100%;
+    letter-spacing: 1px
+}
+msItem>title:after {
+    content: ". "
+}
+rubric {
+    display: block
+}
+rubric:before {
+    content: "Rubric: \201C"
+}
+rubric:after {
+    content: "\201D "
+}
+incipit {
+    display: block
+}
+incipit:before {
+    content: "Incipit: \201C"
+}
+incipit:after {
+    content: "\201D "
+}
+explicit {
+    display: block
+}
+explicit:before {
+    content: "Explicit: \201C"
+}
+explicit:after {
+    content: "\201D "
+}
+incipit[defective="yes"]:before {
+    content: "Begins: \201C"
+}
+explicit[defective="yes"]:before {
+    content: "Ends: \201C"
+}
+rubric[type="final"]:before {
+    content: "Final rubric: \201C"
+}
+rubric[type="final"]:after {
+    content: "\201D "
+}
+colophon {
+    display: block
+}
+colophon:before {
+    content: "Colophon: \201C"
+}
+colophon:after {
+    content: "\201D "
+}
+msItem>textLang {
+    display: block
+}
+msItem>textLang:before {
+    content: "Language of text: "
+}
+msItem>textLang:after {
+    content: "."
+}
+history origin {
+    display: block
+}
+history origin:before {
+    content: "Origin:";
+    font-weight: bold
+}
+history provenance:before {
+    content: "Provenance: ";
+    font-weight: bold
+}
+history provenance {
+    display: block
+}
+history acquisition:before {
+    content: "Acquisition: ";
+    font-weight: bold
+}
+history acquisition {
+    display: block
+}
+msItem>listBibl {
+    display: block;
+    list-style-type: none;
+    margin-left: 20pt
+}
+msItem>listBibl>bibl {
+    display: list-item;
+    margin-left: 30pt
+}
+msItem>listBibl:before {
+    content: "Text editions:";
+    display: block;
+    font-weight: 600
+}
+msItem>bibl {
+    display: block;
+    margin-left: 20pt
+}
+msItem>bibl:before {
+    content: "Text edition: ";
+    font-weight: 600
+}
+msItem>listBibl>bibl:after {
+    content: "."
+}
+author:after {
+    content: ", "
+}
+bibl>editor:after {
+    content: ", ";
+    text-align: left
+}
+bibl title[level="m"] {
+    font-style: italic;
+    font-weight: normal;
+    font-size: 100%
+}
+bibl title[level="j"] {
+    font-style: italic;
+    font-weight: normal;
+    font-size: 100%
+}
+bibl title[level="s"] {
+    font-style: normal;
+    font-weight: normal;
+    font-size: 100%
+}
+bibl title[level="a"] {
+    font-style: normal;
+    font-weight: normal;
+    font-size: 100%
+}
+bibl title[level="a"]:before {
+    content: " \201C"
+}
+bibl title[level="a"]:after {
+    content: "\201D, "
+}
+bibl title[level="s"]:before {
+    content: ", "
+}
+msItem bibl title {
+    font-style: italic
+}
+biblScope[type="pages"]:before {
+    content: ", pp. "
+}
+imprint:before {
+    content: "("
+}
+imprint:after {
+    content: ")"
+}
+pubPlace:after {
+    content: ","
+}
+bibl>note:before {
+    content: " ("
+}
+bibl>note:after {
+    content: ")"
+}
+additional>listBibl>bibl:after {
+    content: "."
+}
+q:before {
+    content: "\201C"
+}
+q:after {
+    content: "\201D"
+}
+q q:before {
+    content: "ï¿½"
+}
+q q:after {
+    content: "ï¿½"
+}
+q[type="block"] {
+    display: block;
+    margin-left: 15pt;
+    font-size: 12pt;
+    line-height: 14pt
+}
+q[type="block"]:before {
+    content: ""
+}
+q[type="block"]:after {
+    content: ""
+}
+msItem note:before {
+    content: " ("
+}
+msItem note:after {
+    content: ")"
+}
+form {
+    display: block
+}
+form:before {
+    content: "Form: ";
+    font-weight: bold
+}
+support {
+    display: block
+}
+support:before {
+    content: "Support: ";
+    font-weight: bold
+}
+extent {
+    display: block
+}
+extent:before {
+    content: "No. of leaves: ";
+    font-weight: bold;
+    display: block
+}
+collation {
+    display: block
+}
+collation:before {
+    content: "Collation: ";
+    font-weight: bold
+}
+layout {
+    display: block
+}
+layout:before {
+    content: "Layout: ";
+    font-weight: bold
+}
+msWriting {
+    display: block
+}
+msWriting:before {
+    content: "Script: ";
+    font-weight: bold
+}
+musicNotation {
+    display: block
+}
+musicNotation:before {
+    content: "Musical notation: ";
+    font-weight: bold
+}
+decoDesc:before {
+    content: "Decoration: ";
+    font-weight: bold
+}
+decoNote {
+    display: list-item;
+    margin-left: 16pt;
+}
+bindingDesc {
+    display: block
+}
+bindingDesc:before {
+    content: "Binding: ";
+    font-weight: bold
+}
+foliation {
+    display: block
+}
+foliation:before {
+    content: "Foliation: ";
+    font-weight: bold
+}
+additions {
+    display: block
+}
+additions:before {
+    content: "Additions: ";
+    font-weight: bold
+}
+condition {
+    display: block
+}
+condition:before {
+    content: "Condition: ";
+    font-weight: bold
+}
+dimensions[type="leaf"] {
+    display: block
+}
+dimensions[type="leaf"]:before {
+    content: "Size of leaves: ";
+    font-weight: bold;
+    display: block
+}
+dimensions height:after {
+    content: " x "
+}
+dimensions:after {
+    content: " mm."
+}
+dimensions depth:before {
+    content: " x "
+}
+recordHist {
+    display: block
+}
+recordHist:before {
+    content: "Record history: ";
+    font-weight: bold
+}
+availability {
+    display: block
+}
+availability:before {
+    content: "Availability: ";
+    font-weight: bold
+}
+custodialHist {
+    display: block
+}
+custodialHist:before {
+    content: "Custodial history: ";
+    font-weight: bold
+}
+custEvent {
+    display: list-item;
+    list-style-type: none;
+    margin-left: 30pt
+}
+surrogates {
+    display: block
+}
+surrogates:before {
+    content: "Surrogates: ";
+    font-weight: bold
+}
+surrogates>p>listBibl {
+    display: block;
+}
+surrogates>p>listBibl>bibl {
+    display: list-item;
+    margin-left: 30pt
+}
+title[type="gmd"]:before {
+    content: "Format: "
+}
+title[type="gmd"]:after {
+    content: ". "
+}
+surrogates idno:before {
+    content: "ID no.: "
+}
+surrogates idno:after {
+    content: ". "
+}
+surrogates bibl date:before {
+    content: "Date created: "
+}
+accMat {
+    display: block
+}
+accMat:before {
+    content: "Accompanying material: ";
+    font-weight: bold
+}
+additional:before {
+    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
+}
+additional>listBibl:before {
+    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
+}
+list {
+    display: block;
+}
+list item {
+    display: list-item;
+    margin-left: 30pt
+}
+q item {
+    list-style-type: none
+}
+item locus:after {
+    content: ": "
+}
+pb:before {
+    font-weight: 600;
+    content: "|" attr(n) "|"
+}
+lb[n] {
+    display: list-item;
+    list-style-type: none;
+    margin-left: 30pt;
+}
+lb[type="hyphenated"]:before {
+    content: "-|"
+}
+lb[n]:after {
+    content: attr(n);
+}
+supplied[reason="damage"]:before {
+    content: "<"
+}
+supplied[reason="damage"]:after {
+    content: ">"
+}
+supplied[reason="illegible"]:before {
+    content: "["
+}
+supplied[reason="illegible"]:after {
+    content: "]"
+}
+supplied[reason="omitted"]:before {
+    content: "\27E8"
+}
+supplied[reason="omitted"]:after {
+    content: "\27E9"
+}
+gap:before {
+    content: " [...]"
+}
+expan {
+    font-style: italic
+}
+foreign {
+    font-style: italic
+}
+ref {
+    font-style: italic
+}
+hi[rend="sup"] {
+    font-size: .83em;
+    vertical-align: super
+}
+hi[rend="underline"] {
+    text-decoration: underline
+}
+hi[rend="bold"] {
+    font-weight: bold
+}
+hi[rend="italic"] {
+    font-style: italic
+}
+del[rend="overstrike"] {
+    text-decoration: line-through
+}
+note>title {
+    font-style: italic
+}
+p {
+    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
+}
+lg {
+    display: block;
+    margin-bottom: 10pt
+}
+l {
+    display: block
+}
+msPart {
+    display: block;
+    margin-top: 15pt;
+    margin-bottom: 15pt
+}
+msPart idno {
+    display: block;
+    font-size: 16pt
+}
+hi[rend="scap"] {
+    font-size: 65%
+}
+hi[rend="lig"] {
+    letter-spacing: -4px
+}
+publisher {
+    display: inline;
+}
+choice > abbr {
+    display: none;
+}
+choice > orig {
+    display: none;
+}
+choice > expan {
+    font-style: normal
+}
+expan > ex:before {
+    content: "(";
+}
+expan > ex:after {
+    content: ")";
+}
+
+placeName, persName, name, genName, geogName, roleName {
+        display: inline;
+}
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/msdescription.css
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/textcrit.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/textcrit.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/textcrit.xsl	(revision 728)
@@ -0,0 +1,97 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/textcrit.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/core.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/core.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/core.xsl	(revision 728)
@@ -0,0 +1,879 @@
+<?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/ 
+
+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.
+</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 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 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 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>
+
+
+   <!-- 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>
+
+   <!-- 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: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>
+
+   <xsl:template match="tei:nameLink">
+</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: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: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: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:byline">
+     <xsl:call-template name="makeSpan"/>
+   </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: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>
+
+   <!-- 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>
+
+  <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/core.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/functions.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/functions.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/functions.xsl	(revision 728)
@@ -0,0 +1,305 @@
+<?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:
+
+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.
+</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 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 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>
+
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/functions.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/header.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/header.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/header.xsl	(revision 728)
@@ -0,0 +1,407 @@
+<?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/ 
+
+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.
+</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: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: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>
+
+   <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[@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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/header.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/odds.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/odds.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/odds.xsl	(revision 728)
@@ -0,0 +1,255 @@
+<?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>
+
+      <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/ 
+
+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.
+</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="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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/odds.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/verbatim.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/verbatim.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/verbatim.xsl	(revision 728)
@@ -0,0 +1,711 @@
+<?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:
+
+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.
+</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/verbatim.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/linking.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/linking.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/linking.xsl	(revision 728)
@@ -0,0 +1,396 @@
+<?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:
+
+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.
+</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 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 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 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] 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>
+         <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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/linking.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/i18n.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/i18n.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/i18n.xsl	(revision 728)
@@ -0,0 +1,163 @@
+<?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:
+
+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.
+</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>
+
+  <xsl:variable name="i18n"
+		select="document('../i18n.xml',document(''))"/>
+
+  <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">
+      <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/i18n.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/tei-param.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/tei-param.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/tei-param.xsl	(revision 728)
@@ -0,0 +1,332 @@
+<?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:
+
+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.
+</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="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="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="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>
+      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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/tei-param.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/tei.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/tei.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/tei.xsl	(revision 728)
@@ -0,0 +1,149 @@
+<?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:
+
+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.
+</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: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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/tei.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/msdescription.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/msdescription.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/msdescription.xsl	(revision 728)
@@ -0,0 +1,465 @@
+<?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:
+
+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.
+</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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/msdescription.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/figures.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/figures.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/figures.xsl	(revision 728)
@@ -0,0 +1,279 @@
+<?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/ 
+
+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.
+</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: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: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: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: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: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: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: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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/figures.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/tagdocs.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/tagdocs.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/tagdocs.xsl	(revision 728)
@@ -0,0 +1,2704 @@
+<?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:
+
+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.
+</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:text>odd_label</xsl:text>
+          <xsl:if test="@status">
+            <xsl:text> status_</xsl:text>
+            <xsl:value-of select="@status"/>
+          </xsl:if>
+        </xsl:attribute>
+        <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: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:text>odd_label</xsl:text>
+          <xsl:if test="@status">
+            <xsl:text> status_</xsl:text>
+            <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:text>odd_value</xsl:text>
+        </xsl:attribute>
+        <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:text>odd_label</xsl:text>
+              </xsl:attribute>
+              <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">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: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: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:text>odd_label</xsl:text>
+        </xsl:attribute>
+        <xsl:element namespace="{$outputNS}" name="{$hiName}">
+          <xsl:attribute name="xml:lang">
+            <xsl:value-of select="$documentationLanguage"/>
+          </xsl:attribute>
+          <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: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: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: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: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: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:text>wovenodd-col2</xsl:text>
+            </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: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: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: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:text>wovenodd-col1</xsl:text>
+              </xsl:attribute>
+              <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">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:text>wovenodd-col1</xsl:text>
+            </xsl:attribute>
+            <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">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:text>wovenodd-col1</xsl:text>
+              </xsl:attribute>
+              <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">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: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: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:text>wovenodd-col2</xsl:text>
+            </xsl:attribute>
+            <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>wovenodd-col1</xsl:text>
+              </xsl:attribute>
+              <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">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:text>wovenodd-col1</xsl:text>
+            </xsl:attribute>
+            <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">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:text>wovenodd-col1</xsl:text>
+            </xsl:attribute>
+            <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">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:text>wovenodd-col1</xsl:text>
+            </xsl:attribute>
+            <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">
+                  <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:text>wovenodd-col1</xsl:text>
+        </xsl:attribute>
+        <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">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: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:text>wovenodd-col1</xsl:text>
+        </xsl:attribute>
+        <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: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: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:text>specList-</xsl:text>
+        <xsl:value-of select="local-name(.)"/>
+      </xsl:attribute>
+      <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: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:with-param>
+                  <xsl:with-param name="type">
+                    <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: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: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: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:text>Attribute</xsl:text>
+        </xsl:attribute>
+        <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: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:text>wovenodd-col1</xsl:text>
+            </xsl:attribute>
+            <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">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: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: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:text>wovenodd-col1</xsl:text>
+                </xsl:attribute>
+                <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">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:text>wovenodd-col1</xsl:text>
+        </xsl:attribute>
+        <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">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:text>moduleSpec</xsl:text>
+      </xsl:attribute>
+      <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: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: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: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: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:text>wovenodd-col1</xsl:text>
+          </xsl:attribute>
+          <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">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:text>odd_label</xsl:text>
+            </xsl:attribute>
+            <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">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: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: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: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>odd_label</xsl:text>
+        </xsl:attribute>
+        <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: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: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: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: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:text>defaultVal</xsl:text>
+              </xsl:attribute>
+              <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>wovenodd-col1</xsl:text>
+          </xsl:attribute>
+          <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">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: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="tei:altIdent">
+                  <xsl:value-of select="tei:altIdent"/>
+                </xsl:when>
+                <xsl:otherwise>
+                  <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">
+                  <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: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">
+              <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: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">
+              <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: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}">
+          <xsl:text>showmembers</xsl:text>
+          <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: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: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: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: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: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: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: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: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="getSpecURL">
+                  <xsl:with-param name="name">
+                    <xsl:value-of select="$name"/>
+                  </xsl:with-param>
+                  <xsl:with-param name="type">
+                    <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: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: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: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: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: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: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: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: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: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: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: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">
+	      <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:attribute>
+	  </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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/tagdocs.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/textstructure.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/textstructure.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/textstructure.xsl	(revision 728)
@@ -0,0 +1,102 @@
+<?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/ 
+
+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.
+</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>
+
+  <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>
+
+
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/common2/textstructure.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/dtd/build-to.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/dtd/build-to.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/dtd/build-to.xml	(revision 728)
@@ -0,0 +1,91 @@
+<?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"/>
+
+  <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>
+
+</project>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/dtd/build-to.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2json.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2json.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2json.xsl	(revision 728)
@@ -0,0 +1,270 @@
+<?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:
+
+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.
+</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: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>"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: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="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="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="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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2json.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/extract-schemaSpec-ident.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/extract-schemaSpec-ident.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/extract-schemaSpec-ident.xsl	(revision 728)
@@ -0,0 +1,30 @@
+<?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                                       -->
+<!--                                                                        -->
+<!-- ********************************************************************** -->
+<xsl:stylesheet xmlns:tei="http://www.tei-c.org/ns/1.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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/extract-schemaSpec-ident.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2dtd.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2dtd.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2dtd.xsl	(revision 728)
@@ -0,0 +1,1644 @@
+<?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"/>
+
+  <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:
+
+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.
+</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;
+	%file.</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>;[
+	&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;
+	%file.</xsl:text>
+            <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
+	    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: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 name="typewriter">
+    <xsl:param name="text"/>
+  </xsl:template>
+
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2dtd.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2relax.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2relax.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2relax.xsl	(revision 728)
@@ -0,0 +1,583 @@
+<?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:
+
+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.
+</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: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: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>
+
+  <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="tei:constraintSpec[@scheme='schematron']">
+      <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="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>
+
+  <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="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>
+
+<!-- and again -->
+
+  <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: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: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="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: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="@*|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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2relax.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/extract-sch.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/extract-sch.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/extract-sch.xsl	(revision 728)
@@ -0,0 +1,161 @@
+<?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:
+
+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.
+</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="NS" 
+	   match="sch:ns"
+	   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: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"/>
+			   </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:text>tei:</xsl:text>
+	<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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/extract-sch.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/table2list.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/table2list.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/table2list.xsl	(revision 728)
@@ -0,0 +1,106 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/table2list.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2lite.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2lite.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2lite.xsl	(revision 728)
@@ -0,0 +1,518 @@
+<?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:
+
+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.
+</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 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 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="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:text>refdoc</xsl:text>
+      </xsl:attribute>
+      <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>
+
+-->
+  <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']  
+				   | 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)]  
+				   | 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: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>
+
+  <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: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="makeSpan">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="tei:listRef" mode="weave"/>
+
+  <xsl:template match="tei:ref" mode="weave" priority="9">
+    <xsl:copy-of select="."/>
+  </xsl:template>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2lite.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/guidelines.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/guidelines.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/guidelines.xsl	(revision 728)
@@ -0,0 +1,1264 @@
+<?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: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:text> </xsl:text>
+                <xsl:call-template name="makeGloss">
+                  <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"/>
+                                </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: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:text>miniTOC miniTOC_left</xsl:text>
+            </xsl:attribute>
+            <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: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">
+              <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">
+            <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>
+
+  <!-- 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"/>
+          </xsl:attribute>
+          <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: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: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>
+
+      <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>
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/guidelines.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/build-to.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/build-to.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/build-to.xml	(revision 728)
@@ -0,0 +1,67 @@
+<?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"/>
+
+  <property name="odd2oddxsl"      value="../odds2/odd2odd.xsl"/>
+  <property name="odd2litexsl"     value="../odds2/odd2lite.xsl"/>
+
+   <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="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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/build-to.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/teiodds.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/teiodds.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/teiodds.xsl	(revision 728)
@@ -0,0 +1,2047 @@
+<?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:
+
+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.
+</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: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: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: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: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>
+
+  <!-- lookup table of element contents, and templates to access the result -->
+  <xsl:key match="Contains" name="ELEMENTPARENTS" use="."/>
+
+  <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 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="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: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: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="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: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>
+
+  <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: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: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: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>
+
+  <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: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: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: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: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>
+
+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='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: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:template match="tei:classSpec" mode="tangleadd">
+    <xsl:apply-templates mode="tangleadd"/>
+  </xsl:template>
+
+
+  <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="text()" mode="doc">
+    <xsl:value-of select="."/>
+  </xsl:template>
+
+  <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: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: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: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: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: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: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: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>
+
+  <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 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/tei:desc"/>
+
+  <xsl:template match="tei:classSpec/tei:desc"/>
+
+  <xsl:template match="tei:macroSpec/tei:desc"/>
+
+  <xsl:template match="tei:elementSpec/tei:gloss"/>
+
+  <xsl:template match="tei:classSpec/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: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:template match="tei:macroSpec/@ident"/>
+
+  <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: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>
+                    <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>
+
+  <!-- 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>
+
+  <!-- end expand RELAX NG section -->
+
+  <xsl:template match="tei:remarks" mode="tangle"/>
+
+
+  <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: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 match="tei:list" mode="copyrighttext">
+    <xsl:text>&#10;</xsl:text>
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <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: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="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="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: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:with-param>
+                <xsl:with-param name="type">
+                  <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: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='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: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="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"/>
+
+  <xsl:template match="tei:altIdent"/>
+
+  <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>
+
+  <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 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="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="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>
+
+  <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: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:text>-constraint-</xsl:text>
+            <xsl:value-of select="ancestor::tei:constraintSpec/@ident"/>
+            <xsl:if test="count(../s:report|s:assert) &gt;1">
+              <xsl:number/>
+            </xsl:if>
+          </xsl:attribute>
+          <rule>
+            <xsl:attribute name="context">
+              <xsl:text>tei:</xsl:text>
+              <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:text>-constraint-</xsl:text>
+            <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">
+              <xsl:text>tei:</xsl:text>
+              <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: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="*" 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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/teiodds.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/RngToRnc.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/RngToRnc.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/RngToRnc.xsl	(revision 728)
@@ -0,0 +1,1502 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--*- 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)"/>
+      </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: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="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:transform>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/RngToRnc.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2html.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2html.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2html.xsl	(revision 728)
@@ -0,0 +1,217 @@
+<?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"/>
+
+  <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/ 
+
+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.
+</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>
+
+  <!-- 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 name="copyrightStatement"/>
+
+  <xsl:template match="processing-instruction()"/>
+
+  <xsl:template name="headingNumberSuffix">
+    <xsl:text> </xsl:text>
+  </xsl:template>
+
+  <xsl:template match="tei:divGen[@type='toc']">
+    <xsl:call-template name="mainTOC"/>
+  </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='index']"/>
+
+  <xsl:template name="logoPicture">
+    <img src="jaco001d.gif" alt="" width="180"/>
+  </xsl:template>
+
+  <xsl:template name="hdr2">
+    <xsl:comment>no nav </xsl:comment>
+  </xsl:template>
+
+  <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>
+
+        <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: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="generateSubTitle">
+    <xsl:value-of select="tei:head"/>
+  </xsl:template>
+
+  <xsl:template name="printLink"/>
+
+  <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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2html.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2odd.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2odd.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2odd.xsl	(revision 728)
@@ -0,0 +1,2351 @@
+<?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:
+
+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.
+</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-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" 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-MODULE_MEMBERS_MODEL" match="tei:classSpec" use="@module"/>
+
+  <xsl:key name="odd2odd-SCHEMASPECS" match="tei:schemaSpec" use="@ident"/>
+
+  <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"/>
+
+   <!-- all of these use a combination of @ident _and_ @ns (where
+   present), in case of duplication of names across schemes -->
+
+  <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="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:variable name="top" select="/"/>
+
+
+  <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: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: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>
+
+
+  <!-- ******************* Pass 1, follow schemaSpec ********************************* -->
+  <xsl:template match="@*|processing-instruction()|text()" mode="odd2odd-pass1">
+    <xsl:copy-of select="."/>
+  </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(.)"/>
+
+    <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: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: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:apply-templates mode="odd2odd-justcopy" select="tei:moduleRef[@url]"/>
+
+      </xsl:copy>
+
+    </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 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: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="*" 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: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 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="@*|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="*" 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: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:text>derived-module-</xsl:text>
+	    <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: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: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"/>
+
+    <!-- 
+    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"/>
+
+    <!-- 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="$New/@usage">
+              <xsl:value-of select="$New/@usage"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <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: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: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: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 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="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="@*|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: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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/odd2odd.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/extract-isosch.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/extract-isosch.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/extract-isosch.xsl	(revision 728)
@@ -0,0 +1,173 @@
+<?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
+					 #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/ 
+
+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.
+</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: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="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: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"/>
+			   </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:text>tei:</xsl:text>
+	<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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/extract-isosch.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/translate-odd.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/translate-odd.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/translate-odd.xsl	(revision 728)
@@ -0,0 +1,118 @@
+<?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>
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odds2/translate-odd.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/make-acdc.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/make-acdc.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/make-acdc.xsl	(revision 728)
@@ -0,0 +1,86 @@
+<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"
+>
+
+  <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: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: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: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>
+
+</XSL:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/make-acdc.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/dc.odd
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/dc.odd	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/dc.odd	(revision 728)
@@ -0,0 +1,29 @@
+<?oxygen RNGSchema="tei_odds.rnc" type="compact"?>
+<TEI xml:lang="en" xmlns="http://www.tei-c.org/ns/1.0" >
+   <teiHeader>
+      <fileDesc>
+         <titleStmt>
+            <title>Mapping TEI to Dublin Core</title>
+	    <author>Sebastian Rahtz</author>
+         </titleStmt>
+         <publicationStmt>
+	   <p> </p>
+	 </publicationStmt>
+         <sourceDesc>
+            <p>authored from scratch</p>
+         </sourceDesc>
+      </fileDesc>
+   </teiHeader>
+   <text>
+     <body>
+       <specGrp xml:id="dc">
+	 <elementSpec ident="publicationStmt" mode="change">
+	   <equiv filter="dc.xsl" mimeType="text/xsl" name="dc_publisher"/>
+	 </elementSpec>
+	 <elementSpec ident="keyword" mode="change">
+	   <equiv filter="dc.xsl" mimeType="text/xsl" name="dc_subject"/>
+	 </elementSpec>
+       </specGrp>
+     </body>
+   </text>
+</TEI>
Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/dc.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/dc.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/dc.xsl	(revision 728)
@@ -0,0 +1,76 @@
+<?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: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_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_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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/dc.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/Makefile
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/Makefile	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/Makefile	(revision 728)
@@ -0,0 +1,10 @@
+default: build compile 
+
+build:
+	saxon -o:rdf.expanded -s:rdf.odd -xsl:/usr/share/xml/tei/stylesheet/odds/odd2odd.xsl
+
+compile:
+	saxon rdf.expanded  make-acdc.xsl > tei2rdf.xsl 
+
+clean:
+	-rm rdf.expanded *.rdf
Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/build-to.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/build-to.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/build-to.xml	(revision 728)
@@ -0,0 +1,74 @@
+<?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"/>
+
+  <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>
+
+</project>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/build-to.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/rdf.odd
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/rdf.odd	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/rdf.odd	(revision 728)
@@ -0,0 +1,30 @@
+<TEI xml:lang="en" xmlns="http://www.tei-c.org/ns/1.0" >
+   <teiHeader>
+      <fileDesc>
+         <titleStmt>
+            <title>Mapping TEI to RDF</title>
+	    <author>Sebastian Rahtz</author>
+         </titleStmt>
+         <publicationStmt>
+	   <p> </p>
+	 </publicationStmt>
+         <sourceDesc>
+            <p>authored from scratch</p>
+         </sourceDesc>
+      </fileDesc>
+   </teiHeader>
+   <text>
+     <body>
+       <schemaSpec ident="rdf" start="TEI"> 
+	 <moduleRef key="header"/> 
+	 <moduleRef key="core"/> 
+	 <moduleRef key="tei"/> 
+	 <moduleRef key="textstructure"/> 
+	 <moduleRef key="namesdates"/> 
+	 <moduleRef key="linking"/> 
+	 <specGrpRef target="crm.odd#crm"/>
+	 <specGrpRef target="crm.odd#properties"/>
+       </schemaSpec> 
+     </body>
+   </text>
+</TEI>
Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/rdf.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/rdf.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/rdf.xsl	(revision 728)
@@ -0,0 +1,409 @@
+<?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
+    service ox-service">
+
+  <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:key name="persons" match="persName" use="@ref"/>
+
+  <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:text>group</xsl:text>
+	      <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')"/>
+	      <xsl:text>group</xsl:text>
+	      <xsl:value-of select="substring-after(@href,'service')"/>
+	    </xsl:attribute>
+	</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:attribute>
+      </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: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>
+
+-->
+
+  <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="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>
+		<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="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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/rdf.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/tei2rdf.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/tei2rdf.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/tei2rdf.xsl	(revision 728)
@@ -0,0 +1,114 @@
+<?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>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/tei2rdf.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/crm.odd
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/crm.odd	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/crm.odd	(revision 728)
@@ -0,0 +1,102 @@
+<?oxygen RNGSchema="tei_odds.rnc" type="compact"?>
+<TEI xml:lang="en" xmlns="http://www.tei-c.org/ns/1.0" >
+   <teiHeader>
+      <fileDesc>
+         <titleStmt>
+            <title>Mapping TEI to CIDOC CRM</title>
+	    <author>Sebastian Rahtz</author>
+         </titleStmt>
+         <publicationStmt>
+	   <p> </p>
+	 </publicationStmt>
+         <sourceDesc>
+            <p>authored from scratch</p>
+         </sourceDesc>
+      </fileDesc>
+   </teiHeader>
+   <text>
+     <body>
+       <specGrp xml:id="crm">
+<!--
+msDesc
+div[@type='inscription']
+-->
+
+	 <elementSpec ident="TEI" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl" name="TEI"/>
+	 </elementSpec>
+
+	 <elementSpec ident="title" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl" name="E35"
+		  uri="http://erlangen-crm.org/current/E35_Title"/>
+	 </elementSpec>
+
+	 <elementSpec ident="author" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl" name="E65"
+		  uri="http://erlangen-crm.org/current/E65_creation"/>
+	 </elementSpec>
+
+	 <elementSpec ident="teiHeader" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl" name="E31" uri="http://erlangen-crm.org/current/E31_Document"/>
+	 </elementSpec>
+
+	 <elementSpec ident="person" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl" name="E21" uri="http://erlangen-crm.org/current/E21_Person"/>
+	 </elementSpec>
+	 <elementSpec ident="place" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl" name="E53" uri="http://erlangen-crm.org/current/E53_Place"/>
+	 </elementSpec>
+	 <elementSpec ident="persName" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl" name="E82" uri="http://erlangen-crm.org/current/E82_Actor_Appellation"/>
+	 </elementSpec>
+
+	 <elementSpec ident="placeName" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl" name="E48"
+		 uri="http://erlangen-crm.org/current/E48_Place_Name"/>
+	 </elementSpec>
+
+	 <elementSpec ident="ab" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl" name="anonblock"/>
+	 </elementSpec>
+       </specGrp>
+
+       <specGrp xml:id="properties">
+	 <elementSpec ident="date" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl" name="E52" uri="http://erlangen-crm.org/current/E52_Time-Span"/>
+	 </elementSpec>
+	 <elementSpec ident="event" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl" name="E5" uri="http://erlangen-crm.org/current/E5_Event"/>
+	 </elementSpec>
+	 <elementSpec ident="org" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl" name="E74" uri="http://erlangen-crm.org/current/E74_Group"/>
+	 </elementSpec>
+	 <elementSpec ident="residence" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl" name="P74" uri="http://erlangen-crm.org/current/P74_has_current_or_former_residence"/>
+	 </elementSpec>
+	 <elementSpec ident="birth" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl" name="E67" uri="http://erlangen-crm.org/current/E67_Birth"/>
+	 </elementSpec>
+	 <elementSpec ident="death" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl" name="E69" uri="http://erlangen-crm.org/current/E69_Death"/>
+	 </elementSpec>
+	 <elementSpec ident="geo" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl" name="E47"
+		  uri="http://erlangen-crm.org/current/E47_Place_Spatial_Coordinates"/>
+	 </elementSpec>
+	 <elementSpec ident="name" mode="change">
+	   <equiv filter="crm.xsl" mimeType="text/xsl"
+		  name="teiname"/>
+	   <attList>
+	     <attDef ident="ref" mode="change" usage="req"/>
+	   </attList>
+	 </elementSpec>
+	 <classSpec ident="att.global" mode="change">
+	   <attList>
+	     <attDef ident="xml:id" mode="change" usage="req"/>
+	   </attList>
+	 </classSpec>
+       </specGrp>
+
+     </body>
+   </text>
+</TEI>
Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/crm.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/crm.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/crm.xsl	(revision 728)
@@ -0,0 +1,661 @@
+<?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: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:key name="Idents" 
+	   match="crm:P87_is_identified_by"
+	   use="crm:E48_Place_Name/@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:template name="processAll">
+    <xsl:call-template name="doit"/>
+  </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>
+
+  <!-- clean up pass -->
+
+  <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="rdf2"/>
+
+  <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="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="*" 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>
+
+   <!-- 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="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="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="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="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="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="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="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 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="E52">
+    <xsl:choose>
+      <xsl:when test="parent::residence"/>
+
+      <xsl:when test="parent::creation"/>
+
+      <xsl:when test="parent::p"/>
+
+      <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="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="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::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="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="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: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
+			      parent::place[@xml:id]">
+		<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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rdf/crm.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/bibtex/teitobib.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/bibtex/teitobib.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/bibtex/teitobib.xsl	(revision 728)
@@ -0,0 +1,176 @@
+<?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:key name="B" match="biblStruct" use="1"/>
+    <xsl:strip-space elements="*"/>
+
+  <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: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="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="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="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="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='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="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="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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/bibtex/teitobib.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/core.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/core.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/core.xsl	(revision 728)
@@ -0,0 +1,2649 @@
+<?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:
+
+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.
+</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: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:text>bibl</xsl:text>
+            <xsl:if test="@type">
+              <xsl:text> bibl-</xsl:text>
+              <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>
+
+  <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: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:call-template name="findRendition">
+                <xsl:with-param name="value">
+                  <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: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>
+              <xsl:when test="@rend='Alignc'">
+                <xsl:text>center</xsl:text>
+              </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:when>
+              <xsl:when test="@rend='indent'">
+                <xsl:text>indent1</xsl:text>
+              </xsl:when>
+              <xsl:when test="@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: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: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:text>note </xsl:text>
+            <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'
+	    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: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
+		      ($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"/>
+          </xsl:attribute>
+        </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: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:call-template name="findRendition">
+          <xsl:with-param name="value">
+            <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: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: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: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: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:attribute>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:attribute name="class">
+          <xsl:if test="not($class1='')">
+            <xsl:value-of select="$class1"/>
+            <xsl:text> </xsl:text>
+          </xsl:if>
+          <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"/>
+
+  <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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/core.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/header.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/header.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/header.xsl	(revision 728)
@@ -0,0 +1,120 @@
+<?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"
+                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:
+
+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.
+</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>
+
+  <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>Process element teiHeader</desc>
+   </doc>
+  <xsl:template match="tei:teiHeader"/>
+
+  <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/header.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/linking.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/linking.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/linking.xsl	(revision 728)
@@ -0,0 +1,560 @@
+<?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:
+
+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.
+</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
+			 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>
+
+  <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: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: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">
+	   <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'
+				 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
+				 ($ancestors &lt; number($splitLevel)) then 1 else
+				 $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>
+
+  </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:attribute>
+            </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:attribute>
+            </xsl:otherwise>
+        </xsl:choose>
+
+         <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 test="contains(@from,'id (')">
+               <xsl:text>#</xsl:text>
+               <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: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: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: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:value-of
+			       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>
+
+  <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>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/linking.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/oddprocessing.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/oddprocessing.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/oddprocessing.xsl	(revision 728)
@@ -0,0 +1,1189 @@
+<?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" >
+
+  <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/ 
+
+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.
+</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:text>pre</xsl:text>
+	<xsl:if test="not(*)">
+	  <xsl:text> cdata</xsl:text>
+	</xsl:if>
+	<xsl:choose>
+	  <xsl:when test="@valid='feasible'">
+	    <xsl:text> egXML_feasible</xsl:text>
+	  </xsl:when>
+	  <xsl:when test="@valid='false'">
+	    <xsl:text> egXML_invalid</xsl:text>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <xsl:text> egXML_valid</xsl:text>
+	  </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:text>oddSpec</xsl:text>
+      <xsl:if test="@status">
+	<xsl:text> status_</xsl:text>
+	<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: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: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:when>
+	    <xsl:otherwise>
+	      <xsl:text>ref-</xsl:text>
+	      <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: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"
+states[1]="element-b"
+states[2]="element-c"
+states[3]="element-d"
+states[4]="element-e"
+states[5]="element-f"
+states[6]="element-g"
+states[7]="element-h"
+states[8]="element-i"
+states[9]="element-j"
+states[10]="element-k"
+states[11]="element-l"
+states[12]="element-m"
+states[13]="element-n"
+states[14]="element-o"
+states[15]="element-p"
+states[16]="element-q"
+states[17]="element-r"
+states[18]="element-s"
+states[19]="element-t"
+states[20]="element-u"
+states[21]="element-v"
+states[22]="element-w"
+states[23]="element-x"
+states[24]="element-y"
+states[25]="element-z"
+
+function startUp() {
+
+}
+
+function hideallExcept(elm) {
+for (var i = 0; i &lt; states.length; i++) {
+ var layer;
+ if (layer = document.getElementById(states[i]) ) {
+  if (states[i] != elm) {
+    layer.style.display = "none";
+  }
+  else {
+   layer.style.display = "block";
+      }
+  }
+ }
+ var mod;
+ if ( mod = document.getElementById('byMod') ) {
+     mod.style.display = "none";
+ }
+}
+
+function showall() {
+ for (var i = 0; i &lt; states.length; i++) {
+   var layer;
+   if (layer = document.getElementById(states[i]) ) {
+      layer.style.display = "block";
+      }
+  }
+}
+
+function showByMod() {
+  hideallExcept('');
+  var mod;
+  if (mod = document.getElementById('byMod') ) {
+     mod.style.display = "block";
+     }
+}
+
+	</xsl:text>
+      </xsl:comment>
+    </script>
+  </xsl:template>
+
+  <xsl:template name="identifyElement">
+    <xsl:param name="id"/>
+    <xsl:attribute name="id">
+      <xsl:value-of select="$id"/>
+    </xsl:attribute>
+  </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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/oddprocessing.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/figures.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/figures.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/figures.xsl	(revision 728)
@@ -0,0 +1,537 @@
+<?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:
+
+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.
+</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:attribute>
+	  </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:attribute>
+	  </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:attribute>
+	  </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: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:attribute>
+	</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: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:text>figure </xsl:text>
+		<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: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: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>
+
+  <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:text>table</xsl:text>
+	   <xsl:if test="@align">
+	     <xsl:text> </xsl:text>
+	     <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: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: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:attribute>
+		</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: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:text>data:</xsl:text>
+            <xsl:value-of select="@mimetype"/>
+            <xsl:text>;base64,</xsl: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:template match="svg:*">
+      <xsl:copy-of select="."/>
+  </xsl:template>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/figures.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/textstructure.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/textstructure.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/textstructure.xsl	(revision 728)
@@ -0,0 +1,2935 @@
+<?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
+					 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:
+
+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.
+</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>
+         <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>
+
+  <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: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: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>
+         <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>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>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>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: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>
+
+  <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>
+
+  <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:if test="$topNavigationPanel='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: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>
+
+  <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>
+
+  <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>
+
+  <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:call-template name="generateLocalCSS"/>
+      
+  </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: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: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: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="."/>
+                  </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
+		  $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: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>
+
+  <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>
+            <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: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 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="$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: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:attribute>
+                  <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:attribute>
+	                 <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: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: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:choose>
+	   <xsl:when test="@type">
+	     <xsl:value-of select="@type"/>
+	   </xsl:when>
+	   <xsl:otherwise>
+	     <xsl:text>teidiv</xsl:text>
+	     <xsl:value-of select="$depth"/>
+	   </xsl:otherwise>
+         </xsl:choose>
+         <xsl:if test="@rend">
+	   <xsl:text> </xsl:text>
+	   <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: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>
+
+  <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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/textstructure.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/textcrit.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/textcrit.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/textcrit.xsl	(revision 728)
@@ -0,0 +1,139 @@
+<?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"
+
+                
+                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/ 
+
+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.
+</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"/>
+     <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>
+
+
+   <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/textcrit.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/build-to.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/build-to.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/build-to.xml	(revision 728)
@@ -0,0 +1,79 @@
+<?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>
+
+ <target name="dist" depends="setup,odd,notodd,transform,cleanup"/>
+
+  <target name="cleanup" unless="debug">  
+    <delete dir="${outputTempDir}"/>
+  </target>
+
+</project>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/build-to.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/corpus.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/corpus.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/corpus.xsl	(revision 728)
@@ -0,0 +1,180 @@
+<?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"
+                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:
+
+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.
+</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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/corpus.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/transcr.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/transcr.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/transcr.xsl	(revision 728)
@@ -0,0 +1,58 @@
+<?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: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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/transcr.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/dictionaries.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/dictionaries.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/dictionaries.xsl	(revision 728)
@@ -0,0 +1,56 @@
+<?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: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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/dictionaries.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/tei-param.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/tei-param.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/tei-param.xsl	(revision 728)
@@ -0,0 +1,786 @@
+<?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:
+
+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.
+</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)]"/>
+
+  <xsl:key name="TAGREND" match="tei:tagUsage[@render]" use="@gi"/>
+
+  <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>
+  <xsl:param name="class_ref">ref</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>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>Link back from footnotes to reference</desc>
+
+   </doc>
+  <xsl:param name="footnoteBackLink">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>
+  <xsl:param name="cssFileInclude">false</xsl:param>
+
+  <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="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="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="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 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="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;'))"/>
+	    </xsl:attribute>
+	  </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">
+
+	                    <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>
+
+                  </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>
+
+  <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>
+
+  <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="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="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="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="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="output" type="string">
+      <desc>An ID passed to the stylesheet to indicate which section to display</desc>
+
+   </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>
+  <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>
+  <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="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>
+
+  <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>
+  <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="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 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="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="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="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>
+  <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="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>
+  <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="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 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>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="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"/>
+
+   <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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/tei-param.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/tei.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/tei.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/tei.xsl	(revision 728)
@@ -0,0 +1,147 @@
+<?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:
+
+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.
+</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"/>
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/tei.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/verse.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/verse.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/verse.xsl	(revision 728)
@@ -0,0 +1,58 @@
+<?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: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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/verse.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/drama.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/drama.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/drama.xsl	(revision 728)
@@ -0,0 +1,275 @@
+<?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:
+
+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.
+</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: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: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>
+	<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>
+
+  <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>
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/drama.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/namesdates.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/namesdates.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/namesdates.xsl	(revision 728)
@@ -0,0 +1,73 @@
+<?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"
+                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:
+
+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.
+</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">
+      <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/namesdates.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/tagdocs.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/tagdocs.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/tagdocs.xsl	(revision 728)
@@ -0,0 +1,122 @@
+<?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">
+
+  <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/ 
+
+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.
+</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:text>pre</xsl:text>
+	<xsl:if test="not(*)">
+	  <xsl:text> cdata</xsl:text>
+	</xsl:if>
+	<xsl:choose>
+	  <xsl:when test="@valid='feasible'">
+	    <xsl:text> egXML_feasible</xsl:text>
+	  </xsl:when>
+	  <xsl:when test="@valid='false'">
+	    <xsl:text> egXML_invalid</xsl:text>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <xsl:text> egXML_valid</xsl:text>
+	  </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>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>
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/xhtml2/tagdocs.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rnc/build-to.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/rnc/build-to.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/rnc/build-to.xml	(revision 728)
@@ -0,0 +1,72 @@
+<?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"/>
+    
+</project>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/rnc/build-to.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/slides/teihtml-slides.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/slides/teihtml-slides.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/slides/teihtml-slides.xsl	(revision 728)
@@ -0,0 +1,532 @@
+<?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: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/ 
+
+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.
+</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 match="tei:docAuthor">
+      <div class="docAuthor">
+         <xsl:apply-templates/>
+      </div>
+  </xsl:template>
+
+  <xsl:template match="tei:docDate">
+      <div class="docDate">
+         <xsl:apply-templates/>
+      </div>
+  </xsl:template>
+
+  <xsl:template match="/tei:TEI">
+      <xsl:param name="slidenum">
+         <xsl:value-of select="$masterFile"/>0</xsl:param>
+
+      <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="mainslide"/>
+      </xsl:result-document>
+      <xsl:if test="$verbose='true'">
+         <xsl:message>Closing file <xsl:value-of select="$outName"/>
+         </xsl:message>
+      </xsl:if>
+
+      <xsl:for-each select="tei:text/tei:body">
+         <xsl:apply-templates select="tei:div|tei:div1"/>
+      </xsl:for-each>
+  </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="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="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) {
+    key = event;
+    key.which = key.keyCode;
+    }
+    switch (key.which) {
+    case 10: // return
+    case 32: // spacebar
+    case 34: // page down
+    case 39: // rightkey
+    // case 40: 
+    // downkey
+    document.location = "</xsl:text>
+            <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";
+    break;
+	}
+	}
+	function startup() {      
+	if (!isOp) {		
+	document.onkeyup = keys;
+	document.onclick = clicker;
+	}
+	}
+	
+	function clicker(e) {
+	var target;
+	if (window.event) {
+	target = window.event.srcElement;
+	e = window.event;
+	} else target = e.target;
+	if (target.href != null ) return true;
+	if (!e.which || e.which == 1) 
+	document.location = "</xsl:text>
+	           <xsl:value-of select="$next"/>
+	           <xsl:text>.xhtml";
+	}
+	
+	window.onload = startup;
+  </xsl:text>
+         </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: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: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 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="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="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="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 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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/slides/teihtml-slides.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/slides/teislides.css
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/slides/teislides.css	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/slides/teislides.css	(revision 728)
@@ -0,0 +1,252 @@
+/* teislides.css */
+
+body
+{
+    background: white;
+    font-family: Helvetica;
+    font-size: 24pt; 
+    color: black;
+}
+
+
+p {
+  margin-top: 6px;
+  margin-bottom: 6px;
+  }
+
+li {
+   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
+}
+
+div.docAuthor {
+    padding: 12pt;
+    font-size: 34pt;
+    color: green;
+}
+
+div.docDate {
+    padding: 12pt;
+    font-size:34pt;
+    color: blue;
+}
+
+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;
+}
+
+
+td
+{
+    color: black;
+    margin-left: 5%;
+    margin-right: 5%;
+    margin-top: 3%;
+}
+
+pre, code, tt, Code
+{
+    font-family:  monospace;
+    color: blue;
+    font-size: 20pt;
+}
+
+tt.url {
+    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;
+    }
+
+
+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;
+}
+
+address
+{
+    font-style:  normal;
+    font-family: cursive;
+    letter-spacing: .1em;
+    font-size: x-small;
+}
+
+a:link
+{
+    color:  blue;
+}
+
+
+a:visited
+{
+    color:  navy;
+}
+
+
+a:active
+{
+    color:  purple;
+    background: yellow;
+}
+
+
+a:hover
+{
+    color:  blue;
+    background:     silver;
+}
+
+.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%;
+	      }
+
+div.slidebottom-text {
+      font-style: italic;
+      font-size: 12pt;
+      float: right;
+}
+div.slidebottom-image {
+      float: left;
+}
+div.slidebottom {
+      clear:both;
+      height: 2%;
+      margin-top: 10pt;
+      border-top: 2px;
+      border-left: 0;
+      border-bottom: 0;
+      border-right: 0;
+	      }
+
+div.slidetop {
+      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%;
+}
+div.xref {
+    height: 10%;
+    float: right;
+    font-size: 12pt;
+    font-weight: bold;
+    margin-bottom: 12pt;
+}
+
+span.bottomright{
+    float: right;
+    margin-top:0;
+    margin-bottom: 8pt;
+}
+
+
+li.slidetoc {
+ display: inline;
+}	      
+
+li.slidetoc:before {
+  content: " * ";
+  font-style: italic;
+}
+
+
+
+img.simple {
+	   border-style: none;
+	   }
+img.inline {
+	   border-style: none;
+	   }
+img.right {
+	   float:right
+	   }
+img.left {
+	   float:left
+	   }
+.button {
+    font-family: Symbol;
+    padding: 2px;
+    font-style: bold;
+    border-style: outset;
+    background: blue; 
+    color: white ;
+}
+a.xreflink:link {
+		        text-decoration: none;		 	    
+	    }		 
+a.xreflink:visited {
+		        text-decoration: none;		 	    
+	    }		 

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/slides/teislides.css
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/slides/slides-common.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/slides/slides-common.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/slides/slides-common.xsl	(revision 728)
@@ -0,0 +1,206 @@
+<?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:
+
+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.
+</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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/slides/slides-common.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/slides/teilatex-slides.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/slides/teilatex-slides.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/slides/teilatex-slides.xsl	(revision 728)
@@ -0,0 +1,392 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+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>
+
+  <xsl:template name="verbatim-lineBreak">
+      <xsl:param name="id"/>
+      <xsl:text>\mbox{}\newline &#10;</xsl:text>
+  </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 name="latexBegin"/>
+
+  <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 match="tei:authority/tei:address/tei:addrLine">
+ \newline <xsl:apply-templates/>
+   </xsl:template> 
+
+   <xsl:template name="printTitleAndLogo">
+     \frame{\maketitle}
+   </xsl:template>
+
+   <xsl:template match="tei:divGen[@type='toc']">
+  \begin{frame} 
+  \frametitle{Outline} 
+  \tableofcontents
+  \end{frame}
+</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: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:div2|tei:div3">
+      <xsl:call-template name="makeFrame"/>
+   </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 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 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  
+  \begin{scriptsize}
+  \begin{longtable}</xsl:text>
+      <xsl:call-template name="makeTable"/>
+      <xsl:text>\end{longtable}
+  \end{scriptsize}</xsl:text>
+   </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>
+
+   <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>
+
+
+  <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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/slides/teilatex-slides.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/VERSION
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/VERSION	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/VERSION	(revision 728)
@@ -0,0 +1 @@
+6.7
Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/TEIP5.ott
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/TEIP5.ott
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/expandxsl.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/expandxsl.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/expandxsl.xsl	(revision 728)
@@ -0,0 +1,80 @@
+<?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"
+>
+
+<!--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
+-->
+
+<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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/expandxsl.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/fixgraphics.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/fixgraphics.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/fixgraphics.xsl	(revision 728)
@@ -0,0 +1,95 @@
+<?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:
+
+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.
+</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: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:for-each>
+	           </xsl:attribute>
+	        </xsl:if>
+      </xsl:copy>
+  </xsl:template>
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/fixgraphics.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/TypeDetection.xcu
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/TypeDetection.xcu	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/TypeDetection.xcu	(revision 728)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="TypeDetection" oor:package="org.openoffice.Office">
+ <node oor:name="Types">
+  <node oor:name="TEIP5">
+   <prop oor:name="Data" oor:type="xs:string">
+    <value>0,,doctype:TEI,,xml,0,</value>
+   </prop>
+   <prop oor:name="UIName" oor:type="xs:string">
+    <value xml:lang="en-US">TEI</value>
+   </prop>
+  </node>
+ </node>
+ <node oor:name="Filters">
+  <node oor:name="TEIP5">
+   <prop oor:name="UIName" oor:type="xs:string">
+    <value xml:lang="en-US">TEI</value>
+   </prop>
+   <prop oor:name="Data" oor:type="xs:string">
+    <value>0,TEIP5,com.sun.star.text.TextDocument,com.sun.star.comp.Writer.XmlFilterAdaptor,524355,com.sun.star.documentconversion.XSLTFilter;;com.sun.star.comp.Writer.XMLOasisImporter;com.sun.star.comp.Writer.XMLOasisExporter;vnd.sun.star.Package:TEIP5/teitoodt.xsl;vnd.sun.star.Package:TEIP5/odttotei.xsl;vnd.sun.star.Package:TEIP5/teilite.dtd;,0,vnd.sun.star.Package:TEIP5/TEIP5.ott</value>
+   </prop>
+  </node></node>
+</oor:component-data>
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/build-to.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/build-to.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/build-to.xml	(revision 728)
@@ -0,0 +1,104 @@
+<?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"/>
+
+  <path id="classpath">
+    <pathelement path="${java.class.path}"/>
+  </path>
+
+  <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="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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/build-to.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/build-from.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/build-from.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/build-from.xml	(revision 728)
@@ -0,0 +1,85 @@
+<?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"/>
+
+  <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="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="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="cleanup" unless="debug">
+    <delete dir="${outputTempDir}"/>
+  </target>
+
+</project>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/build-from.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/grouping.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/grouping.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/grouping.xsl	(revision 728)
@@ -0,0 +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:
+
+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.
+</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: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.
+
+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/
+-->
+

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/grouping.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/odttotei.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/odttotei.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/odttotei.xsl	(revision 728)
@@ -0,0 +1,1450 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+  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">
+
+    <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/ 
+
+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.
+</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:param name="debug">false</xsl:param>
+
+  <xsl:param name="dir">.</xsl:param>
+
+  <xsl:output encoding="utf-8" indent="yes"/>
+
+  <!--  <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: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="*" 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:attribute>
+	</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 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: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>
+
+  <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: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:choose>
+	      <xsl:when test="@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: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="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:when test="@text:style-name='Document Title'">
+        <title>
+          <xsl:apply-templates/>
+        </title>
+      </xsl:when>
+
+      <xsl:when test="@text:style-name='Author'">
+        <author>
+          <xsl:apply-templates/>
+        </author>
+      </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: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:template match="office:annotation/text:p" priority="100">
+    <note>
+        <xsl:apply-templates/>
+    </note>
+  </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>
+
+  <!-- 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: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>
+
+  <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 -->
+
+  <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: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: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: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: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: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:attribute>
+        <xsl:attribute name="colname">
+          <xsl:text>c</xsl:text>
+          <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>
+
+  <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/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-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: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:attribute>
+      </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"/>
+
+  <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">
+    <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:attribute>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </note>
+  </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: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 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>
+
+  <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>
+
+  <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: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">
+    <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:attribute>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="text:reference-mark-start"/>
+
+  <xsl:template match="text:reference-mark-end"/>
+
+  <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: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: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: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:text>id_</xsl:text>
+	<xsl:value-of select="@text:name"/>
+      </xsl:attribute>
+    </anchor>
+  </xsl:template>
+
+  <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:attribute>
+    </anchor>
+  </xsl:template>
+
+  <xsl:template match="text:bookmark">
+    <anchor>
+      <xsl:attribute name="xml:id">
+	<xsl:text>id_</xsl:text>
+	<xsl:value-of select="@text:name"/>
+      </xsl:attribute>
+    </anchor>
+  </xsl:template>
+  <!--
+These seem to have no obvious translation
+-->
+
+  <xsl:template match="text:endnotes-configuration"/>
+
+  <xsl:template match="text:file-name"/>
+
+  <xsl:template match="text:footnotes-configuration"/>
+
+  <xsl:template match="text:linenumbering-configuration"/>
+
+  <xsl:template match="text:list-level-style-bullet"/>
+
+  <xsl:template match="text:list-level-style-number"/>
+
+  <xsl:template match="text:list-style"/>
+
+  <xsl:template match="text:outline-level-style"/>
+
+  <xsl:template match="text:outline-style"/>
+
+  <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:*"> [[[UNTRANSLATED <xsl:value-of select="name(.)"/>: <xsl:apply-templates/>]]] </xsl:template>
+
+
+  <!-- sections of the OO format we don't need at present -->
+
+  <xsl:template match="office:automatic-styles"/>
+
+  <xsl:template match="office:font-decls"/>
+
+  <xsl:template match="office:meta"/>
+
+  <xsl:template match="office:script"/>
+
+  <xsl:template match="office:settings"/>
+
+  <xsl:template match="office:styles"/>
+
+  <xsl:template match="style:*"/>
+
+
+  <xsl:template match="dc:*">
+    <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-duration"/>
+
+  <xsl:template match="meta:generator"/>
+
+  <xsl:template match="meta:user-defined"/>
+
+  <!--
+<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:sequence-decl">
+  <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:section-source"/>
+
+
+<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 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="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="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>
+
+  <xsl:template match="tei:p[not(node())]" mode="pass1"/>
+
+  <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 -->
+
+
+  <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: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>
+
+  <!-- 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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/odttotei.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/teitoodt.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/teitoodt.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/teitoodt.xsl	(revision 728)
@@ -0,0 +1,1929 @@
+<?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: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:
+
+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.
+</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"/>
+
+
+  <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:text>.</xsl:text>
+	      <xsl:value-of select="$imagetype"/>
+	    </xsl:attribute>
+	    <xsl:attribute name="manifest:media-type">
+	      <xsl:text>image/</xsl:text>
+	      <xsl:choose>
+		<xsl:when test="$imagetype='png'">png</xsl:when>
+		<xsl:when test="$imagetype='gif'">gif</xsl:when>
+		<xsl:when test="$imagetype='jpg'">jpeg</xsl:when>
+		<xsl:when test="$imagetype='jpeg'">jpg</xsl:when>
+		<xsl:when test="$imagetype='tiff'">tiff</xsl:when>
+		<xsl:when test="$imagetype='tif'">tiff</xsl:when>
+		<xsl:otherwise>jpeg</xsl:otherwise>
+	      </xsl:choose>
+	    </xsl:attribute>
+	  </manifest:file-entry>
+	</xsl:for-each>
+	</xsl:if>
+      </manifest:manifest>
+    </xsl:result-document>
+
+  </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>
+
+  <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: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: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: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>
+
+
+
+<!-- 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>
+
+
+
+<!-- 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 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="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="parent::tei:figure">
+		<xsl:text>paragraph</xsl:text>
+	      </xsl:when>
+	      <xsl:otherwise>
+		<xsl:text>as-char</xsl:text>
+	      </xsl:otherwise>
+	    </xsl:choose>
+	  </xsl:attribute>
+	  
+	  <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: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>
+
+
+<!-- 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: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:choose>
+	    <xsl:when test="self::tei:listBibl">L2</xsl:when>
+            <xsl:when test="not(@type)">L1</xsl:when>
+            <xsl:when test="@type='ordered'">L2</xsl:when>
+            <xsl:when test="@type='unordered'">L1</xsl:when>
+	</xsl:choose>
+      </xsl:attribute>
+      <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']/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: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:choose>
+		<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>
+
+<!-- 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: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: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: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: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: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 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:choose>
+	  <xsl:when test="@rend='normalweight'">
+	    <xsl:text>Standard</xsl:text>
+	  </xsl:when>
+	  <xsl:when test="@rend='code' or @rend='typewriter'">
+	    <xsl:text>Source_20_Text</xsl:text>
+	  </xsl:when>
+	  <xsl:when test="@rend='sup' or @rend='superscript'">
+	    <xsl:text>Superscript</xsl:text>
+	  </xsl:when>
+	  <xsl:when test="@rend='sub' or @rend='subscript'">
+	    <xsl:text>Subscript</xsl:text>
+	  </xsl:when>
+	  <xsl:when test="@rend='bold'">
+	    <xsl:text>Highlight</xsl:text>
+	  </xsl:when>
+	  <xsl:when test="@rend='label'">
+	    <xsl:text>Highlight</xsl:text>
+	  </xsl:when>
+	  <xsl:when test="@rend='it' or @rend='i' or @rend='italic'">
+	    <xsl:text>Emphasis</xsl:text>
+	  </xsl:when>
+	  <xsl:when test="@rend='underline'">
+	    <xsl:text>Underline</xsl:text>
+	  </xsl:when>
+	  <xsl:when test="@rend='sc' or @rend='smallcaps'">
+	    <xsl:text>SmallCaps</xsl:text>
+	  </xsl:when>
+	  <xsl:when test="@rend='sc' or @rend='capsall'">
+	    <xsl:text>AllCaps</xsl:text>
+	  </xsl:when>
+	  <xsl:when test="@rend='strikethrough'">
+	    <xsl:text>StrikeThrough</xsl:text>
+	  </xsl:when>
+	  <xsl:when test="@rend='strikedoublethrough'">
+	    <xsl:text>StrikeDoubleThrough</xsl:text>
+	  </xsl:when>
+	  <xsl:when test="@rend='underline'">
+	    <xsl:text>UnderLine</xsl:text>
+	  </xsl:when>
+	  <xsl:when test="@rend='underdoubleline'">
+	    <xsl:text>UnderDoubleLine</xsl:text>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <xsl:text>Emphasis</xsl:text>
+	  </xsl:otherwise>
+	</xsl:choose>
+      </xsl:attribute>
+      <xsl:apply-templates/>
+    </text:span>
+  </xsl:template>
+
+  <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: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="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()"/>
+
+  <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: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: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 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: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>
+
+  <!-- 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: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: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: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: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: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>
+
+  <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="wrapLength">65</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="newLine">&#10;</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="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>
+		
+	      </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: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: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="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="makeElementName">
+    <xsl:param name="start"/>
+    <xsl:choose>
+
+      <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: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
+	  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: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: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: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://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: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
+	  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://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: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 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 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: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: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="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: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: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="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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/teitoodt.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/listgraphics.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/listgraphics.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/listgraphics.xsl	(revision 728)
@@ -0,0 +1,90 @@
+<?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:
+
+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.
+</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:output method="text"/>
+  <xsl:param name="DIR"/>
+  <xsl:param name="ORIG">.</xsl:param>
+
+  <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/listgraphics.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/mimetype
===================================================================
Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/teilite.dtd
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/teilite.dtd	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/teilite.dtd	(revision 728)
@@ -0,0 +1,2103 @@
+
+<!--
+DTD Generated 2011-02-13T12:21:23Z. 
+-->
+
+<!-- start datatypes -->
+
+<!ENTITY % data.certainty '(high|
+medium|
+low|
+unknown)' >
+
+<!ENTITY % data.numeric ' CDATA' >
+
+<!ENTITY % data.count ' CDATA' >
+
+<!ENTITY % data.temporal.w3c ' CDATA' >
+
+<!ENTITY % data.duration.w3c ' CDATA' >
+
+<!ENTITY % data.truthValue ' CDATA' >
+
+<!ENTITY % data.xTruthValue '(unknown|
+inapplicable | true | false)' >
+
+<!ENTITY % data.language ' CDATA' >
+
+<!ENTITY % data.outputMeasurement ' CDATA' >
+
+<!ENTITY % data.pattern ' CDATA' >
+
+<!ENTITY % data.pointer ' CDATA' >
+
+<!ENTITY % data.version ' CDATA' >
+
+<!ENTITY % data.key ' CDATA' >
+
+<!ENTITY % data.word ' CDATA' >
+
+<!ENTITY % data.code ' CDATA' >
+
+<!ENTITY % data.name ' CDATA' >
+
+<!ENTITY % data.enumerated '%data.name;' >
+
+<!-- end datatypes -->
+
+<!--predeclared classes -->
+
+<!ENTITY % model.entryPart ""> 
+<!ENTITY % model.entryPart_sequence ""> 
+<!ENTITY % model.entryPart_sequenceOptional ""> 
+<!ENTITY % model.entryPart_sequenceOptionalRepeatable ""> 
+<!ENTITY % model.entryPart_sequenceRepeatable ""> 
+<!ENTITY % model.resourceLike ""> 
+<!ENTITY % model.resourceLike_sequence ""> 
+<!ENTITY % model.resourceLike_sequenceOptional ""> 
+<!ENTITY % model.resourceLike_sequenceOptionalRepeatable ""> 
+<!ENTITY % model.resourceLike_sequenceRepeatable ""> <!ENTITY % att.global.linking.attributes '
+corresp CDATA  #IMPLIED
+synch CDATA  #IMPLIED
+sameAs %data.pointer;  #IMPLIED
+copyOf %data.pointer;  #IMPLIED
+next %data.pointer;  #IMPLIED
+prev %data.pointer;  #IMPLIED
+exclude CDATA  #IMPLIED
+select CDATA  #IMPLIED'> 
+<!ENTITY % att.global.linking.attribute.corresp '
+corresp CDATA  #IMPLIED'>
+
+<!ENTITY % att.global.linking.attribute.synch '
+synch CDATA  #IMPLIED'>
+
+<!ENTITY % att.global.linking.attribute.sameAs '
+sameAs %data.pointer;  #IMPLIED'>
+
+<!ENTITY % att.global.linking.attribute.copyOf '
+copyOf %data.pointer;  #IMPLIED'>
+
+<!ENTITY % att.global.linking.attribute.next '
+next %data.pointer;  #IMPLIED'>
+
+<!ENTITY % att.global.linking.attribute.prev '
+prev %data.pointer;  #IMPLIED'>
+
+<!ENTITY % att.global.linking.attribute.exclude '
+exclude CDATA  #IMPLIED'>
+
+<!ENTITY % att.global.linking.attribute.select '
+select CDATA  #IMPLIED'>
+<!ENTITY % att.global.analytic.attributes '
+ana CDATA  #IMPLIED'> 
+<!ENTITY % att.global.analytic.attribute.ana '
+ana CDATA  #IMPLIED'>
+
+<!--end of predeclared classes -->
+<!ENTITY % att.ascribed.attributes '
+who CDATA  #IMPLIED'> 
+<!ENTITY % att.ascribed.attribute.who '
+who CDATA  #IMPLIED'>
+<!ENTITY % att.canonical.attributes '
+key %data.key;  #IMPLIED
+ref CDATA  #IMPLIED'> 
+<!ENTITY % att.canonical.attribute.key '
+key %data.key;  #IMPLIED'>
+
+<!ENTITY % att.canonical.attribute.ref '
+ref CDATA  #IMPLIED'>
+<!ENTITY % att.ranging.attributes '
+atLeast %data.numeric;  #IMPLIED
+atMost %data.numeric;  #IMPLIED
+min %data.numeric;  #IMPLIED
+max %data.numeric;  #IMPLIED'> 
+<!ENTITY % att.ranging.attribute.atLeast '
+atLeast %data.numeric;  #IMPLIED'>
+
+<!ENTITY % att.ranging.attribute.atMost '
+atMost %data.numeric;  #IMPLIED'>
+
+<!ENTITY % att.ranging.attribute.min '
+min %data.numeric;  #IMPLIED'>
+
+<!ENTITY % att.ranging.attribute.max '
+max %data.numeric;  #IMPLIED'>
+<!ENTITY % att.dimensions.attributes ' %att.ranging.attributes;
+unit %data.enumerated;  #IMPLIED
+quantity %data.numeric;  #IMPLIED
+extent CDATA  #IMPLIED
+precision %data.certainty;  #IMPLIED
+scope %data.enumerated;  #IMPLIED'> 
+<!ENTITY % att.dimensions.attribute.unit '
+unit %data.enumerated;  #IMPLIED'>
+
+<!ENTITY % att.dimensions.attribute.quantity '
+quantity %data.numeric;  #IMPLIED'>
+
+<!ENTITY % att.dimensions.attribute.extent '
+extent CDATA  #IMPLIED'>
+
+<!ENTITY % att.dimensions.attribute.precision '
+precision %data.certainty;  #IMPLIED'>
+
+<!ENTITY % att.dimensions.attribute.scope '
+scope %data.enumerated;  #IMPLIED'>
+<!ENTITY % att.breaking.attributes '
+break %data.enumerated;  #IMPLIED'> 
+<!ENTITY % att.breaking.attribute.break '
+break %data.enumerated;  #IMPLIED'>
+<!ENTITY % att.datable.w3c.attributes '
+period %data.pointer;  #IMPLIED
+when %data.temporal.w3c;  #IMPLIED
+notBefore %data.temporal.w3c;  #IMPLIED
+notAfter %data.temporal.w3c;  #IMPLIED
+from %data.temporal.w3c;  #IMPLIED
+to %data.temporal.w3c;  #IMPLIED'> 
+<!ENTITY % att.datable.w3c.attribute.period '
+period %data.pointer;  #IMPLIED'>
+
+<!ENTITY % att.datable.w3c.attribute.when '
+when %data.temporal.w3c;  #IMPLIED'>
+
+<!ENTITY % att.datable.w3c.attribute.notBefore '
+notBefore %data.temporal.w3c;  #IMPLIED'>
+
+<!ENTITY % att.datable.w3c.attribute.notAfter '
+notAfter %data.temporal.w3c;  #IMPLIED'>
+
+<!ENTITY % att.datable.w3c.attribute.from '
+from %data.temporal.w3c;  #IMPLIED'>
+
+<!ENTITY % att.datable.w3c.attribute.to '
+to %data.temporal.w3c;  #IMPLIED'>
+<!ENTITY % att.datable.attributes ' %att.datable.w3c.attributes;'> <!ENTITY % att.declarable.attributes '
+default (true|false) "false" '> 
+<!ENTITY % att.declarable.attribute.default '
+default (true|false) "false" '>
+<!ENTITY % att.declaring.attributes '
+decls CDATA  #IMPLIED'> 
+<!ENTITY % att.declaring.attribute.decls '
+decls CDATA  #IMPLIED'>
+<!ENTITY % att.divLike.attributes '
+org (composite|uniform) "uniform" 
+sample (initial|medial|final|unknown|complete) "complete" 
+part (Y|N|I|M|F) "N" '> 
+<!ENTITY % att.divLike.attribute.org '
+org (composite|uniform) "uniform" '>
+
+<!ENTITY % att.divLike.attribute.sample '
+sample (initial|medial|final|unknown|complete) "complete" '>
+
+<!ENTITY % att.divLike.attribute.part '
+part (Y|N|I|M|F) "N" '>
+<!ENTITY % att.docStatus.attributes '
+status %data.enumerated;  "draft" '> 
+<!ENTITY % att.docStatus.attribute.status '
+status %data.enumerated;  "draft" '>
+<!ENTITY % att.responsibility.attributes '
+cert %data.certainty;  #IMPLIED
+resp CDATA  #IMPLIED'> 
+<!ENTITY % att.responsibility.attribute.cert '
+cert %data.certainty;  #IMPLIED'>
+
+<!ENTITY % att.responsibility.attribute.resp '
+resp CDATA  #IMPLIED'>
+<!ENTITY % att.editLike.attributes ' %att.dimensions.attributes; %att.responsibility.attributes;
+evidence NMTOKENS  #IMPLIED
+source CDATA  #IMPLIED'> 
+<!ENTITY % att.editLike.attribute.evidence '
+evidence NMTOKENS  #IMPLIED'>
+
+<!ENTITY % att.editLike.attribute.source '
+source CDATA  #IMPLIED'>
+<!ENTITY % att.global.attributes ' %att.global.linking.attributes; %att.global.analytic.attributes;
+xml:id ID #IMPLIED
+n CDATA  #IMPLIED
+xml:lang %data.language;  #IMPLIED
+rend CDATA  #IMPLIED
+xml:base %data.pointer;  #IMPLIED
+xml:space (default|preserve) #IMPLIED'> 
+<!ENTITY % att.global.attribute.xmlid '
+xml:id ID #IMPLIED'>
+
+<!ENTITY % att.global.attribute.n '
+n CDATA  #IMPLIED'>
+
+<!ENTITY % att.global.attribute.xmllang '
+xml:lang %data.language;  #IMPLIED'>
+
+<!ENTITY % att.global.attribute.rend '
+rend CDATA  #IMPLIED'>
+
+<!ENTITY % att.global.attribute.xmlbase '
+xml:base %data.pointer;  #IMPLIED'>
+
+<!ENTITY % att.global.attribute.xmlspace '
+xml:space (default|preserve) #IMPLIED'>
+<!ENTITY % att.handFeatures.attributes '
+scribe %data.name;  #IMPLIED
+scribeRef CDATA  #IMPLIED
+script NMTOKENS  #IMPLIED
+scriptRef CDATA  #IMPLIED
+medium %data.enumerated;  #IMPLIED
+scope (sole|major|minor) #IMPLIED'> 
+<!ENTITY % att.handFeatures.attribute.scribe '
+scribe %data.name;  #IMPLIED'>
+
+<!ENTITY % att.handFeatures.attribute.scribeRef '
+scribeRef CDATA  #IMPLIED'>
+
+<!ENTITY % att.handFeatures.attribute.script '
+script NMTOKENS  #IMPLIED'>
+
+<!ENTITY % att.handFeatures.attribute.scriptRef '
+scriptRef CDATA  #IMPLIED'>
+
+<!ENTITY % att.handFeatures.attribute.medium '
+medium %data.enumerated;  #IMPLIED'>
+
+<!ENTITY % att.handFeatures.attribute.scope '
+scope (sole|major|minor) #IMPLIED'>
+<!ENTITY % att.internetMedia.attributes '
+mimeType %data.word;  #IMPLIED'> 
+<!ENTITY % att.internetMedia.attribute.mimeType '
+mimeType %data.word;  #IMPLIED'>
+<!ENTITY % att.interpLike.attributes ' %att.responsibility.attributes;
+type %data.enumerated;  #IMPLIED
+inst CDATA  #IMPLIED'> 
+<!ENTITY % att.interpLike.attribute.type '
+type %data.enumerated;  #IMPLIED'>
+
+<!ENTITY % att.interpLike.attribute.inst '
+inst CDATA  #IMPLIED'>
+<!ENTITY % att.measurement.attributes '
+unit %data.enumerated;  #IMPLIED
+quantity %data.numeric;  #IMPLIED
+commodity CDATA  #IMPLIED'> 
+<!ENTITY % att.measurement.attribute.unit '
+unit %data.enumerated;  #IMPLIED'>
+
+<!ENTITY % att.measurement.attribute.quantity '
+quantity %data.numeric;  #IMPLIED'>
+
+<!ENTITY % att.measurement.attribute.commodity '
+commodity CDATA  #IMPLIED'>
+<!ENTITY % att.naming.attributes ' %att.canonical.attributes;
+role %data.enumerated;  #IMPLIED
+nymRef CDATA  #IMPLIED'> 
+<!ENTITY % att.naming.attribute.role '
+role %data.enumerated;  #IMPLIED'>
+
+<!ENTITY % att.naming.attribute.nymRef '
+nymRef CDATA  #IMPLIED'>
+<!ENTITY % att.placement.attributes '
+place NMTOKENS  #IMPLIED'> 
+<!ENTITY % att.placement.attribute.place '
+place NMTOKENS  #IMPLIED'>
+<!ENTITY % att.typed.attributes '
+type %data.enumerated;  #IMPLIED
+subtype %data.enumerated;  #IMPLIED'> 
+<!ENTITY % att.typed.attribute.type '
+type %data.enumerated;  #IMPLIED'>
+
+<!ENTITY % att.typed.attribute.subtype '
+subtype %data.enumerated;  #IMPLIED'>
+<!ENTITY % att.pointing.attributes '
+target CDATA  #IMPLIED
+evaluate (all|one|none) #IMPLIED'> 
+<!ENTITY % att.pointing.attribute.target '
+target CDATA  #IMPLIED'>
+
+<!ENTITY % att.pointing.attribute.evaluate '
+evaluate (all|one|none) #IMPLIED'>
+<!ENTITY % att.segLike.attributes '
+function %data.enumerated;  #IMPLIED
+part (Y|N|I|M|F) "N" '> 
+<!ENTITY % att.segLike.attribute.function '
+function %data.enumerated;  #IMPLIED'>
+
+<!ENTITY % att.segLike.attribute.part '
+part (Y|N|I|M|F) "N" '>
+<!ENTITY % att.sourced.attributes '
+ed CDATA  #IMPLIED'> 
+<!ENTITY % att.sourced.attribute.ed '
+ed CDATA  #IMPLIED'>
+<!ENTITY % att.spanning.attributes '
+spanTo %data.pointer;  #IMPLIED'> 
+<!ENTITY % att.spanning.attribute.spanTo '
+spanTo %data.pointer;  #IMPLIED'>
+<!ENTITY % att.tableDecoration.attributes '
+role %data.enumerated;  "data" 
+rows %data.count;  "1" 
+cols %data.count;  "1" '> 
+<!ENTITY % att.tableDecoration.attribute.role '
+role %data.enumerated;  "data" '>
+
+<!ENTITY % att.tableDecoration.attribute.rows '
+rows %data.count;  "1" '>
+
+<!ENTITY % att.tableDecoration.attribute.cols '
+cols %data.count;  "1" '>
+<!ENTITY % att.transcriptional.attributes ' %att.editLike.attributes;
+hand %data.pointer;  #IMPLIED
+status %data.enumerated;  "unremarkable" 
+seq CDATA  #IMPLIED'> 
+<!ENTITY % att.transcriptional.attribute.hand '
+hand %data.pointer;  #IMPLIED'>
+
+<!ENTITY % att.transcriptional.attribute.status '
+status %data.enumerated;  "unremarkable" '>
+
+<!ENTITY % att.transcriptional.attribute.seq '
+seq CDATA  #IMPLIED'>
+<!ENTITY % att.translatable.attributes '
+version %data.word;  #IMPLIED'> 
+<!ENTITY % att.translatable.attribute.version '
+version %data.word;  #IMPLIED'>
+
+<!ENTITY % model.nameLike.agent "name"> 
+<!ENTITY % model.nameLike.agent_sequence "name"> 
+<!ENTITY % model.nameLike.agent_sequenceOptional "name?"> 
+<!ENTITY % model.nameLike.agent_sequenceOptionalRepeatable "name*"> 
+<!ENTITY % model.nameLike.agent_sequenceRepeatable "name+"> 
+<!ENTITY % model.segLike "seg |
+ s |
+ pc"> 
+<!ENTITY % model.segLike_sequence "seg, s, pc"> 
+<!ENTITY % model.segLike_sequenceOptional "seg?, s?, pc?"> 
+<!ENTITY % model.segLike_sequenceOptionalRepeatable "seg*, s*, pc*"> 
+<!ENTITY % model.segLike_sequenceRepeatable "seg+, s+, pc+"> 
+<!ENTITY % model.hiLike "hi"> 
+<!ENTITY % model.hiLike_sequence "hi"> 
+<!ENTITY % model.hiLike_sequenceOptional "hi?"> 
+<!ENTITY % model.hiLike_sequenceOptionalRepeatable "hi*"> 
+<!ENTITY % model.hiLike_sequenceRepeatable "hi+"> 
+<!ENTITY % model.emphLike "foreign |
+ emph |
+ mentioned |
+ soCalled |
+ gloss |
+ term |
+ title |
+ code |
+ ident"> 
+<!ENTITY % model.emphLike_sequence "foreign, emph, mentioned, soCalled, gloss, term, title, code, ident"> 
+<!ENTITY % model.emphLike_sequenceOptional "foreign?, emph?, mentioned?, soCalled?, gloss?, term?, title?, code?, ident?"> 
+<!ENTITY % model.emphLike_sequenceOptionalRepeatable "foreign*, emph*, mentioned*, soCalled*, gloss*, term*, title*, code*, ident*"> 
+<!ENTITY % model.emphLike_sequenceRepeatable "foreign+, emph+, mentioned+, soCalled+, gloss+, term+, title+, code+, ident+"> 
+<!ENTITY % model.highlighted "%model.hiLike; |
+ %model.emphLike;"> 
+<!ENTITY % model.highlighted_sequence "%model.hiLike;, %model.emphLike;"> 
+<!ENTITY % model.highlighted_sequenceOptional "%model.hiLike;?, %model.emphLike;?"> 
+<!ENTITY % model.highlighted_sequenceOptionalRepeatable "%model.hiLike;*, %model.emphLike;*"> 
+<!ENTITY % model.highlighted_sequenceRepeatable "%model.hiLike;+, %model.emphLike;+"> 
+<!ENTITY % model.dateLike "date |
+ time"> 
+<!ENTITY % model.dateLike_sequence "date, time"> 
+<!ENTITY % model.dateLike_sequenceOptional "date?, time?"> 
+<!ENTITY % model.dateLike_sequenceOptionalRepeatable "date*, time*"> 
+<!ENTITY % model.dateLike_sequenceRepeatable "date+, time+"> 
+<!ENTITY % model.measureLike "num |
+ measureGrp"> 
+<!ENTITY % model.measureLike_sequence "num, measureGrp"> 
+<!ENTITY % model.measureLike_sequenceOptional "num?, measureGrp?"> 
+<!ENTITY % model.measureLike_sequenceOptionalRepeatable "num*, measureGrp*"> 
+<!ENTITY % model.measureLike_sequenceRepeatable "num+, measureGrp+"> 
+<!ENTITY % model.egLike "eg |
+ egXML"> 
+<!ENTITY % model.egLike_sequence "eg, egXML"> 
+<!ENTITY % model.egLike_sequenceOptional "eg?, egXML?"> 
+<!ENTITY % model.egLike_sequenceOptionalRepeatable "eg*, egXML*"> 
+<!ENTITY % model.egLike_sequenceRepeatable "eg+, egXML+"> 
+<!ENTITY % model.graphicLike "graphic |
+ formula"> 
+<!ENTITY % model.graphicLike_sequence "graphic, formula"> 
+<!ENTITY % model.graphicLike_sequenceOptional "graphic?, formula?"> 
+<!ENTITY % model.graphicLike_sequenceOptionalRepeatable "graphic*, formula*"> 
+<!ENTITY % model.graphicLike_sequenceRepeatable "graphic+, formula+"> 
+<!ENTITY % model.pPart.editorial "choice |
+ abbr |
+ expan"> 
+<!ENTITY % model.pPart.editorial_sequence "choice, abbr, expan"> 
+<!ENTITY % model.pPart.editorial_sequenceOptional "choice?, abbr?, expan?"> 
+<!ENTITY % model.pPart.editorial_sequenceOptionalRepeatable "choice*, abbr*, expan*"> 
+<!ENTITY % model.pPart.editorial_sequenceRepeatable "choice+, abbr+, expan+"> 
+<!ENTITY % model.pPart.transcriptional "sic |
+ corr |
+ reg |
+ orig |
+ add |
+ del |
+ unclear"> 
+<!ENTITY % model.pPart.transcriptional_sequence "sic, corr, reg, orig, add, del, unclear"> 
+<!ENTITY % model.pPart.transcriptional_sequenceOptional "sic?, corr?, reg?, orig?, add?, del?, unclear?"> 
+<!ENTITY % model.pPart.transcriptional_sequenceOptionalRepeatable "sic*, corr*, reg*, orig*, add*, del*, unclear*"> 
+<!ENTITY % model.pPart.transcriptional_sequenceRepeatable "sic+, corr+, reg+, orig+, add+, del+, unclear+"> 
+<!ENTITY % model.pPart.edit "%model.pPart.editorial; |
+ %model.pPart.transcriptional;"> 
+<!ENTITY % model.pPart.edit_sequence "%model.pPart.editorial;, %model.pPart.transcriptional;"> 
+<!ENTITY % model.pPart.edit_sequenceOptional "%model.pPart.editorial;?, %model.pPart.transcriptional;?"> 
+<!ENTITY % model.pPart.edit_sequenceOptionalRepeatable "%model.pPart.editorial;*, %model.pPart.transcriptional;*"> 
+<!ENTITY % model.pPart.edit_sequenceRepeatable "%model.pPart.editorial;+, %model.pPart.transcriptional;+"> 
+<!ENTITY % model.ptrLike "ptr |
+ ref"> 
+<!ENTITY % model.ptrLike_sequence "ptr, ref"> 
+<!ENTITY % model.ptrLike_sequenceOptional "ptr?, ref?"> 
+<!ENTITY % model.ptrLike_sequenceOptionalRepeatable "ptr*, ref*"> 
+<!ENTITY % model.ptrLike_sequenceRepeatable "ptr+, ref+"> 
+<!ENTITY % model.global.meta "index |
+ interp |
+ interpGrp"> 
+<!ENTITY % model.global.meta_sequence "index, interp, interpGrp"> 
+<!ENTITY % model.global.meta_sequenceOptional "index?, interp?, interpGrp?"> 
+<!ENTITY % model.global.meta_sequenceOptionalRepeatable "index*, interp*, interpGrp*"> 
+<!ENTITY % model.global.meta_sequenceRepeatable "index+, interp+, interpGrp+"> 
+<!ENTITY % model.milestoneLike "milestone |
+ pb |
+ lb |
+ anchor"> 
+<!ENTITY % model.milestoneLike_sequence "milestone, pb, lb, anchor"> 
+<!ENTITY % model.milestoneLike_sequenceOptional "milestone?, pb?, lb?, anchor?"> 
+<!ENTITY % model.milestoneLike_sequenceOptionalRepeatable "milestone*, pb*, lb*, anchor*"> 
+<!ENTITY % model.milestoneLike_sequenceRepeatable "milestone+, pb+, lb+, anchor+"> 
+<!ENTITY % model.gLike ""> 
+<!ENTITY % model.gLike_sequence ""> 
+<!ENTITY % model.gLike_sequenceOptional ""> 
+<!ENTITY % model.gLike_sequenceOptionalRepeatable ""> 
+<!ENTITY % model.gLike_sequenceRepeatable ""> 
+<!ENTITY % model.phrase.xml "att |
+ gi |
+ val"> 
+<!ENTITY % model.phrase.xml_sequence "att, gi, val"> 
+<!ENTITY % model.phrase.xml_sequenceOptional "att?, gi?, val?"> 
+<!ENTITY % model.phrase.xml_sequenceOptionalRepeatable "att*, gi*, val*"> 
+<!ENTITY % model.phrase.xml_sequenceRepeatable "att+, gi+, val+"> 
+<!ENTITY % model.biblLike "bibl |
+ biblFull"> 
+<!ENTITY % model.biblLike_sequence "bibl, biblFull"> 
+<!ENTITY % model.biblLike_sequenceOptional "bibl?, biblFull?"> 
+<!ENTITY % model.biblLike_sequenceOptionalRepeatable "bibl*, biblFull*"> 
+<!ENTITY % model.biblLike_sequenceRepeatable "bibl+, biblFull+"> 
+<!ENTITY % model.headLike "head"> 
+<!ENTITY % model.headLike_sequence "head"> 
+<!ENTITY % model.headLike_sequenceOptional "head?"> 
+<!ENTITY % model.headLike_sequenceOptionalRepeatable "head*"> 
+<!ENTITY % model.headLike_sequenceRepeatable "head+"> 
+<!ENTITY % model.labelLike "desc |
+ label"> 
+<!ENTITY % model.labelLike_sequence "desc, label"> 
+<!ENTITY % model.labelLike_sequenceOptional "desc?, label?"> 
+<!ENTITY % model.labelLike_sequenceOptionalRepeatable "desc*, label*"> 
+<!ENTITY % model.labelLike_sequenceRepeatable "desc+, label+"> 
+<!ENTITY % model.listLike "list |
+ listBibl"> 
+<!ENTITY % model.listLike_sequence "list, listBibl"> 
+<!ENTITY % model.listLike_sequenceOptional "list?, listBibl?"> 
+<!ENTITY % model.listLike_sequenceOptionalRepeatable "list*, listBibl*"> 
+<!ENTITY % model.listLike_sequenceRepeatable "list+, listBibl+"> 
+<!ENTITY % model.noteLike "note"> 
+<!ENTITY % model.noteLike_sequence "note"> 
+<!ENTITY % model.noteLike_sequenceOptional "note?"> 
+<!ENTITY % model.noteLike_sequenceOptionalRepeatable "note*"> 
+<!ENTITY % model.noteLike_sequenceRepeatable "note+"> 
+<!ENTITY % model.lLike "l"> 
+<!ENTITY % model.lLike_sequence "l"> 
+<!ENTITY % model.lLike_sequenceOptional "l?"> 
+<!ENTITY % model.lLike_sequenceOptionalRepeatable "l*"> 
+<!ENTITY % model.lLike_sequenceRepeatable "l+"> 
+<!ENTITY % model.pLike "p"> 
+<!ENTITY % model.pLike_sequence "p"> 
+<!ENTITY % model.pLike_sequenceOptional "p?"> 
+<!ENTITY % model.pLike_sequenceOptionalRepeatable "p*"> 
+<!ENTITY % model.pLike_sequenceRepeatable "p+"> 
+<!ENTITY % model.stageLike "stage"> 
+<!ENTITY % model.stageLike_sequence "stage"> 
+<!ENTITY % model.stageLike_sequenceOptional "stage?"> 
+<!ENTITY % model.stageLike_sequenceOptionalRepeatable "stage*"> 
+<!ENTITY % model.stageLike_sequenceRepeatable "stage+"> 
+<!ENTITY % model.entryPart ""> 
+<!ENTITY % model.entryPart_sequence ""> 
+<!ENTITY % model.entryPart_sequenceOptional ""> 
+<!ENTITY % model.entryPart_sequenceOptionalRepeatable ""> 
+<!ENTITY % model.entryPart_sequenceRepeatable ""> 
+<!ENTITY % model.entryPart.top "cit"> 
+<!ENTITY % model.entryPart.top_sequence "cit"> 
+<!ENTITY % model.entryPart.top_sequenceOptional "cit?"> 
+<!ENTITY % model.entryPart.top_sequenceOptionalRepeatable "cit*"> 
+<!ENTITY % model.entryPart.top_sequenceRepeatable "cit+"> 
+<!ENTITY % model.global.edit "gap"> 
+<!ENTITY % model.global.edit_sequence "gap"> 
+<!ENTITY % model.global.edit_sequenceOptional "gap?"> 
+<!ENTITY % model.global.edit_sequenceOptionalRepeatable "gap*"> 
+<!ENTITY % model.global.edit_sequenceRepeatable "gap+"> 
+<!ENTITY % model.divPart "%model.lLike; |
+ %model.pLike; |
+ lg |
+ sp"> 
+<!ENTITY % model.divPart_sequence "%model.lLike;, %model.pLike;, lg, sp"> 
+<!ENTITY % model.divPart_sequenceOptional "%model.lLike;?, %model.pLike;?, lg?, sp?"> 
+<!ENTITY % model.divPart_sequenceOptionalRepeatable "%model.lLike;*, %model.pLike;*, lg*, sp*"> 
+<!ENTITY % model.divPart_sequenceRepeatable "%model.lLike;+, %model.pLike;+, lg+, sp+"> 
+<!ENTITY % model.personPart "bibl"> 
+<!ENTITY % model.personPart_sequence "bibl"> 
+<!ENTITY % model.personPart_sequenceOptional "bibl?"> 
+<!ENTITY % model.personPart_sequenceOptionalRepeatable "bibl*"> 
+<!ENTITY % model.personPart_sequenceRepeatable "bibl+"> 
+<!ENTITY % model.publicationStmtPart "address |
+ date |
+ publisher |
+ pubPlace |
+ distributor |
+ authority |
+ idno |
+ availability"> 
+<!ENTITY % model.publicationStmtPart_sequence "address, date, publisher, pubPlace, distributor, authority, idno, availability"> 
+<!ENTITY % model.publicationStmtPart_sequenceOptional "address?, date?, publisher?, pubPlace?, distributor?, authority?, idno?, availability?"> 
+<!ENTITY % model.publicationStmtPart_sequenceOptionalRepeatable "address*, date*, publisher*, pubPlace*, distributor*, authority*, idno*, availability*"> 
+<!ENTITY % model.publicationStmtPart_sequenceRepeatable "address+, date+, publisher+, pubPlace+, distributor+, authority+, idno+, availability+"> 
+<!ENTITY % model.glossLike "desc |
+ gloss"> 
+<!ENTITY % model.glossLike_sequence "desc, gloss"> 
+<!ENTITY % model.glossLike_sequenceOptional "desc?, gloss?"> 
+<!ENTITY % model.glossLike_sequenceOptionalRepeatable "desc*, gloss*"> 
+<!ENTITY % model.glossLike_sequenceRepeatable "desc+, gloss+"> 
+<!ENTITY % model.quoteLike "quote |
+ cit"> 
+<!ENTITY % model.quoteLike_sequence "quote, cit"> 
+<!ENTITY % model.quoteLike_sequenceOptional "quote?, cit?"> 
+<!ENTITY % model.quoteLike_sequenceOptionalRepeatable "quote*, cit*"> 
+<!ENTITY % model.quoteLike_sequenceRepeatable "quote+, cit+"> 
+<!ENTITY % model.qLike "%model.quoteLike; |
+ said |
+ q"> 
+<!ENTITY % model.qLike_sequence "%model.quoteLike;, said, q"> 
+<!ENTITY % model.qLike_sequenceOptional "%model.quoteLike;?, said?, q?"> 
+<!ENTITY % model.qLike_sequenceOptionalRepeatable "%model.quoteLike;*, said*, q*"> 
+<!ENTITY % model.qLike_sequenceRepeatable "%model.quoteLike;+, said+, q+"> 
+<!ENTITY % model.respLike "author |
+ editor |
+ respStmt |
+ sponsor |
+ funder |
+ principal"> 
+<!ENTITY % model.respLike_sequence "author, editor, respStmt, sponsor, funder, principal"> 
+<!ENTITY % model.respLike_sequenceOptional "author?, editor?, respStmt?, sponsor?, funder?, principal?"> 
+<!ENTITY % model.respLike_sequenceOptionalRepeatable "author*, editor*, respStmt*, sponsor*, funder*, principal*"> 
+<!ENTITY % model.respLike_sequenceRepeatable "author+, editor+, respStmt+, sponsor+, funder+, principal+"> 
+<!ENTITY % model.divWrapper "byline |
+ dateline |
+ argument |
+ epigraph |
+ salute |
+ docAuthor |
+ docDate"> 
+<!ENTITY % model.divWrapper_sequence "byline, dateline, argument, epigraph, salute, docAuthor, docDate"> 
+<!ENTITY % model.divWrapper_sequenceOptional "byline?, dateline?, argument?, epigraph?, salute?, docAuthor?, docDate?"> 
+<!ENTITY % model.divWrapper_sequenceOptionalRepeatable "byline*, dateline*, argument*, epigraph*, salute*, docAuthor*, docDate*"> 
+<!ENTITY % model.divWrapper_sequenceRepeatable "byline+, dateline+, argument+, epigraph+, salute+, docAuthor+, docDate+"> 
+<!ENTITY % model.divTopPart "%model.headLike; |
+ opener"> 
+<!ENTITY % model.divTopPart_sequence "%model.headLike;, opener"> 
+<!ENTITY % model.divTopPart_sequenceOptional "%model.headLike;?, opener?"> 
+<!ENTITY % model.divTopPart_sequenceOptionalRepeatable "%model.headLike;*, opener*"> 
+<!ENTITY % model.divTopPart_sequenceRepeatable "%model.headLike;+, opener+"> 
+<!ENTITY % model.divTop "%model.divWrapper; |
+ %model.divTopPart;"> 
+<!ENTITY % model.divTop_sequence "%model.divWrapper;, %model.divTopPart;"> 
+<!ENTITY % model.divTop_sequenceOptional "%model.divWrapper;?, %model.divTopPart;?"> 
+<!ENTITY % model.divTop_sequenceOptionalRepeatable "%model.divWrapper;*, %model.divTopPart;*"> 
+<!ENTITY % model.divTop_sequenceRepeatable "%model.divWrapper;+, %model.divTopPart;+"> 
+<!ENTITY % model.pLike.front "head |
+ byline |
+ argument |
+ epigraph |
+ docTitle |
+ titlePart |
+ docAuthor |
+ docEdition |
+ docImprint |
+ docDate"> 
+<!ENTITY % model.pLike.front_sequence "head, byline, argument, epigraph, docTitle, titlePart, docAuthor, docEdition, docImprint, docDate"> 
+<!ENTITY % model.pLike.front_sequenceOptional "head?, byline?, argument?, epigraph?, docTitle?, titlePart?, docAuthor?, docEdition?, docImprint?, docDate?"> 
+<!ENTITY % model.pLike.front_sequenceOptionalRepeatable "head*, byline*, argument*, epigraph*, docTitle*, titlePart*, docAuthor*, docEdition*, docImprint*, docDate*"> 
+<!ENTITY % model.pLike.front_sequenceRepeatable "head+, byline+, argument+, epigraph+, docTitle+, titlePart+, docAuthor+, docEdition+, docImprint+, docDate+"> 
+<!ENTITY % model.divBottomPart "trailer |
+ closer |
+ signed |
+ postscript"> 
+<!ENTITY % model.divBottomPart_sequence "trailer, closer, signed, postscript"> 
+<!ENTITY % model.divBottomPart_sequenceOptional "trailer?, closer?, signed?, postscript?"> 
+<!ENTITY % model.divBottomPart_sequenceOptionalRepeatable "trailer*, closer*, signed*, postscript*"> 
+<!ENTITY % model.divBottomPart_sequenceRepeatable "trailer+, closer+, signed+, postscript+"> 
+<!ENTITY % model.divBottom "%model.divWrapper; |
+ %model.divBottomPart;"> 
+<!ENTITY % model.divBottom_sequence "%model.divWrapper;, %model.divBottomPart;"> 
+<!ENTITY % model.divBottom_sequenceOptional "%model.divWrapper;?, %model.divBottomPart;?"> 
+<!ENTITY % model.divBottom_sequenceOptionalRepeatable "%model.divWrapper;*, %model.divBottomPart;*"> 
+<!ENTITY % model.divBottom_sequenceRepeatable "%model.divWrapper;+, %model.divBottomPart;+"> 
+<!ENTITY % model.titlepagePart "graphic |
+ byline |
+ argument |
+ epigraph |
+ docTitle |
+ titlePart |
+ docAuthor |
+ docEdition |
+ docImprint |
+ docDate"> 
+<!ENTITY % model.titlepagePart_sequence "graphic, byline, argument, epigraph, docTitle, titlePart, docAuthor, docEdition, docImprint, docDate"> 
+<!ENTITY % model.titlepagePart_sequenceOptional "graphic?, byline?, argument?, epigraph?, docTitle?, titlePart?, docAuthor?, docEdition?, docImprint?, docDate?"> 
+<!ENTITY % model.titlepagePart_sequenceOptionalRepeatable "graphic*, byline*, argument*, epigraph*, docTitle*, titlePart*, docAuthor*, docEdition*, docImprint*, docDate*"> 
+<!ENTITY % model.titlepagePart_sequenceRepeatable "graphic+, byline+, argument+, epigraph+, docTitle+, titlePart+, docAuthor+, docEdition+, docImprint+, docDate+"> 
+<!ENTITY % model.msQuoteLike "title"> 
+<!ENTITY % model.msQuoteLike_sequence "title"> 
+<!ENTITY % model.msQuoteLike_sequenceOptional "title?"> 
+<!ENTITY % model.msQuoteLike_sequenceOptionalRepeatable "title*"> 
+<!ENTITY % model.msQuoteLike_sequenceRepeatable "title+"> 
+<!ENTITY % model.msItemPart "%model.quoteLike; |
+ %model.respLike; |
+ %model.msQuoteLike; |
+ bibl |
+ listBibl"> 
+<!ENTITY % model.msItemPart_sequence "%model.quoteLike;, %model.respLike;, %model.msQuoteLike;, bibl, listBibl"> 
+<!ENTITY % model.msItemPart_sequenceOptional "%model.quoteLike;?, %model.respLike;?, %model.msQuoteLike;?, bibl?, listBibl?"> 
+<!ENTITY % model.msItemPart_sequenceOptionalRepeatable "%model.quoteLike;*, %model.respLike;*, %model.msQuoteLike;*, bibl*, listBibl*"> 
+<!ENTITY % model.msItemPart_sequenceRepeatable "%model.quoteLike;+, %model.respLike;+, %model.msQuoteLike;+, bibl+, listBibl+"> 
+<!ENTITY % model.choicePart "sic |
+ corr |
+ reg |
+ orig |
+ unclear |
+ abbr |
+ expan |
+ seg"> 
+<!ENTITY % model.choicePart_sequence "sic, corr, reg, orig, unclear, abbr, expan, seg"> 
+<!ENTITY % model.choicePart_sequenceOptional "sic?, corr?, reg?, orig?, unclear?, abbr?, expan?, seg?"> 
+<!ENTITY % model.choicePart_sequenceOptionalRepeatable "sic*, corr*, reg*, orig*, unclear*, abbr*, expan*, seg*"> 
+<!ENTITY % model.choicePart_sequenceRepeatable "sic+, corr+, reg+, orig+, unclear+, abbr+, expan+, seg+"> 
+<!ENTITY % model.imprintPart "publisher |
+ biblScope |
+ pubPlace |
+ distributor"> 
+<!ENTITY % model.imprintPart_sequence "publisher, biblScope, pubPlace, distributor"> 
+<!ENTITY % model.imprintPart_sequenceOptional "publisher?, biblScope?, pubPlace?, distributor?"> 
+<!ENTITY % model.imprintPart_sequenceOptionalRepeatable "publisher*, biblScope*, pubPlace*, distributor*"> 
+<!ENTITY % model.imprintPart_sequenceRepeatable "publisher+, biblScope+, pubPlace+, distributor+"> 
+<!ENTITY % model.catDescPart ""> 
+<!ENTITY % model.catDescPart_sequence ""> 
+<!ENTITY % model.catDescPart_sequenceOptional ""> 
+<!ENTITY % model.catDescPart_sequenceOptionalRepeatable ""> 
+<!ENTITY % model.catDescPart_sequenceRepeatable ""> 
+<!ENTITY % model.addressLike "address"> 
+<!ENTITY % model.addressLike_sequence "address"> 
+<!ENTITY % model.addressLike_sequenceOptional "address?"> 
+<!ENTITY % model.addressLike_sequenceOptionalRepeatable "address*"> 
+<!ENTITY % model.addressLike_sequenceRepeatable "address+"> 
+<!ENTITY % model.nameLike "%model.nameLike.agent; |
+ rs |
+ idno"> 
+<!ENTITY % model.nameLike_sequence "%model.nameLike.agent;, rs, idno"> 
+<!ENTITY % model.nameLike_sequenceOptional "%model.nameLike.agent;?, rs?, idno?"> 
+<!ENTITY % model.nameLike_sequenceOptionalRepeatable "%model.nameLike.agent;*, rs*, idno*"> 
+<!ENTITY % model.nameLike_sequenceRepeatable "%model.nameLike.agent;+, rs+, idno+"> 
+<!ENTITY % model.global "%model.global.meta; |
+ %model.milestoneLike; |
+ %model.noteLike; |
+ %model.global.edit; |
+ figure"> 
+<!ENTITY % model.global_sequence "%model.global.meta;, %model.milestoneLike;, %model.noteLike;, %model.global.edit;, figure"> 
+<!ENTITY % model.global_sequenceOptional "%model.global.meta;?, %model.milestoneLike;?, %model.noteLike;?, %model.global.edit;?, figure?"> 
+<!ENTITY % model.global_sequenceOptionalRepeatable "%model.global.meta;*, %model.milestoneLike;*, %model.noteLike;*, %model.global.edit;*, figure*"> 
+<!ENTITY % model.global_sequenceRepeatable "%model.global.meta;+, %model.milestoneLike;+, %model.noteLike;+, %model.global.edit;+, figure+"> 
+<!ENTITY % model.biblPart "%model.respLike; |
+ %model.imprintPart; |
+ relatedItem |
+ edition |
+ extent"> 
+<!ENTITY % model.biblPart_sequence "%model.respLike;, %model.imprintPart;, relatedItem, edition, extent"> 
+<!ENTITY % model.biblPart_sequenceOptional "%model.respLike;?, %model.imprintPart;?, relatedItem?, edition?, extent?"> 
+<!ENTITY % model.biblPart_sequenceOptionalRepeatable "%model.respLike;*, %model.imprintPart;*, relatedItem*, edition*, extent*"> 
+<!ENTITY % model.biblPart_sequenceRepeatable "%model.respLike;+, %model.imprintPart;+, relatedItem+, edition+, extent+"> 
+<!ENTITY % model.frontPart "divGen |
+ titlePage"> 
+<!ENTITY % model.frontPart_sequence "divGen, titlePage"> 
+<!ENTITY % model.frontPart_sequenceOptional "divGen?, titlePage?"> 
+<!ENTITY % model.frontPart_sequenceOptionalRepeatable "divGen*, titlePage*"> 
+<!ENTITY % model.frontPart_sequenceRepeatable "divGen+, titlePage+"> 
+<!ENTITY % model.addrPart "%model.nameLike; |
+ addrLine"> 
+<!ENTITY % model.addrPart_sequence "%model.nameLike;, addrLine"> 
+<!ENTITY % model.addrPart_sequenceOptional "%model.nameLike;?, addrLine?"> 
+<!ENTITY % model.addrPart_sequenceOptionalRepeatable "%model.nameLike;*, addrLine*"> 
+<!ENTITY % model.addrPart_sequenceRepeatable "%model.nameLike;+, addrLine+"> 
+<!ENTITY % model.pPart.data "%model.dateLike; |
+ %model.measureLike; |
+ %model.addressLike; |
+ %model.nameLike;"> 
+<!ENTITY % model.pPart.data_sequence "%model.dateLike;, %model.measureLike;, %model.addressLike;, %model.nameLike;"> 
+<!ENTITY % model.pPart.data_sequenceOptional "%model.dateLike;?, %model.measureLike;?, %model.addressLike;?, %model.nameLike;?"> 
+<!ENTITY % model.pPart.data_sequenceOptionalRepeatable "%model.dateLike;*, %model.measureLike;*, %model.addressLike;*, %model.nameLike;*"> 
+<!ENTITY % model.pPart.data_sequenceRepeatable "%model.dateLike;+, %model.measureLike;+, %model.addressLike;+, %model.nameLike;+"> 
+<!ENTITY % model.inter "%model.egLike; |
+ %model.biblLike; |
+ %model.labelLike; |
+ %model.listLike; |
+ %model.stageLike; |
+ %model.qLike; |
+ table"> 
+<!ENTITY % model.inter_sequence "%model.egLike;, %model.biblLike;, %model.labelLike;, %model.listLike;, %model.stageLike;, %model.qLike;, table"> 
+<!ENTITY % model.inter_sequenceOptional "%model.egLike;?, %model.biblLike;?, %model.labelLike;?, %model.listLike;?, %model.stageLike;?, %model.qLike;?, table?"> 
+<!ENTITY % model.inter_sequenceOptionalRepeatable "%model.egLike;*, %model.biblLike;*, %model.labelLike;*, %model.listLike;*, %model.stageLike;*, %model.qLike;*, table*"> 
+<!ENTITY % model.inter_sequenceRepeatable "%model.egLike;+, %model.biblLike;+, %model.labelLike;+, %model.listLike;+, %model.stageLike;+, %model.qLike;+, table+"> 
+<!ENTITY % model.common "%model.divPart; |
+ %model.inter;"> 
+<!ENTITY % model.common_sequence "%model.divPart;, %model.inter;"> 
+<!ENTITY % model.common_sequenceOptional "%model.divPart;?, %model.inter;?"> 
+<!ENTITY % model.common_sequenceOptionalRepeatable "%model.divPart;*, %model.inter;*"> 
+<!ENTITY % model.common_sequenceRepeatable "%model.divPart;+, %model.inter;+"> 
+<!ENTITY % model.phrase "%model.segLike; |
+ %model.highlighted; |
+ %model.graphicLike; |
+ %model.pPart.edit; |
+ %model.ptrLike; |
+ %model.phrase.xml; |
+ %model.pPart.data;"> 
+<!ENTITY % model.phrase_sequence "%model.segLike;, %model.highlighted;, %model.graphicLike;, %model.pPart.edit;, %model.ptrLike;, %model.phrase.xml;, %model.pPart.data;"> 
+<!ENTITY % model.phrase_sequenceOptional "%model.segLike;?, %model.highlighted;?, %model.graphicLike;?, %model.pPart.edit;?, %model.ptrLike;?, %model.phrase.xml;?, %model.pPart.data;?"> 
+<!ENTITY % model.phrase_sequenceOptionalRepeatable "%model.segLike;*, %model.highlighted;*, %model.graphicLike;*, %model.pPart.edit;*, %model.ptrLike;*, %model.phrase.xml;*, %model.pPart.data;*"> 
+<!ENTITY % model.phrase_sequenceRepeatable "%model.segLike;+, %model.highlighted;+, %model.graphicLike;+, %model.pPart.edit;+, %model.ptrLike;+, %model.phrase.xml;+, %model.pPart.data;+"> 
+<!ENTITY % model.limitedPhrase "%model.emphLike; |
+ %model.pPart.editorial; |
+ %model.ptrLike; |
+ %model.phrase.xml; |
+ %model.pPart.data;"> 
+<!ENTITY % model.limitedPhrase_sequence "%model.emphLike;, %model.pPart.editorial;, %model.ptrLike;, %model.phrase.xml;, %model.pPart.data;"> 
+<!ENTITY % model.limitedPhrase_sequenceOptional "%model.emphLike;?, %model.pPart.editorial;?, %model.ptrLike;?, %model.phrase.xml;?, %model.pPart.data;?"> 
+<!ENTITY % model.limitedPhrase_sequenceOptionalRepeatable "%model.emphLike;*, %model.pPart.editorial;*, %model.ptrLike;*, %model.phrase.xml;*, %model.pPart.data;*"> 
+<!ENTITY % model.limitedPhrase_sequenceRepeatable "%model.emphLike;+, %model.pPart.editorial;+, %model.ptrLike;+, %model.phrase.xml;+, %model.pPart.data;+"> 
+<!ENTITY % model.divLike "div"> 
+<!ENTITY % model.divLike_sequence "div"> 
+<!ENTITY % model.divLike_sequenceOptional "div?"> 
+<!ENTITY % model.divLike_sequenceOptionalRepeatable "div*"> 
+<!ENTITY % model.divLike_sequenceRepeatable "div+"> 
+<!ENTITY % model.divGenLike "divGen"> 
+<!ENTITY % model.divGenLike_sequence "divGen"> 
+<!ENTITY % model.divGenLike_sequenceOptional "divGen?"> 
+<!ENTITY % model.divGenLike_sequenceOptionalRepeatable "divGen*"> 
+<!ENTITY % model.divGenLike_sequenceRepeatable "divGen+"> 
+<!ENTITY % model.div1Like ""> 
+<!ENTITY % model.div1Like_sequence ""> 
+<!ENTITY % model.div1Like_sequenceOptional ""> 
+<!ENTITY % model.div1Like_sequenceOptionalRepeatable ""> 
+<!ENTITY % model.div1Like_sequenceRepeatable ""> 
+<!ENTITY % model.applicationLike "application"> 
+<!ENTITY % model.applicationLike_sequence "application"> 
+<!ENTITY % model.applicationLike_sequenceOptional "application?"> 
+<!ENTITY % model.applicationLike_sequenceOptionalRepeatable "application*"> 
+<!ENTITY % model.applicationLike_sequenceRepeatable "application+"> 
+<!ENTITY % model.teiHeaderPart "encodingDesc |
+ profileDesc"> 
+<!ENTITY % model.teiHeaderPart_sequence "encodingDesc, profileDesc"> 
+<!ENTITY % model.teiHeaderPart_sequenceOptional "encodingDesc?, profileDesc?"> 
+<!ENTITY % model.teiHeaderPart_sequenceOptionalRepeatable "encodingDesc*, profileDesc*"> 
+<!ENTITY % model.teiHeaderPart_sequenceRepeatable "encodingDesc+, profileDesc+"> 
+<!ENTITY % model.sourceDescPart ""> 
+<!ENTITY % model.sourceDescPart_sequence ""> 
+<!ENTITY % model.sourceDescPart_sequenceOptional ""> 
+<!ENTITY % model.sourceDescPart_sequenceOptionalRepeatable ""> 
+<!ENTITY % model.sourceDescPart_sequenceRepeatable ""> 
+<!ENTITY % model.encodingDescPart "projectDesc |
+ samplingDecl |
+ editorialDecl |
+ refsDecl |
+ classDecl |
+ appInfo |
+ geoDecl"> 
+<!ENTITY % model.encodingDescPart_sequence "projectDesc, samplingDecl, editorialDecl, refsDecl, classDecl, appInfo, geoDecl"> 
+<!ENTITY % model.encodingDescPart_sequenceOptional "projectDesc?, samplingDecl?, editorialDecl?, refsDecl?, classDecl?, appInfo?, geoDecl?"> 
+<!ENTITY % model.encodingDescPart_sequenceOptionalRepeatable "projectDesc*, samplingDecl*, editorialDecl*, refsDecl*, classDecl*, appInfo*, geoDecl*"> 
+<!ENTITY % model.encodingDescPart_sequenceRepeatable "projectDesc+, samplingDecl+, editorialDecl+, refsDecl+, classDecl+, appInfo+, geoDecl+"> 
+<!ENTITY % model.editorialDeclPart ""> 
+<!ENTITY % model.editorialDeclPart_sequence ""> 
+<!ENTITY % model.editorialDeclPart_sequenceOptional ""> 
+<!ENTITY % model.editorialDeclPart_sequenceOptionalRepeatable ""> 
+<!ENTITY % model.editorialDeclPart_sequenceRepeatable ""> 
+<!ENTITY % model.profileDescPart "creation |
+ langUsage |
+ textClass"> 
+<!ENTITY % model.profileDescPart_sequence "creation, langUsage, textClass"> 
+<!ENTITY % model.profileDescPart_sequenceOptional "creation?, langUsage?, textClass?"> 
+<!ENTITY % model.profileDescPart_sequenceOptionalRepeatable "creation*, langUsage*, textClass*"> 
+<!ENTITY % model.profileDescPart_sequenceRepeatable "creation+, langUsage+, textClass+"> 
+<!ENTITY % model.resourceLike ""> 
+<!ENTITY % model.resourceLike_sequence ""> 
+<!ENTITY % model.resourceLike_sequenceOptional ""> 
+<!ENTITY % model.resourceLike_sequenceOptionalRepeatable ""> 
+<!ENTITY % model.resourceLike_sequenceRepeatable ""> <!ENTITY % att.global.linking.attributes '
+corresp CDATA  #IMPLIED
+synch CDATA  #IMPLIED
+sameAs %data.pointer;  #IMPLIED
+copyOf %data.pointer;  #IMPLIED
+next %data.pointer;  #IMPLIED
+prev %data.pointer;  #IMPLIED
+exclude CDATA  #IMPLIED
+select CDATA  #IMPLIED'> 
+<!ENTITY % att.global.linking.attribute.corresp '
+corresp CDATA  #IMPLIED'>
+
+<!ENTITY % att.global.linking.attribute.synch '
+synch CDATA  #IMPLIED'>
+
+<!ENTITY % att.global.linking.attribute.sameAs '
+sameAs %data.pointer;  #IMPLIED'>
+
+<!ENTITY % att.global.linking.attribute.copyOf '
+copyOf %data.pointer;  #IMPLIED'>
+
+<!ENTITY % att.global.linking.attribute.next '
+next %data.pointer;  #IMPLIED'>
+
+<!ENTITY % att.global.linking.attribute.prev '
+prev %data.pointer;  #IMPLIED'>
+
+<!ENTITY % att.global.linking.attribute.exclude '
+exclude CDATA  #IMPLIED'>
+
+<!ENTITY % att.global.linking.attribute.select '
+select CDATA  #IMPLIED'>
+<!ENTITY % att.global.analytic.attributes '
+ana CDATA  #IMPLIED'> 
+<!ENTITY % att.global.analytic.attribute.ana '
+ana CDATA  #IMPLIED'>
+
+<!-- start predeclared patterns -->
+
+<!-- end predeclared patterns -->
+
+<!-- start rest of patterns -->
+
+<!ENTITY % macro.paraContent '( #PCDATA |
+ _DUMMY_model.gLike |
+ %model.phrase; |
+ %model.inter; |
+ %model.global;)*' >
+
+<!ENTITY % macro.limitedContent '( #PCDATA |
+ %model.limitedPhrase; |
+ %model.inter;)*' >
+
+<!ENTITY % macro.phraseSeq '( #PCDATA |
+ _DUMMY_model.gLike |
+ %model.phrase; |
+ %model.global;)*' >
+
+<!ENTITY % macro.phraseSeq.limited '( #PCDATA |
+ %model.limitedPhrase; |
+ %model.global;)*' >
+
+<!ENTITY % macro.specialPara '( #PCDATA |
+ _DUMMY_model.gLike |
+ %model.phrase; |
+ %model.inter; |
+ %model.divPart; |
+ %model.global;)*' >
+
+<!ENTITY % macro.xtext '( #PCDATA |
+ _DUMMY_model.gLike)*' >
+
+<!ENTITY % macro.anyXML ' ANY' >
+
+<!-- end patterns -->
+
+<!-- start elements -->
+
+<!--doc:(TEI document) contains a single TEI-conformant document,
+comprising a TEI header and a text, either in isolation or as part of a
+teiCorpus element. -->
+<!ELEMENT TEI (teiHeader,((_DUMMY_model.resourceLike+,text?) |
+ text))>
+<!ATTLIST TEI xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST TEI
+ %att.global.attributes;
+version %data.version;  #IMPLIED >
+<!ATTLIST TEI xsi:schemaLocation CDATA #IMPLIED
+ xmlns:xsi CDATA #FIXED 'http://www.w3.org/2001/XMLSchema-instance'
+ >
+<!--doc:(abbreviation) contains an abbreviation of any sort. -->
+<!ELEMENT abbr %macro.phraseSeq;>
+<!ATTLIST abbr xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST abbr
+ %att.global.attributes;
+ %att.responsibility.attributes;
+type %data.enumerated;  #IMPLIED >
+<!--doc:(addition) contains letters, words, or phrases inserted in the text by an
+        author, scribe, annotator, or corrector. -->
+<!ELEMENT add %macro.paraContent;>
+<!ATTLIST add xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST add
+ %att.global.attributes;
+ %att.transcriptional.attributes;
+ %att.placement.attributes;
+ %att.typed.attributes; >
+<!--doc:(address line) contains one line of a postal address. -->
+<!ELEMENT addrLine %macro.phraseSeq;>
+<!ATTLIST addrLine xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST addrLine
+ %att.global.attributes; >
+<!--doc:contains a postal  address, for example of a
+        publisher, an organization, or an individual. -->
+<!ELEMENT address ((%model.global;)*,((%model.addrPart;),(%model.global;)*)+)>
+<!ATTLIST address xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST address
+ %att.global.attributes; >
+<!--doc:(anchor point) attaches an identifier to a point within a text, whether or not it corresponds with a textual element. -->
+<!ELEMENT anchor EMPTY>
+<!ATTLIST anchor xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST anchor
+ %att.global.attributes;
+ %att.typed.attributes; >
+<!--doc:(application information) records information about an application which has
+  edited the TEI file.  -->
+<!ELEMENT appInfo (%model.applicationLike;)+>
+<!ATTLIST appInfo xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST appInfo
+ %att.global.attributes; >
+<!--doc:provides information about an application which has acted upon the document. -->
+<!ELEMENT application ((%model.labelLike;)+,((%model.ptrLike;)* |
+ (%model.pLike;)*))>
+<!ATTLIST application xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST application
+ %att.global.attributes;
+ %att.typed.attributes;
+ %att.datable.attributes;
+ident %data.name;  #REQUIRED
+version CDATA #REQUIRED >
+<!--doc:A formal list or prose description of the topics addressed by
+	a subdivision of a text. -->
+<!ELEMENT argument ((%model.global; |
+ %model.headLike;)*,((%model.common;),(%model.global;)*)+)>
+<!ATTLIST argument xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST argument
+ %att.global.attributes; >
+<!--doc:(attribute) contains the name of an attribute appearing within running text. -->
+<!ELEMENT att  (#PCDATA)>
+<!ATTLIST att xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST att
+ %att.global.attributes;
+scheme %data.enumerated;  "TEI"  >
+<!--doc:in a bibliographic reference, contains the name(s) of the
+  author(s), personal or corporate, of a work; for example in the same
+  form as that provided by a recognized bibliographic name authority.  -->
+<!ELEMENT author %macro.phraseSeq;>
+<!ATTLIST author xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST author
+ %att.global.attributes;
+ %att.naming.attributes; >
+<!--doc:(release authority) supplies the name of a person or other agency responsible for
+  making an electronic file available, other than a publisher or
+  distributor. -->
+<!ELEMENT authority %macro.phraseSeq.limited;>
+<!ATTLIST authority xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST authority
+ %att.global.attributes; >
+<!--doc:supplies information about the availability of a text, for example any restrictions on its
+    use or distribution, its copyright status, etc. -->
+<!ELEMENT availability (%model.pLike;)+>
+<!ATTLIST availability xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST availability
+ %att.global.attributes;
+ %att.declarable.attributes;
+status (free|unknown|restricted) "unknown"  >
+<!--doc:(back matter) contains any appendixes, etc. following the main part of a text. -->
+<!ELEMENT back ((%model.frontPart; |
+ %model.pLike.front; |
+ %model.global;)*,((_DUMMY_model.div1Like,(%model.frontPart; |
+ _DUMMY_model.div1Like |
+ %model.global;)*) |
+ ((%model.divLike;),(%model.frontPart; |
+ %model.divLike; |
+ %model.global;)*))?,((%model.divBottomPart;),(%model.divBottomPart; |
+ %model.global;)*)?)>
+<!ATTLIST back xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST back
+ %att.global.attributes;
+ %att.declaring.attributes; >
+<!--doc:(bibliographic citation) contains a loosely-structured bibliographic citation of which the sub-components may or may
+    not be explicitly tagged.  -->
+<!ELEMENT bibl ( #PCDATA |
+ _DUMMY_model.gLike |
+ %model.highlighted; |
+ %model.pPart.data; |
+ %model.pPart.edit; |
+ %model.segLike; |
+ %model.ptrLike; |
+ %model.biblPart; |
+ %model.global;)*>
+<!ATTLIST bibl xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST bibl
+ %att.global.attributes;
+ %att.declarable.attributes;
+ %att.typed.attributes; >
+<!--doc:(fully-structured bibliographic citation) contains a fully-structured bibliographic citation, in which all components of the TEI file
+    description are present. -->
+<!ELEMENT biblFull ((titleStmt,editionStmt?,extent?,publicationStmt,seriesStmt?,notesStmt?),sourceDesc*)>
+<!ATTLIST biblFull xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST biblFull
+ %att.global.attributes;
+ %att.declarable.attributes; >
+<!--doc:(scope of citation) defines the scope of a bibliographic reference, for example as a
+        list of page numbers, or a named subdivision of a larger work. -->
+<!ELEMENT biblScope %macro.phraseSeq;>
+<!ATTLIST biblScope xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST biblScope
+ %att.global.attributes;
+type %data.enumerated;  #IMPLIED
+from %data.word;  #IMPLIED
+to %data.word;  #IMPLIED >
+<!--doc:(text body) contains the whole body of a single unitary text, excluding any front or back matter. -->
+<!ELEMENT body ((%model.global;)*,((%model.divTop;),(%model.global; |
+ %model.divTop;)*)?,((%model.divGenLike;),(%model.global; |
+ %model.divGenLike;)*)?,(((%model.divLike;),(%model.global; |
+ %model.divGenLike;)*)+ |
+ (_DUMMY_model.div1Like,(%model.global; |
+ %model.divGenLike;)*)+ |
+ (((%model.common;),(%model.global;)*)+,(((%model.divLike;),(%model.global; |
+ %model.divGenLike;)*)+ |
+ (_DUMMY_model.div1Like,(%model.global; |
+ %model.divGenLike;)*)+)?)),((%model.divBottom;),(%model.global;)*)*)>
+<!ATTLIST body xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST body
+ %att.global.attributes;
+ %att.declaring.attributes; >
+<!--doc:contains the primary statement of responsibility given for a work
+on its title page or at the head or end of the work. -->
+<!ELEMENT byline ( #PCDATA |
+ _DUMMY_model.gLike |
+ %model.phrase; |
+ docAuthor |
+ %model.global;)*>
+<!ATTLIST byline xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST byline
+ %att.global.attributes; >
+<!--doc:(canonical reference pattern) specifies an expression and replacement pattern for transforming a canonical reference into
+    a URI.  -->
+<!ELEMENT cRefPattern (%model.pLike;)*>
+<!ATTLIST cRefPattern xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST cRefPattern
+ %att.global.attributes;
+matchPattern %data.pattern;  #REQUIRED
+replacementPattern CDATA #REQUIRED >
+<!--doc:(category description) describes some category within a taxonomy or text typology, either in the form of a brief
+    prose description or in terms of the situational parameters used by the TEI formal textDesc. -->
+<!ELEMENT catDesc ( #PCDATA |
+ %model.limitedPhrase; |
+ _DUMMY_model.catDescPart)*>
+<!ATTLIST catDesc xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST catDesc
+ %att.global.attributes; >
+<!--doc:(category reference) specifies one or more defined categories within some taxonomy or text typology. -->
+<!ELEMENT catRef EMPTY>
+<!ATTLIST catRef xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST catRef
+ %att.global.attributes;
+ %att.pointing.attributes;
+scheme %data.pointer;  #IMPLIED >
+<!--doc:contains an individual descriptive category, possibly nested within a superordinate
+    category, within a user-defined taxonomy. -->
+<!ELEMENT category ((catDesc+ |
+ (%model.glossLike;)*),category*)>
+<!ATTLIST category xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST category
+ %att.global.attributes; >
+<!--doc:contains one cell of a table.  -->
+<!ELEMENT cell %macro.paraContent;>
+<!ATTLIST cell xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST cell
+ %att.global.attributes;
+ %att.tableDecoration.attributes; >
+<!--doc:summarizes a particular change or correction made to a particular version of an electronic
+    text which is shared between several researchers. -->
+<!ELEMENT change ( #PCDATA |
+ %model.limitedPhrase; |
+ %model.inter; |
+ %model.global;)*>
+<!ATTLIST change xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST change
+ %att.global.attributes;
+ %att.ascribed.attributes;
+ %att.datable.attributes;
+ %att.docStatus.attributes; >
+<!--doc:groups a number of alternative encodings for the same point in
+        a text. -->
+<!ELEMENT choice (%model.choicePart; |
+ choice)*>
+<!ATTLIST choice xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST choice
+ %att.global.attributes; >
+<!--doc:(cited quotation) contains a quotation from some other document, together with a bibliographic reference to
+    its source. In a dictionary it may contain an example text with at least one occurrence of the
+    word form, used in the sense being described, or a translation of the headword, or an example.  -->
+<!ELEMENT cit (%model.qLike; |
+ %model.egLike; |
+ %model.biblLike; |
+ %model.ptrLike; |
+ %model.global; |
+ _DUMMY_model.entryPart)+>
+<!ATTLIST cit xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST cit
+ %att.global.attributes;
+ %att.typed.attributes; >
+<!--doc:(classification code) contains the classification code used for this text in some standard classification system. -->
+<!ELEMENT classCode %macro.phraseSeq.limited;>
+<!ATTLIST classCode xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST classCode
+ %att.global.attributes;
+scheme %data.pointer;  #REQUIRED >
+<!--doc:(classification declarations) contains one or more taxonomies defining any classificatory
+codes used elsewhere in the text. -->
+<!ELEMENT classDecl (taxonomy)+>
+<!ATTLIST classDecl xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST classDecl
+ %att.global.attributes; >
+<!--doc:groups together salutations, datelines, and similar phrases appearing as a final group at
+    the end of a division, especially of a letter. -->
+<!ELEMENT closer ( #PCDATA |
+ _DUMMY_model.gLike |
+ signed |
+ dateline |
+ salute |
+ %model.phrase; |
+ %model.global;)*>
+<!ATTLIST closer xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST closer
+ %att.global.attributes; >
+<!--doc:contains literal code from some formal language such as a
+programming language. -->
+<!ELEMENT code  (#PCDATA)>
+<!ATTLIST code xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST code
+ %att.global.attributes;
+lang %data.word;  #IMPLIED >
+<!--doc:(correction) contains the correct form of a passage apparently erroneous in the copy text. -->
+<!ELEMENT corr %macro.paraContent;>
+<!ATTLIST corr xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST corr
+ %att.global.attributes;
+ %att.editLike.attributes;
+ %att.typed.attributes; >
+<!--doc:contains information about the creation of a text. -->
+<!ELEMENT creation %macro.phraseSeq.limited;>
+<!ATTLIST creation xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST creation
+ %att.global.attributes; >
+<!--doc:contains a date in any format. -->
+<!ELEMENT date ( #PCDATA |
+ _DUMMY_model.gLike |
+ %model.phrase; |
+ %model.global;)*>
+<!ATTLIST date xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST date
+ %att.global.attributes;
+ %att.datable.attributes;
+ %att.editLike.attributes;
+ %att.typed.attributes;
+calendar %data.enumerated;  #IMPLIED >
+<!--doc:contains a brief description of the place, date, time, etc. of production of a letter,
+    newspaper story, or other work, prefixed or suffixed to it as a kind of heading or trailer.  -->
+<!ELEMENT dateline %macro.phraseSeq;>
+<!ATTLIST dateline xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST dateline
+ %att.global.attributes; >
+<!--doc:(deletion) contains a letter, word, or passage deleted, marked as deleted, or otherwise indicated as
+    superfluous or spurious in the copy text by an author, scribe, annotator, or corrector. -->
+<!ELEMENT del %macro.paraContent;>
+<!ATTLIST del xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST del
+ %att.global.attributes;
+ %att.transcriptional.attributes;
+ %att.typed.attributes; >
+<!--doc:(description) contains a brief description of the object documented by its parent element, including its
+    intended usage, purpose, or application where this is appropriate. -->
+<!ELEMENT desc %macro.limitedContent;>
+<!ATTLIST desc xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST desc
+ %att.global.attributes;
+ %att.translatable.attributes; >
+<!--doc:supplies the name of a person or other agency responsible for the
+distribution of a text. -->
+<!ELEMENT distributor %macro.phraseSeq;>
+<!ATTLIST distributor xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST distributor
+ %att.global.attributes; >
+<!--doc:(text division) contains a subdivision of the front, body, or back of a text. -->
+<!ELEMENT div ((%model.divTop; |
+ %model.global;)*,((((%model.divLike; |
+ %model.divGenLike;),(%model.global;)*)+ |
+ (((%model.common;),(%model.global;)*)+,((%model.divLike; |
+ %model.divGenLike;),(%model.global;)*)*)),((%model.divBottom;),(%model.global;)*)*)?)>
+<!ATTLIST div xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST div
+ %att.global.attributes;
+ %att.divLike.attributes;
+ %att.typed.attributes;
+ %att.declaring.attributes; >
+<!--doc:(automatically generated text division) indicates the location at which a textual division generated
+        automatically by a text-processing application is to appear. -->
+<!ELEMENT divGen (%model.headLike;)*>
+<!ATTLIST divGen xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST divGen
+ %att.global.attributes;
+type %data.enumerated;  #IMPLIED >
+<!--doc:(document author) contains the name of the author of the document, as given on the
+title page (often but not always contained in a byline). -->
+<!ELEMENT docAuthor %macro.phraseSeq;>
+<!ATTLIST docAuthor xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST docAuthor
+ %att.global.attributes;
+ %att.canonical.attributes; >
+<!--doc:(document date) contains the date of a document, as given
+(usually) on a title page. -->
+<!ELEMENT docDate %macro.phraseSeq;>
+<!ATTLIST docDate xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST docDate
+ %att.global.attributes;
+when %data.temporal.w3c;  #IMPLIED >
+<!--doc:(document edition) contains an edition statement as presented on a title page of a
+document. -->
+<!ELEMENT docEdition %macro.paraContent;>
+<!ATTLIST docEdition xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST docEdition
+ %att.global.attributes; >
+<!--doc:(document imprint) contains the imprint statement (place and date of publication,
+publisher name), as given
+(usually) at the foot of a title page. -->
+<!ELEMENT docImprint ( #PCDATA |
+ _DUMMY_model.gLike |
+ %model.phrase; |
+ pubPlace |
+ docDate |
+ publisher |
+ %model.global;)*>
+<!ATTLIST docImprint xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST docImprint
+ %att.global.attributes; >
+<!--doc:(document title) contains the title of a document, including all its
+constituents, as given on a title page. -->
+<!ELEMENT docTitle ((%model.global;)*,(titlePart,(%model.global;)*)+)>
+<!ATTLIST docTitle xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST docTitle
+ %att.global.attributes;
+ %att.canonical.attributes; >
+<!--doc:(edition) describes the particularities of one edition of a text. -->
+<!ELEMENT edition %macro.phraseSeq;>
+<!ATTLIST edition xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST edition
+ %att.global.attributes; >
+<!--doc:(edition statement) groups information relating to one edition of a text. -->
+<!ELEMENT editionStmt ((%model.pLike;)+ |
+ (edition,respStmt*))>
+<!ATTLIST editionStmt xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST editionStmt
+ %att.global.attributes; >
+<!--doc:secondary statement of responsibility for a bibliographic item, for example the name of an
+    individual, institution or organization, (or of several such) acting as editor, compiler,
+    translator, etc.  -->
+<!ELEMENT editor %macro.phraseSeq;>
+<!ATTLIST editor xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST editor
+ %att.global.attributes;
+ %att.naming.attributes; >
+<!--doc:(editorial practice declaration) provides details of editorial principles and practices applied
+during the encoding of a text. -->
+<!ELEMENT editorialDecl (%model.pLike; |
+ _DUMMY_model.editorialDeclPart)+>
+<!ATTLIST editorialDecl xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST editorialDecl
+ %att.global.attributes;
+ %att.declarable.attributes; >
+<!--doc:(example) contains any kind of illustrative example.  -->
+<!ELEMENT eg  (#PCDATA)>
+<!ATTLIST eg xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST eg
+ %att.global.attributes; >
+<!--doc:(example of XML) contains a single well-formed XML fragment demonstrating the use of some XML element or
+    attribute, in which the egXML element itself functions as the root element.  -->
+<!ELEMENT egXML (#PCDATA)*>
+<!ATTLIST egXML xmlns CDATA "http://www.tei-c.org/ns/Examples">
+<!ATTLIST egXML
+ %att.global.attributes;
+valid (true|feasible|false) "true"  >
+<!--doc:(emphasized) marks words or phrases which are stressed or emphasized for
+        linguistic or rhetorical effect. -->
+<!ELEMENT emph %macro.paraContent;>
+<!ATTLIST emph xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST emph
+ %att.global.attributes; >
+<!--doc:(encoding description) documents the relationship between an electronic text and the
+source or sources from which it was derived. -->
+<!ELEMENT encodingDesc (%model.encodingDescPart; |
+ %model.pLike;)+>
+<!ATTLIST encodingDesc xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST encodingDesc
+ %att.global.attributes; >
+<!--doc:contains a quotation, anonymous or attributed, appearing at the start of a section or
+    chapter, or on a title page.  -->
+<!ELEMENT epigraph (%model.common; |
+ %model.global;)*>
+<!ATTLIST epigraph xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST epigraph
+ %att.global.attributes; >
+<!--doc:(expansion) contains the expansion of an abbreviation. -->
+<!ELEMENT expan %macro.phraseSeq;>
+<!ATTLIST expan xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST expan
+ %att.global.attributes;
+ %att.editLike.attributes; >
+<!--doc:describes the approximate size of a text as stored on some carrier medium, whether digital
+    or non-digital, specified in any convenient units. -->
+<!ELEMENT extent %macro.phraseSeq;>
+<!ATTLIST extent xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST extent
+ %att.global.attributes; >
+<!--doc:(description of figure) contains a brief prose description of the appearance or content
+of a graphic figure, for use when documenting an image without
+displaying it. -->
+<!ELEMENT figDesc %macro.limitedContent;>
+<!ATTLIST figDesc xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST figDesc
+ %att.global.attributes; >
+<!--doc:groups elements representing or containing graphic information such as an illustration or
+    figure. -->
+<!ELEMENT figure (%model.headLike; |
+ %model.pLike; |
+ figDesc |
+ %model.graphicLike; |
+ %model.egLike; |
+ %model.global;)*>
+<!ATTLIST figure xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST figure
+ %att.global.attributes;
+ %att.placement.attributes;
+ %att.typed.attributes; >
+<!--doc:(file description) contains a full bibliographic description of an electronic file. -->
+<!ELEMENT fileDesc ((titleStmt,editionStmt?,extent?,publicationStmt,seriesStmt?,notesStmt?),sourceDesc+)>
+<!ATTLIST fileDesc xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST fileDesc
+ %att.global.attributes; >
+<!--doc:(foreign) identifies a word or phrase as belonging to some language other than that of the
+                surrounding text.  -->
+<!ELEMENT foreign %macro.phraseSeq;>
+<!ATTLIST foreign xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST foreign
+ %att.global.attributes; >
+<!--doc:contains a mathematical or other formula. -->
+<!ELEMENT formula ( #PCDATA |
+ %model.graphicLike;)*>
+<!ATTLIST formula xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST formula
+ %att.global.attributes;
+notation %data.code;  #IMPLIED >
+<!--doc:(front matter) contains any prefatory matter (headers,
+title page, prefaces, dedications, etc.)
+found  at the start of a document, before the main body. -->
+<!ELEMENT front ((%model.frontPart; |
+ %model.pLike.front; |
+ %model.global;)*,((_DUMMY_model.div1Like,(%model.frontPart; |
+ _DUMMY_model.div1Like |
+ %model.global;)*) |
+ ((%model.divLike;),(%model.frontPart; |
+ %model.divLike; |
+ %model.global;)*))?,((%model.divBottomPart;),(%model.divBottomPart; |
+ %model.global;)*)?)>
+<!ATTLIST front xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST front
+ %att.global.attributes;
+ %att.declaring.attributes; >
+<!--doc:(funding body) specifies the name of an individual, institution, or organization responsible for the
+    funding of a project or text. -->
+<!ELEMENT funder %macro.phraseSeq.limited;>
+<!ATTLIST funder xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST funder
+ %att.global.attributes; >
+<!--doc:(gap) indicates a point where material has been omitted in a transcription, whether for editorial
+    reasons described in the TEI header, as part of sampling practice, or because the material is
+    illegible, invisible, or inaudible. -->
+<!ELEMENT gap (%model.glossLike;)*>
+<!ATTLIST gap xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST gap
+ %att.global.attributes;
+ %att.editLike.attributes;
+reason CDATA  #IMPLIED
+hand %data.pointer;  #IMPLIED
+agent %data.enumerated;  #IMPLIED >
+<!--doc:(geographic coordinates declaration) documents the notation and the datum used for geographic coordinates expressed as content of
+    the geo element elsewhere within the document. -->
+<!ELEMENT geoDecl %macro.phraseSeq;>
+<!ATTLIST geoDecl xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST geoDecl
+ %att.global.attributes;
+ %att.declarable.attributes;
+datum %data.enumerated;  "WGS84"  >
+<!--doc:(element name) contains the name (generic identifier) of an element. -->
+<!ELEMENT gi  (#PCDATA)>
+<!ATTLIST gi xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST gi
+ %att.global.attributes;
+scheme %data.enumerated;  "TEI"  >
+<!--doc:identifies a phrase or word used to provide a gloss or definition for some other word or
+    phrase. -->
+<!ELEMENT gloss %macro.phraseSeq;>
+<!ATTLIST gloss xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST gloss
+ %att.global.attributes;
+ %att.declaring.attributes;
+ %att.translatable.attributes;
+ %att.typed.attributes;
+ %att.pointing.attributes;
+cRef %data.pointer;  #IMPLIED >
+<!--doc:indicates the location of an inline graphic, illustration, or figure. -->
+<!ELEMENT graphic (%model.glossLike;)*>
+<!ATTLIST graphic xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST graphic
+ %att.global.attributes;
+ %att.internetMedia.attributes;
+ %att.declaring.attributes;
+width %data.outputMeasurement;  #IMPLIED
+height %data.outputMeasurement;  #IMPLIED
+scale %data.numeric;  #IMPLIED
+url %data.pointer;  #REQUIRED >
+<!--doc:contains the body of a composite text, grouping together a sequence of distinct texts (or
+    groups of such texts) which are regarded as a unit for some purpose, for example the collected
+    works of an author, a sequence of prose essays, etc. -->
+<!ELEMENT group ((%model.divTop; |
+ %model.global;)*,((text |
+ group),(text |
+ group |
+ %model.global;)*),(%model.divBottom;)*)>
+<!ATTLIST group xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST group
+ %att.global.attributes;
+ %att.declaring.attributes; >
+<!--doc:(heading) contains any type of heading, for example the title of a section, or the heading of a list,
+    glossary, manuscript description, etc. -->
+<!ELEMENT head %macro.paraContent;>
+<!ATTLIST head xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST head
+ %att.global.attributes;
+ %att.typed.attributes; >
+<!--doc:(highlighted) marks a word or phrase as graphically distinct from the
+        surrounding text, for reasons concerning which no claim is
+        made.  -->
+<!ELEMENT hi %macro.paraContent;>
+<!ATTLIST hi xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST hi
+ %att.global.attributes; >
+<!--doc:(identifier) contains an identifier or name for an object of some kind in a formal language. -->
+<!ELEMENT ident  (#PCDATA)>
+<!ATTLIST ident xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST ident
+ %att.global.attributes;
+ %att.typed.attributes; >
+<!--doc:(identifier) supplies any form of identifier used to identify some object,
+  such as a bibliographic item, a person, a title, an organization,
+  etc. in a standardized way. -->
+<!ELEMENT idno %macro.xtext;>
+<!ATTLIST idno xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST idno
+ %att.global.attributes;
+type %data.enumerated;  #IMPLIED >
+<!--doc:(index entry) marks a location to be indexed for whatever purpose. -->
+<!ELEMENT index (term,index?)*>
+<!ATTLIST index xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST index
+ %att.global.attributes;
+ %att.spanning.attributes;
+indexName %data.name;  #IMPLIED >
+<!--doc:(interpretation) summarizes a specific interpretative annotation which can be linked to a span of text. -->
+<!ELEMENT interp ( #PCDATA |
+ _DUMMY_model.gLike |
+ %model.glossLike;)*>
+<!ATTLIST interp xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST interp
+ %att.global.attributes;
+ %att.interpLike.attributes; >
+<!--doc:(interpretation group) collects together a set of related interpretations which share responsibility or type. -->
+<!ELEMENT interpGrp ((%model.glossLike;)*,interp+)>
+<!ATTLIST interpGrp xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST interpGrp
+ %att.global.attributes;
+ %att.interpLike.attributes; >
+<!--doc:contains one component of a list. -->
+<!ELEMENT item %macro.specialPara;>
+<!ATTLIST item xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST item
+ %att.global.attributes; >
+<!--doc:contains a list of keywords or phrases identifying the topic or nature of a text. -->
+<!ELEMENT keywords (term+ |
+ list)>
+<!ATTLIST keywords xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST keywords
+ %att.global.attributes;
+scheme %data.pointer;  #REQUIRED >
+<!--doc:(verse line) contains a single, possibly incomplete, line of verse. -->
+<!ELEMENT l %macro.paraContent;>
+<!ATTLIST l xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST l
+ %att.global.attributes;
+part (Y|N|I|M|F) "N"  >
+<!--doc:contains the label associated with an item in a list; in glossaries, marks the term being
+    defined. -->
+<!ELEMENT label %macro.phraseSeq;>
+<!ATTLIST label xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST label
+ %att.global.attributes; >
+<!--doc:(language usage) describes the languages, sublanguages, registers, dialects, etc.
+represented within a text. -->
+<!ELEMENT langUsage (language)+>
+<!ATTLIST langUsage xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST langUsage
+ %att.global.attributes;
+ %att.declarable.attributes; >
+<!--doc:characterizes a single language or sublanguage used within a text. -->
+<!ELEMENT language %macro.phraseSeq.limited;>
+<!ATTLIST language xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST language
+ %att.global.attributes;
+ident %data.language;  #REQUIRED
+usage CDATA #IMPLIED >
+<!--doc:(line break) marks the start of a new (typographic) line in some edition or version of a text. -->
+<!ELEMENT lb EMPTY>
+<!ATTLIST lb xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST lb
+ %att.global.attributes;
+ %att.typed.attributes;
+ %att.sourced.attributes;
+ %att.spanning.attributes;
+ %att.breaking.attributes; >
+<!--doc:(line group) contains a group of verse lines functioning as a formal unit, e.g. a stanza, refrain,
+        verse paragraph, etc. -->
+<!ELEMENT lg ((%model.divTop; |
+ %model.global;)*,(%model.lLike; |
+ lg),(%model.lLike; |
+ lg |
+ %model.global;)*,((%model.divBottom;),(%model.global;)*)*)>
+<!ATTLIST lg xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST lg
+ %att.global.attributes;
+ %att.divLike.attributes;
+ %att.typed.attributes;
+ %att.declaring.attributes; >
+<!--doc:(list) contains any sequence of items organized as a list. -->
+<!ELEMENT list (((%model.divTop;) |
+ (%model.global;))*,((item,(%model.global;)*)+ |
+ (label,(%model.global;)*,item,(%model.global;)*)+),((%model.divBottom;),(%model.global;)*)*)>
+<!ATTLIST list xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST list
+ %att.global.attributes;
+type %data.enumerated;  "simple"  >
+<!--doc:(citation list) contains a list of bibliographic citations of any kind.  -->
+<!ELEMENT listBibl ((%model.headLike;)*,(%model.biblLike; |
+ %model.milestoneLike; |
+ listBibl)+)>
+<!ATTLIST listBibl xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST listBibl
+ %att.global.attributes;
+ %att.declarable.attributes;
+ %att.typed.attributes; >
+<!--doc:(measure group) contains a group of dimensional specifications which relate to the same object, for example
+    the height and width of a manuscript page. -->
+<!ELEMENT measureGrp ( #PCDATA |
+ _DUMMY_model.gLike |
+ %model.measureLike;)*>
+<!ATTLIST measureGrp xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST measureGrp
+ %att.global.attributes;
+ %att.measurement.attributes;
+ %att.typed.attributes; >
+<!--doc:marks words or phrases mentioned, not used. -->
+<!ELEMENT mentioned %macro.phraseSeq;>
+<!ATTLIST mentioned xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST mentioned
+ %att.global.attributes; >
+<!--doc:marks a boundary point separating any kind of section of a text, typically but not
+    necessarily indicating a point at which some part of a standard reference system changes, where
+    the change is not represented by a structural element. -->
+<!ELEMENT milestone EMPTY>
+<!ATTLIST milestone xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST milestone
+ %att.global.attributes;
+ %att.typed.attributes;
+ %att.sourced.attributes;
+ %att.spanning.attributes;
+ %att.breaking.attributes;
+unit %data.enumerated;  #REQUIRED >
+<!--doc:(name, proper noun) contains a proper noun or noun phrase. -->
+<!ELEMENT name %macro.phraseSeq;>
+<!ATTLIST name xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST name
+ %att.global.attributes;
+ %att.naming.attributes;
+ %att.typed.attributes; >
+<!--doc:contains a note or annotation. -->
+<!ELEMENT note %macro.specialPara;>
+<!ATTLIST note xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST note
+ %att.global.attributes;
+ %att.placement.attributes;
+ %att.pointing.attributes;
+ %att.responsibility.attributes;
+ %att.typed.attributes;
+anchored %data.truthValue;  "true" 
+targetEnd CDATA  #IMPLIED >
+<!--doc:(notes statement) collects together any notes providing information about a text additional to that recorded
+    in other parts of the bibliographic description. -->
+<!ELEMENT notesStmt (%model.noteLike;)+>
+<!ATTLIST notesStmt xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST notesStmt
+ %att.global.attributes; >
+<!--doc:(number) contains a number, written in any form. -->
+<!ELEMENT num %macro.phraseSeq;>
+<!ATTLIST num xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST num
+ %att.global.attributes;
+ %att.ranging.attributes;
+type %data.enumerated;  #IMPLIED
+value %data.numeric;  #IMPLIED >
+<!--doc:groups together dateline, byline, salutation, and similar phrases appearing as a preliminary
+    group at the start of a division, especially of a letter. -->
+<!ELEMENT opener ( #PCDATA |
+ _DUMMY_model.gLike |
+ %model.phrase; |
+ argument |
+ byline |
+ dateline |
+ epigraph |
+ salute |
+ signed |
+ %model.global;)*>
+<!ATTLIST opener xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST opener
+ %att.global.attributes; >
+<!--doc:(original form) contains a reading which is marked as following the original, rather than being normalized
+        or corrected. -->
+<!ELEMENT orig %macro.paraContent;>
+<!ATTLIST orig xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST orig
+ %att.global.attributes;
+ %att.responsibility.attributes; >
+<!--doc:(paragraph) marks paragraphs in prose. -->
+<!ELEMENT p %macro.paraContent;>
+<!ATTLIST p xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST p
+ %att.global.attributes;
+ %att.declaring.attributes; >
+<!--doc:(page break) marks the boundary between one page of a text and the next in a standard reference system. -->
+<!ELEMENT pb EMPTY>
+<!ATTLIST pb xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST pb
+ %att.global.attributes;
+ %att.typed.attributes;
+ %att.sourced.attributes;
+ %att.spanning.attributes;
+ %att.breaking.attributes; >
+<!--doc: (punctuation character) a character or string of characters regarded as constituting a
+  single punctuation mark. -->
+<!ELEMENT pc ( #PCDATA |
+ _DUMMY_model.gLike)*>
+<!ATTLIST pc xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST pc
+ %att.global.attributes;
+ %att.segLike.attributes;
+ %att.typed.attributes;
+force (strong|weak|inter) #IMPLIED
+unit %data.enumerated;  #IMPLIED
+pre %data.truthValue;  #IMPLIED >
+<!--doc:contains a postscript, e.g. to a letter. -->
+<!ELEMENT postscript ((%model.common;) |
+ (%model.global;))*>
+<!ATTLIST postscript xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST postscript
+ %att.global.attributes; >
+<!--doc:(principal researcher) supplies the name of the principal researcher responsible for the
+creation of an electronic text. -->
+<!ELEMENT principal %macro.phraseSeq.limited;>
+<!ATTLIST principal xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST principal
+ %att.global.attributes; >
+<!--doc:(text-profile description) provides a detailed description of non-bibliographic aspects of a text, specifically the
+    languages and sublanguages used, the situation in which it was produced, the participants and
+    their setting. -->
+<!ELEMENT profileDesc (%model.profileDescPart;)*>
+<!ATTLIST profileDesc xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST profileDesc
+ %att.global.attributes; >
+<!--doc:(project description) describes in detail the aim or purpose for which an electronic file was encoded, together
+    with any other relevant information concerning the process by which it was assembled or
+    collected. -->
+<!ELEMENT projectDesc (%model.pLike;)+>
+<!ATTLIST projectDesc xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST projectDesc
+ %att.global.attributes;
+ %att.declarable.attributes; >
+<!--doc:(pointer) defines a pointer to another location. -->
+<!ELEMENT ptr EMPTY>
+<!ATTLIST ptr xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST ptr
+ %att.global.attributes;
+ %att.pointing.attributes;
+ %att.typed.attributes;
+ %att.declaring.attributes;
+cRef CDATA  #IMPLIED >
+<!--doc:(publication place) contains the name of the place where a bibliographic item was published. -->
+<!ELEMENT pubPlace %macro.phraseSeq;>
+<!ATTLIST pubPlace xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST pubPlace
+ %att.global.attributes;
+ %att.naming.attributes; >
+<!--doc:(publication statement) groups information concerning the publication or distribution of an electronic or other
+    text.  -->
+<!ELEMENT publicationStmt ((%model.pLike;)+ |
+ (%model.publicationStmtPart;)+)>
+<!ATTLIST publicationStmt xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST publicationStmt
+ %att.global.attributes; >
+<!--doc:provides the name of the organization responsible for the publication or distribution of a
+        bibliographic item. -->
+<!ELEMENT publisher %macro.phraseSeq;>
+<!ATTLIST publisher xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST publisher
+ %att.global.attributes; >
+<!--doc:(separated from the surrounding text with quotation marks) contains material which is marked as (ostensibly) being somehow different than the
+    surrounding text, for any one of a variety of reasons including, but not limited to: direct
+    speech or thought, technical terms or jargon, authorial distance, quotations from elsewhere, and
+    passages that are mentioned but not used. -->
+<!ELEMENT q %macro.specialPara;>
+<!ATTLIST q xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST q
+ %att.global.attributes;
+ %att.ascribed.attributes;
+type %data.enumerated;  #IMPLIED >
+<!--doc:(quotation) contains a phrase or passage attributed by the narrator or author to some agency external
+        to the text. -->
+<!ELEMENT quote %macro.specialPara;>
+<!ATTLIST quote xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST quote
+ %att.global.attributes;
+ %att.typed.attributes; >
+<!--doc:(reference) defines a reference to another location, possibly modified by additional text or comment. -->
+<!ELEMENT ref %macro.paraContent;>
+<!ATTLIST ref xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST ref
+ %att.global.attributes;
+ %att.pointing.attributes;
+ %att.typed.attributes;
+ %att.declaring.attributes;
+cRef CDATA  #IMPLIED >
+<!--doc:(reference state) specifies one component of a canonical reference defined by the milestone method. -->
+<!ELEMENT refState EMPTY>
+<!ATTLIST refState xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST refState
+ %att.global.attributes;
+ %att.sourced.attributes;
+unit %data.enumerated;  #REQUIRED
+length %data.count;  #IMPLIED
+delim CDATA #IMPLIED >
+<!--doc:(references declaration) specifies how canonical references are constructed for this
+  text. -->
+<!ELEMENT refsDecl ((%model.pLike;)+ |
+ cRefPattern+ |
+ refState+)>
+<!ATTLIST refsDecl xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST refsDecl
+ %att.global.attributes;
+ %att.declarable.attributes; >
+<!--doc:(regularization) contains a reading which has been regularized or normalized in some sense. -->
+<!ELEMENT reg %macro.paraContent;>
+<!ATTLIST reg xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST reg
+ %att.global.attributes;
+ %att.editLike.attributes;
+ %att.typed.attributes; >
+<!--doc:contains or references some other bibliographic item which is related to the present one in
+    some specified manner, for example as a constituent or alternative version of it. -->
+<!ELEMENT relatedItem (%model.biblLike; |
+ %model.ptrLike;)?>
+<!ATTLIST relatedItem xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST relatedItem
+ %att.global.attributes;
+ %att.typed.attributes;
+target %data.pointer;  #IMPLIED >
+<!--doc:(responsibility) contains a phrase describing the nature of a person's intellectual responsibility. -->
+<!ELEMENT resp %macro.phraseSeq.limited;>
+<!ATTLIST resp xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST resp
+ %att.global.attributes;
+ %att.canonical.attributes; >
+<!--doc:(statement of responsibility) supplies a statement of responsibility for the intellectual content of a text, edition,
+    recording, or series, where the specialized elements for authors, editors, etc. do not suffice
+    or do not apply. -->
+<!ELEMENT respStmt ((resp+,(%model.nameLike.agent;)+) |
+ ((%model.nameLike.agent;)+,resp+))>
+<!ATTLIST respStmt xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST respStmt
+ %att.global.attributes; >
+<!--doc:(revision description) summarizes the revision history for a file. -->
+<!ELEMENT revisionDesc (list |
+ change+)>
+<!ATTLIST revisionDesc xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST revisionDesc
+ %att.global.attributes;
+ %att.docStatus.attributes; >
+<!--doc:contains one row of a table.  -->
+<!ELEMENT row (cell)+>
+<!ATTLIST row xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST row
+ %att.global.attributes;
+ %att.tableDecoration.attributes; >
+<!--doc:(referencing string) contains a general purpose name or referring string. -->
+<!ELEMENT rs %macro.phraseSeq;>
+<!ATTLIST rs xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST rs
+ %att.global.attributes;
+ %att.naming.attributes;
+type %data.enumerated;  #IMPLIED >
+<!--doc:(s-unit) contains a sentence-like division of a text. -->
+<!ELEMENT s %macro.phraseSeq;>
+<!ATTLIST s xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST s
+ %att.global.attributes;
+ %att.segLike.attributes;
+ %att.typed.attributes; >
+<!--doc:(speech or thought) indicates passages thought or spoken aloud, whether explicitly indicated in the source or
+    not, whether directly or indirectly reported, whether by real people or fictional characters. -->
+<!ELEMENT said %macro.specialPara;>
+<!ATTLIST said xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST said
+ %att.global.attributes;
+ %att.ascribed.attributes;
+aloud %data.xTruthValue;  "unknown" 
+direct %data.xTruthValue;  "true"  >
+<!--doc:(salutation) contains a salutation or greeting prefixed to a foreword, dedicatory epistle, or other
+    division of a text, or the salutation in the closing of a letter, preface, etc. -->
+<!ELEMENT salute %macro.phraseSeq;>
+<!ATTLIST salute xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST salute
+ %att.global.attributes; >
+<!--doc:(sampling declaration) contains a prose description of the rationale and methods used in sampling texts in the
+    creation of a corpus or collection. -->
+<!ELEMENT samplingDecl (%model.pLike;)+>
+<!ATTLIST samplingDecl xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST samplingDecl
+ %att.global.attributes;
+ %att.declarable.attributes; >
+<!--doc:describes a particular script distinguished within
+    the description of a manuscript or similar resource. -->
+<!ELEMENT scriptNote %macro.specialPara;>
+<!ATTLIST scriptNote xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST scriptNote
+ %att.global.attributes;
+ %att.handFeatures.attributes; >
+<!--doc:(arbitrary segment) represents any segmentation of text below the chunk level. -->
+<!ELEMENT seg %macro.paraContent;>
+<!ATTLIST seg xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST seg
+ %att.global.attributes;
+ %att.segLike.attributes;
+ %att.typed.attributes;
+ %att.responsibility.attributes; >
+<!--doc:(series statement) groups information about the series, if any, to which a publication belongs. -->
+<!ELEMENT seriesStmt ((%model.pLike;)+ |
+ (title+,(idno |
+ respStmt)*))>
+<!ATTLIST seriesStmt xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST seriesStmt
+ %att.global.attributes; >
+<!--doc:(latin for thus or so
+  ) contains text reproduced although apparently incorrect or inaccurate. -->
+<!ELEMENT sic %macro.paraContent;>
+<!ATTLIST sic xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST sic
+ %att.global.attributes;
+ %att.responsibility.attributes; >
+<!--doc:(signature) contains the closing salutation, etc., appended to a foreword,
+dedicatory epistle, or other division of a text.  -->
+<!ELEMENT signed %macro.phraseSeq;>
+<!ATTLIST signed xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST signed
+ %att.global.attributes; >
+<!--doc:contains a word or phrase for which the author or narrator indicates a disclaiming of
+    responsibility, for example by the use of scare quotes or italics. -->
+<!ELEMENT soCalled %macro.phraseSeq;>
+<!ATTLIST soCalled xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST soCalled
+ %att.global.attributes; >
+<!--doc:(source description) describes the source from which an electronic text was derived or generated, typically a
+    bibliographic description in the case of a digitized text, or a phrase such as "born digital"
+    for a text which has no previous existence. -->
+<!ELEMENT sourceDesc ((%model.pLike;)+ |
+ (%model.biblLike; |
+ _DUMMY_model.sourceDescPart |
+ %model.listLike;)+)>
+<!ATTLIST sourceDesc xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST sourceDesc
+ %att.global.attributes;
+ %att.declarable.attributes; >
+<!--doc:(speech) An individual speech in a performance text, or a passage presented as such in a prose or
+    verse text. -->
+<!ELEMENT sp ((%model.global;)*,(speaker,(%model.global;)*)?,((%model.lLike; |
+ lg |
+ %model.pLike; |
+ %model.stageLike; |
+ %model.qLike;),(%model.global;)*)+)>
+<!ATTLIST sp xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST sp
+ %att.global.attributes;
+ %att.ascribed.attributes; >
+<!--doc:A specialized form of heading or label, giving the name of one or more speakers in a
+        dramatic text or fragment. -->
+<!ELEMENT speaker %macro.phraseSeq;>
+<!ATTLIST speaker xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST speaker
+ %att.global.attributes; >
+<!--doc:specifies the name of a sponsoring organization or institution. -->
+<!ELEMENT sponsor %macro.phraseSeq.limited;>
+<!ATTLIST sponsor xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST sponsor
+ %att.global.attributes; >
+<!--doc:(stage direction) contains any kind of stage direction within a dramatic text or fragment. -->
+<!ELEMENT stage %macro.specialPara;>
+<!ATTLIST stage xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST stage
+ %att.global.attributes;
+type %data.enumerated;  #IMPLIED >
+<!--doc:contains text displayed in tabular form, in rows and columns. -->
+<!ELEMENT table ((%model.headLike; |
+ %model.global;)*,(row,(%model.global;)*)+)>
+<!ATTLIST table xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST table
+ %att.global.attributes;
+rows %data.count;  #IMPLIED
+cols %data.count;  #IMPLIED >
+<!--doc:defines a typology used to classify texts either implicitly, by means of a bibliographic
+    citation, or explicitly by a structured taxonomy. -->
+<!ELEMENT taxonomy ((%model.glossLike;)* |
+ category+ |
+ ((%model.biblLike;),category*))>
+<!ATTLIST taxonomy xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST taxonomy
+ %att.global.attributes; >
+<!--doc:contains the whole of a TEI encoded corpus, comprising a single corpus header and one or
+    more TEI elements, each containing a single text header and a text. -->
+<!ELEMENT teiCorpus (teiHeader,(TEI |
+ teiCorpus)+)>
+<!ATTLIST teiCorpus xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST teiCorpus
+ %att.global.attributes;
+version %data.version;  "5.0"  >
+<!ATTLIST teiCorpus xsi:schemaLocation CDATA #IMPLIED
+ xmlns:xsi CDATA #FIXED 'http://www.w3.org/2001/XMLSchema-instance'
+ >
+<!--doc:(TEI Header) supplies the descriptive and declarative information making up an electronic title page
+    prefixed to every TEI-conformant text. -->
+<!ELEMENT teiHeader (fileDesc,(%model.teiHeaderPart;)*,revisionDesc?)>
+<!ATTLIST teiHeader xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST teiHeader
+ %att.global.attributes;
+type %data.enumerated;  "text"  >
+<!--doc:contains a single-word, multi-word, or symbolic designation which is regarded as a technical
+    term. -->
+<!ELEMENT term %macro.phraseSeq;>
+<!ATTLIST term xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST term
+ %att.global.attributes;
+ %att.declaring.attributes;
+ %att.pointing.attributes;
+ %att.typed.attributes;
+ %att.canonical.attributes;
+cRef %data.pointer;  #IMPLIED
+sortKey %data.word;  #IMPLIED >
+<!--doc:contains a single text of any kind, whether unitary or composite, for example a poem or
+    drama, a collection of essays, a novel, a dictionary, or a corpus sample. -->
+<!ELEMENT text ((%model.global;)*,(front,(%model.global;)*)?,(body |
+ group),(%model.global;)*,(back,(%model.global;)*)?)>
+<!ATTLIST text xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST text
+ %att.global.attributes;
+ %att.declaring.attributes;
+ %att.typed.attributes; >
+<!--doc:(text classification) groups information which describes the nature or topic of a text in terms of a standard
+    classification scheme, thesaurus, etc. -->
+<!ELEMENT textClass (classCode |
+ catRef |
+ keywords)*>
+<!ATTLIST textClass xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST textClass
+ %att.global.attributes;
+ %att.declarable.attributes; >
+<!--doc:contains a phrase defining a time of day in any format. -->
+<!ELEMENT time ( #PCDATA |
+ _DUMMY_model.gLike |
+ %model.phrase; |
+ %model.global;)*>
+<!ATTLIST time xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST time
+ %att.global.attributes;
+ %att.datable.attributes;
+ %att.editLike.attributes;
+ %att.typed.attributes; >
+<!--doc:contains a title for any kind of work. -->
+<!ELEMENT title %macro.paraContent;>
+<!ATTLIST title xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST title
+ %att.global.attributes;
+ %att.canonical.attributes;
+level (a|m|j|s|u) #IMPLIED
+type %data.enumerated;  #IMPLIED >
+<!--doc:(title page) contains the title page of a text, appearing within the front or back matter.  -->
+<!ELEMENT titlePage ((%model.global;)*,(%model.titlepagePart;),(%model.titlepagePart; |
+ %model.global;)*)>
+<!ATTLIST titlePage xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST titlePage
+ %att.global.attributes;
+type %data.enumerated;  #IMPLIED >
+<!--doc:contains a subsection or division of the title of a work, as
+indicated on a title page. -->
+<!ELEMENT titlePart %macro.paraContent;>
+<!ATTLIST titlePart xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST titlePart
+ %att.global.attributes;
+type %data.enumerated;  "main"  >
+<!--doc:(title statement) groups information about the title of a work and those responsible for its intellectual
+    content. -->
+<!ELEMENT titleStmt (title+,(%model.respLike;)*)>
+<!ATTLIST titleStmt xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST titleStmt
+ %att.global.attributes; >
+<!--doc:contains a closing title or footer appearing at the end of a division of a text.  -->
+<!ELEMENT trailer %macro.phraseSeq;>
+<!ATTLIST trailer xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST trailer
+ %att.global.attributes; >
+<!--doc:describes a particular font or other significant typographic feature distinguished within
+    the description of a printed resource. -->
+<!ELEMENT typeNote %macro.specialPara;>
+<!ATTLIST typeNote xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST typeNote
+ %att.global.attributes;
+ %att.handFeatures.attributes; >
+<!--doc:contains a word, phrase, or passage which cannot be transcribed with certainty because it
+        is illegible or inaudible in the source. -->
+<!ELEMENT unclear %macro.paraContent;>
+<!ATTLIST unclear xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST unclear
+ %att.global.attributes;
+ %att.editLike.attributes;
+reason CDATA  #IMPLIED
+hand %data.pointer;  #IMPLIED
+agent %data.enumerated;  #IMPLIED >
+<!--doc:(value) contains a single attribute value. -->
+<!ELEMENT val  (#PCDATA)>
+<!ATTLIST val xmlns CDATA "http://www.tei-c.org/ns/1.0">
+<!ATTLIST val
+ %att.global.attributes; >
+<!-- end elements -->

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odt/teilite.dtd
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/nlm/tei_to_nlm.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/nlm/tei_to_nlm.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/nlm/tei_to_nlm.xsl	(revision 728)
@@ -0,0 +1,749 @@
+<?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">
+
+  <!--
+        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">
+
+        <!-- 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>
+
+        <!--        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>
+
+          <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>
+
+<!-- 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>
+
+<!--        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>
+
+      </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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/nlm/tei_to_nlm.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/nlm/nlm_3_to_nlm_2.3.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/nlm/nlm_3_to_nlm_2.3.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/nlm/nlm_3_to_nlm_2.3.xsl	(revision 728)
@@ -0,0 +1,143 @@
+<?xml version="1.0"?>
+<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>
+
+  <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 
+                      @person-group-type='assignee' or 
+                      @person-group-type='author' or 
+                      @person-group-type='compiler' or 
+                      @person-group-type='director' or 
+                      @person-group-type='editor' or 
+                      @person-group-type='guest-editor' or 
+                      @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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/nlm/nlm_3_to_nlm_2.3.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub/epub-common.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub/epub-common.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub/epub-common.xsl	(revision 728)
@@ -0,0 +1,505 @@
+<?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:
+
+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.
+</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])"/>
+
+  <xsl:param name="javascriptFiles"/>
+  <xsl:param name="epubMimetype">application/epub+zip</xsl:param>
+
+  <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:template name="generateSubjectHook"/>
+
+  <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>
+
+  <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:lb[@rend='space']">
+    <xsl:text> </xsl:text>
+  </xsl:template>
+
+  <xsl:template match="tei:milestone[@unit='line']">
+    <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:projectDesc" mode="metadata">
+    <h3>Creation</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: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: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:licence" mode="metadata">
+    <div>
+      <xsl:apply-templates/>
+    </div>
+  </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"
+		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="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 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">
+    <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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub/epub-common.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub/build-to.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub/build-to.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub/build-to.xml	(revision 728)
@@ -0,0 +1,120 @@
+<?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"/>
+
+  <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>
+</project>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub/build-to.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub/tei-to-epub.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub/tei-to-epub.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub/tei-to-epub.xsl	(revision 728)
@@ -0,0 +1,904 @@
+<?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:
+
+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.
+</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;
+}
+img.fullpage {
+position: absolute;
+height: </xsl:text>
+            <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>
+
+          <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: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">
+                          <xsl:text>pagefacs</xsl:text>
+                          <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"/>
+                          <xsl:text>-audio</xsl:text>
+                        </xsl:attribute>
+                      </xsl:if>
+                      <xsl:attribute name="id">
+                        <xsl:text>page</xsl:text>
+                        <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">
+                            <xsl:text>section</xsl:text>
+                            <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">
+                            <xsl:text>section</xsl:text>
+                            <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">
+                          <xsl:text>pagefacs</xsl:text>
+                          <xsl:number level="any"/>
+                        </xsl:attribute>
+                        <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: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:text>section</xsl:text>
+                            <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:text>section</xsl:text>
+                            <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: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])"/>
+                        </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])"/>
+                              </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">
+		      font-family: serif; 
+		      height:860;          
+		      font-size:30pt; 
+		      font-weight: bold;
+		      padding-top: 15pt;
+		      margin: 12pt;
+		      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: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>
+
+  <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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub/tei-to-epub.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub/epub-preflight.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub/epub-preflight.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub/epub-preflight.xsl	(revision 728)
@@ -0,0 +1,143 @@
+<?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:
+
+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.
+</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>
+
+  <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: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: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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/epub/epub-preflight.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tbx/teitotbx.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tbx/teitotbx.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tbx/teitotbx.xsl	(revision 728)
@@ -0,0 +1,96 @@
+<?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:
+
+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.
+</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:key name="T" match="tbx:termEntry" use="1"/>
+
+<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="*">
+      <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>
+
+
+
+

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tbx/teitotbx.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odd.css
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/odd.css	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/odd.css	(revision 728)
@@ -0,0 +1,382 @@
+/* tables for reference display */
+table.wovenodd {
+    width: 100%;
+    clear: both;
+}
+td.wovenodd-col1 {
+    width:15%;
+    vertical-align: top;
+}
+td.wovenodd-col2 {
+    width:85%;
+}
+table.wovenodd tr td {
+    border: 1px solid #555;
+    padding:1%;
+}
+table.wovenodd {
+    border-spacing:0px;
+    border-collapse:collapse;
+}
+table.wovenodd tr td {
+    border-spacing:0px;
+}
+table.wovenodd tr {
+    border-spacing:0px;
+    border-collapse:collapse;
+}
+table.wovenodd tr td table.attList {
+    border-spacing:0px;
+    border:none;
+}
+table.wovenodd tr td table.attList tr {
+    border-spacing:0px;
+    border:none;
+}
+table.wovenodd tr td table.attList tr td {
+    border-spacing:0px;
+    border:none;
+}
+table.attList {
+    table-layout: fixed;
+    width: 100%;
+    margin: 0pt;
+    padding: 0pt;
+}
+td.odd_label {
+    vertical-align: top;
+    width: 10%;
+    font-weight: bold;
+}
+td.odd_value {
+    vertical-align: top;
+    width: 90%;
+}
+table.attDef {
+    table-layout: fixed;
+    width: 100%;
+}
+table.attDef td.odd_label {
+    width: 10%;
+    vertical-align: top;
+    font-weight: normal;
+}
+table.attDef td.odd_value {
+    vertical-align: top;
+    width: 90%;
+}
+table.attList  td.odd_label:before {
+    content: "@";
+}
+table.attDef  td.odd_label:before {
+    content: "";
+}
+table.valList  td.odd_label:before {
+    content: "";
+}
+table.valList {
+    table-layout: fixed;
+    width: 100%;
+}
+table.valList td.odd_label {
+    width: 10%;
+    vertical-align: top;
+    font-style: normal;
+    font-weight: normal;
+}
+table.valList td.odd_value {
+    vertical-align: top;
+    width: 90%;
+}
+table.specDesc td.Attribute {
+    font-weight: bold;
+    vertical-align: top;
+}
+table.specDesc {
+    margin-left: 1em;
+}
+td p {
+    margin-top: 0pt;
+    margin-bottom: 2pt;
+}
+
+div.cdata {
+    white-space: pre;
+    clear:both;
+}
+
+span.tag:before {
+     
+}
+span.tag:after {
+     
+}
+span.gi,span.tag {
+}
+span.att {
+     
+}
+span.att:before {
+    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-file, span.ident-ns {
+    font-style: italic;
+}
+
+button.displayRelaxButton {
+    margin-right: 2px;
+    margin-top: 2px;
+    font-size: 70%;
+    float: right;
+    cursor: pointer;
+}
+pre.RNG_XML {
+	    display: none;
+	    }
+
+span.RNG_XML {
+	    display: none;
+	    }
+
+/* pretty printing of XML */
+td.classSpec, td.macroSpec {
+    font-weight: bold;
+}
+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_class:link,a.link_odd_class:visited {
+
+}
+span.element {
+    font-weight: bold;
+    color: black;
+}
+td.elementSpec,span.elementname {
+    font-weight: bold;
+    color: #222288;
+}
+span.highlightelementname {
+    color: red;
+}
+
+span.attribute {
+    color: #222288;
+}
+span.attributevalue {
+    color: black;
+}
+span.comment {
+    color: black;
+    font-style:italic;
+}
+span.namespace {
+    color: #222288;
+}
+/* pretty print rnc */
+span.rnc_nc {
+    color: #006400;
+}
+span.rnc_decl {
+    color: green;
+}
+span.rnc_prefix {
+    color: blue;
+}
+span.rnc_param {
+    color: gray;
+}
+span.rnc_atom {
+    color: yellow;
+}
+span.rnc_annot {
+    color: #FF8040;
+}
+span.rnc_comment {
+    color: #FF00FF;
+}
+span.rnc_annot {
+    color: #00FFFF;
+}
+span.rnc_type {
+    color: purple;
+}
+span.rnc_keyword {
+    color: teal;
+}
+span.defaultVal {
+    font-weight: bold;
+}
+span.required {
+    font-weight: bold;
+}
+div.moduleSpec {
+    padding: 1px;
+    margin: 1px;
+    background-color: #C0C0C0;
+    color:inherit;
+    clear:right;
+}
+span.moduleSpecHead {
+    font-style: italic;
+}
+ul.specList li {
+    list-style: none;
+}
+span.specList-macroSpec {
+    font-weight: bold;
+}
+span.specList-elementSpec {
+    font-weight: bold;
+}
+span.specList-elementSpec:before {
+    content: "<";
+     
+}
+span.specList-elementSpec:after {
+    content: ">";
+     
+}
+span.specList-classSpec {
+    font-weight: bold;
+}
+span.specName {
+    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;
+}
+#azindex p {
+    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;
+}
+.index li {
+    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;
+}
+li.showall, li.showall a:visited,li.showall a:link {
+    width: 10em;
+}
+* html .index li {
+    margin: 0.2em 0.2em;
+}
+ul.index li a:hover {
+    background-color: #93D1E4;
+    color: #fff;
+    text-decoration: underline;
+}
+div.atozwrapper {
+   float: left;
+   width: 70%;
+}
+div.atoz {    
+   clear: left;
+   float: left;
+}    
+#byMod {
+   margin-top: 12px;
+   clear: left;
+}
+ul.atoz {
+    list-style: none;
+    text-align:left;
+    margin: 2px;
+    padding: 2px;
+    background-color: #eef;
+    color:inherit;
+}
+.atoz li {
+    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;
+}
+/* End of A - Z styles */
+div.specChildren {
+    margin: 0em;
+    padding: 0em;
+}
+span.specChildModule {
+    font-weight: bold;
+}
+div.specChild {
+    margin-bottom: 4pt;
+    margin-left: 25px;
+    text-indent: -30px;
+}
+span.emptySlash:after {
+    content: "/";
+}
+/* status notation */
+.status_deprecated:after {
+    content: " (deprecated)";
+    color: red;
+}
+.status_changed:after {
+    content: " (changed)";
+    color: blue;
+}
+.status_unstable:after {
+    content: " (unstable)";
+    color: orange;
+}
+.status_deprecated {
+    border: solid red 1pt;
+}
+.status_changed {
+    border: solid blue 1pt;
+}
+.status_unstable {
+    border: solid orange 1pt;
+}
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/odd.css
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/processpb.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/processpb.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/processpb.xsl	(revision 728)
@@ -0,0 +1,164 @@
+<?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:
+
+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"/>
+
+  <xsl:template match="teiHeader">
+    <xsl:copy-of select="."/>
+  </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>
+
+  <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>
+
+
+ <!-- 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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/processpb.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/getfiles.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/getfiles.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/getfiles.xsl	(revision 728)
@@ -0,0 +1,104 @@
+<?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: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="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="*" mode="copy">
+      <xsl:copy>
+         <xsl:apply-templates select="*|@*|text()" mode="copy"/>
+      </xsl:copy>
+  </xsl:template>
+  
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/getfiles.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/analyze.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/analyze.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/analyze.xsl	(revision 728)
@@ -0,0 +1,18 @@
+<?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>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/analyze.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/checkodd.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/checkodd.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/checkodd.xsl	(revision 728)
@@ -0,0 +1,56 @@
+<?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:
+
+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
+-->
+
+<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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/checkodd.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/checkxsl.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/checkxsl.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/checkxsl.xsl	(revision 728)
@@ -0,0 +1,67 @@
+<?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:
+
+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
+-->
+
+<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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/checkxsl.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/fixdocprop.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/fixdocprop.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/fixdocprop.xsl	(revision 728)
@@ -0,0 +1,38 @@
+<?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: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: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>
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/fixdocprop.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/oucs.docx
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/oucs.docx
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/fixstyle
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/fixstyle	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/fixstyle	(revision 728)
@@ -0,0 +1,97 @@
+#!/bin/sh
+HERE=`pwd`
+IN=`basename $1`
+OUT=`basename $2`
+INd=`dirname $1`
+OUTd=`dirname $2`
+INDIR=`(cd $INd; pwd)`
+OUTDIR=`(cd $OUTd; pwd)`
+AD=`dirname $0`
+APPDIR=`(cd $AD; pwd)`
+mkdir temp$$
+cd temp$$
+unzip -q $INDIR/$IN
+# remove old template
+if test -e $OUTDIR/$OUT
+then
+  echo "remove old template"
+  rm $OUTDIR/$OUT
+fi
+
+# remove custom document properties
+if test -e docProps/custom.xml
+then
+  echo "removed custom.xml"
+  rm docProps/custom.xml
+  #saxon docProps/custom.xml $APPDIR/fixdocprop.xsl  template="$3" > x.xml
+  #mv x.xml docProps/custom.xml
+fi
+
+# remove custom xml folder
+if test -e customXml
+then
+  echo "remove customXml folder"
+  rm -r customXml
+fi
+
+# remove webSettings
+if test -e word/webSettings.xml
+then
+	echo "remove webSettings.xml"
+	rm word/webSettings.xml
+fi
+
+# remove word/_rels/settings.xml.rels
+if test -e word/_rels/settings.xml.rels
+then
+	echo "remove settings.xml.rels"
+	rm word/_rels/settings.xml.rels	
+fi
+
+# remove headers and footers
+echo "remove all header and footer files"
+rm word/footer*
+rm word/header*
+
+# remove theme directory
+if test -e word/theme
+then
+	echo "remove document themes"
+	rm -r word/theme
+fi
+	
+
+# remove endnotes and footnotes
+if test -e word/endnotes.xml
+then
+	echo "remove endotes.xml"
+	rm word/endnotes.xml
+fi
+if test -e word/footnotes.xml
+then
+	echo "remove footnotes.xml"
+	rm word/footnotes.xml
+fi
+
+
+# remove glossary dir
+if test -e word/glossary
+then
+	echo "remove glossary directory"
+	rm -r word/glossary
+fi
+
+# fix .rels
+saxon _rels/.rels $APPDIR/fixdotrels.xsl > x
+mv x _rels/.rels
+
+#fix styles
+saxon word/styles.xml $APPDIR/fixstyle.xsl > x
+mv x word/styles.xml
+
+# zip back together
+zip -r -q $OUTDIR/$OUT .
+cd ..
+rm -rf temp$$
+
+echo "stored template in $OUTDIR/$OUT"
Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/fixdotrels.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/fixdotrels.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/fixdotrels.xsl	(revision 728)
@@ -0,0 +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: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>
+
+  <!-- do not copy custom xml rel -->
+  <xsl:template match="*[@Target='docProps/custom.xml']"/>
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/fixdotrels.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/fixstyle.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/fixstyle.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/fixstyle.xsl	(revision 728)
@@ -0,0 +1,208 @@
+<?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: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>
+
+  <!-- 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: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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/fixstyle.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/build.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/build.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/build.xml	(revision 728)
@@ -0,0 +1,85 @@
+<?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"/>
+  
+	<!-- modfiy basedir, if necessary: -Dbasedir=... -->
+	<echo>     basedir: ${basedir}</echo>
+	
+	<!-- profile, may be overwritten by external property: -Dprofile=default -->
+	<property name="profile" value="default"/>
+    
+	<!-- the profiles directory, may be overwritten by: -DprofilesDir=... -->
+	<property name="profilesDir">../../profiles/</property>
+	<echo> profilesDir: ${profilesDir}</echo>
+
+	<!-- the source directory, may be overwritten by: -DsourceDir=... -->
+	<property name="sourceDir">${profilesDir}${profile}/docx/</property>
+
+	<!-- 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. -->
+	<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>
+	
+	<!-- 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" />
+
+	<!-- remove custom document properties -->
+	<delete includeEmptyDirs="true" verbose="true">
+		<fileset dir="${temp}">
+			<include name="docProps/custom.xml" />
+			<include name="word/webSettings.xml" />
+			<include name="word/_rels/settings.xml.rels" />
+			<include name="word/endnotes.xml" />
+			<include name="word/footnotes.xml" />
+			<include name="customXml/*" />
+			<include name="word/footer*" />
+			<include name="word/header*" />
+			<include name="word/theme" />
+			<include name="word/glossary" />
+		</fileset>
+	</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>
+	<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>
+	<move file="${temp}word/_styles.xml" tofile="${temp}word/styles.xml" verbose="true" />
+
+	<!-- zip back together -->
+	<zip destfile="${targetFile}" basedir="${temp}" />
+
+	<!-- delete the working directory whith all its content -->
+	<echo>remove working directory</echo>
+	<delete includeEmptyDirs="true" verbose="true">
+		<fileset dir="${temp}"/>
+	</delete>
+
+	<echo>  target template stored in ${targetFile}</echo>
+
+</project>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/build.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/template-oucs.docx
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/template-oucs.docx
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/enrich_template.docx
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/docx-templates-twiddling/enrich_template.docx
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/tangle.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/tangle.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/tangle.xsl	(revision 728)
@@ -0,0 +1,27 @@
+<?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: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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/tangle.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/checki18n.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/checki18n.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/checki18n.xsl	(revision 728)
@@ -0,0 +1,23 @@
+<?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: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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/checki18n.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/oddbyexample.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/oddbyexample.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/oddbyexample.xsl	(revision 728)
@@ -0,0 +1,434 @@
+<?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: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:text> </xsl:text>
+              <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>
+
+
+</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:choose>
+        <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="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.word']">true</xsl:when>
+      -->
+        <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 match="text()" mode="copy"/>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/oddbyexample.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/iden.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/iden.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/iden.xsl	(revision 728)
@@ -0,0 +1,57 @@
+<?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:
+
+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: 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>
+
+
+   <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/iden.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/xhtml2tei.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/xhtml2tei.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/xhtml2tei.xsl	(revision 728)
@@ -0,0 +1,483 @@
+<?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:output method="xml" indent="yes"/>
+
+   <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: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: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>
+
+
+   <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>
+
+   <!-- 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: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: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: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: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>
+
+   <!-- ====== 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>
+
+   <!-- ============ 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: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:ul">
+      <list type="unordered">
+         <xsl:apply-templates/>
+      </list>
+   </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>
+
+
+
+   <!-- 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: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:attribute>
+         </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: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: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: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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/xhtml2tei.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/odd2nuodd.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/odd2nuodd.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/odd2nuodd.xsl	(revision 728)
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="utf-8"?>
+<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"
+>
+
+  <!--
+      
+      $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:variable name="orig" select="/"/>
+
+  <!-- identifty transforms -->
+  <xsl:template match="@*|text()|comment()|processing-instruction()">
+    <xsl:copy-of select="."/>
+  </xsl:template>
+
+  <xsl:template match="@*|text()|comment()|processing-instruction()" mode="stage2">
+    <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="*" 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"/>
+
+  <!-- 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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/odd2nuodd.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/makegraphicsanttask.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/makegraphicsanttask.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/makegraphicsanttask.xsl	(revision 728)
@@ -0,0 +1,141 @@
+<?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:
+
+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.
+</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: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>
+
+	 <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/makegraphicsanttask.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/html2tei.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/html2tei.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/html2tei.xsl	(revision 728)
@@ -0,0 +1,377 @@
+<?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:output method="xml" indent="yes"/>
+
+  <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="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: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="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="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="tei:p[not(node())]"
+		mode="pass1"/>
+
+  <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>
+
+  <xsl:template match="@*|text()|comment()|processing-instruction()" mode="pass2">
+    <xsl:copy-of select="."/>
+  </xsl:template>
+
+  <xsl:template match="tei:p[not(*) and normalize-space(.)='']" mode="pass2"/>
+
+  <xsl:template match="*" mode="pass2">
+    <xsl:copy>
+      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="pass2"/>
+    </xsl:copy>
+  </xsl:template>
+
+  <xsl:template match="br">
+    <lb/>
+  </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="li">
+    <item>
+      <xsl:apply-templates/>
+    </item>
+  </xsl:template>
+
+  <xsl:template match="div">
+      <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="link">
+</xsl:template>
+
+  <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:matching-substring>
+              <xsl:text>px</xsl:text>
+            </xsl:matching-substring>
+          </xsl:analyze-string>
+        </xsl:attribute>
+      </xsl:for-each>
+    </graphic>
+  </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="sup">
+    <hi rend="sup">
+      <xsl:apply-templates/>
+    </hi>
+  </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="@title"/>
+
+  <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="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="font">
+      <xsl:apply-templates/>
+  </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="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="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="hr"/>
+
+  <xsl:template match="*">
+    <xsl:message>UNKNOWN TAG <xsl:value-of select="name()"/></xsl:message>
+    <xsl:apply-templates/>
+  </xsl:template>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/html2tei.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/ImageInfo/build.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/ImageInfo/build.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/ImageInfo/build.xml	(revision 728)
@@ -0,0 +1,18 @@
+<project name="Image Size Reader" default='build'>
+
+	<target name="build">
+		<mkdir dir="bin" />
+		<javac srcdir='src' destdir='bin' includeantruntime='true' />
+		<copy file='antlib.xml' todir='bin' />
+	</target>
+
+	<target name='jar' depends='build'>
+		<jar destfile='ImageInfo.jar' basedir='bin' />
+	</target>
+
+	<target name='clean'>
+		<delete dir='bin' />
+		<delete dir='build' />
+	</target>
+
+</project>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/ImageInfo/build.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/ImageInfo/antlib.xml
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/ImageInfo/antlib.xml	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/ImageInfo/antlib.xml	(revision 728)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<antlib>
+	<taskdef name="generate-image-size-report" classname="ImageTask" />
+</antlib>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/ImageInfo/antlib.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/ImageInfo/ImageInfo.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/ImageInfo/ImageInfo.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/extract-xsl-from-sch.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/extract-xsl-from-sch.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/extract-xsl-from-sch.xsl	(revision 728)
@@ -0,0 +1,78 @@
+<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"
+>
+
+<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: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="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:stylesheet>
+
+
+</xsl:template>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/extract-xsl-from-sch.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/addlang.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/addlang.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/addlang.xsl	(revision 728)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+   <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:key name="K" match="entry" use="key"/>
+
+   <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>
+
+   <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>
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/addlang.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/folint.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/folint.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/folint.xsl	(revision 728)
@@ -0,0 +1,3224 @@
+<?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">
+
+   <xsl:output method="xml" omit-xml-declaration="yes"/>
+
+   <!-- Strictness level. Currently used levels: 0 (loose), 1 (normal), 2 (pedantic) -->
+<xsl:param name="strictness">1</xsl:param>
+
+   <!-- =================================== -->
+<!-- Match topmost node - must be <root> -->
+
+<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:apply-templates select="fo:root"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Root                                -->
+
+<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>
+
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="no-text"/>
+
+      <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: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>
+
+      <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: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: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="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="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="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>
+
+      <!-- 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>
+
+      <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: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:apply-templates select="*"/>
+
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Layout-master-set                   -->
+
+<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>
+
+      <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:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Simple-page-master                  -->
+
+<xsl:template match="fo:simple-page-master">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="no-text"/>
+
+      <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(@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: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: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: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: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="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>
+
+      <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>
+
+      <!-- I didn't want to control the ordering of regions; -->
+  <!-- but they convinced me...                          -->
+
+  <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="*"/>
+   </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>
+
+      <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="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: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:template>
+
+
+   <!-- =================================== -->
+<!-- Page-sequence-master                -->
+
+<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>
+
+      <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: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>
+
+      <xsl:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Page master references              -->
+
+<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>
+
+
+   <!-- =================================== -->
+<!-- Repeatable-page-master-alternatives -->
+
+<xsl:template match="fo:repeatable-page-master-alternatives">
+      <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: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:apply-templates select="*"/>
+   </xsl:template>
+
+   <!-- =================================== -->
+<!-- Rx:meta-info                        -->
+
+<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>
+
+      <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:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Rx:meta-field                       -->
+
+<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>
+
+   <!-- =================================== -->
+<!-- Rx:page-device                      -->
+
+<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>
+
+
+   <!-- =================================== -->
+<!-- Declarations                        -->
+
+<xsl:template match="fo:declarations">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="no-text"/>
+
+      <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: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>
+
+
+   <!-- =================================== -->
+<!-- Rx:outline                        -->
+
+<xsl:template match="rx:outline">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="no-text"/>
+
+      <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 (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>
+
+
+   <!-- =================================== -->
+<!-- Rx:bookmark                         -->
+
+<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>
+
+      <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="*[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: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>
+
+      <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:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Rx:bookmark-label                   -->
+
+<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>
+
+
+   <!-- =================================== -->
+<!-- Page-sequence                       -->
+
+<xsl:template match="fo:page-sequence">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="no-text"/>
+
+      <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>
+
+      <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: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="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>
+
+      <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>
+
+
+   <!-- =================================== -->
+<!-- Title                               -->
+
+<xsl:template match="fo:title">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="inline-level"/>
+      <xsl:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Flow and static-content             -->
+
+<xsl:template match="fo:flow | fo:static-content">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="block-level"/>
+
+      <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: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:flow-section                     -->
+
+<xsl:template match="rx:flow-section">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="block-level"/>
+
+      <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="*"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Block                               -->
+
+<xsl:template match="fo:block">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="mixed-level"/>
+      <xsl:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Containers                          -->
+
+<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>
+
+
+   <!-- =================================== -->
+<!-- Bidi-override                       -->
+
+<xsl:template match="fo:bidi-override">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="inline-level"/>
+
+      <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>
+
+
+   <!-- =================================== -->
+<!-- Character                           -->
+
+<xsl:template match="fo:character">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="empty-element"/>
+
+      <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>
+
+
+   <!-- =================================== -->
+<!-- Initial-property-set                -->
+
+<xsl:template match="fo:initial-property-set">
+      <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="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>
+
+         <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>
+
+
+   <!-- =================================== -->
+<!-- Line-numerator                      -->
+
+<xsl:template match="rx:ruler">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="empty-element"/>
+
+      <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: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: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>
+
+
+   <!-- =================================== -->
+<!-- External-graphic                    -->
+
+<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>
+
+
+   <!-- =================================== -->
+<!-- Instream-foreign-object             -->
+
+<xsl:template match="fo:instream-foreign-object">
+      <xsl:apply-templates select="@*"/>
+      <!-- only the attributes are checked -->
+</xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Inline                              -->
+
+<xsl:template match="fo:inline">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="mixed-level"/>
+      <xsl:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Leader                              -->
+
+<xsl:template match="fo:leader">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="inline-level"/>
+      <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>
+
+
+   <!-- =================================== -->
+<!-- Page-number-citation                -->
+
+<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>
+
+   <!-- ========================================================== -->
+<!-- Rx:page-number-citation-last (actually an XSL 1.1 element) -->
+
+<xsl:template match="rx:page-number-citation-last">
+      <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>
+
+
+   <!-- =================================== -->
+<!-- Rx:pinpoint                        -->
+
+<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>
+
+
+   <!-- =================================== -->
+<!-- Rx:page-index                       -->
+
+<xsl:template match="rx:page-index">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="no-text"/>
+
+      <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(@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>
+
+   <!-- =================================== -->
+<!-- Rx:index-item                       -->
+
+<xsl:template match="rx:index-item">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="empty-element"/>
+
+      <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>
+
+
+   <!-- =================================== -->
+<!-- Rx:begin-index-range                -->
+
+<xsl:template match="rx:begin-index-range">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="empty-element"/>
+
+      <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                  -->
+
+<xsl:template match="rx:end-index-range">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="empty-element"/>
+
+      <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: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>
+
+
+   <!-- =================================== -->
+<!-- Table-and-caption                   -->
+
+<xsl:template match="fo:table-and-caption">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="no-text"/>
+
+      <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: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="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="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: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:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Table-caption                       -->
+
+<xsl:template match="fo:table-caption">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="block-level"/>
+      <xsl:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Table                               -->
+
+<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>
+
+      <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="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: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="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="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>
+
+      <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:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Row group elements                  -->
+
+<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="*[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>
+
+      <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-row                           -->
+
+<xsl:template match="fo:table-row">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="no-text"/>
+
+      <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(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:apply-templates select="*"/>
+   </xsl:template>
+
+   <!-- =================================== -->
+<!-- Table-cell                          -->
+
+<xsl:template match="fo:table-cell">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="block-level"/>
+      <xsl:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- List-block                          -->
+
+<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>
+
+      <xsl:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- List-item                           -->
+
+<xsl:template match="fo:list-item">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="no-text"/>
+
+      <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>
+
+      <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="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>
+
+      <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: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>
+
+      <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:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- List item subcomponents             -->
+
+<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>
+
+
+   <!-- =================================== -->
+<!-- Footnote                            -->
+
+<xsl:template match="fo:footnote">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="no-text"/>
+      <xsl:call-template name="out-of-line"/>
+
+      <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(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(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>
+
+      <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: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>
+
+      <xsl:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Footnote-body                       -->
+
+<xsl:template match="fo:footnote-body">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="block-level"/>
+      <xsl:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Float                               -->
+
+<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>
+
+
+   <!-- =================================== -->
+<!-- Wrapper                             -->
+
+<xsl:template match="fo:wrapper">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="mixed-level"/>
+      <xsl:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- === =============================== -->
+<!-- Marker                              -->
+
+<xsl:template match="fo:marker">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="mixed-level"/>
+
+      <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="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>
+
+      <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>
+
+      <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="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>
+
+   <!-- === =============================== -->
+<!-- Retrieve-marker                     -->
+
+<xsl:template match="fo:retrieve-marker">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="empty-element"/>
+
+      <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>
+
+
+   <!-- === =============================== -->
+<!-- Basic-link                          -->
+
+<xsl:template match="fo:basic-link">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="mixed-level"/>
+
+      <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: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>
+
+
+   <!-- =================================== -->
+<!-- Multi-switch                        -->
+
+<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>
+
+      <xsl:apply-templates select="*"/>
+   </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>
+
+
+   <!-- ===================================== -->
+<!-- Multi-toggle                          -->
+
+<xsl:template match="fo:multi-toggle">
+      <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:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- ===================================== -->
+<!-- Multi-properties                    -->
+
+<xsl:template match="fo:multi-properties">
+      <xsl:apply-templates select="@*"/>
+      <xsl:call-template name="no-text"/>
+
+      <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="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>
+
+      <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: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:apply-templates select="*"/>
+   </xsl:template>
+
+
+   <!-- ===================================== -->
+<!-- Multi-property-set                    -->
+
+<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>
+
+   </xsl:template>
+
+
+   <!-- =================================== -->
+<!-- Common structure-checking templates -->
+
+<!-- Check for block-level elements         -->
+
+<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: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>
+
+
+   <!-- 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>
+
+
+   <!-- 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>
+
+
+   <!-- Check constraints applicable to out-of-line elements  -->
+
+<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: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>
+
+      <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: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>
+
+   <!-- =================================== -->
+<!-- Auxiliary templates                 -->
+
+
+<!-- Check for non-blank #PCDATA -->
+
+<xsl:template name="no-text">
+      <xsl:param name="reason" select="''"/>
+
+      <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>
+
+
+   <!-- 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>
+
+
+
+   <!-- Report an element that may not be present in a given point -->
+
+<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>
+
+   <xsl:template match="*" mode="report-intrusive-elements-block" priority="-1">
+      <xsl:param name="reason"/>
+
+      <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:apply-templates select="." mode="report-intrusive-elements">
+         <xsl:with-param name="reason" select="$reason"/>
+      </xsl:apply-templates>
+   </xsl:template>
+
+
+   <!-- Special case: report an invalid element contained in a wrapper -->
+
+<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>
+
+   <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: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>
+
+
+   <!-- Default rules -->
+
+<xsl:template match="*" priority="-1"/>
+   <xsl:template match="text()"/>
+
+
+   <!-- ##################################################################### -->
+<!-- Processing of attributes.                                             -->
+<!-- ##################################################################### -->
+
+<!-- Report any attribute not covered by enabling templates -->
+
+<xsl:template match="@*" priority="-2">
+      <xsl:call-template name="complain-attribute"/>
+   </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="@*[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="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()"/>
+
+      <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>
+
+
+   <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 a value that is not a valid number or length. Skips validation -->
+<!-- of attributes containing digits, parentheses, and math operators.     -->
+
+<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>
+
+   <!-- 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>
+
+   <!-- 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 match="@role" priority="5"/>
+
+   <!-- 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>
+
+   <!-- 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="@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="@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="@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="@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"/>
+
+   <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="@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>
+
+   <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="@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="@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>
+
+   <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>
+
+
+   <!-- 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 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 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 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"/>
+
+   <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 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="@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 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>
+
+   <!-- 7.7. Font properties  -->
+<xsl:template match="@font-family">
+      <xsl:call-template name="disable-on-graphics"/>
+   </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="@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="@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="@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="@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="@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="@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>
+
+   <xsl:template match="@language">
+      <xsl:call-template name="disable-on-graphics"/>
+   </xsl:template>
+
+   <xsl:template match="@script">
+      <xsl:call-template name="disable-on-graphics"/>
+   </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="@hyphenation-character">
+      <xsl:call-template name="disable-on-graphics"/>
+   </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>
+
+
+   <!-- 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 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>
+
+
+   <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="@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="@start-indent | @end-indent">
+      <xsl:call-template name="quantitative-values">
+         <xsl:with-param name="valuelist"> 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>
+
+   <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="@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="@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="@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>
+
+   <!-- 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="@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="@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="@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="@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="@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>
+
+
+   <!-- 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>
+
+   <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="@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="@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="@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>
+
+   <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="@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>
+
+   <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="@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="@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="@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.15. Character properties -->
+<xsl:template match="fo:character/@character"/>
+
+   <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="@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="@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="@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="@text-decoration">
+      <xsl:call-template name="disable-on-graphics"/>
+   </xsl:template>
+
+   <xsl:template match="@text-shadow">
+      <xsl:call-template name="disable-on-graphics"/>
+   </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="@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>
+
+   <!-- 7.16. Color properties -->
+<xsl:template match="@color"/>
+
+   <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.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="@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: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="@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>
+
+   <!-- 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="@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.19. Layout-related properties -->
+<xsl:template priority="3" match="@clip"/>
+
+   <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 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="@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>
+
+   <!-- 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="@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>
+
+   <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="@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="@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>
+
+   <!-- 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="fo:multi-case/@case-name"/>
+   <xsl:template match="fo:multi-case/@case-title"/>
+
+   <xsl:template match="fo:basic-link/@destination-placement-offset">
+      <xsl:call-template name="quantitative-values"/>
+   </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="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 match="fo:root/@rx:initial-destination"/>
+
+   <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: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>
+
+
+   <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="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="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: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>
+
+
+   <!-- 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>
+
+   <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>
+
+   <!-- 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="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: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 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>
+
+   <xsl:template match="rx:flow-section/@column-count">
+      <xsl:call-template name="quantitative-values"/>
+   </xsl:template>
+
+   <xsl:template match="rx:flow-section/@column-gap">
+      <xsl:call-template name="quantitative-values"/>
+   </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="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="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="5"
+                 match="fo:simple-page-master/@master-name                    | fo:page-sequence-master/@master-name"/>
+
+   <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>
+
+
+   <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 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 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 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"/>
+
+   <!-- 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="@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="@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>
+
+   <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>
+
+   <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:table-column/@number-columns-repeated">
+      <xsl:call-template name="quantitative-values"/>
+   </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>
+
+   <xsl:template match="fo:table-cell/@number-rows-spanned">
+      <xsl:call-template name="quantitative-values"/>
+   </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="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>
+
+
+   <!-- 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>
+
+   <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="@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="@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 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/@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>
+
+
+   <!-- 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="@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="@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 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 match="fo:external-graphic/@src">
+      <xsl:call-template name="check-url"/>
+   </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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/tei/tools/folint.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/ts2xmlw.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/ts2xmlw.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/ts2xmlw.xsl	(revision 728)
@@ -0,0 +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">
+
+  <xd:doc type="stylesheet">
+
+    <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: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>
+
+    <xd:copyright>2016, ENS de Lyon/CNRS (UMR IHRIM Cactus)</xd:copyright>
+
+  </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:for-each>
+	        <xsl:value-of select="@word"/>
+		</w>
+  </xsl:template>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/ts2xmlw.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xmltxm-textgrid.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xmltxm-textgrid.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xmltxm-textgrid.xsl	(revision 728)
@@ -0,0 +1,290 @@
+<?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: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:template match="tei:l">
+		<xsl:if test="preceding-sibling::*">
+			<br/>
+		</xsl:if>
+		<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:variable>
+		<xsl:element name="h{$level}">
+			<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>-->
+	</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: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="@n and not(@rend='prose')">
+			<xsl:choose>
+				<xsl:when test="matches(@n,'^[0-9]*[05]$')">
+					<a title="{@n}" class="verseline" style="position:relative">&#xa0;</a>
+				</xsl:when>
+				<xsl:when test="matches(@n,'[^0-9]')">
+					<a title="{@n}" class="verseline" style="position:relative">&#xa0;</a>
+				</xsl:when>
+				<xsl:otherwise>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>
+	</xsl:template>
+	
+	<!-- 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: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: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: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]]">
+					<span class="footnote">
+						<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: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>
+	</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"/>                                
+	</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:if>
+                                		<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: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: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="following-sibling::*[1][self::tei:note]"></xsl:when>
+			<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:template>
+	
+                
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xmltxm-textgrid.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/concordance_simple.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/concordance_simple.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/concordance_simple.xsl	(revision 728)
@@ -0,0 +1,243 @@
+ï»¿<?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">
+	<!-- 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"/>
+	<!-- 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>
+	<!-- terminal pivot features to show -->
+				
+	<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: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>
+		
+		<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']">
+			
+			<!-- Each #pivot node in the document is selected -->
+
+			<xsl:variable name="inpivot">
+
+				<pivot>
+					<xsl:apply-templates select="key('idkey', @idref)" mode="get-terminals" />
+				</pivot>
+
+			</xsl:variable>
+
+			<xsl:variable name="inpivot-sort">
+				<pivot>
+					<xsl:for-each select="exsl:node-set($inpivot)//t">
+						<xsl:sort select="@id" />
+						<xsl:copy-of select="." />
+					</xsl:for-each>
+				</pivot>
+			</xsl:variable>
+
+			<xsl:variable name="firstpivotid">
+
+				<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:variable>
+
+			<!-- sentence 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>
+
+			<!-- 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>
+			
+			<!-- 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: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>
+				
+			<!-- right context -->
+			<xsl:apply-templates select="key('idkey', $lastpivotid)" mode="right-cx" /><xsl:text>&#x0D;&#x0A;</xsl:text>
+
+		</xsl:for-each>
+
+	</xsl:template>
+
+	<xsl:template match="t" mode="get-terminals">
+
+		<xsl:copy-of select="." />
+
+	</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: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: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>
+				
+				<!-- 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: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: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: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: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: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:for-each>
+		
+	</xsl:template>
+
+	<xsl:template match="s" mode="pivot">
+		<xsl:param name="inpivot" />
+
+			<xsl:variable name="firstpivotid">
+
+				<xsl:apply-templates select="$inpivot//t[1]" mode="id" />
+					
+			</xsl:variable>
+
+			<xsl:variable name="lastpivotid">
+				<xsl:apply-templates select="$inpivot//t[last()]" mode="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: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>
+
+	<xsl:template match="nt" mode="get-terminals">
+
+		<xsl:for-each select="edge">
+
+			<xsl:apply-templates select="key('idkey', @idref)" mode="get-terminals" />
+	
+		</xsl:for-each>
+
+	</xsl:template>
+
+</xsl:stylesheet>
+

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/concordance_simple.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teip5-xmlw-preserve.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teip5-xmlw-preserve.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teip5-xmlw-preserve.xsl	(revision 728)
@@ -0,0 +1,113 @@
+<?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>
+  
+
+  <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--> 
+	
+	<!-- 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="deleteTag"></xsl:param>
+	
+	<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>
+	
+	<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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teip5-xmlw-preserve.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teip5-xmlw-simplify.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teip5-xmlw-simplify.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teip5-xmlw-simplify.xsl	(revision 728)
@@ -0,0 +1,231 @@
+<?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>
+  
+
+  <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: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,'$'))]">
+		<xsl:call-template name="copyAll"></xsl:call-template>
+	</xsl:template>
+	
+	<!-- balises Ã  supprimer, contenu Ã  conserver, c'est la rÃ¨gle par dÃ©faut -->  
+	<xsl:template match="*">
+		<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 -->
+
+  <xsl:template match="@*|comment()">
+    <xsl:copy/>
+  </xsl:template>
+
+<xsl:template match="processing-instruction()"/>
+
+<xsl:template match="text()"><xsl:value-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>-->
+	
+
+<!-- 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

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teip5-xmlw-simplify.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/breakByMilestone.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/breakByMilestone.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/breakByMilestone.xsl	(revision 728)
@@ -0,0 +1,75 @@
+<?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">
+
+    <!-- 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: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: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: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="body">
+        <!-- <xsl:variable name="containingNode" select="//text"/> -->
+        <xsl:sequence select="tei:page-content(//pb[@id=$pbval1], //pb[@id=$pbval2], //body)"/>
+    </xsl:template>
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/breakByMilestone.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-corpusakkadien-xmlw_mots_effaces.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-corpusakkadien-xmlw_mots_effaces.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-corpusakkadien-xmlw_mots_effaces.xsl	(revision 728)
@@ -0,0 +1,93 @@
+<?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>
+  
+
+  <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:choose>
+          </xsl:attribute>
+          <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: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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-corpusakkadien-xmlw_mots_effaces.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-rnc-xmlw.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-rnc-xmlw.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-rnc-xmlw.xsl	(revision 728)
@@ -0,0 +1,35 @@
+<?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:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
+
+  <xsl:template match="*">
+
+         <xsl:element name="{local-name(.)}">
+          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
+        </xsl:element>
+
+  </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="text()">
+    <xsl:value-of select="."/>
+  </xsl:template>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-rnc-xmlw.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teibvh-xmlw-posttok.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teibvh-xmlw-posttok.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teibvh-xmlw-posttok.xsl	(revision 728)
@@ -0,0 +1,369 @@
+<?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: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: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: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:template>
+	
+  
+  <xsl:template match="s">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teibvh-xmlw-posttok.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/p4top5_perseus.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/p4top5_perseus.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/p4top5_perseus.xsl	(revision 728)
@@ -0,0 +1,843 @@
+<?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.
+       
+  -->
+
+  <!-- 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="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: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>
+
+
+  <!-- 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:attribute>
+  </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="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 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/@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="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>
+
+
+  <!-- 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/@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:attribute>
+  </xsl:template>
+
+
+  <xsl:template match="@url">
+    <xsl:attribute name="target">
+      <xsl:value-of select="."/>
+    </xsl:attribute>
+  </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:attribute>
+      </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:attribute>
+  </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
+    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: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 -->
+
+
+  <!-- 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>
+
+  <!-- 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>
+
+  <!-- space does not have @extent any more -->
+  <xsl:template match="space/@extent">
+    <xsl:attribute name="quantity">
+      <xsl:value-of select="."/>
+    </xsl:attribute>
+  </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>
+
+  <!-- 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>
+
+  <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">
+
+      <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: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">
+    <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 -->
+
+  <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: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: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: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: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: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: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: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:attribute>
+        </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(translate(.,$uc,$lc) ='unspecified')">
+      <xsl:attribute name="place">
+        <xsl:value-of select="."/>
+      </xsl:attribute>
+    </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:attribute>
+    </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:attribute>
+    </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:attribute>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- yes|no to boolean -->
+
+  <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 match="sourceDesc/@default"/>
+
+  <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 match="@langKey"/>
+
+  <xsl:template match="@TEIform"/>
+
+  <!-- assorted atts -->
+  <xsl:template match="@old"/>
+
+  <xsl:template match="@mergedin">
+    <xsl:attribute name="mergedIn">
+      <xsl:value-of select="."/>
+    </xsl:attribute>
+  </xsl:template>
+
+  <!-- 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="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>
+
+<!--
+  <!-\- 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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/p4top5_perseus.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/all/xsl/filter-keep-only-select.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/filter-keep-only-select.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/filter-keep-only-select.xsl	(revision 728)
@@ -0,0 +1,82 @@
+<?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>
+  
+
+  <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: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="/">
+  <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:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/filter-keep-only-select.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-qgraal_cm-xmlw.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-qgraal_cm-xmlw.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-qgraal_cm-xmlw.xsl	(revision 728)
@@ -0,0 +1,175 @@
+<?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:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
+  
+  <xsl:strip-space elements="me:norm tei:w"/>
+
+<!-- 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: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: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="@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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-qgraal_cm-xmlw.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/xsl/svn2cl.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/xsl/svn2cl.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/xsl/svn2cl.xsl	(revision 728)
@@ -0,0 +1,500 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+	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.
+
+-->
+
+<!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:output
+   method="text"
+   encoding="utf-8"
+   media-type="text/plain"
+   omit-xml-declaration="yes"
+   standalone="yes"
+   indent="no" />
+
+ <xsl:strip-space elements="*" />
+
+ <!-- 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" />
+
+ <!-- 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 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 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 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" />
+
+ <!-- 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 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>
+
+ <!-- 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>
+
+ <!-- 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>
+
+ <!-- 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>
+
+ <!-- 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>
+
+ <!-- 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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/xsl/svn2cl.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/LICENSE_FR.TXT
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/LICENSE_FR.TXT	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/LICENSE_FR.TXT	(revision 728)
@@ -0,0 +1,812 @@
+
+                        LICENCE PUBLIQUE GÃ‰NÃ‰RALE GNU
+                         Version 3, du 29 juin 2007.
+
+Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+
+Chacun est autorisÃ© Ã  copier et distribuer des copies conformes de ce
+document de licence, mais toute modification en est proscrite.
+
+Traduction franÃ§aise par Philippe Verdy
+<verdy_p (Ã ) wanadoo (point) fr>, le 30 juin 2007.
+
+_______________________________________________________________________
+
+Avertissement important au sujet de cette traduction franÃ§aise.
+_______________________________________________________________________
+
+Ceci est une traduction en franÃ§ais de la licence â€œGNU General Public
+Licenseâ€� (GPL). Cette traduction est fournie ici dans lâ€™espoir quâ€™elle
+facilitera sa comprÃ©hension, mais elle ne constitue pas une traduction
+officielle ou approuvÃ©e dâ€™un point de vue juridique.
+
+La Free Software Foundation (FSF) ne publie pas cette traduction et ne
+lâ€™a pas approuvÃ©e en tant que substitut valide au plan lÃ©gal pour la
+licence authentique â€œGNU General Public Licenceâ€�. Cette traduction nâ€™a
+pas encore Ã©tÃ© passÃ©e en revue attentivement par un juriste et donc le
+traducteur ne peut garantir avec certitude quâ€™elle reprÃ©sente avec
+exactitude la signification lÃ©gale des termes de la licence authentique
+â€œGNU General Public Licenseâ€� publiÃ©e en anglais. Cette traduction
+nâ€™Ã©tablit donc lÃ©galement aucun des termes et conditions dâ€™utilisation
+dâ€™un logiciel sous licence GNU GPL â€” seul le texte original en anglais
+le fait. Si vous souhaitez Ãªtre sÃ»r que les activitÃ©s que vous projetez
+seront autorisÃ©es par la GNU General Public License, veuillez vous
+rÃ©fÃ©rer Ã  sa seule version anglaise authentique.
+
+La FSF vous recommande fermement de ne pas utiliser cette traduction en
+tant que termes officiels pour vos propres programmes ; veuillez plutÃ´t
+utiliser la version anglaise authentique telle que publiÃ©e par la FSF.
+Si vous choisissez dâ€™acheminer cette traduction en mÃªme temps quâ€™un
+Programme sous licence GNU GPL, cela ne vous dispense pas de lâ€™obligation
+dâ€™acheminer en mÃªme temps une copie de la licence authentique en anglais,
+et de conserver dans la traduction cet avertissement important en
+franÃ§ais et son Ã©quivalent en anglais ci-dessous.
+
+_______________________________________________________________________
+
+Important Warning About This French Translation.
+_______________________________________________________________________
+
+This is a translation of the GNU General Public License (GPL) into
+French. This translation is distributed in the hope that it will
+facilitate understanding, but it is not an official or legally approved
+translation.
+
+The Free Software Foundation (FSF) is not the publisher of this
+translation and has not approved it as a legal substitute for the
+authentic GNU General Public License. The translation has not been
+reviewed carefully by lawyers, and therefore the translator cannot be
+sure that it exactly represents the legal meaning of the authentic GNU
+General Public License published in English. This translation does not
+legally state the terms and conditions of use of any Program licenced
+under GNU GPL â€” only the original English text of the GNU LGPL does
+that. If you wish to be sure whether your planned activities are
+permitted by the GNU General Public License, please refer to its sole
+authentic English version.
+
+The FSF strongly urges you not to use this translation as the official
+distribution terms for your programs; instead, please use the authentic
+English version published by the FSF. If you choose to convey this
+translation along with a Program covered by the GPL Licence, this does
+not remove your obligation to convey at the same time a copy of the
+authentic GNU GPL License in English, and you must keep in this
+translation this important warning in English and its equivalent in
+French above.
+
+_______________________________________________________________________
+
+
+PrÃ©ambule
+
+La Licence Publique GÃ©nÃ©rale GNU (â€œGNU General Public Licenseâ€�) est une
+licence libre, en â€œcopyleftâ€�, destinÃ©e aux Å“uvres logicielles et
+dâ€™autres types de travaux.
+
+Les licences de la plupart des Å“uvres logicielles et autres travaux de
+pratique sont conÃ§ues pour Ã´ter votre libertÃ© de partager et modifier
+ces travaux. En contraste, la Licence Publique GÃ©nÃ©rale GNU a pour but
+de garantir votre libertÃ© de partager et changer toutes les versions
+dâ€™un programme â€” afin dâ€™assurer quâ€™il restera libre pour tous les
+utilisateurs. Nous, la Free Software Foundation, utilisons la Licence
+Publique GÃ©nÃ©rale GNU pour la plupart de nos logiciels ; cela
+sâ€™applique aussi Ã  tout autre travail Ã©ditÃ© de cette faÃ§on par ses
+auteurs. Vous pouvez, vous aussi, lâ€™appliquer Ã  vos propres programmes.
+
+Quand nous parlons de logiciel libre (â€œfreeâ€�), nous nous rÃ©fÃ©rons Ã  la
+libertÃ© (â€œfreedomâ€�), pas au prix. Nos Licences Publiques GÃ©nÃ©rales sont
+conÃ§ues pour assurer que vous ayez la libertÃ© de distribuer des copies
+de logiciel libre (et le facturer si vous le souhaitez), que vous
+receviez le code source ou pouviez lâ€™obtenir si vous le voulez, que
+vous pouviez modifier le logiciel ou en utiliser toute partie dans de
+nouveaux logiciels libres, et que vous sachiez que vous avez le droit
+de faire tout ceci.
+
+Pour protÃ©ger vos droits, nous avons besoin dâ€™empÃªcher que dâ€™autres
+vous restreignent ces droits ou vous demande de leur abandonner ces
+droits. En consÃ©quence, vous avez certaines responsabilitÃ©s si vous
+distribuez des copies dâ€™un tel programme ou si vous le modifiez :
+les responsabilitÃ©s de respecter la libertÃ© des autres.
+
+Par exemple, si vous distribuez des copies dâ€™un tel programme, que ce
+soit gratuit ou contre un paiement, vous devez accorder aux
+Destinataires les mÃªmes libertÃ©s que vous avez reÃ§ues. Vous devez aussi
+vous assurer quâ€™eux aussi reÃ§oivent ou peuvent recevoir son code
+source. Et vous devez leur montrer les termes de cette licence afin
+quâ€™ils connaissent leurs droits.
+
+Les dÃ©veloppeurs qui utilisent la GPL GNU protÃ¨gent vos droits en deux
+Ã©tapes : (1) ils affirment leur droits dâ€™auteur (â€œcopyrightâ€�) sur le
+logiciel, et (2) vous accordent cette Licence qui vous donne la
+permission lÃ©gale de le copier, le distribuer et/ou le modifier.
+
+Pour la protection des dÃ©veloppeurs et auteurs, la GPL stipule
+clairement quâ€™il nâ€™y a pas de garantie pour ce logiciel libre. Aux fins
+Ã  la fois des utilisateurs et auteurs, la GPL requiÃ¨re que les versions
+modifiÃ©es soient marquÃ©es comme changÃ©es, afin que leurs problÃ¨mes ne
+soient pas attribuÃ©s de faÃ§on erronÃ©e aux auteurs des versions
+prÃ©cÃ©dentes.
+
+Certains dispositifs sont conÃ§us pour empÃªcher lâ€™accÃ¨s des utilisateurs
+Ã  lâ€™installation ou lâ€™exÃ©cution de versions modifiÃ©es du logiciel Ã 
+lâ€™intÃ©rieur de ces dispositifs, alors que les fabricants le peuvent.
+Ceci est fondamentalement incompatible avec le but de protÃ©ger la
+libertÃ© des utilisateurs de modifier le logiciel. Lâ€™aspect systÃ©matique
+de tels abus se produit dans le secteur des produits destinÃ©s aux
+utilisateurs individuels, ce qui est prÃ©cidÃ©ment ce qui est le plus
+inacceptable. Aussi, nous avons conÃ§u cette version de la GPL pour
+prohiber cette pratique pour ces produits. Si de tels problÃ¨mes
+surviennent dans dâ€™autres domaines, nous nous tenons prÃªt Ã  Ã©tendre
+cette restriction Ã  ces domaines dans de futures versions de la GPL,
+autant quâ€™il sera nÃ©cessaire pour protÃ©ger la libertÃ© des utilisateurs.
+
+Finalement, chaque programme est constamment menacÃ© par les brevets
+logiciels. Les Ã‰tats ne devraient pas autoriser de tels brevets Ã 
+restreindre le dÃ©veloppement et lâ€™utilisation de logiciels libres sur
+des ordinateurs dâ€™usage gÃ©nÃ©ral ; mais dans ceux qui le font, nous
+voulons spÃ©cialement Ã©viter le danger que les brevets appliquÃ©s Ã  un
+programme libre puisse le rendre effectivement propriÃ©taire. Pour
+empÃªcher ceci, la GPL assure que les brevets ne peuvent Ãªtre utilisÃ©s
+pour rendre le programme non-libre.
+
+Les termes prÃ©cis et conditions concernant la copie, la distribution
+et la modification suivent.
+
+
+TERMES ET CONDITIONS
+
+
+Article 0. DÃ©finitions.
+
+Â« Cette Licence Â» se rÃ©fÃ¨re Ã  la version 3 de la â€œGNU General Public
+Licenseâ€� (le texte original en anglais).
+
+Â« Droit dâ€™Auteur Â» signifie aussi les droits du â€œcopyrightâ€� ou voisins
+qui sâ€™appliquent Ã  dâ€™autres types de travaux, tels que ceux sur les
+masques de semi-conducteurs.
+
+Â« Le Programme Â» se rÃ©fÃ¨re Ã  tout travail qui peut Ãªtre sujet au Droit
+dâ€™Auteur (â€œcopyrightâ€�) et dont les droits dâ€™utilisation sont concÃ©dÃ©s
+en vertu de cette Licence. Chacun des LicenciÃ©s, Ã  qui cette Licence
+est concÃ©dÃ©e, est dÃ©signÃ© par Â« vous. Â» Les Â« LicenciÃ©s Â» et les
+Â« Destinataires Â» peuvent Ãªtre des personnes physiques ou morales
+(individus ou organisations).
+
+Â« Modifier Â» un travail signifie en obtenir une copie et adapter tout
+ou partie du travail dâ€™une faÃ§on nÃ©cessitant une autorisation dâ€™un
+titulaire de Droit dâ€™Auteur, autre que celle permettant dâ€™en produire
+une copie conforme. Le travail rÃ©sultant est appelÃ© une Â« version
+modifiÃ©e Â» du prÃ©cÃ©dent travail, ou un travail Â« basÃ© sur Â» le
+prÃ©cÃ©dent travail.
+
+Un Â« Travail Couvert Â» signifie soit le Programme non modifiÃ© soit un
+travail basÃ© sur le Programme.
+
+Â« Propager Â» un travail signifie faire quoi que ce soit avec lui qui,
+sans permission, vous rendrait directement ou indirectement responsable
+dâ€™un dÃ©lit de contrefaÃ§on suivant les lois relatives au Droit dâ€™Auteur,
+Ã  lâ€™exception de son exÃ©cution sur un ordinateur ou de la modification
+dâ€™une copie privÃ©e. La propagation inclue la copie, la distribution
+(avec ou sans modification), la mise Ã  disposition envers le public, et
+aussi d'autres activitÃ©s dans certains pays.
+
+Â« Acheminer Â» un travail signifie tout moyen de propagation de celui-ci
+qui permet Ã  dâ€™autres parties de rÃ©aliser ou recevoir des copies. La
+simple interaction dâ€™un utilisateur Ã  travers un rÃ©seau informatique,
+sans transfert effectif dâ€™une copie, ne constitue pas un acheminement.
+
+Une interface utilisateur interactive affiche des Â« Notices LÃ©gales
+AppropriÃ©es Â» quand elle comprend un dispositif convenable, bien
+visible et Ã©vident qui (1) affiche une notice appropriÃ©e sur les droits
+dâ€™auteur et (2) informe lâ€™utilisateur quâ€™il nâ€™y a pas de garantie pour
+le travail (sauf si des garanties ont Ã©tÃ© fournies hors du cadre de
+cette Licence), que les licenciÃ©s peuvent acheminer le travail sous
+cette Licence, et comment voir une copie de cette Licence. Si
+lâ€™interface prÃ©sente une liste de commandes utilisateur ou dâ€™options,
+tel quâ€™un menu, un Ã©lÃ©ment Ã©vident dans la liste prÃ©sentÃ©e remplit ce
+critÃ¨re.
+
+
+Article 1. Code source.
+
+Le Â« code source Â» dâ€™un travail signifie la forme prÃ©fÃ©rÃ©e du travail
+permettant ou facilitant les modifications de celui-ci. Le Â« code
+objet Â» dâ€™un travail signifie toute forme du travail qui nâ€™en est pas
+le code source.
+
+Une Â« Interface Standard Â» signifie une interface qui est soit celle
+dâ€™une norme officielle dÃ©finie par un organisme de normalisation
+reconnu ou, dans le cas des interfaces spÃ©cifiÃ©es pour un langage de
+programmation particulier, une interface largement utilisÃ©e parmi les
+dÃ©veloppeurs travaillant dans ce langage.
+
+Les Â« BibliothÃ¨ques SystÃ¨me Â» dâ€™un travail exÃ©cutable incluent tout ce
+qui, en dehors du travail dans son ensemble, (a) est inclus dans la
+forme usuelle de paquetage dâ€™un Composant Majeur mais ne fait pas
+partie de ce Composant Majeur et (b) sert seulement Ã  permettre
+lâ€™utilisation du travail avec ce Composant Majeur ou Ã  implÃ©menter une
+Interface Standard pour laquelle une implÃ©mentation est disponible au
+public sous forme de code source ; un Â« Composant Majeur Â» signifie,
+dans ce contexte, un composant majeur essentiel (noyau, systÃ¨me de
+fenÃªtrage, etc.) du systÃ¨me dâ€™exploitation (le cas Ã©chÃ©ant) dâ€™un
+systÃ¨me sur lequel le travail exÃ©cutable fonctionne, ou bien un
+compilateur utilisÃ© pour produire le code objet du travail, ou un
+interprÃ¨te de code objet utilisÃ© pour exÃ©cuter celui-ci.
+
+Le Â« Source Correspondant Â» dâ€™un travail sous forme de code objet
+signifie lâ€™ensemble des codes sources nÃ©cessaires pour gÃ©nÃ©rer,
+installer et (dans le cas dâ€™un travail exÃ©cutable) exÃ©cuter le code
+objet et modifier le travail, y compris les scripts pour contrÃ´ler ces
+activitÃ©s. Cependant, cela nâ€™inclue pas les BibliothÃ¨ques SystÃ¨me du
+travail, ni les outils dâ€™usage gÃ©nÃ©ral ou les programmes libres
+gÃ©nÃ©ralement disponibles qui peuvent Ãªtre utilisÃ©s sans modification
+pour achever ces activitÃ©s mais ne sont pas partie de ce travail. Par
+exemple le Source Correspondant inclut les fichiers de dÃ©finition
+dâ€™interfaces associÃ©s aux fichiers sources du travail, et le code
+source des bibliothÃ¨ques partagÃ©es et des sous-routines liÃ©es
+dynamiquement, pour lesquelles le travail est spÃ©cifiquement conÃ§u pour
+les requÃ©rir via, par exemple, des communications de donnÃ©es ou
+contrÃ´les de flux internes entre ces sous-programmes et dâ€™autres
+parties du travail.
+
+Le Source Correspondant nâ€™a pas besoin dâ€™inclure tout ce que les
+utilisateurs peuvent regÃ©nÃ©rer automatiquement Ã  partir dâ€™autres
+parties du Source Correspondant.
+
+Le Source Correspondant pour un travail sous forme de code source est
+ce mÃªme travail.
+
+
+Article 2. Permissions de base.
+
+Tous les droits accordÃ©s suivant cette Licence le sont jusquâ€™au terme
+des Droits dâ€™Auteur (â€œcopyrightâ€�) sur le Programme, et sont
+irrÃ©vocables pourvu que les conditions Ã©tablies soient remplies. Cette
+Licence affirme explicitement votre permission illimitÃ©e dâ€™exÃ©cuter le
+Programme non modifiÃ©. La sortie produite par lâ€™exÃ©cution dâ€™un Travail
+Couvert nâ€™est couverte par cette Licence que si cette sortie, Ã©tant
+donnÃ© leur contenu, constitue un Travail Couvert. Cette Licence
+reconnait vos propres droits dâ€™usage raisonnable (â€œfair useâ€� en
+lÃ©gislation des Ã‰tats-Unis dâ€™AmÃ©rique) ou autres Ã©quivalents, tels
+quâ€™ils sont pourvus par la loi applicable sur le Droit dâ€™Auteur
+(â€œcopyrightâ€�).
+
+Vous pouvez crÃ©er, exÃ©cuter et propager sans condition des Travaux
+Couverts que vous nâ€™acheminez pas, aussi longtemps que votre licence
+demeure en vigueur. Vous pouvez acheminer des Travaux Couverts Ã 
+dâ€™autres personnes dans le seul but de leur faire rÃ©aliser des
+modifications Ã  votre usage exclusif, ou pour quâ€™ils vous fournissent
+des facilitÃ©s vous permettant dâ€™exÃ©cuter ces travaux, pourvu que vous
+vous conformiez aux termes de cette Licence lors de lâ€™acheminement de
+tout matÃ©riel dont vous ne contrÃ´lez pas le Droit dâ€™Auteur
+(â€œcopyrightâ€�). Ceux qui, dÃ¨s lors, rÃ©alisent ou exÃ©cutent pour vous les
+Travaux Couverts ne doivent alors le faire quâ€™exclusivement pour votre
+propre compte, sous votre direction et votre contrÃ´le, suivant des
+termes qui leur interdisent de rÃ©aliser, en dehors de leurs relations
+avec vous, toute copie de votre matÃ©riel soumis au Droit dâ€™Auteur.
+
+Lâ€™acheminement dans toutes les autres circonstances nâ€™est permis que
+selon les conditions Ã©tablies ci-dessous. La concession de
+sous-licences nâ€™est pas autorisÃ© ; lâ€™article 10 rend cet usage non
+nÃ©cessaire.
+
+
+Article 3. Protection des droits lÃ©gaux des utilisateurs envers les
+lois anti-contournement.
+
+Aucun Travail Couvert ne doit Ãªtre vu comme faisant partie dâ€™une mesure
+technologique effective selon toute loi applicable remplissant les
+obligations prÃ©vues Ã  lâ€™article 11 du traitÃ© international sur le droit
+dâ€™auteur adoptÃ© Ã  lâ€™OMPI le 20 dÃ©cembre 1996, ou toutes lois similaires
+qui prohibent ou restreignent le contournement de telles mesures.
+
+Si vous acheminez un Travail Couvert, vous renoncez Ã  tout pouvoir lÃ©gal
+dâ€™interdire le contournement des mesures technologiques dans tous les
+cas oÃ¹ un tel contournement serait effectuÃ© en exerÃ§ant les droits
+prÃ©vus dans cette Licence pour ce Travail Couvert, et vous dÃ©clarez
+rejeter toute intention de limiter lâ€™opÃ©ration ou la modification du
+Travail, en tant que moyens de renforcer, Ã  lâ€™encontre des utilisateurs
+de ce Travail, vos droits lÃ©gaux ou ceux de tierces parties dâ€™interdire
+le contournement des mesures technologiques.
+
+
+Article 4. Acheminement des copies conformes.
+
+Vous pouvez acheminer des copies conformes du code source du Programme
+tel que vous lâ€™avez reÃ§u, sur nâ€™importe quel support, pourvu que vous
+publiiez scrupuleusement et de faÃ§on appropriÃ©e sur chaque copie une
+notice de Droit dâ€™Auteur appropriÃ©e ; gardez intactes toutes les
+notices Ã©tablissant que cette Licence et tous les termes additionnels non
+permissifs ajoutÃ©s en accord avec lâ€™article 7 sâ€™appliquent Ã  ce code ;
+et donnez Ã  chacun des Destinataires une copie de cette Licence en mÃªme
+temps que le Programme.
+
+Vous pouvez facturer Ã  un prix quelconque, y compris gratuit, chacune
+des copies que vous acheminez, et vous pouvez offrir une protection
+additionnelle de support ou de garantie en Ã©change dâ€™un paiement.
+
+
+Article 5. Acheminement des versions sources modifiÃ©es.
+
+Vous pouvez acheminer un travail basÃ© sur le Programme, ou bien les
+modifications pour le produire Ã  partir du Programme, sous la forme de
+code source suivant les termes de lâ€™article 4, pourvu que vous
+satisfassiez aussi Ã  chacune des conditions requises suivantes :
+
+  a) Le travail doit comporter des notices Ã©videntes Ã©tablissant que
+     vous lâ€™avez modifiÃ© et donnant la date correspondante.
+
+  b) Le travail doit comporter des notices Ã©videntes Ã©tablissant quâ€™il
+     est Ã©ditÃ© selon cette Licence et les conditions ajoutÃ©es dâ€™aprÃ¨s
+     lâ€™article 7. Cette obligation vient modifier lâ€™obligation de
+     lâ€™article 4 de Â« garder intactes toutes les notices. Â»
+
+  c) Vous devez licencier le travail entier, comme un tout, suivant
+     cette Licence Ã  quiconque entre en possession dâ€™une copie. Cette
+     Licence sâ€™appliquera en consÃ©quence, avec les termes additionnels
+     applicables prÃ©vus par lâ€™article 7, Ã  la totalitÃ© du travail et
+     chacune de ses parties, indÃ©pendamment de la faÃ§on dont ils sont
+     empaquetÃ©s. Cette licence ne donne aucune permission de licencier
+     le travail dâ€™une autre faÃ§on, mais elle nâ€™invalide pas une telle
+     permission si vous lâ€™avez reÃ§ue sÃ©parÃ©ment. 
+
+  d) Si le travail a des interfaces utilisateurs interactives, chacune
+     doit afficher les Notices LÃ©gales AppropriÃ©es ; cependant si le
+     Programme a des interfaces qui nâ€™affichent pas les Notices LÃ©gales
+     AppropriÃ©es, votre travail nâ€™a pas Ã  les modifier pour quâ€™elles
+     les affichent. 
+
+Une compilation dâ€™un Travail Couvert avec dâ€™autres travaux sÃ©parÃ©s et
+indÃ©pendants, qui ne sont pas par leur nature des extensions du Travail
+Couvert, et qui ne sont pas combinÃ©s avec lui de faÃ§on Ã  former un
+programme plus large, dans ou sur un volume de stockage ou un support
+de distribution, est appelÃ© un Â« aggrÃ©gat Â» si la compilation et son
+Droit dâ€™Auteur rÃ©sultant ne sont pas utilisÃ©s pour limiter lâ€™accÃ¨s ou
+les droits lÃ©gaux des utilisateurs de la compilation en deÃ§a de ce que
+permettent les travaux individuels. Lâ€™inclusion dâ€™un Travail Couvert
+dans un aggrÃ©gat ne cause pas lâ€™application de cette Licence aux
+autres parties de lâ€™aggrÃ©gat.
+
+
+Article 6. Acheminement des formes non sources.
+
+Vous pouvez acheminer sous forme de code objet un Travail Couvert
+suivant les termes des articles 4 et 5, pourvu que vous acheminiez
+Ã©galement suivant les termes de cette Licence le Source Correspondant
+lisible par une machine, dâ€™une des faÃ§ons suivantes :
+
+  a) Acheminer le code objet sur, ou inclus dans, un produit physique
+     (y compris un support de distribution physique), accompagnÃ© par le
+     Source Correspondant fixÃ© sur un support physique durable
+     habituellement utilisÃ© pour les Ã©changes de logiciels.
+
+  b) Acheminer le code objet sur, ou inclus dans, un produit physique
+     (y compris un support de distribution physique), accompagnÃ© dâ€™une
+     offre Ã©crite, valide pour au moins trois annÃ©es et valide pour
+     aussi longtemps que vous fournissez des piÃ¨ces de rechange ou un
+     support client pour ce modÃ¨le de produit, afin de donner Ã 
+     quiconque possÃ¨de le code objet soit (1) une copie du Source
+     Correspondant Ã  tout logiciel dans ce produit qui est couvert par
+     cette Licence, sur un support physique durable habituellement
+     utilisÃ© pour les Ã©changes de logiciels, pour un prix non supÃ©rieur
+     au coÃ»t raisonnable de la rÃ©alisation physique de lâ€™acheminement
+     de la source, ou soit (2) un accÃ¨s permettant de copier le Source
+     Correspondant depuis un serveur rÃ©seau sans frais.
+
+  c) Acheminer des copies individuelles du code objet avec une copie de
+     lâ€™offre Ã©crite de fournir le Source Correspondant. Cette
+     alternative est permise seulement occasionellement et non
+     commercialement, et seulement si vous avez reÃ§u le code objet avec
+     une telle offre, en accord avec lâ€™article 6 alinÃ©a b.
+
+  d) Acheminer le code objet en offrant un accÃ¨s depuis un emplacement
+     dÃ©signÃ© (gratuit ou contre facturation) et offrir un accÃ¨s
+     Ã©quivalent au Source Correspondant de la mÃªme faÃ§on via le mÃªme
+     emplacement et sans facturation supplÃ©mentaire. Vous nâ€™avez pas
+     besoin dâ€™obliger les Destinataires Ã  copier le Source
+     Correspondant en mÃªme temps que le code objet. Si lâ€™emplacement
+     pour copier le code objet est un serveur rÃ©seau, le Source
+     Correspondant peut Ãªtre sur un serveur diffÃ©rent (opÃ©rÃ© par vous
+     ou par un tiers) qui supporte des facilitÃ©s Ã©quivalentes de
+     copie, pourvu que vous mainteniez des directions claires Ã 
+     proximitÃ© du code objet indiquant oÃ¹ trouver le Source
+     Correspondant. IndÃ©pendamment de quel serveur hÃ©berge le Source
+     Correspondant, vous restez obligÃ© de vous assurer quâ€™il reste
+     disponible aussi longtemps que nÃ©cessaire pour satisfaire Ã  ces
+     obligations.
+
+  e) Acheminer le code objet en utilisant une transmission
+     dâ€™Ã©gal-Ã -Ã©gal, pourvu que vous informiez les autres participants
+     sur oÃ¹ le code objet et le Source Correspondant du travail sont
+     offerts sans frais au public gÃ©nÃ©ral suivant lâ€™article 6 alinÃ©a d.
+     Une portion sÃ©parable du code objet, dont le code source est exclu
+     du Source Correspondant en tant que BibliothÃ¨que SystÃ¨me, nâ€™a pas
+     besoin dâ€™Ãªtre inclu dans lâ€™acheminement du travail sous forme de
+     code objet.
+
+Un Â« Produit Utilisateur Â» est soit (1) un Â« Produit de Consommation, Â»
+ce qui signifie toute propriÃ©tÃ© personnelle tangible normalement
+utilisÃ©e Ã  des fins personnelles, familiales ou relatives au foyer,
+soit (2) toute chose conÃ§ue ou vendue pour lâ€™incorporation dans un lieu
+dâ€™habitation. Pour dÃ©terminer si un produit constitue un Produit de
+Consommation, les cas ambigus sont rÃ©solus en fonction de la
+couverture. Pour un produit particulier reÃ§u par un utilisateur
+particulier, lâ€™expression Â« normalement utilisÃ©e Â» ci-avant se rÃ©fÃ¨re
+Ã  une utilisation typique ou lâ€™usage commun de produits de mÃªme
+catÃ©gorie, indÃ©pendamment du statut de cet utilisateur particulier ou
+de la faÃ§on spÃ©cifique dont cet utilisateur particulier utilise
+effectivement ou sâ€™attend lui-mÃªme ou est attendu Ã  utiliser ce
+produit. Un produit est un Produit de Consommation indÃ©pendamment du
+fait que ce produit a ou nâ€™a pas dâ€™utilisations substantielles
+commerciales, industrielles ou hors Consommation, Ã  moins que de telles
+utilisations reprÃ©sentent le seul mode significatif dâ€™utilisation du
+produit.
+
+Les Â« Informations dâ€™Installation Â» dâ€™un Produit Utilisateur signifient
+toutes les mÃ©thodes, procÃ©dures, clÃ©s dâ€™autorisation ou autres
+informations requises pour installer et exÃ©cuter des versions modifiÃ©es
+dâ€™un Travail Couvert dans ce Produit Utilisateur Ã  partir dâ€™une version
+modifiÃ©e de son Source Correspondant. Les informations qui suffisent Ã 
+assurer la continuitÃ© de fonctionnement du code objet modifiÃ© ne
+doivent en aucun cas Ãªtre empÃªchÃ©es ou interfÃ©rÃ©es du seul fait quâ€™une
+modification a Ã©tÃ© effectuÃ©e.
+
+Si vous acheminez le code objet dâ€™un Travail Couvert dans, ou avec, ou
+spÃ©cifiquement pour lâ€™utilisation dans, un Produit Utilisateur et
+lâ€™acheminement se produit en tant quâ€™Ã©lÃ©ment dâ€™une transaction dans
+laquelle le droit de possession et dâ€™utilisation du Produit
+Utilisateur est transfÃ©rÃ© au Destinataire dÃ©finitivement ou pour un
+terme fixÃ© (indÃ©pendamment de la faÃ§on dont la transaction est
+caractÃ©risÃ©e), le Source Correspondant acheminÃ© selon cet article-ci
+doit Ãªtre accompagnÃ© des Informations dâ€™Installation. Mais cette
+obligation ne sâ€™applique pas si ni vous ni aucune tierce partie ne
+dÃ©tient la possibilitÃ© dâ€™intaller un code objet modifiÃ© sur le Produit
+Utilisateur (par exemple, le travail a Ã©tÃ© installÃ© en mÃ©moire morte).
+
+Lâ€™obligation de fournir les Informations dâ€™Installation nâ€™inclue pas
+celle de continuer Ã  fournir un service de support, une garantie ou des
+mises Ã  jour pour un travail qui a Ã©tÃ© modifiÃ© ou installÃ© par le
+Destinataire, ou pour le Produit Utilisateur dans lequel il a Ã©tÃ©
+modifiÃ© ou installÃ©. Lâ€™accÃ¨s Ã  un rÃ©seau peut Ãªtre rejetÃ© quand la
+modification elle-mÃªme affecte matÃ©riellement et dÃ©favorablement les
+opÃ©rations du rÃ©seau ou viole les rÃ¨gles et protocoles de communication
+au travers du rÃ©seau.
+
+Le Source Correspondant acheminÃ© et les Informations dâ€™Installation
+fournies, en accord avec cet article, doivent Ãªtre dans un format
+publiquement documentÃ© (et dont une implÃ©mentation est disponible
+auprÃ¨s du public sous forme de code source) et ne doit nÃ©cessiter
+aucune clÃ© ou mot de passe spÃ©cial pour le dÃ©paquetage, la lecture ou
+la copie.
+
+
+Article 7. Termes additionnels.
+
+Les Â« permissions additionelles Â» dÃ©signent les termes qui
+supplÃ©mentent ceux de cette Licence en Ã©mettant des exceptions Ã  lâ€™une
+ou plusieurs de ses conditions. Les permissions additionnelles qui
+sont applicables au Programme entier doivent Ãªtre traitÃ©es comme si
+elles Ã©taient incluent dans cette Licence, dans les limites de leur
+validitÃ© suivant la loi applicable. Si des permissions additionnelles
+sâ€™appliquent seulement Ã  une partie du Programme, cette partie peut
+Ãªtre utilisÃ©e sÃ©parÃ©ment suivant ces permissions, mais le Programme
+tout entier reste gouvernÃ© par cette Licence sans regard aux
+permissions additionelles.
+
+Quand vous acheminez une copie dâ€™un Travail Couvert, vous pouvez Ã 
+votre convenance Ã´ter toute permission additionelle de cette copie, ou
+de nâ€™importe quelle partie de celui-ci. (Des permissions
+additionnelles peuvent Ãªtre rÃ©digÃ©es de faÃ§on Ã  requÃ©rir leur propre
+suppression dans certains cas oÃ¹ vous modifiez le travail.) Vous
+pouvez placer les permissions additionnelles sur le matÃ©riel acheminÃ©,
+ajoutÃ©es par vous Ã  un Travail Couvert pour lequel vous avez ou pouvez
+donner les permissions de Droit dâ€™Auteur (â€œcopyrightâ€�) appropriÃ©es.
+
+Nonobstant toute autre clause de cette Licence, pour tout constituant
+que vous ajoutez Ã  un Travail Couvert, vous pouvez (si autorisÃ© par les
+titulaires de Droit dâ€™Auteur pour ce constituant) supplÃ©menter les
+termes de cette Licence avec des termes :
+
+  a) qui rejettent la garantie ou limitent la responsabilitÃ© de faÃ§on
+     diffÃ©rente des termes des articles 15 et 16 de cette Licence ; ou
+
+  b) qui requiÃ¨rent la prÃ©servation de notices lÃ©gales raisonnables
+     spÃ©cifiÃ©es ou les attributions dâ€™auteur dans ce constituant ou
+     dans les Notices LÃ©gales AppropriÃ©es affichÃ©es par les travaux qui
+     le contiennent ; ou
+
+  c) qui prohibent la reprÃ©sentation incorrecte de lâ€™origine de ce
+     constituant, ou qui requiÃ¨rent que les versions modifiÃ©es dâ€™un tel
+     constituant soit marquÃ©es par des moyens raisonnables comme
+     diffÃ©rentes de la version originale ; ou
+
+  d) qui limitent lâ€™usage Ã  but publicitaire des noms des concÃ©dants de
+     licence et des auteurs du constituant ; ou
+
+  e) qui refusent Ã  accorder des droits selon la lÃ©gislation relative
+     aux marques commerciales, pour lâ€™utilisation dans des noms
+     commerciaux, marques commerciales ou marques de services ; ou
+
+  f) qui requiÃ¨rent lâ€™indemnisation des concÃ©dants de licences et
+     auteurs du constituant par quiconque achemine ce constituant (ou
+     des versions modifiÃ©es de celui-ci) en assumant contractuellement
+     la responsabilitÃ© envers le Destinataire, pour toute
+     responsabilitÃ© que ces engagements contractuels imposent
+     directement Ã  ces octroyants de licences et auteurs.
+
+Tous les autres termes additionnels non permissifs sont considÃ©rÃ©s
+comme des Â« restrictions avancÃ©es Â» dans le sens de lâ€™article 10. Si le
+Programme tel que vous lâ€™avez reÃ§u, ou toute partie de celui-ci,
+contient une notice Ã©tablissant quâ€™il est gouvernÃ© par cette Licence en
+mÃªme temps quâ€™un terme qui est une restriction avancÃ©e, vous pouvez
+Ã´ter ce terme. Si un document de licence contient une restriction
+avancÃ©e mais permet la reconcession de licence ou lâ€™acheminement
+suivant cette Licence, vous pouvez ajouter un Travail Couvert
+constituant gouvernÃ© par les termes de ce document de licence, pourvu
+que la restriction avancÃ©e ne survit pas Ã  un telle cession de licence
+ou acheminement.
+
+Si vous ajoutez des termes Ã  un Travail Couvert en accord avec cet
+article, vous devez placer, dans les fichiers sources appropriÃ©s, une
+dÃ©claration des termes additionnels qui sâ€™appliquent Ã  ces fichiers, ou
+une notice indiquant oÃ¹ trouver les termes applicables.
+
+Les termes additionnels, quâ€™ils soient permissifs ou non permissifs,
+peuvent Ãªtre Ã©tablis sous la forme dâ€™une licence Ã©crite sÃ©parÃ©ment, ou
+Ã©tablis comme des exceptions ; les obligations ci-dessus sâ€™appliquent
+dans chacun de ces cas.
+
+
+Article 8. Terminaison.
+
+Vous ne pouvez ni propager ni modifier un Travail Couvert autrement que
+suivant les termes de cette Licence. Toute autre tentative de le
+propager ou le modifier est nulle et terminera automatiquement vos
+droits selon cette Licence (y compris toute licence de brevet accordÃ©e
+selon le troisiÃ¨me paragraphe de lâ€™article 11).
+
+Cependant, si vous cessez toute violation de cette Licence, alors votre
+licence depuis un titulaire de Droit dâ€™Auteur (â€œcopyrightâ€�) est
+rÃ©instaurÃ©e (a) Ã  titre provisoire Ã  moins que et jusquâ€™Ã  ce que le
+titulaire de Droit dâ€™Auteur termine finalement et explicitement votre
+licence, et (b) de faÃ§on permanente si le titulaire de Droit dâ€™Auteur
+ne parvient pas Ã  vous notifier de la violation par quelque moyen
+raisonnable dans les soixante (60) jours aprÃ¨s la cessation.
+
+De plus, votre licence depuis un titulaire particulier de Droit
+dâ€™Auteur est rÃ©instaurÃ©e de faÃ§on permanente si ce titulaire vous
+notifie de la violation par quelque moyen raisonnable, câ€™est la
+premiÃ¨re fois que vous avez reÃ§u une notification deviolation de cette
+Licence (pour un travail quelconque) depuis ce titulaire de Droit
+dâ€™Auteur, et vous rÃ©solvez la violation dans les trente (30) jours qui
+suivent votre rÃ©ception de la notification.
+
+La terminaison de vos droits suivant cette section ne terminera pas les
+licences des parties qui ont reÃ§u des copies ou droits de votre part
+suivant cette Licence. Si vos droits ont Ã©tÃ© terminÃ©s et non
+rÃ©instaurÃ©s de faÃ§on permanente, vous nâ€™Ãªtes plus qualifiÃ© Ã  recevoir
+de nouvelles licences pour les mÃªmes constituants selon lâ€™article 10.
+
+
+Article 9. Acceptation non requise pour obtenir des copies.
+
+Vous nâ€™Ãªtes pas obligÃ© dâ€™accepter cette licence afin de recevoir ou
+exÃ©cuter une copie du Programme. La propagation asservie dâ€™un Travail
+Couvert qui se produit simplement en consÃ©quence dâ€™une transmission
+dâ€™Ã©gal-Ã -Ã©gal pour recevoir une copie ne nÃ©cessite pas lâ€™acceptation.
+Cependant, rien dâ€™autre que cette Licence ne vous accorde la
+permission de propager ou modifier un quelconque Travail Couvert. Ces
+actions enfreignent le Droit dâ€™Auteur si vous nâ€™acceptez pas cette
+Licence. Par consÃ©quent, en modifiant ou propageant un Travail Couvert,
+vous indiquez votre acceptation de cette Licence pour agir ainsi.
+
+
+Article 10. Cession automatique de Licence aux Destinataires et
+intermÃ©diaires.
+
+Chaque fois que vous acheminez un Travail Couvert, le Destinataire
+reÃ§oit automatiquement une licence depuis les concÃ©dants originaux,
+pour exÃ©cuter, modifier et propager ce travail, suivant les termes de
+cette Licence. Vous nâ€™Ãªtes pas responsable du renforcement de la
+conformation des tierces parties avec cette Licence.
+
+Une Â« transaction dâ€™entitÃ© Â» dÃ©signe une transaction qui transfÃ¨re le
+contrÃ´le dâ€™une organisation, ou de substantiellement tous ses actifs,
+ou la subdivision dâ€™une organisation, ou la fusion de plusieurs
+organisations. Si la propagation dâ€™un Travail Couvert rÃ©sulte dâ€™une
+transaction dâ€™entitÃ©, chaque partie Ã  cette transaction qui reÃ§oit une
+copie du travail reÃ§oit aussi les licences pour le travail que le
+prÃ©dÃ©cesseur intÃ©ressÃ© Ã  cette partie avait ou pourrait donner selon le
+paragraphe prÃ©cÃ©dent, plus un droit de possession du Source
+Correspondant de ce travail depuis le prÃ©dÃ©cesseur intÃ©ressÃ© si ce
+prÃ©dÃ©cesseur en dispose ou peut lâ€™obtenir par des efforts raisonnables.
+
+Vous ne pouvez imposer aucune restriction avancÃ©e dans lâ€™exercice des
+droits accordÃ©s ou affirmÃ©s selon cette Licence. Par exemple, vous ne
+pouvez imposer aucun paiement pour la licence, aucune royaltie, ni
+aucune autre charge pour lâ€™exercice des droits accordÃ©s selon cette
+Licence ; et vous ne pouvez amorcer aucun litige judiciaire (y compris
+une rÃ©clamation croisÃ©e ou contre-rÃ©clamation dans un procÃ¨s) sur
+lâ€™allÃ©gation quâ€™une revendication de brevet est enfreinte par la
+rÃ©alisation, lâ€™utilisation, la vente, lâ€™offre de vente, ou
+lâ€™importation du Programme ou dâ€™une quelconque portion de celui-ci.
+
+
+Article 11. Brevets.
+
+Un Â« contributeur Â» est un titulaire de Droit dâ€™Auteur (â€œcopyrightâ€�)
+qui autorise lâ€™utilisation selon cette Licence du Programme ou du
+travail sur lequel le Programme est basÃ©. Le travail ainsi soumis Ã 
+licence est appelÃ© la Â« version contributive Â» de ce contributeur.
+
+Les Â« revendications de brevet essentielles Â» sont toutes les
+revendications de brevets dÃ©tenues ou contrÃ´lÃ©es par le contributeur,
+quâ€™elles soient dÃ©jÃ  acquises par lui ou acquises subsÃ©quemment, qui
+pourraient Ãªtre enfreintes de quelque maniÃ¨re, permises par cette
+Licence, sur la rÃ©alisation, lâ€™utilisation ou la vente de la version
+contributive de celui-ci. Aux fins de cette dÃ©finition, le Â« contrÃ´le Â»
+inclue le droit de concÃ©der des sous-licences de brevets dâ€™une maniÃ¨re
+consistante, nÃ©cessaire et suffisante, avec les obligations de cette
+Licence.
+
+Chaque contributeur vous accorde une licence de brevet non exclusive,
+mondiale et libre de toute royaltie, selon les revendications de brevet
+essentielles, pour rÃ©aliser, utiliser, vendre, offrir Ã  la vente,
+importer et autrement exÃ©cuter, modifier et propager les contenus de sa
+version contributive.
+
+Dans les trois paragraphes suivants, une Â« licence de brevet Â» dÃ©signe
+tous les accords ou engagements exprimÃ©s, quel que soit le nom que vous
+lui donnez, de ne pas mettre en vigueur un brevet (telle quâ€™une
+permission explicite pour mettre en pratique un brevet, ou un accord
+pour ne pas poursuivre un Destinataire pour cause de violation de
+brevet). Â« Accorder Â» une telle licence de brevet Ã  une partie signifie
+conclure un tel accord ou engagement Ã  ne pas faire appliquer le brevet
+Ã  cette partie.
+
+Si vous acheminez un Travail Couvert, dÃ©pendant en connaissance dâ€™une
+licence de brevet, et si le Source Correspondant du travail nâ€™est pas
+disponible Ã  quiconque copie, sans frais et suivant les termes de cette
+Licence, Ã  travers un serveur rÃ©seau publiquement acessible ou tout
+autre moyen immÃ©diatement accessible, alors vous devez soit (1) rendre
+la Source Correspondante ainsi disponible, soit (2) vous engager Ã  vous
+priver pour vous-mÃªme du bÃ©nÃ©fice de la licence de brevet pour ce
+travail particulier, soit (3) vous engager, dâ€™une faÃ§on consistante
+avec les obligations de cette Licence, Ã  Ã©tendre la licence de brevet
+aux Destinataires de ce travail. Â« DÃ©pendant en connaissance Â» signifie
+que vous avez effectivement connaissance que, selon la licence de
+brevet, votre acheminement du Travail Couvert dans un pays, ou
+lâ€™utilisation du Travail Couvert par votre Destinataire dans un pays,
+infreindrait un ou plusieurs brevets identifiables dans ce pays oÃ¹ vous
+avez des raisons de penser quâ€™ils sont valides.
+
+Si, conformÃ©ment Ã  ou en liaison avec une mÃªme transaction ou un mÃªme
+arrangement, vous acheminez, ou propagez en procurant un acheminement
+de, un Travail Couvert et accordez une licence de brevet Ã  lâ€™une des
+parties recevant le Travail Couvert pour lui permettre dâ€™utiliser,
+propager, modifier ou acheminer une copie spÃ©cifique du Travail
+Couvert, alors votre accord est automatiquement Ã©tendu Ã  tous les
+Destinataires du Travail Couvert et des travaux basÃ©s sur celui-ci.
+
+Une licence de brevet est Â« discriminatoire Â» si, dans le champ de sa
+couverture, elle nâ€™inclut pas un ou plusieurs des droits qui sont
+spÃ©cifiquement accordÃ©s selon cette Licence, ou en prohibe lâ€™exercice,
+ou est conditionnÃ©e par le non-exercice dâ€™un ou plusieurs de ces
+droits. Vous ne pouvez pas acheminer un Travail Couvert si vous Ãªtes
+partie Ã  un arrangement selon lequel une partie tierce exerÃ§ant son
+activitÃ© dans la distribution de logiciels et Ã  laquelle vous effectuez
+un paiement fondÃ© sur lâ€™Ã©tendue de votre activitÃ© dâ€™acheminement du
+travail, et selon lequel la partie tierce accorde, Ã  une quelconque
+partie qui recevrait depuis vous le Travail Couvert, une licence de
+brevet discriminatoire (a) en relation avec les copies du Travail
+Couvert acheminÃ©es par vous (ou les copies rÃ©alisÃ©es Ã  partir de ces
+copies), ou (b) avant tout destinÃ©e et en relation avec des produits
+spÃ©cifiques ou compilations contenant le Travail Couvert, Ã  moins que
+vous ayez conclu cet arrangement ou que la licence de brevet ait Ã©tÃ©
+accordÃ©e avant le 28 mars 2007.
+
+Rien dans cette Licence ne devrait Ãªtre interprÃ©tÃ© comme devant exclure
+ou limiter toute licence implicite ou dâ€™autres moyens de dÃ©fense Ã  une
+infraction qui vous seraient autrement disponible selon la loi
+applicable relative aux brevets.
+
+
+Article 12. Non abandon de la libertÃ© des autres.
+
+Si des conditions vous sont imposÃ©es (que ce soit par dÃ©cision
+judiciaire, par un accord ou autrement) qui contredisent les conditions
+de cette Licence, elles ne vous excusent pas des conditions de cette
+Licence. Si vous ne pouvez pas acheminer un Travail Couvert de faÃ§on Ã 
+satisfaire simultÃ©nÃ©ment vos obligations suivant cette Licence et
+toutes autres obligations pertinentes, alors en consÃ©quence vous ne
+pouvez pas du tout lâ€™acheminer. Par exemple, si vous avez un accord sur
+des termes qui vous obligent Ã  collecter pour le rÃ©acheminement des
+royalties depuis ceux Ã  qui vous acheminez le Programme, la seule faÃ§on
+qui puisse vous permettre de satisfaire Ã  la fois Ã  ces termes et ceux
+de cette Licence sera de vous abstenir entiÃ¨rement dâ€™acheminer le
+Programme.
+
+
+Article 13. Utilisation avec la Licence GÃ©nÃ©rale Publique Affero GNU.
+
+Nonobstant toute autre clause de cette Licence, vous avez la permission
+de lier ou combiner tout Travail Couvert avec un travail placÃ© sous la
+version 3 de la Licence GÃ©nÃ©rale Publique GNU Affero (â€œGNU Affero
+General Public Licenseâ€�) en un seul travail combinÃ©, et dâ€™acheminer le
+travail rÃ©sultant. Les termes de cette Licence continueront Ã 
+sâ€™appliquer Ã  la partie formant un Travail Couvert, mais les
+obligations spÃ©ciales de la Licence GÃ©nÃ©rale Publique GNU Affero,
+article 13, concernant lâ€™interaction Ã  travers un rÃ©seau sâ€™appliqueront
+Ã  la combinaison en tant que telle.
+
+
+Article 14. Versions rÃ©visÃ©es de cette License.
+
+La Free Software Foundation peut publier des versions rÃ©visÃ©es et/ou
+nouvelles de la Licence Publique GÃ©nÃ©rale GNU (â€œGNU General Public
+Licenseâ€�) de temps en temps. De telles version nouvelles resteront
+similaires dans lâ€™esprit avec la prÃ©sente version, mais peuvent
+diffÃ©rer dans le dÃ©tail afin de traiter de nouveaux problÃ¨mes ou
+prÃ©occupations.
+
+Chaque version reÃ§oit un numÃ©ro de version distinctif. Si le Programme
+indique quâ€™une version spÃ©cifique de la Licence Publique GÃ©nÃ©rale GNU
+Â« ou toute version ultÃ©rieure Â» (â€œor any later versionâ€�) sâ€™applique Ã 
+celui-ci, vous avez le choix de suivre soit les termes et conditions de
+cette version numÃ©rotÃ©e, soit ceux de nâ€™importe quelle version publiÃ©e
+ultÃ©rieurement par la Free Software Foundation. Si le Programme
+nâ€™indique pas une version spÃ©cifique de la Licence Publique GÃ©nÃ©rale
+GNU, vous pouvez choisir lâ€™une quelconque des versions qui ont Ã©tÃ©
+publiÃ©es par la Free Software Foundation.
+
+Si le Programme spÃ©cifie quâ€™un intermÃ©diaire peut dÃ©cider quelles
+versions futures de la Licence GÃ©nÃ©rale Publique GNU peut Ãªtre
+utilisÃ©e, la dÃ©claration publique dâ€™acceptation dâ€™une version par cet
+intermÃ©diaire vous autorise Ã  choisir cette version pour le Programme.
+
+Des versions ultÃ©rieures de la licence peuvent vous donner des
+permissions additionelles ou diffÃ©rentes. Cependant aucune obligation
+additionelle nâ€™est imposÃ©e Ã  lâ€™un des auteurs ou titulaires de Droit
+dâ€™Auteur du fait de votre choix de suivre une version ultÃ©rieure.
+
+
+Article 15. DÃ©claration dâ€™absence de garantie.
+
+IL Nâ€™Y A AUCUNE GARANTIE POUR LE PROGRAMME, DANS LES LIMITES PERMISES
+PAR LA LOI APPLICABLE. Ã€ MOINS QUE CELA NE SOIT Ã‰TABLI DIFFÃ‰REMMENT PAR
+Ã‰CRIT, LES PROPRIÃ‰TAIRES DE DROITS ET/OU LES AUTRES PARTIES FOURNISSENT
+LE PROGRAMME Â« EN Lâ€™Ã‰TAT Â» SANS GARANTIE Dâ€™AUCUNE SORTE, QUâ€™ELLE SOIT
+EXPRIMÃ‰E OU IMPLICITE, CECI COMPRENANT, SANS SE LIMITER Ã€ CELLES-CI,
+LES GARANTIES IMPLICITES DE COMMERCIALISABILITÃ‰ ET Dâ€™ADÃ‰QUATION Ã€ UN
+OBJECTIF PARTICULIER. VOUS ASSUMEZ LE RISQUE ENTIER CONCERNANT LA
+QUALITÃ‰ ET LES PERFORMANCES DU PROGRAMME. DANS Lâ€™Ã‰VENTUALITÃ‰ OÃ™ LE
+PROGRAMME Sâ€™AVÃ‰RERAIT DÃ‰FECTUEUX, VOUS ASSUMEZ LES COÃ›TS DE TOUS LES
+SERVICES, RÃ‰PARATIONS OU CORRECTIONS NÃ‰CESSAIRES.
+
+
+Article 16. Limitation de responsabilitÃ©.
+
+EN AUCUNE AUTRE CIRCONSTANCE QUE CELLES REQUISES PAR LA LOI APPLICABLE
+OU ACCORDÃ‰ES PAR Ã‰CRIT, UN TITULAIRE DE DROITS SUR LE PROGRAMME, OU
+TOUT AUTRE PARTIE QUI MODIFIE OU ACHEMINE LE PROGRAMME COMME PERMIS
+CI-DESSUS, NE PEUT ÃŠTRE TENU POUR RESPONSABLE ENVERS VOUS POUR LES
+DOMMAGES, INCLUANT TOUT DOMMAGE GÃ‰NÃ‰RAL, SPÃ‰CIAL, ACCIDENTEL OU INDUIT
+SURVENANT PAR SUITE DE Lâ€™UTILISATION OU DE Lâ€™INCAPACITÃ‰ Dâ€™UTILISER LE
+PROGRAMME (Y COMPRIS, SANS SE LIMITER Ã€ CELLES-CI, LA PERTE DE DONNÃ‰ES
+OU Lâ€™INEXACTITUDE DES DONNÃ‰ES RETOURNÃ‰ES OU LES PERTES SUBIES PAR VOUS
+OU DES PARTIES TIERCES OU Lâ€™INCAPACITÃ‰ DU PROGRAMME Ã€ FONCTIONNER AVEC
+TOUT AUTRE PROGRAMME), MÃŠME SI UN TEL TITULAIRE OU TOUTE AUTRE PARTIE
+A Ã‰TÃ‰ AVISÃ‰ DE LA POSSIBILITÃ‰ DE TELS DOMMAGES.
+
+
+Article 17. InterprÃ©tation des sections 15 et 16.
+
+Si la dÃ©claration dâ€™absence de garantie et la limitation de
+responsabilitÃ© fournies ci-dessus ne peuvent prendre effet localement
+selon leurs termes, les cours de justice qui les examinent doivent
+appliquer la lÃ©gislation locale qui approche au plus prÃ¨s possible une
+levÃ©e absolue de toute responsabilitÃ© civile liÃ©e au Programme, Ã  moins
+quâ€™une garantie ou assumation de responsabilitÃ© accompagne une copie du
+Programme en Ã©change dâ€™un paiement.
+
+
+FIN DES TERMES ET CONDITIONS.
Index: tmp/trunk/org.txm.setups/shared/all/license_agreement.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/license_agreement.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/license_agreement.txt	(revision 728)
@@ -0,0 +1,31 @@
+          TXM 0.8.0
+
+Copyright Â© 2010-2017 ENS de Lyon,University of Franche-ComtÃ©.
+Copyright Â© 2010-2013 ENS de Lyon.
+Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+Lyon 2, University of Franche-ComtÃ©, University of Nice
+Sophia Antipolis, University of Paris 3.
+
+The TXM platform is free software: you can redistribute it
+and/or modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation,
+either version 2 of the License, or (at your option) any
+later version.
+
+The TXM platform 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 General Public License for more
+details.
+
+You should have received a copy of the GNU General 
+Public License along with the TXM platform. If not, see 
+http://www.gnu.org/licenses.
+___________________________________________________________
+
+To continue installing the software you must agree to the 
+terms of the GNU General Public License version 2 (GPL) 
+http://www.gnu.org/licenses/gpl-2.0.html software 
+licence agreement:
+ - click on "I agree" to continue the installation
+ - click on "Cancel" to abort

Property changes on: tmp/trunk/org.txm.setups/shared/all/license_agreement.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/annotation/BuildWordPropTableMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/annotation/BuildWordPropTableMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/annotation/BuildWordPropTableMacro.groovy	(revision 728)
@@ -0,0 +1,179 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+// $LastChangedDate: 2012-10-15 17:35:36 +0200 (lun., 15 oct. 2012) $
+// $LastChangedRevision: 2279 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.macro.annotation
+
+import org.txm.Toolbox
+import org.txm.searchengine.cqp.corpus.*
+import org.txm.searchengine.cqp.corpus.query.*
+import org.txm.functions.concordances.*
+import org.txm.functions.concordances.comparators.*
+import org.txm.functions.ReferencePattern
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+def corpus = corpusViewSelection
+if (!(corpus instanceof Corpus)) {
+	println "Error: you must select a corpus or a subcorpus to export properties"
+	return false;
+}
+
+@Field @Option(name="properties", usage="columns to inject separated by commas", widget="String", required=true, def="p1, p2, ... , pn")
+		def properties = "pos"
+
+@Field @Option(name="query", usage="The query to select words to annotate", widget="Query", required=true, def="[]")
+		def query
+
+@Field @Option(name="leftcontextsize", usage="The context sizes", widget="Integer", required=true, def="10")
+		def leftcontextsize = 10
+
+@Field @Option(name="rightcontextsize", usage="The context sizes", widget="Integer", required=true, def="10")
+		def rightcontextsize = 10
+
+@Field @Option(name="references", usage="references to show", widget="String", required=true, def="text_id")
+		def references = "text_id, p_id, s_id"
+
+@Field @Option(name="tsvFile", usage="The result TSV file", widget="File", required=true, def="export.tsv")
+		def tsvFile
+
+if (!ParametersDialog.open(this)) return;
+
+def split = properties.split(",")
+if (split.length == 0) {
+	println "ERROR: no property given"
+	return false
+}
+properties = []
+for (def p : split) properties << p.trim()
+
+println "Building Annotation Table with the following parameters: "
+println "- corpus: $corpus"
+println "- query: $query"
+println "- annotation properties: $properties"
+println "- TSV file: $tsvFile"
+
+tsvFile = tsvFile.getAbsoluteFile()
+if (!tsvFile.getParentFile().canWrite()) {
+	println "Error: "+tsvFile.getParentFile()+" is not writable."
+	return;
+}
+
+def annots = []
+for (def p : properties) {
+	def prop = corpus.getProperty(p)
+	if (prop == null) {
+		println "No such property $p in the $corpus corpus"
+		return false;
+	}
+	annots << prop
+}
+def id = corpus.getProperty("id")
+def word = corpus.getProperty("word")
+def text = corpus.getStructuralUnit("text")
+def text_id = text.getProperty("id")
+def refs = references.split(",")
+
+if (annots == null || annots.size() == 0) {
+	println "No such property given"//$annots in the $corpus corpus"
+	return false;
+}
+
+println "Exporting ..."
+def start = System.currentTimeMillis()
+
+// define the references pattern for each concordance line
+def referencePattern = new ReferencePattern()
+referencePattern.addProperty(text_id)
+referencePattern.addProperty(id)
+for (def annot : annots) referencePattern.addProperty(annot)
+
+def refProperties = []
+for (def ref : refs) {
+	ref = ref.trim()
+	try {
+		if (ref.contains("_")) {
+			def split2 = ref.split("_",2)
+			def refp = corpus.getStructuralUnit(split2[0].trim()).getProperty(split2[1].trim())
+			if (ref != "text_id")
+				referencePattern.addProperty(refp)
+			refProperties << refp
+		} else {
+			def p = corpus.getProperty(ref)
+			if (p != null) referencePattern.addProperty(p)
+		}
+	} catch(Exception e) { println "Error while parsing references: "+ref+" "+e}
+}
+
+// compute the concordance with contexts of 15 words on each side of the keyword
+//query = new Query(Query.fixQuery(query))
+def viewprops = [word]
+viewprops.addAll(annots)
+def concordance = new Concordance(corpus, query, word, viewprops, referencePattern, referencePattern, leftcontextsize, rightcontextsize)
+concordance.computeConcordance()
+//println "Conc done "+(System.currentTimeMillis()-start)
+
+def writer = tsvFile.newWriter("UTF-8");
+
+//println "Writing lines..."
+start = System.currentTimeMillis()
+String annotHeader = ""
+for (def annot : annots) annotHeader += "\t$annot"
+writer.write("N"+"\t"+"RÃ©fÃ©rences"+"\t"+"ContexteGauche"+"\t"+"Pivot"+annotHeader+"\t"+"ContexteDroit"+"\t"+"id"+"\t"+"text_id\n")
+
+// define which occurrence properties will be displayed
+concordance.setViewProperties([word])
+int NLines = concordance.getNLines();
+int chunk = 1000;
+for (int i = 0 ; i < concordance.getNLines() ; i += chunk) {
+	List<Line> lines
+	if (i+chunk > NLines)
+		lines = concordance.getLines(i, concordance.getNLines()-1)
+	else
+		lines = concordance.getLines(i, i+chunk-1) // e.g. from 0 to 999
+
+	int n = 1
+	for (Line l : lines) {
+		String ntext = l.getViewRef().getValue(text_id)
+		String lcontext = l.leftContextToString()
+		String pivot = l.keywordToString()
+		String rcontext = l.rightContextToString()
+		String ids = l.getViewRef().getValue(id)
+		String refValue = "";
+		for (def refp : refProperties) refValue += " "+l.getViewRef().getValue(refp)
+
+		String poss = "";
+		for (def annot : annots) {
+			poss += "\t"+l.getViewRef().getValue(annot)
+		}
+
+		//println l.getKeywordsViewProperties().get(pos)
+		writer.write(""+(l.getKeywordPosition())+"\t"+refValue+"\t"+lcontext+"\t"+pivot+poss+"\t"+rcontext+"\t"+ids+"\t"+ntext+"\n")
+	}
+	writer.flush()
+}
+println "Saved in "+tsvFile.getAbsolutePath()
+writer.close()
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/annotation/AnnotationInjectionFilter.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/annotation/AnnotationInjectionFilter.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/annotation/AnnotationInjectionFilter.groovy	(revision 728)
@@ -0,0 +1,176 @@
+package org.txm.macro.annotation
+
+import javax.xml.stream.*
+
+import org.txm.importer.StaxIdentityParser
+import org.txm.importer.filters.*
+import org.txm.importer.graal.PersonalNamespaceContext
+
+/**
+ * The Class AnnotationInjection.
+ *
+ * @author mdecorde
+ *
+ * inject annotation from a stand-off file into a xml-tei-txm
+ * file
+ */
+
+public class AnnotationInjectionFilter extends StaxIdentityParser {
+
+	public static String TXMNS = "http://textometrie.org/1.0"
+
+	/** The xml reader factory. */
+	private def factory;
+
+	def xmlFile;
+	def records;
+	def properties;
+	int n = 0;
+	boolean debug = false
+
+	public AnnotationInjectionFilter() {
+		super(null, null, null);
+	}
+	
+	/**
+	 * Instantiates a new annotation injection.
+	 *
+	 * @param url the xml-tei-txm file
+	 * @param anaurl the stand-off file
+	 */
+	public AnnotationInjectionFilter(File xmlFile, def records, def properties, def debug) {
+		super(xmlFile.toURI().toURL()); // init reader and writer
+		
+		this.debug = debug
+		this.xmlFile = xmlFile
+		this.records = records
+		this.properties = properties
+		this.n = 0;
+		//println ""+records.size()+" lines to process..."
+
+		try {
+			factory = XMLInputFactory.newInstance();
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		} catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+
+	def data; // the word id properties to add/replace
+	String newform = null
+	String wordId;
+	String anaType;
+	boolean start = false;
+	boolean replaceAnnotation = false;
+	protected void processStartElement() {
+		// this block don't write but only do tests
+		switch (localname) {
+			case "form":
+				if (start) {
+					def f = data.get("word")
+					if (f != null && f.length() > 0)
+						newform = f
+				}
+			case "w":
+				for (int i= 0 ; i < parser.getAttributeCount() ; i++ ) {
+					if (parser.getAttributeLocalName(i) == "id") {
+						wordId = parser.getAttributeValue(i);
+						data = records.get(wordId)
+						if (records.containsKey(wordId)) {
+							n++;
+							start = true; // found a word to update !
+							//println "found word $wordId"
+						}
+						break;
+					}
+				}
+				break;
+			case "ana":
+				if (start) { // found a word to update
+					for (int i= 0 ; i < parser.getAttributeCount() ; i++) { // look for the "type" attribute
+						if (parser.getAttributeLocalName(i) == "type") { 
+							anaType = parser.getAttributeValue(i);
+							anaType = anaType.substring(1)
+							//if (debug) println "type: $anaType"
+							replaceAnnotation = properties.contains(anaType) // there is a new value for this property
+							//if (replaceAnnotation) println " replace annotation $anaType"
+							break;
+						}
+					}
+				}
+				break;
+		}
+
+		super.processStartElement();
+	}
+
+	@Override
+	protected void processCharacters() {
+		if (start && replaceAnnotation) return; // don't write annotation chars if we are currently replacing
+		if (newform != null) { // don't rewrite form content
+			// we are currently in a <w> tags
+		} else {
+			super.processCharacters();
+		}
+	}
+
+	protected void processEndElement() {
+		if (start) { // write the new content of the <w> tags
+			switch (localname) {
+				case "w":
+					start = false
+					if (data.keySet().size() > 0) writer.writeCharacters("\n");
+					// write remaining properties
+					if (debug) if (data.size() > 0) println "new ana: " +data
+					for (def prop : data.keySet()) { // (1)
+						// write prop
+						writer.writeStartElement(TXMNS, "ana")
+						writer.writeAttribute("resp", "txm")
+						writer.writeAttribute("type", "#$prop")
+						writer.writeCharacters(data.get(prop))
+						writer.writeEndElement()
+						writer.writeCharacters("\n")
+						println " create annotation $prop with "+data.get(prop)
+					}
+					break;
+				case "form":
+					if (start) newform = null
+				case "ana":
+					if (replaceAnnotation) {
+						writer.writeCharacters(data.get(anaType))
+						if (debug) println " replace annotation $anaType content with "+data.get(anaType)
+						data.remove(anaType) // the anaType is removed because it is now written. I don't need to write it here (1)
+					}
+					anaType = ""
+					replaceAnnotation = false;
+					break;
+			}
+		}
+		super.processEndElement();
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+
+		File xmlFile = new File("/home/mdecorde/TEMP/annotation/01_DeGaulle.xml")
+		def properties = ["p1", "lemma"]
+		def records = [
+			"w_1":["p1":"a", "lemma":"b"],
+			"w_224":["p1":"c", "lemma":"d"],
+			"w_400":["p1":"e", "lemma":"f"],
+			"w_750":["p1":"g", "lemma":"h"],
+			"w_753":["p1":"i", "lemma":"j"],
+			"w_756":["p1":"k", "lemma":"l"]
+		]
+
+		def builder = new AnnotationInjectionFilter(xmlFile, records, properties);
+		builder.process(new File("/home/mdecorde/TEMP", "rez.xml"));
+
+		return;
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/annotation/InjectWordPropTableMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/annotation/InjectWordPropTableMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/annotation/InjectWordPropTableMacro.groovy	(revision 728)
@@ -0,0 +1,104 @@
+package org.txm.macro.annotation;
+
+import org.txm.utils.*
+
+import java.nio.charset.Charset
+
+import org.kohsuke.args4j.*
+
+import groovy.transform.Field
+
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+@Field @Option(name="inputDirectory", usage="The XML-TXM folder", widget="Folder", required=true, def="")
+def inputDirectory = new File(System.getProperty("user.home"), "xml/anapovoas/HELPTXM-02-131124/ite02")
+
+@Field @Option(name="outputDirectory", usage="The result folder", widget="Folder", required=true, def="")
+def outputDirectory = new File(System.getProperty("user.home"), "xml/anapovoas/HELPTXM-02-131124/ite03")
+
+@Field @Option(name="tsvFile", usage="The annotation TSV file", widget="File", required=true, def="")
+def tsvFile = new File(System.getProperty("user.home"), "xml/anapovoas/HELPTXM-02-131124/TSV-ITE02.csv")
+
+@Field @Option(name="properties", usage="columns to inject separated by commas", widget="String", required=true, def="p1, p2, ... , pn")
+def properties = "verificado"
+
+@Field @Option(name="debug", usage="Debug de the macro", widget="Boolean", required=true, def="false")
+def debug = true
+
+if (!ParametersDialog.open(this)) return;
+
+def split = properties.split(",")
+if (split.length == 0) {
+	println "ERROR: no property given"
+	return false
+}
+properties = []
+for (def p : split) properties << p.trim()
+
+println "Injecting annotations with the following parameters:"
+println "- inputDirectory: $inputDirectory"
+println "- outputDirectory: $outputDirectory"
+println "- tsvFile: $tsvFile"
+println "- properties: $properties"
+
+outputDirectory.mkdir()
+if (!outputDirectory.exists()) {
+	println "ERROR: could not create or read $outputDirectory directory"
+	return false
+}
+
+CsvReader records = new CsvReader(tsvFile.getAbsolutePath(), "\t".charAt(0), Charset.forName("UTF-8"))
+records.setTextQualifier((char)0)
+records.readHeaders();
+
+def header = Arrays.asList(records.getHeaders())
+if (debug) println "CSV header: $header"
+for (def s : properties) if (!header.contains(s)) {
+	println "Missing annotation property : $s"
+	return;
+}
+for (def s : ["text_id", "id"]) if (!header.contains(s)) {
+	println "Missing annotation property : $s"
+	return;
+}
+
+def injections = [:]
+int no = 1;
+while (records.readRecord()) {
+	String textid = records.get("text_id")
+	if (!injections.containsKey(textid)) injections[textid] = [:]
+	
+	def props = [:]
+	for (def s : properties) props[s] = records.get(s)
+	if (records.get("id") == "") {
+		 print "ERROR in record "+no
+	} else {
+		injections[textid][records.get("id")] = props
+	}
+	no++;
+}
+
+println "Injecting..."
+//for (String textid : injections.keySet()) {
+for (File currentXMLFile : inputDirectory.listFiles()) {
+	if (currentXMLFile.isDirectory()) continue;
+	if (currentXMLFile.isHidden()) continue;
+	
+	String textid = currentXMLFile.getName();
+	int idx = textid.indexOf(".")
+	if (idx > 0) textid = textid.substring(0, idx);
+	
+	if (injections.containsKey(textid)) {	
+		if (debug) println "Injections of "+injections[textid].size()+" lines."
+		
+		def builder = new AnnotationInjectionFilter(currentXMLFile, injections[textid], properties, debug)
+		println "injecting in $currentXMLFile $properties"
+		builder.process(new File(outputDirectory, currentXMLFile.getName()));
+		println ""+builder.n+" lines injected."
+	} else {
+		println "copying file $currentXMLFile"
+		FileCopy.copy(currentXMLFile, new File(outputDirectory, currentXMLFile.getName()))
+	}
+}
+
+println "New XML-TXM files are saved in ${outputDirectory}."
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/SearchReplaceInFileMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/SearchReplaceInFileMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/SearchReplaceInFileMacro.groovy	(revision 728)
@@ -0,0 +1,64 @@
+package org.txm.macro.txt
+// Copyright Â© - ENS de Lyon - http://textometrie.ens-lyon.fr
+// @author sheiden
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+// $LastChangedDate: 2013-05-02 11:28:42 +0200 (jeu., 02 mai 2013) $
+// $LastChangedRevision: 2378 $
+// $LastChangedBy: sheiden $
+//
+
+// imports
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+// parameters
+
+// **change this parameter**
+@Field @Option(name="file",usage="Dossier qui contient les fichiers Ã  modifier", widget="File", required=true, def='/home/mdecorde/xml/qgraalc/qgraal_cm-c.xml')
+		file = new File(System.getProperty("user.home"), "Bureau/voeux")
+
+// **change this parameter**
+@Field @Option(name="extension",usage="Regexp de l'extension des fichiers Ã  modifier", widget="String", required=true, def='\\.txt')
+		extension = "\\.txt"
+
+// **change this parameter**
+@Field @Option(name="find",usage="Expression rÃ©guliÃ¨re", widget="String", required=true, def='â€™')
+		find = "â€™"
+
+// **change this parameter**
+@Field @Option(name="replaceWith",usage="ChaÃ®ne de remplacement", widget="String", required=false, def='\'')
+		replaceWith = "'"
+
+// **change this parameter**
+@Field @Option(name="encoding",usage="Encodage des fichiers", widget="String", required=true, def='UTF-8')
+		encoding = "utf-8"
+
+if (!ParametersDialog.open(this)) return;
+
+println "SearchAndReplace in $file"
+
+	def tmp = File.createTempFile("SearchReplaceInDirectoryTemp", ".tmp", file.getParentFile()) // create temporary file
+	tmp.write('')                                // create empty file
+	tmp.withWriter(encoding) { writer ->
+		String txt = file.getText(encoding);
+		writer.println txt.replaceAll(find, replaceWith)
+		writer.close()
+	}
+	file.delete()
+	tmp.renameTo(file)                           // save results
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/CharListMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/CharListMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/CharListMacro.groovy	(revision 728)
@@ -0,0 +1,30 @@
+package org.txm.macro.txt;
+// STANDARD DECLARATIONS
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+// BEGINNING OF PARAMETERS
+
+// Declare each parameter here
+// (available widget types: Query, File, Folder, String, Text, Boolean, Integer, Float and Date)
+
+@Field @Option(name="inputFile", usage="The file to read", widget="File", required=true, def="C:/Temp/foo.txt")
+def inputFile
+
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return;
+
+// END OF PARAMETERS
+
+String s = inputFile.getText()
+
+def dic = [:]
+
+for (char c : s) {
+	if (!dic.containsKey(c)) { dic[c] = 0 }
+	dic[c]++
+}
+
+for (def e : dic) { println(sprintf("%c\t%d", [e.getKey(), e.getValue()])) }
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/ChangeEncodingMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/ChangeEncodingMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/ChangeEncodingMacro.groovy	(revision 728)
@@ -0,0 +1,76 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+package org.txm.macro.txt
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.utils.CharsetDetector
+
+@Field @Option(name="inputDirectory", usage="Dossier qui contient les fichiers Ã  traiter", widget="Folder", required=true, def="")
+File inputDirectory
+
+@Field @Option(name="inputEncoding", usage="Input encoding", widget="String", required=false, def="")
+String inputEncoding
+
+@Field @Option(name="outputEncoding", usage="Output encoding", widget="String", required=true, def="UTF-8")
+String outputEncoding
+
+if (!ParametersDialog.open(this)) return;
+
+File outDir = new File(inputDirectory, "out") // write result in "out" folder
+if (outDir.exists()) {
+	if (!outDir.deleteDir()) {
+		println "Could not delete directory: $outDir"
+		return;
+	}
+}
+if (!outDir.mkdir()) {
+	println "Could not create directory: $outDir"
+	return;
+}
+println "Writing result in : $outDir"
+
+def processFile(File file, File outfile, String fromEncoding, String toutputEncoding) {
+	String text = file.getText(fromEncoding)
+	outfile.withWriter(toutputEncoding) {writer -> // read with the "fromEncoding"
+		writer.write(text) // write with the "toutputEncoding"
+	}
+}
+
+try {
+inputDirectory.eachFile { file ->
+	if (!file.isHidden() && !file.isDirectory()) {
+		String e = inputEncoding
+		if (inputEncoding == null || inputEncoding.length() == 0) {
+			CharsetDetector detector = new CharsetDetector(file)
+			e = detector.getEncoding()
+		}
+		
+		File outfile = new File(outDir, file.getName())
+		println "$e -> $outputEncoding : "+outfile.getName()
+		processFile(file, outfile, e, outputEncoding)
+	}
+}
+} catch (UnsupportedEncodingException e) {
+	println "ERROR: Unsupported encoding: "+e
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/SearchReplaceInDirectoryMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/SearchReplaceInDirectoryMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/SearchReplaceInDirectoryMacro.groovy	(revision 728)
@@ -0,0 +1,104 @@
+package org.txm.macro.txt
+// Copyright Â© - ENS de Lyon - http://textometrie.ens-lyon.fr
+// @author sheiden
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+// $LastChangedDate: 2013-05-02 11:28:42 +0200 (jeu., 02 mai 2013) $
+// $LastChangedRevision: 2378 $
+// $LastChangedBy: sheiden $
+//
+
+// imports
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+// parameters
+
+// **change this parameter**
+@Field @Option(name="inputDirectory",usage="Dossier qui contient les fichiers Ã  modifier", widget="Folder", required=true, def='voeux')
+		inputDirectory = new File(System.getProperty("user.home"), "Bureau/voeux")
+
+// **change this parameter**
+@Field @Option(name="extension",usage="Regexp de l'extension des fichiers Ã  modifier", widget="String", required=true, def='\\.txt')
+		extension = "\\.txt"
+
+// **change this parameter**
+@Field @Option(name="find",usage="Expression rÃ©guliÃ¨re", widget="String", required=true, def='â€™')
+		find = "â€™"
+
+// **change this parameter**
+@Field @Option(name="replaceWith",usage="ChaÃ®ne de remplacement", widget="String", required=false, def='\'')
+		replaceWith = "'"
+
+// **change this parameter**
+@Field @Option(name="encoding",usage="Encodage des fichiers", widget="String", required=true, def='UTF-8')
+		encoding = "utf-8"
+
+// **change this parameter**
+// 'true' = only display matching lines, 'false' = replace in matching files
+//@Field @Option(name="showMatchingFilesOnly",usage="Montrer seulement les matchs", widget="Boolean", required=false, def='false')
+		showMatchingFilesOnly = false;
+
+if (!ParametersDialog.open(this)) return;
+
+println "Working with $inputDirectory files with extension="+/.*$extension/
+if (showMatchingFilesOnly) {
+	println "Search '$find'"
+} else {
+	println "Replace '$find' with '$replaceWith'"
+}
+
+//find = /date="([0-9]+)-([0-9]+-[0-9]+)"/
+// **change this parameter**
+//replaceWith = 'date="$1-$2" year="$1"'
+// **change this parameter** (warning: '$1', '$2'... can be interpreted by Groovy in "..." strings)
+process(inputDirectory, extension, encoding, find, replaceWith, showMatchingFilesOnly)
+
+// main body
+def process(File inputDirectory, extension, encoding, find, replaceWith, showMatchingFilesOnly) {
+	
+	inputDirectory.eachFileMatch(~/.*$extension/) { file ->               // for each file matching extension
+		println "Processing: "+file.getName()
+//		if (showMatchingFilesOnly) {
+//			printMatches(file, encoding, find)
+//		} else {
+			replaceInFile(file, encoding, find,replaceWith)
+//		}
+	}
+}
+
+//def printMatches(File file, encoding, find) {
+//	file.eachLine(encoding) { line ->                  // for each line
+//		if (line.matches("$find")) { println " *match* : "+line }
+//	}
+//}
+
+def replaceInFile(File file, encoding,  find, replaceWith) {
+	def tmp = File.createTempFile("SearchReplaceInDirectoryTemp", ".tmp", file.getParentFile()) // create temporary file
+	tmp.write('')                                // create empty file
+	tmp.withWriter(encoding) { writer ->
+		String txt = file.getText(encoding);
+		writer.println txt.replaceAll(find, replaceWith)
+//		file.eachLine(encoding) { line ->                  // for each line
+//			writer.println line.replaceAll(find, replaceWith) // find&replace and print
+//		}
+		writer.close()
+	}
+	file.delete()
+	tmp.renameTo(file)                           // save results
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/CharListDirectoryMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/CharListDirectoryMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/CharListDirectoryMacro.groovy	(revision 728)
@@ -0,0 +1,55 @@
+package org.txm.macro.txt;
+// STANDARD DECLARATIONS
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+// BEGINNING OF PARAMETERS
+
+// Declare each parameter here
+// (available widget types: Query, File, Folder, String, Text, Boolean, Integer, Float and Date)
+
+@Field @Option(name="inputFile",usage="The file to read", widget="File", required=true, def="C:/Temp/foo.txt")
+def inputFile
+
+@Field @Option(name="inputDir",usage="The file to read", widget="Folder", required=false, def="")
+def inputDir
+
+
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return;
+
+def dic = [:]
+
+// END OF PARAMETERS
+if (inputDir != null && inputDir.exists()) {
+if (inputDir.listFiles() == null) {println "no files..."; return;}
+	println "processing "+inputDir.listFiles().size()+" files"
+	for (def f : inputDir.listFiles()) {
+		if (f.isDirectory()) continue;
+		print "."
+		count(f, dic)
+	}
+	println ""
+} else {
+	count(inputFile, dic)
+}
+int total = 0
+for (def e : dic.sort()) {
+	println(sprintf("%c\t%d", [e.getKey(), e.getValue()]))
+	total += e.getValue()
+}
+println "TOTAL\t$total"
+
+def count(def f, def dic) {
+	String s = f.getText()
+	for (char c : s) {
+		if (c == '\r' || c == '\n' || c == '\t' || c == ' ' || c == 'Â ') continue;
+		if (!dic.containsKey(c)) { dic[c] = 0 }
+		dic[c]++
+	}
+
+	return dic
+}
+
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/SearchInDirectoryMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/SearchInDirectoryMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/SearchInDirectoryMacro.groovy	(revision 728)
@@ -0,0 +1,45 @@
+package org.txm.macro.txt
+
+import org.kohsuke.args4j.*
+
+import groovy.transform.Field
+
+import java.nio.charset.Charset
+
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.utils.*
+
+import javax.xml.stream.*
+
+import java.net.URL
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+@Field @Option(name="inputDirectory", usage="TXT directory", widget="Folder", required=false, def="txt")
+File inputDirectory;
+@Field @Option(name="regexp", usage="Regular expression to match", widget="String", required=false, def="p")
+String regexp;
+@Field @Option(name="encoding", usage="File encoding", widget="String", required=false, def="UTF-8")
+String encoding;
+
+if (!ParametersDialog.open(this)) return;
+
+def p = /$regexp/
+
+println "processing: "+inputDirectory.listFiles()
+for (File inputfile : inputDirectory.listFiles()) {
+	if (inputfile.isDirectory()) continue // ignore
+	
+	def lines = []
+	inputfile.eachLine("UTF-8") { line, n ->
+		def m = line =~ p
+		if ( m.size() > 0) {
+			lines << "  line $n: $line"
+		}
+	}
+	
+	println inputfile.getName() + " "+lines.size() + " match" +((lines.size() > 1)?"s":"")
+	if (lines.size() > 0) {
+		for (String s : lines ) println s
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/TXT2XMLMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/TXT2XMLMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/TXT2XMLMacro.groovy	(revision 728)
@@ -0,0 +1,47 @@
+package org.txm.macro.txt
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import java.nio.charset.Charset
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.utils.*
+import javax.xml.stream.*
+import java.net.URL
+
+@Field @Option(name="inputDirectory", usage="TXT directory", widget="Folder", required=false, def="txt")
+File inputDirectory;
+
+@Field @Option(name="encoding", usage="File encoding", widget="String", required=false, def="UTF-8")
+String encoding;
+
+@Field @Option(name="rootTag", usage="rootTag", widget="String", required=false, def="doc")
+String rootTag;
+
+if (!ParametersDialog.open(this)) return;
+rootTag = rootTag.trim()
+encoding = encoding.trim()
+
+File outputDirectory = new File(inputDirectory, "out")
+outputDirectory.mkdir()
+println "processing: "+inputDirectory
+for (File inputfile : inputDirectory.listFiles()) {
+	if (inputfile.isDirectory() || inputfile.isHidden() || !inputfile.getName().endsWith(".txt")) continue // ignore
+	println " file: "+inputfile
+	
+	String name = inputfile.getName()
+	int idx = name.lastIndexOf(".")
+	if (idx > 0) name = name.substring(0, idx)
+	File outputfile = new File(outputDirectory, name+".xml")
+	
+	XMLOutputFactory factory = XMLOutputFactory.newInstance()
+	FileOutputStream output = new FileOutputStream(outputfile)
+	XMLStreamWriter writer = factory.createXMLStreamWriter(output)
+
+	writer.writeStartDocument("UTF-8","1.0")
+	writer.writeCharacters("\n") // manage XML reserved characters
+	writer.writeStartElement(rootTag)
+	writer.writeCharacters(inputfile.getText(encoding)) // manage XML reserved characters
+	writer.writeEndElement() // rootTag
+	writer.close()
+	output.close()
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/MergeByNumberMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/MergeByNumberMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/txt/MergeByNumberMacro.groovy	(revision 728)
@@ -0,0 +1,89 @@
+// STANDARD DECLARATIONS
+package org.txm.macro.txt
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+// BEGINNING OF PARAMETERS
+
+@Field @Option(name="folder", usage="an example folder", widget="Folder", required=false, def="C:/Temp")
+def folder
+
+@Field @Option(name="ext", usage="an example string", widget="String", required=false, def=".txt")
+def ext
+
+@Field @Option(name="encoding", usage="an example string", widget="String", required=false, def="UTF-8")
+def encoding
+
+
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return;
+
+// END OF PARAMETERS
+
+println "Mergin files in $folder with extension=$ext"
+
+File outdir = new File(folder, "out");
+outdir.deleteDir()
+outdir.mkdir()
+File errordir = new File(folder, "error");
+errordir.deleteDir()
+errordir.mkdir()
+
+def files = folder.listFiles().findAll{File it-> it.getName().endsWith(ext)};
+files.sort()
+if (files.size() == 0) return;
+def toMerge = []
+def prefix = null
+def prefix2;
+
+for (File current : files) {
+	prefix2 = current.getName();
+	int idx = prefix2.indexOf(ext)
+	if (idx <= 0) {
+		println "error $ext file $current"
+		new File(errordir, current.getName()) << current.getText(encoding)
+		toMerge << current
+		continue;
+	}
+	prefix2 = prefix2.substring(0, idx)
+	int idx2 = prefix2.indexOf("-")
+	if (idx2 <= 0) {
+		println "error '-' file $current"
+		new File(errordir, current.getName()) << current.getText(encoding)
+		toMerge << current
+		continue;
+	}
+	String snumber = prefix2.substring(idx2+1);
+	prefix2 = prefix2.substring(0, idx2)
+	
+	if (!prefix2.equals(prefix)) {	
+		println "merging $toMerge"
+		File mergedFile = new File(outdir, prefix+ext)
+		for (def f : toMerge) mergedFile << f.getText(encoding)
+		toMerge.clear()
+		
+	}
+	
+	toMerge << current
+	prefix = prefix2
+}
+
+if (toMerge.size() > 0) {
+	File current = toMerge[0]
+	prefix2 = current.getName();
+	int idx = prefix2.indexOf(ext)
+	prefix2 = prefix2.substring(0, idx)
+	int idx2 = prefix2.indexOf("-")
+	String snumber = prefix2.substring(idx2+1);
+	prefix2 = prefix2.substring(0, idx2)
+	
+		println "merging $toMerge"
+		File mergedFile = new File(outdir, prefix+ext)
+		for (def f : toMerge) mergedFile << f.getText(encoding)
+		toMerge.clear()
+		
+	println "merging last files: $toMerge"
+	println "in $mergedFile"
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/export/ExportTextContentMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/export/ExportTextContentMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/export/ExportTextContentMacro.groovy	(revision 728)
@@ -0,0 +1,80 @@
+// STANDARD DECLARATIONS
+package org.txm.macro.export
+
+import org.txm.searchengine.cqp.corpus.*
+import org.txm.searchengine.cqp.corpus.query.Query
+import org.txm.Toolbox
+import org.txm.utils.i18n.LangFormater;
+import org.apache.commons.lang.StringUtils;
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+println "corpora selection: "+corpusViewSelection
+
+if (!(corpusViewSelection instanceof Corpus)) {
+	println "Please select a corpus"
+	return;
+}
+
+// PARAMETERS
+
+@Field @Option(name="exportDir", usage="Result directory ", widget="Folder", required=true, def="export")
+File exportDir
+
+@Field @Option(name="lineSeparatorStructureName", usage="line separator structure", widget="String", required=false, def="p")
+def lineSeparatorStructureName
+
+if (!ParametersDialog.open(this)) return
+
+// BEGINNING
+
+if (!exportDir.exists()) exportDir.mkdirs()
+
+Corpus corpus = corpusViewSelection
+CQI = Toolbox.getCqiClient();
+
+def lineSeparatorStructure = corpus.getStructuralUnit(lineSeparatorStructureName)
+
+if (lineSeparatorStructure == null) {
+	println "The $lineSeparatorStructureName structure does not exists in the $corpus corpus"
+	return;
+}
+
+def breaks_pos = Arrays.asList(corpus.query(new Query("[]</"+lineSeparatorStructureName+">"),"test", false).getEnds())
+println breaks_pos
+
+println "Exporting $corpus text content to $exportDir"
+
+def wordProperty = corpus.getWordProperty()
+def textidProperty = corpus.getStructuralUnit("text").getProperty("id")
+def textStartBoundaries = corpus.getTextStartLimits();
+def textEndBoundaries = corpus.getTextEndLimits();
+int[] struct_pos = CQI.cpos2Struc(textidProperty.getQualifiedName(), textStartBoundaries)
+String[] textids =  CQI.struc2Str(textidProperty.getQualifiedName(), struct_pos)
+println ""+textStartBoundaries.size()+" texts"
+
+for (int i = 0 ; i < textStartBoundaries.size() ; i++) {
+	int start = textStartBoundaries[i];
+	int end = textEndBoundaries[i]
+
+	File txtFile = new File(exportDir, textids[i]+".txt")
+	print ".."
+	def writer = txtFile.newWriter("UTF-8")
+	int[] positions = new int[end - start + 1]
+	int c = 0;
+	for (int p : start..end) {
+		positions[c++] = p
+	}
+	int[] idx = CQI.cpos2Id(wordProperty.getQualifiedName(), positions)
+	def words = CQI.id2Str(wordProperty.getQualifiedName(), idx)
+	for (int j = 0 ; j < positions.length ; j++) {
+		int p = positions[j]
+		if (breaks_pos.contains(p)) words[j] = words[j] +"\n" 
+	}
+	writer.println LangFormater.format(StringUtils.join(words, " "),
+				corpus.getAttribute("lang"));
+	writer.close();
+}  
+
+println "\nDone, result saved in "+exportDir.getAbsolutePath()
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/cqp/CreateCQPListMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/cqp/CreateCQPListMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/cqp/CreateCQPListMacro.groovy	(revision 728)
@@ -0,0 +1,118 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+package org.txm.macro.cqp
+
+/*
+This macro allows you to define CQL lists which you can call in CQP queries during the current session.
+To use this macro for your own lists,
+1. Find below an example of the type of list you want to create
+   (case 1 = explicit list, or case 2 = list from file),
+2. Copy then paste this example (5 lines) after the given examples
+3. Give the name for your list as a string after list_name=
+4. Give the content of the list as a string after
+either list_value= (for case 1, explicit list)
+or list_path= (for case 2, list from file).
+5. Save this file (macro code)
+6. Run the macro by double-clicking on it.
+The lists are defined only for the current session.
+To use the same lists in a new session, just run the macro to generate the lists again.
+*/
+
+import org.txm.Toolbox
+import org.txm.searchengine.cqp.*
+
+def CQI = Toolbox.getCqiClient();
+if ((CQI instanceof NetCqiClient)) {
+	println "Error: only available in CQP memory mode"
+	return;
+}
+
+def list_name=""
+def list_value=""
+def list_path=""
+def cqp_value=""
+File f;
+try {
+
+// BEGIN CONFIGURATION HERE
+
+// 1st case : explicit lists
+list_name = "negatif"
+list_value = "rien non ne pas sans"
+
+cqp_statement = "define \$$list_name = \"$list_value\";"
+println "CQP executes : $cqp_statement"
+CQI.query(cqp_statement)
+
+// two other examples of 1st case (explicit list)
+// 1st explicit list
+list_name = "evaluation"
+list_value = "trop assez peu bien trÃ¨s beaucoup vraiment"
+
+cqp_statement = "define \$$list_name = \"$list_value\";"
+println "CQP executes : $cqp_statement"
+CQI.query(cqp_statement)
+
+// 2nd explicit list
+list_name = "categoriesmotsvides"
+list_value = "ABR ADV DET:ART DET:POS INT KON NUM PRO PRO:DEM PRO:IND PRO:PER PRO:POS PRO:REL PRP PRP:det PUN PUN:cit SENT SYM"
+
+cqp_statement = "define \$$list_name = \"$list_value\";"
+println "CQP executes : $cqp_statement"
+CQI.query(cqp_statement)
+
+// one example of regular expression list to be used with RE()
+list_name = "regexp_categoriesmotsvides"
+list_value = "ABR ADV DET.* INT KON NUM PRO.* PRP.* PUN.* SENT SYM"
+
+cqp_statement = "define \$$list_name = \"$list_value\";"
+println "CQP executes : $cqp_statement"
+CQI.query(cqp_statement)
+
+// 2nd case : list from a file
+
+list_name = "motsvides"
+list_path = System.getProperty("user.home")+"/TXM/cqp/listes/stopwords_fr_ranknl.txt"
+// Windows users must replace "/" with "\\". 
+// for instance : 
+// list_path = System.getProperty("user.home")+"\\TXM\\cqp\\listes\\stopwords_fr_ranknl.txt"
+f = new File(list_path);
+if (f.exists()) {
+	cqp_statement = "define \$$list_name < \"$list_path\";"
+	println "CQP executes : $cqp_statement"
+	CQI.query(cqp_statement)
+} else {
+	println "Error: \"$f\" file does not exists"
+}
+
+/*
+You can comment a group of several lines of code
+using stars and slash like this.
+*/
+
+// END OF CONFIGURATION
+
+} catch (Exception e) {
+	println "Error during the \"$list_name\" list creation with the \"$list_value\" value"
+	println "CPQ statement was \"$cqp_statement\""
+	if (f != null) println "Last CQL file path was \"$f\""
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/cqp/ExecCQPMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/cqp/ExecCQPMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/cqp/ExecCQPMacro.groovy	(revision 728)
@@ -0,0 +1,173 @@
+package org.txm.macro.cqp
+// Copyright Â© 2014 ENS de Lyon
+//
+// Authors:
+// - Matthieu Decorde
+// - Serge Heiden
+//
+// Licence:
+// This file is part of the TXM platform.
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+// Version:
+// $LastChangedDate: 2014-11-01 16:00:01 +0100 (sam., 1 nov. 2014) $
+// $LastChangedRevision: XXXX $
+// $LastChangedBy: sheiden $
+//
+
+//Title:
+// EN:
+// Macro to call directly internal CQP corpus engine statements
+//
+// Warning: This macro must be used by advanced users,
+// at the risk of compromising CQP engine stability for the current TXM session
+//
+//FR:
+// Macro de demande d'exÃ©cution directe d'instructions au moteur de corpus interne CQP
+//
+// Avertissement : Cette macro doit Ãªtre utilisÃ©e par des utilisateurs avertis,
+// au risque de compromettre la stabilitÃ© du moteur CQP pour la session TXM courante
+
+// Necessary declarations - DÃ©clarations prÃ©alables
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.Toolbox
+import org.txm.searchengine.cqp.*
+
+// Sanity check - VÃ©rification de cohÃ©rence
+def CQI = Toolbox.getCqiClient();
+if ((CQI instanceof NetCqiClient)) {
+	println "Error: CQP eval only available in CQP memory mode"
+	return;
+}
+
+// Parameter declaration - DÃ©claration du paramÃ¨tre
+@Field @Option(name="statement", usage="CQP statement to execute (mind the ';' at the end)", widget="String", required=true, def="set da enpos;")
+String statement;
+
+// Usefull CQP statements - Instructions CQP Utiles //
+//
+// 1] Set a CQP variable - rÃ©gler une variable CQP :
+// "set variable valeur;"
+//
+// Useful CQP variables
+// A) da = DefaultNonbrackAttr variable setting: the implicit word property in subsequent CQL queries
+//    For example, when DefaultNonbrackAttr=word, the "the" CQL query is interpreted by CQP as the '[word="the"]' query
+// Example Statements:
+// - set da word;     set implicit word property to "word" ('word' meaning graphical form of the word)
+// - set da enlemma;	set implicit word property to "enlemma" ('enlemma' meaning TreeTagger based 'En'glish 'Lemma')
+// - set da enpos;	set implicit word property to "enpos" ('enpos' meaning TreeTagger based 'En'glish 'P'art 'O'f 'S'peech)
+//
+// B) ms = MatchingStrategy variable setting: the CQL query word level iterators (?, *, +) resolution strategy used by CQP
+// Possible Statements:
+// - set ms shortest: ?, *, + word level operators should match sequences with the minimal number of words.
+//                    Optional words at the begining or at the end of the query are ignored.
+// - set ms standard: early match of ?, *, + word level operators are considered.
+//                    Optional words at the end of the query are ignored.
+// - set ms longest: ?, *, + word level operators should match sequences with the maximum number of words.
+// - set ms traditional: early match of ?, *, + word level operators are considered. Every sequence is returned.
+//
+// Example resolutions for each MatchingStrategy type 
+// (from The CQP Query Language Tutorial, (CWB version 2.2.b90), Stefan Evert, 10 July 2005)
+//
+// for the query:
+// [enpos="DET"]? [enpos="ADJ"]* [enpos="NN"] ([enpos="PREP"] [enpos="DET"]? [enpos="ADJ"]* [enpos="NN"])*
+//
+// Input:
+//     the old book on the table in the room
+//
+// - 'shortest' match strategy: (3 matches)
+// r1=         book
+// r2=                     table
+// r3=                                  room
+//
+// - 'longest' match strategy: (1 match)
+// r1= the old book on the table in the room
+//
+// - 'standard' matching strategy: (3 matches)
+// r1= the old book
+// r2=                 the table
+// r3=                              the room
+//
+// - 'traditional' matching strategy: (7 overlapping matches)
+// r1= the old book
+// r2=     old book
+// r3=         book
+// r4=                 the table
+// r5=                     table
+// r6=                              the room
+// r7=                                  room
+//
+// C) sr = StrictRegions variable setting: CQL queries must match a single structure
+// Possible Statements:
+// - set sr on: ?, *, + word level operators cannot cross a boundary of the structure involved in the query
+// - set sr off: ?, *, + word level operators can cross any number of boundaries of the structure involved in the query
+
+// Parameters settings UI
+if (!ParametersDialog.open(this)) {
+	println("** ExecCQLMacro error: Impossible to open Parameters settings UI dialog box.")
+	return
+}
+
+// Actual CQP call
+CQI.query(statement)
+
+// End of the macro
+
+/////////////////////////////////////
+//// CQP variables documentation ////
+/////////////////////////////////////
+
+//// Useful CQP variables ///
+// [da]	DefaultNonbrackAttr - implicit word property in queries ('word' by default)
+// [ms]	MatchingStrategy    - shortest | standard | longest | traditional
+// [sr]	StrictRegions       - single structure match
+
+//// Maybe useful variables ////
+// [o]	Optimize - simple regular expressions infixe optimizer
+// [hf]	HistoryFile
+// [wh]	WriteHistory
+
+//// Useless variables ////
+// [p]	 Paging
+// [pg]	 Pager
+// [h]	 Highlighting
+// [col] Colour
+// [pb]	 ProgressBar
+// [pp]	 PrettyPrint
+// [c]	 Context
+// [lc]	 LeftContext
+// [rc]	 RightContext
+// [ld]	 LeftKWICDelim
+// [rd]	 RightKWICDelim
+// [pm]	 PrintMode
+// [po]	 PrintOptions
+// [ps]	 PrintStructures
+// [sta] ShowTagAttributes
+// [st]	 ShowTargets
+// [as]	 AutoShow
+// [es]	 ExternalSort
+// [esc] ExternalSortCommand
+// 	     AutoSave
+// 	     SaveOnExit
+// 	     Timing
+
+//// Variables that must not be changed ////
+// [r]	 Registry
+// [dd]	 DataDirectory
+// [sub] AutoSubquery
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/cqp/SetMatchingStrategyMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/cqp/SetMatchingStrategyMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/cqp/SetMatchingStrategyMacro.groovy	(revision 728)
@@ -0,0 +1,42 @@
+package org.txm.macro.cqp
+
+// STANDARD DECLARATIONS
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.Toolbox
+import org.txm.searchengine.cqp.*
+
+def current = System.getProperty("cqp_matching_strategy")
+if (current != null)
+	println "Current strategy is: $current"
+
+def CQI = Toolbox.getCqiClient();
+if ((CQI instanceof NetCqiClient)) {
+	println "Error: only available in CQP memory mode"
+	return;
+}
+
+// BEGINNING OF PARAMETERS
+@Field @Option(name="matchingStrategy", usage="CQL matching strategy", widget="String", required=false, def="shortest | standard | longest | traditional")
+def matchingStrategy 
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return;
+// END OF PARAMETERS
+
+matchingStrategy = matchingStrategy.trim().toLowerCase();
+switch(matchingStrategy ) {
+	case "shortest":
+	case "standard":
+	case "longest":
+	case "traditional":
+		println "Setting Greedy to $matchingStrategy "
+		CQI.query("set MatchingStrategy ${matchingStrategy };")
+		System.setProperty("cqp_matching_strategy",matchingStrategy ) 
+	break
+	case "shortest | standard | longest | traditional":
+		println "You must choose between shortest, standard, longest or traditional"
+	break
+	default:
+		println "Unknown matching strategy: ${matchingStrategy}. Aborting "
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/text/Text2TXTMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/text/Text2TXTMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/text/Text2TXTMacro.groovy	(revision 728)
@@ -0,0 +1,40 @@
+package org.txm.macro.text;
+// STANDARD DECLARATIONS
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.doc.*;
+import org.txm.importer.*;
+
+// BEGINNING OF PARAMETERS
+@Field @Option(name="inputDirectory", usage="the directory containing the DOC/ODT/RTF files to convert", widget="Folder", required=true, def="")
+File inputDirectory
+
+@Field @Option(name="extension", usage="an example file", widget="String", required=true, def="(odt|doc|rtf|html)")
+String extension = "doc"
+
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return;
+
+boolean debug = false;
+
+ConvertDocument converter;
+def files = []
+try {
+	converter = new ConvertDocument();
+	inputDirectory.eachFileMatch(~/.+\.$extension/) { docFile ->
+		String name = docFile.getName()
+		name = name.substring(0, name.lastIndexOf("."))
+		def txtFile = new File(docFile.getParentFile(), name+".txt")
+		converter.autoFile(docFile, txtFile, "txt")
+		files << docFile
+	}
+} catch(Exception e) {
+	println "Error while processing directory: "+e;
+	if (debug) e.printStackTrace();
+}
+if (converter != null) converter.stop();
+
+println "Processed directory: $inputDirectory"
+println "files: "+files
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/GroovyVersionMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/GroovyVersionMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/GroovyVersionMacro.groovy	(revision 728)
@@ -0,0 +1,5 @@
+// Copyright Â© 2016 ENS de Lyon, CNRS, University of Franche-ComtÃ©
+// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
+// @author sheiden
+
+println GroovySystem.version
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/JavascriptVersionMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/JavascriptVersionMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/JavascriptVersionMacro.groovy	(revision 728)
@@ -0,0 +1,12 @@
+// Copyright Â© 2016 ENS de Lyon, CNRS, University of Franche-ComtÃ©
+// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
+// @author sheiden
+
+import javax.script.*
+import org.txm.rcp.synoptic.editor.*
+
+manager = new ScriptEngineManager()
+engine = manager.getEngineByName("JavaScript")
+factory = engine.getFactory()
+
+println factory.getLanguageName()+" "+factory.getLanguageVersion()+" ("+factory.getEngineName()+" "+factory.getEngineVersion()+")"
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/XSLTVersionMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/XSLTVersionMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/XSLTVersionMacro.groovy	(revision 728)
@@ -0,0 +1,7 @@
+// Copyright Â© 2016 ENS de Lyon, CNRS, University of Franche-ComtÃ©
+// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
+// @author sheiden
+
+import net.sf.saxon.Version
+
+println "XSLT "+Version.getXSLVersionString()+" ("+Version.getProductTitle()+" - "+Version.getReleaseDate()+")"
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/DirectoryInfosMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/DirectoryInfosMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/DirectoryInfosMacro.groovy	(revision 728)
@@ -0,0 +1,106 @@
+// Copyright Â© 2016 ENS de Lyon, CNRS, University of Franche-ComtÃ©
+// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import java.nio.file.Path
+import java.nio.file.attribute.FileOwnerAttributeView
+import java.nio.file.attribute.UserPrincipal
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.Toolbox
+import org.txm.searchengine.cqp.*
+import java.io.IOException;
+import java.nio.file.*
+import java.nio.file.attribute.*;
+
+// Parameter declaration - DÃ©claration du paramÃ¨tre
+@Field @Option(name="directory", usage="the directory to diagnose", widget="Folder", required=true, def="set da enpos;")
+		File directory;
+
+// Parameters settings UI
+if (!ParametersDialog.open(this)) {
+	println("** ExecCQLMacro error: Impossible to open Parameters settings UI dialog box.")
+	return
+}
+
+println "full path="+directory.getAbsolutePath()
+println " exists? "+directory.exists()
+println " read? "+directory.canRead()
+println " write? "+directory.canWrite()
+println " executable? "+directory.canExecute()
+println " hidden? "+directory.isHidden()
+def files = directory.listFiles()
+println " number of files? "+files.size()
+
+
+Path path = Paths.get(directory.getAbsolutePath());
+
+FileOwnerAttributeView ownerAttributeView = Files.getFileAttributeView(path, FileOwnerAttributeView.class);
+if (ownerAttributeView != null) {
+	UserPrincipal owner = ownerAttributeView.getOwner();
+	if (owner != null) println " file owner attribute: "+owner.getName()
+}
+
+AclFileAttributeView aclAttributeView = Files.getFileAttributeView(path, AclFileAttributeView.class);
+if (aclAttributeView != null) {
+	List<AclEntry> acl = aclAttributeView.getAcl();
+	if (acl != null) {
+		for (AclEntry entry : acl)
+			if (acl != null) println " acl entry: "+entry
+	}
+}
+
+BasicFileAttributeView basicAttributeView = Files.getFileAttributeView(path, BasicFileAttributeView.class);
+if (basicAttributeView != null) {
+	BasicFileAttributes attributes = basicAttributeView.readAttributes()
+	if (attributes != null)  {
+		println " basic attributes: creation time: "+attributes.creationTime()
+		println " basic attributes: last access time: "+attributes.lastAccessTime()
+		println " basic attributes: last modification time: "+attributes.lastModifiedTime()
+		println " basic attributes: file key: "+attributes.fileKey()
+		println " basic attributes: directory file?: "+attributes.isDirectory()
+		println " basic attributes: symbolic link?: "+attributes.isSymbolicLink()
+		println " basic attributes: regular file?: "+attributes.isRegularFile()
+	}
+}
+
+DosFileAttributeView dosAttributeView = Files.getFileAttributeView(path, DosFileAttributeView.class);
+if (dosAttributeView != null) {
+	DosFileAttributes attributes = dosAttributeView.readAttributes()
+	if (attributes != null) {
+		println " dos attributes: creation time: "+attributes.creationTime()
+		println " dos attributes: last access time: "+attributes.lastAccessTime()
+		println " dos attributes: last modification time: "+attributes.lastModifiedTime()
+		println " dos attributes: file key: "+attributes.fileKey()
+		println " dos attributes: directory file?: "+attributes.isDirectory()
+		println " dos attributes: symbolic link?: "+attributes.isSymbolicLink()
+		println " dos attributes: regular file?: "+attributes.isRegularFile()
+		println " dos attributes: archive file?: "+attributes.isArchive()
+		println " dos attributes: system file?: "+attributes.isSystem()
+	}
+}
+
+PosixFileAttributeView posixAttributeView = Files.getFileAttributeView(path, PosixFileAttributeView.class);
+if (posixAttributeView != null) {
+	PosixFileAttributes attributes = posixAttributeView.readAttributes()
+	if (attributes != null) {
+		println " posix attributes: group: "+attributes.group()
+		println " posix attributes: creation time: "+attributes.creationTime()
+		println " posix attributes: last access time: "+attributes.lastAccessTime()
+		println " posix attributes: last modification time: "+attributes.lastModifiedTime()
+		println " posix attributes: file key: "+attributes.fileKey()
+		println " posix attributes: directory file?: "+attributes.isDirectory()
+		println " posix attributes: symbolic link?: "+attributes.isSymbolicLink()
+		println " posix attributes: regular file?: "+attributes.isRegularFile()
+		println " posix attributes: permissions: "+attributes.permissions().sort()
+	}
+}
+
+UserDefinedFileAttributeView userdefinedAttributeView = Files.getFileAttributeView(path, UserDefinedFileAttributeView.class);
+if (userdefinedAttributeView != null) {
+	def attributes = userdefinedAttributeView.list()
+	if (attributes != null) {
+		for (def entry : attributes)
+			println " user defined attributes: "+entry
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/OperatingSystemVersionMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/OperatingSystemVersionMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/OperatingSystemVersionMacro.groovy	(revision 728)
@@ -0,0 +1,9 @@
+// Copyright Â© 2016 ENS de Lyon, CNRS, University of Franche-ComtÃ©
+// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
+// @author sheiden
+
+System.properties.each { key, value ->
+	if (key ==~ /^os\..*/) {
+		println sprintf("%10s = %s", key, value)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/JavaVersionMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/JavaVersionMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/JavaVersionMacro.groovy	(revision 728)
@@ -0,0 +1,5 @@
+// Copyright Â© 2016 ENS de Lyon, CNRS, University of Franche-ComtÃ©
+// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
+// @author sheiden
+
+println System.properties.'java.version'
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/RVersionMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/RVersionMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/RVersionMacro.groovy	(revision 728)
@@ -0,0 +1,9 @@
+// Copyright Â© 2016 ENS de Lyon, CNRS, University of Franche-ComtÃ©
+// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
+// @author sheiden
+
+import org.txm.stat.engine.r.RWorkspace
+
+def r = RWorkspace.getRWorkspaceInstance()
+
+println r.eval("R.version.string").asString()
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/BrowserVersionMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/BrowserVersionMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/debug/BrowserVersionMacro.groovy	(revision 728)
@@ -0,0 +1,26 @@
+// Copyright Â© 2016 ENS de Lyon, CNRS, University of Franche-ComtÃ©
+// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
+// @author sheiden
+
+import org.eclipse.ui.*
+import org.eclipse.ui.browser.*
+import org.eclipse.ui.internal.browser.*
+import org.eclipse.ui.internal.browser.browsers.MozillaBrowser.*
+import org.txm.rcpapplication.commands.*
+
+b = PlatformUI.getWorkbench().getBrowserSupport().createBrowser(IWorkbenchBrowserSupport.LOCATION_BAR | IWorkbenchBrowserSupport.NAVIGATION_BAR | IWorkbenchBrowserSupport.STATUS, 'iname', 'name', 'longName')
+
+println b.getClass()
+
+monitor.syncExec(new Runnable() {
+			public void run() {
+
+				def editor = OpenBrowser.openfile("file:hello", "Hello");
+
+				def script = """
+return ""+navigator.appName+" "+navigator.appVersion
+"""
+				println editor.webBrowser.getBrowser().evaluate(script);
+				
+				editor.close()
+			}});
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AbbreviationsAndSemanticsMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AbbreviationsAndSemanticsMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AbbreviationsAndSemanticsMacro.groovy	(revision 728)
@@ -0,0 +1,197 @@
+// STANDARD DECLARATIONS
+package org.txm.macro.oriflamms.analyse
+
+import groovy.transform.Field
+import org.kohsuke.args4j.*
+import org.txm.*
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.searchengine.cqp.corpus.*
+import org.txm.searchengine.cqp.corpus.query.*
+import org.txm.stat.utils.ConsoleProgressBar
+
+if (corpusViewSelection == null) {
+	println "Il faut d'abord sÃ©lectionner un corpus dans la vue 'Corpus'. Abandon."
+	return
+}
+
+if (!(corpusViewSelection instanceof Corpus)) {
+	println "$corpusViewSelection n'est pas un corpus. Abandon"
+	return;
+}
+
+@Field @Option(name="tsvFile", usage="TSV output file", widget="CreateFile", required=false, def="file.tsv")
+def tsvFile
+
+@Field @Option(name="entities", usage="1	2	3", metaVar="name	persName	placeName	orgName	roleName", widget="StructuralUnits", required=false, def="persName")
+def entities
+
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return;
+
+entities = entities.split(",")
+
+// END OF PARAMETERS
+
+println "corpora selection: "+corpusViewSelection
+
+def corpus = corpusViewSelection
+CQI = Toolbox.getCqiClient();
+def w = corpus.getStructuralUnit("w");
+
+def wordCorpus = (w == null)
+if (wordCorpus) {
+	println "Corpus de mots"
+} else {
+	println "Corpus de lettres"
+}
+
+println "DÃ©nombrement des abbrÃ©viations en '"+(wordCorpus?"mots":"lettres")+"' pour les entitÃ©s $entities"
+
+for (String prop : ["letters-all", "letters-alignable", "characters","abbr-n"]) {
+	if (corpus.getProperty(prop) == null) {
+		println "Le corpus '$corpus' n'a pas de propriÃ©tÃ© de mot '$prop'. Abandon."
+		return
+	}
+}
+for (String structName : entities) {
+	StructuralUnit su = corpus.getStructuralUnit(structName);
+	if (su == null) {
+		println "Corpus '$corpus' has no structure '$structName'. Abandon."
+		return
+	} else if (su.getProperty("n") == null) {
+		println "Le corpus '$corpus' n'a pas de structure'$structName' avec une propriÃ©tÃ© 'n'. Abandon."
+		return
+	}
+}
+structures = []
+for (String structName : entities) structures << corpus.getStructuralUnit(structName).getProperty("n")
+
+text_su = corpus.getStructuralUnit("text")
+text_id = text_su.getProperty("id")
+pb_id = corpus.getProperty("pbid")
+cb_id = corpus.getProperty("cbid")
+lb_id = corpus.getProperty("lbid")
+lettersAll = corpus.getProperty("letters-all")
+lettersAlignable = corpus.getProperty("letters-alignable")
+characters = corpus.getProperty("characters")
+abbrn = corpus.getProperty("abbr-n")
+form = corpus.getProperty("word")
+
+writer = tsvFile.newWriter("UTF-8")
+writer.println "text_id\tpb_id\tcb_id\tlb_id\tentity\tNabbr\tNcharAbbr\ttotal\t%=NcharAbbr/Ntotal"
+Partition p = corpus.createPartition("tmp", text_su,text_id)
+for (Part part : p.getParts()) {
+	processText(part, part.getName())
+}
+writer.close()
+p.delete()
+println "Result saved in "+tsvFile.getAbsolutePath()
+
+def processText(Corpus corpus, def text_id) {
+
+	def matches = corpus.getMatches()
+	def first_match = matches[0]
+	def last_match = matches[-1]
+	int start = first_match.getStart()
+	int end = last_match.getEnd()
+
+	def CQI = Toolbox.getCqiClient();
+	int[] positions;
+	def r = corpus.query(new Query("[pbstart=\"0\"]"), "ABBRORI1", false)
+	def pb_pos = r.starts
+	r.drop()
+	r = corpus.query(new Query("[cbstart=\"0\"]"), "ABBRORI2", false)
+	def cb_pos = r.starts
+	r.drop()
+	r = corpus.query(new Query("[lbstart=\"0\"]"), "ABBRORI3", false)
+	def lb_pos = r.starts
+	r.drop()
+
+	println "N pb = "+pb_pos.length
+	println "N cb = "+cb_pos.length
+	println "N lb = "+lb_pos.length
+	
+	def pb_idx = CQI.cpos2Id(pb_id.getQualifiedName(), pb_pos)
+	def cb_idx = CQI.cpos2Id(cb_id.getQualifiedName(), cb_pos)
+	def lb_idx = CQI.cpos2Id(lb_id.getQualifiedName(), lb_pos)
+
+	def pb_idx_str = CQI.id2Str(pb_id.getQualifiedName(), pb_idx)
+	def cb_idx_str = CQI.id2Str(cb_id.getQualifiedName(), cb_idx)
+	def lb_idx_str = CQI.id2Str(lb_id.getQualifiedName(), lb_idx)
+
+	ConsoleProgressBar cpb = new ConsoleProgressBar(lb_pos.size())
+	int p = 0 ;
+	int c = 0 ;
+
+	for (int l = 0 ; l < lb_pos.size() ; l++) {
+		cpb.tick();
+		
+		// get the current column milestone
+		while (c < cb_pos.length - 1 && lb_pos[l] > cb_pos[c+1]) { 
+			c++
+		}
+		// get the current page milestone
+		while (p < pb_pos.length - 1 && lb_pos[l] > pb_pos[p+1]) { 
+			p++
+		}
+
+		def line_length; // compute line length
+		if (l == lb_pos.size() -1) line_length = end - lb_pos[l]
+		else line_length = lb_pos[l+1] - lb_pos[l]
+
+
+		def (abbrNs, allLetters, alignableLetters, characters, words, structuresPositions) = getInfos(lb_pos[l], line_length);
+
+		processLine(text_id, pb_idx_str[p], cb_idx_str[c], lb_idx_str[l], line_length, abbrNs, allLetters, alignableLetters, characters, words, structuresPositions)
+	}
+}
+
+def getInfos(int from ,int length) {
+
+	int[] positions = new int[length]
+	for (int i = 0 ; i < length ; i++) positions[i] = from++;
+	
+	def abbrNs = CQI.cpos2Str(abbrn.getQualifiedName(), positions);
+	def allLetters = CQI.cpos2Str(lettersAll.getQualifiedName(), positions);
+	def alignableLetters = CQI.cpos2Str(lettersAlignable.getQualifiedName(), positions);
+	def characters = CQI.cpos2Str(characters.getQualifiedName(), positions);
+	def words = CQI.cpos2Str(form.getQualifiedName(), positions);
+	def structuresPositions = [:]
+	for (def structProp : structures) {
+		structuresPositions[structProp.getFullName()] = CQI.cpos2Struc(structProp.getQualifiedName(), positions);
+	}
+	
+	return [abbrNs,allLetters,alignableLetters,characters,words, structuresPositions]
+}
+
+def processLine(def text_id, def pb_id, def cb_id, def lb_id, int length,
+		def abbrNs, def allLetters, def alignableLetters, def characters, def words, def structuresPositions) {
+
+	int NabbrTotal = 0, NsupAbbrTotal = 0, NtotalTotal = 0;
+	for (int i = 0 ; i < length ; i++) {
+		NabbrTotal += Integer.parseInt(abbrNs[i]);
+		NsupAbbrTotal += allLetters[i].length() - characters[i].length();
+		NtotalTotal += allLetters[i].length();
+	}
+
+	for (def strutcProp : structures) {
+		int Nabbr = 0, NsupAbbr = 0, Ntotal = 0;
+		def structureP = structuresPositions[strutcProp.getFullName()]
+
+		for (int i = 0 ; i < length ; i++) {
+			if (structureP[i] >= 0) { // the position is in the structure
+				Nabbr += Integer.parseInt(abbrNs[i]);
+				NsupAbbr += allLetters[i].length() - characters[i].length();
+				Ntotal += allLetters[i].length();
+			}
+		}
+	
+		writer.println "$text_id\t$pb_id\t$cb_id\t$lb_id\t"+strutcProp.getStructuralUnit()+"\t$Nabbr\t$NsupAbbr\t$Ntotal\t"+((float)NsupAbbr/(float)Ntotal);
+		NabbrTotal -= Nabbr
+		NsupAbbrTotal -= NsupAbbr
+		NtotalTotal -= Ntotal
+	}
+	
+	int Nabbr = 0, NsupAbbr = 0, Ntotal = 0;	
+	writer.println "$text_id\t$pb_id\t$cb_id\t$lb_id\t#REST\t$NabbrTotal\t$NsupAbbrTotal\t$NtotalTotal\t"+((float)NsupAbbrTotal/(float)NtotalTotal);
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AbbreviationsAndLinesMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AbbreviationsAndLinesMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AbbreviationsAndLinesMacro.groovy	(revision 728)
@@ -0,0 +1,188 @@
+// STANDARD DECLARATIONS
+package org.txm.macro.oriflamms.analyse
+
+import groovy.transform.Field
+
+import org.kohsuke.args4j.*
+import org.txm.*
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.searchengine.cqp.corpus.*
+import org.txm.searchengine.cqp.corpus.query.*
+import org.txm.stat.utils.ConsoleProgressBar
+
+if (corpusViewSelection == null) {
+	println "Il faut d'abord sÃ©lectionner un corpus dans la vue 'Corpus'. Abandon."
+	return
+}
+
+if (!(corpusViewSelection instanceof Corpus)) {
+	println "$corpusViewSelection n'est pas un corpus. Abandon"
+	return;
+}
+
+@Field @Option(name="tsvFile", usage="TSV output file", widget="CreateFile", required=false, def="file.tsv")
+def tsvFile
+
+@Field @Option(name="dist_start", usage="Distance depuis le dÃ©but de ligne", widget="Integer", required=false, def="0")
+		def dist_start
+
+@Field @Option(name="dist_end", usage="Distance depuis la fin de ligne", widget="Integer", required=false, def="1")
+		def dist_end
+
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return;
+// END OF PARAMETERS
+
+if (dist_start <= 0 && dist_end <= 0) {
+	println "Au moins, une des deux distances doit Ãªtre supÃ©rieure Ã  0"
+	return
+}
+dist_start = Math.abs(dist_start)
+dist_end = Math.abs(dist_end)
+
+def corpus = corpusViewSelection
+def w = corpus.getStructuralUnit("w");
+
+def wordCorpus = (w == null)
+if (wordCorpus) {
+	println "Corpus de mots"
+} else {
+	println "Corpus de lettres"
+}
+
+println "DÃ©nombrement des abbrÃ©viations de $corpus en '"+(wordCorpus?"mots":"lettres")+"' pour des distances au dÃ©but de $dist_start et Ã  la fin $dist_end de la ligne"
+
+for (String prop : ["pbid", "pbstart", "pbend","cbid", 
+	"cbstart","cbend","lbid", "lbstart", "lbend", "letters-all",
+	"letters-alignable", "characters","abbr-n" ]) {
+	if (corpus.getProperty(prop) == null) {
+		println "Le corpus '$corpus' n'a pas de propriÃ©tÃ© de mot '$prop'. Abandon."
+		return
+	}
+}
+
+text_su = corpus.getStructuralUnit("text")
+text_id = text_su.getProperty("id")
+pb_id = corpus.getProperty("pbid")
+cb_id = corpus.getProperty("cbid")
+lb_id = corpus.getProperty("lbid")
+lettersAll = corpus.getProperty("letters-all")
+lettersAlignable = corpus.getProperty("letters-alignable")
+characters = corpus.getProperty("characters")
+abbrn = corpus.getProperty("abbr-n")
+form = corpus.getProperty("word")
+
+writer = tsvFile.newWriter("UTF-8")
+writer.println "text_id\tpb_id\tcb_id\tlb_id\tline part\tNabbr\tNcharAbbr\ttotal\t%=NcharAbbr/Ntotal"
+Partition p = corpus.createPartition("tmp", text_su,text_id)
+for (Part part : p.getParts()) {
+	processText(part, part.getName())
+}
+writer.close()
+p.delete()
+println "Result saved in "+tsvFile.getAbsolutePath()
+
+def processText(Corpus corpus, def text_id) {
+
+	def matches = corpus.getMatches()
+	def first_match = matches[0]
+	def last_match = matches[-1]
+	int start = first_match.getStart()
+	int end = last_match.getEnd()
+
+	def CQI = Toolbox.getCqiClient();
+	int[] positions;
+	def r = corpus.query(new Query("[pbstart=\"0\"]"), "ABBRORI1", false)
+	def pb_pos = r.starts
+	r.drop()
+	r = corpus.query(new Query("[cbstart=\"0\"]"), "ABBRORI2", false)
+	def cb_pos = r.starts
+	r.drop()
+	r = corpus.query(new Query("[lbstart=\"0\"]"), "ABBRORI3", false)
+	def lb_pos = r.starts
+	r.drop()
+
+	println "N pb = "+pb_pos.length
+	println "N cb = "+cb_pos.length
+	println "N lb = "+lb_pos.length
+	
+	def pb_idx = CQI.cpos2Id(pb_id.getQualifiedName(), pb_pos)
+	def cb_idx = CQI.cpos2Id(cb_id.getQualifiedName(), cb_pos)
+	def lb_idx = CQI.cpos2Id(lb_id.getQualifiedName(), lb_pos)
+
+	def pb_idx_str = CQI.id2Str(pb_id.getQualifiedName(), pb_idx)
+	def cb_idx_str = CQI.id2Str(cb_id.getQualifiedName(), cb_idx)
+	def lb_idx_str = CQI.id2Str(lb_id.getQualifiedName(), lb_idx)
+
+	ConsoleProgressBar cpb = new ConsoleProgressBar(lb_pos.size())
+	int p = 0 ;
+	int c = 0 ;
+
+	for (int l = 0 ; l < lb_pos.size() ; l++) {
+		cpb.tick();
+		
+		while (c < cb_pos.length - 1 && lb_pos[l] > cb_pos[c+1]) {
+			c++
+		}
+		while (p < pb_pos.length - 1 && lb_pos[l] > pb_pos[p+1]) {
+			p++
+		}
+
+		def line_length;
+		if (l == lb_pos.size() -1) line_length = end - lb_pos[l]
+		else line_length = lb_pos[l+1] - lb_pos[l]
+
+		def (abbrNs, allLetters, alignableLetters, characters, words) = getInfos(lb_pos[l], line_length);
+
+		processLine(text_id, pb_idx_str[p], cb_idx_str[c], lb_idx_str[l], line_length,
+				abbrNs, allLetters, alignableLetters, characters, words)
+	}
+}
+
+def processLine(def text_id, def pb_id, def cb_id, def lb_id, int length,
+		def abbrNs, def allLetters, def alignableLetters, def characters, def words) {
+
+	int Nabbr, NsupAbbr, Ntotal;
+	int p2 = length - dist_end
+	if (p2 < 0) p2 = length+1;
+	if (p2 < dist_start) p2 = dist_start
+	
+	for (int i = 0 ; i < length ; i++) {
+
+		if (i == dist_start) {
+			writer.println "$text_id\t$pb_id\t$cb_id\t$lb_id\ts\t$Nabbr\t$NsupAbbr\t$Ntotal\t"+(100.0*(float)NsupAbbr/(float)Ntotal);
+
+			Nabbr = 0;
+			NsupAbbr = 0;
+			Ntotal = 0;
+		} 
+		if (i == p2) {
+			writer.println "$text_id\t$pb_id\t$cb_id\t$lb_id\tm\t$Nabbr\t$NsupAbbr\t$Ntotal\t"+(100.0*(float)NsupAbbr/(float)Ntotal);
+
+			Nabbr = 0;
+			NsupAbbr = 0;
+			Ntotal = 0;
+		}
+
+		Nabbr += Integer.parseInt(abbrNs[i]);
+		NsupAbbr += allLetters[i].length() - characters[i].length();
+		Ntotal += allLetters[i].length();
+
+	}
+	writer.println "$text_id\t$pb_id\t$cb_id\t$lb_id\te\t$Nabbr\t$NsupAbbr\t$Ntotal\t"+(100.0*(float)NsupAbbr/(float)Ntotal);
+}
+
+def getInfos(int from ,int length) {
+
+	int[] positions = new int[length]
+	for (int i = 0 ; i < length ; i++) positions[i] = from++;
+	def CQI = Toolbox.getCqiClient();
+
+	def abbrNs = CQI.cpos2Str(abbrn.getQualifiedName(), positions);
+	def allLetters = CQI.cpos2Str(lettersAll.getQualifiedName(), positions);
+	def alignableLetters = CQI.cpos2Str(lettersAlignable.getQualifiedName(), positions);
+	def characters = CQI.cpos2Str(characters.getQualifiedName(), positions);
+	def words = CQI.cpos2Str(form.getQualifiedName(), positions);
+	
+	return [abbrNs,allLetters,alignableLetters,characters,words]
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AbbreviationsAndSemanticsMacro.properties
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AbbreviationsAndSemanticsMacro.properties	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AbbreviationsAndSemanticsMacro.properties	(revision 728)
@@ -0,0 +1,6 @@
+#
+#Fri Feb 05 09:13:22 CET 2016
+tsvFile=file.tsv
+dist_start=0
+dist_end=1
+entities=name

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AbbreviationsAndSemanticsMacro.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AllographsMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AllographsMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AllographsMacro.groovy	(revision 728)
@@ -0,0 +1,173 @@
+// STANDARD DECLARATIONS
+package org.txm.macro.oriflamms.analyse
+
+import org.apache.tools.ant.types.resources.selectors.InstanceOf;
+import org.kohsuke.args4j.*
+
+import groovy.transform.Field
+import java.util.regex.Pattern
+import org.txm.*
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.searchengine.cqp.corpus.Corpus
+import org.txm.searchengine.cqp.corpus.Part
+import org.txm.searchengine.cqp.corpus.Partition
+import org.txm.searchengine.cqp.corpus.StructuralUnit
+import org.txm.searchengine.cqp.corpus.query.Query
+import org.txm.stat.utils.ConsoleProgressBar
+
+// BEGINNING OF PARAMETERS
+
+if (!(corpusViewSelection instanceof Corpus)) {
+	println "Corpora view selection must be a Corpus"
+	return;
+}
+
+Corpus corpus = corpusViewSelection;
+if (!corpus.getName().endsWith("C")) {
+	println "The selected Corpus is not a character corpus."
+	return;
+}
+
+@Field @Option(name="tsvFile", usage="TSV output file", widget="CreateFile", required=false, def="file.tsv")
+tsvFile
+
+@Field @Option(name="query", usage="The query", widget="Query", required=true, def='<s>[]')
+query
+
+@Field @Option(name="sign", usage="The sign", widget="String", required=false, def="amaj")
+sign
+
+@Field @Option(name="allograph", usage="The allograph", widget="String", required=false, def="amaj")
+allograph
+
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return;
+
+println "DÃ©nombrement des allographes '$allograph' de signe '$sign' dans le contexte '$query'"
+
+for (String prop : ["sign", "allograph-expert", "allograph-auto", "characters"]) {
+	if (corpus.getProperty(prop) == null) {
+		println "Le corpus '$corpus' n'a pas de propriÃ©tÃ© de mot '$prop'. Abandon."
+		return
+	}
+}
+
+signRegExp = ~/$sign/
+characterRegExp = ~/$allograph/
+
+CQI = Toolbox.getCqiClient();
+text_su = corpus.getStructuralUnit("text")
+text_id = text_su.getProperty("id")
+pb_id = corpus.getProperty("pbid")
+cb_id = corpus.getProperty("cbid")
+lb_id = corpus.getProperty("lbid")
+sign_property = corpus.getProperty("sign")
+allograph_expert_property = corpus.getProperty("allograph-expert")
+allograph_auto_property = corpus.getProperty("allograph-auto")
+characters_property = corpus.getProperty("characters")
+
+writer = tsvFile.newWriter("UTF-8")
+writer.println "text_id\tpb_id\tcb_id\tlb_id\tsign\tchar\tcount\t%/sign"
+Partition p = corpus.createPartition("tmp", text_su,text_id)
+ConsoleProgressBar cpb = new ConsoleProgressBar(p.getParts().size())
+for (Part part : p.getParts()) {
+	processText(part, part.getName())
+	cpb.tick();
+}
+writer.close()
+p.delete()
+println "Result saved in "+tsvFile.getAbsolutePath()
+
+def processText(Corpus corpus, def text_id) {
+
+	def matches = corpus.getMatches()
+	def first_match = matches[0]
+	def last_match = matches[-1]
+	int start = first_match.getStart()
+	int end = last_match.getEnd()
+
+	int[] positions;
+	def r = corpus.query(new Query("[pbstart=\"0\"]"), "ABBRORI1", false)
+	def pb_pos = r.starts
+	r.drop()
+	r = corpus.query(new Query("[cbstart=\"0\"]"), "ABBRORI2", false)
+	def cb_pos = r.starts
+	r.drop()
+	r = corpus.query(new Query("[lbstart=\"0\"]"), "ABBRORI3", false)
+	def lb_pos = r.starts
+	r.drop()
+
+//	println "N pb = "+pb_pos.length
+//	println "N cb = "+cb_pos.length
+//	println "N lb = "+lb_pos.length
+	
+	def pb_idx = CQI.cpos2Id(pb_id.getQualifiedName(), pb_pos)
+	def cb_idx = CQI.cpos2Id(cb_id.getQualifiedName(), cb_pos)
+	def lb_idx = CQI.cpos2Id(lb_id.getQualifiedName(), lb_pos)
+
+	def pb_idx_str = CQI.id2Str(pb_id.getQualifiedName(), pb_idx)
+	def cb_idx_str = CQI.id2Str(cb_id.getQualifiedName(), cb_idx)
+	def lb_idx_str = CQI.id2Str(lb_id.getQualifiedName(), lb_idx)
+
+	int p = 0 ;
+	int c = 0 ;
+
+	for (int l = 0 ; l < lb_pos.size() ; l++) {
+		
+		// get the current column milestone
+		while (c < cb_pos.length - 1 && lb_pos[l] > cb_pos[c+1]) {
+			c++
+		}
+		// get the current page milestone
+		while (p < pb_pos.length - 1 && lb_pos[l] > pb_pos[p+1]) {
+			p++
+		}
+
+		def line_length; // compute line length
+		if (l == lb_pos.size() -1) line_length = end - lb_pos[l]
+		else line_length = lb_pos[l+1] - lb_pos[l]
+
+
+		def (signs, allographs_expert, allographs_auto, characters) = getInfos(lb_pos[l], line_length);
+
+		processLine(text_id, pb_idx_str[p], cb_idx_str[c], lb_idx_str[l], line_length, signs, allographs_expert, allographs_auto, characters)
+	}
+}
+
+def getInfos(int from ,int length) {
+
+	int[] positions = new int[length]
+	for (int i = 0 ; i < length ; i++) positions[i] = from++;
+	
+	def signs = CQI.cpos2Str(sign_property.getQualifiedName(), positions);
+	def allographs_expert = CQI.cpos2Str(allograph_expert_property.getQualifiedName(), positions);
+	def allographs_auto = CQI.cpos2Str(allograph_auto_property.getQualifiedName(), positions);
+	def characters = CQI.cpos2Str(characters_property.getQualifiedName(), positions);
+	
+	return [signs,allographs_expert,allographs_auto, characters]
+}
+
+def processLine(def text_id, def pb_id, def cb_id, def lb_id, int length,
+	def signs, def allographs_expert, def allographs_auto,def characters) {
+	//println "$sign -> $signs $characters"
+	def count_signs = [:]
+	
+	for (int i = 0 ; i < length ; i++) {
+		
+		if (signRegExp.matcher(signs[i]).find() && characterRegExp.matcher(characters[i]).find()) {
+			if (!count_signs.containsKey(signs[i])) count_signs[signs[i]] = [:];
+			def counts = count_signs[signs[i]]
+			
+			if (!counts.containsKey(characters[i])) counts[characters[i]] = 0;
+			counts[characters[i]] = counts[characters[i]] + 1;
+		}
+	}
+
+	for (def s : count_signs.keySet()) {
+		def counts = count_signs[s]
+		def sum = counts.values().sum()
+		for (def c : counts.keySet()) {
+			writer.println "$text_id\t$pb_id\t$cb_id\t$lb_id\t"+s+"\t"+c+"\t"+counts[c]+"\t"+((float)counts[c]/(float)sum);
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AbbreviationsAndLinesMacro.properties
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AbbreviationsAndLinesMacro.properties	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AbbreviationsAndLinesMacro.properties	(revision 728)
@@ -0,0 +1,5 @@
+#
+#Sun Feb 07 13:40:59 CET 2016
+tsvFile=file.tsv
+dist_start=3
+dist_end=5

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/analyse/AbbreviationsAndLinesMacro.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/2-default-pager.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/2-default-pager.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/2-default-pager.xsl	(revision 728)
@@ -0,0 +1,233 @@
+<?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"
+  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$
+     
+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="html"/>
+  
+  <xsl:param name="css-name-txm">txm</xsl:param>
+  <xsl:param name="css-name">tei</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: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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/2-default-pager.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/css/tei.css
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/css/tei.css	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/css/tei.css	(revision 728)
@@ -0,0 +1,1406 @@
+/*
+** Copyright 2011 TEI Consortium
+
+$Id$
+
+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.
+
+*/
+
+
+/* main layout */
+
+body.simple {
+   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.pagetable {
+   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;
+}
+
+#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;
+}
+
+#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;
+}
+
+
+/* now the layers of the header */
+
+/* the main title */
+div.stdheader {
+      border-bottom: 1pt solid black;
+}
+
+#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;
+}
+
+/* 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;
+}
+
+.bannerright {
+   float: right ;
+   color: #FFFFFF;
+   font-family : Arial, Helvetica, sans-serif;
+   font-size : 0.8em;
+   font-weight : bold;
+   text-decoration: none;
+}
+
+/* section headings */
+#hdr h1 { color: red; }
+h1 {
+   font-weight: bold;
+   font-size: 2em;
+   line-height: 34pt;
+}
+
+h2 {
+   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;
+}
+
+
+h1.maintitle {
+   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;
+}
+
+h2.institution {
+   margin-left: 100px;
+   font-family: Arial,Helvetica,sans-serif;
+}
+
+h2.department {
+   margin-left: 100px;
+   font-family: Arial,Helvetica,sans-serif;
+}
+
+h2.subtitle {
+   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.8em;
+}
+
+
+
+/* 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.8em;
+}
+
+ul.breadcrumb
+{
+   display: inline;
+   font-size: 1.1em;
+}
+
+li.breadcrumb:before {
+    content: "â–¶";
+    }
+li.breadcrumb-first:before {
+    content: "â–¶";
+    }
+li.breadcrumb
+{
+   padding-left: 12px;
+   padding-right: 5px;
+   display: inline;
+   color: #000000;
+}
+li.breadcrumb-first
+{
+   padding-left: 12px;
+   padding-right: 5px;
+   display: inline;
+   color: #000000;
+}
+
+div.breadcrumb {
+   display: inline;
+}
+
+.skiplinks{
+   font-family: arial, sans-serif;
+   color: #FFFFFF;
+   font-weight : bold;
+   font-size : 0.8em;
+   text-decoration: none;
+   padding-right : 15px;
+}
+
+.tocontent{
+   color : #000066;
+   display : none;
+}
+
+.hide{
+   display : none;
+}
+
+a:hover
+{
+   text-decoration: underline;
+}
+
+a.navbar:link
+{
+   color: #FFFFFF;
+   text-decoration: none;
+}
+
+a.navbar:visited
+{
+   color: #FFFFFF;
+   text-decoration: none;
+}
+
+a.navbar:hover {
+   color: #FFFFFF;
+   text-decoration: underline;
+}
+
+
+
+/* an inner <text>, eg inside a <q> */
+div.innertext {
+   margin: 6pt;
+   border: 1pt solid red;
+}
+/* literal code */
+
+div.cdata {
+    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;
+}
+
+div.egXML_valid {
+    background-color: #f7f9f6;
+    border-color: #c5d8bb;
+    }
+div.egXML_feasible {
+    background-color: #fff9f3;
+    border-color: #ffe1ad;
+    }
+div.egXML_invalid {
+    border-color: #ffe7e8 ;
+    background-color: #fdbbac;
+    }
+
+
+/* table of contents */
+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-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;
+}
+
+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;
+}
+
+p.toclist1 {
+   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;
+}
+
+p.toclist3 {
+   margin-left: 2em;
+   text-indent: -1.5em;
+   font-size: small;
+}
+
+span.toclist-this {
+   color: red;
+}
+
+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;
+}
+div.noteBody {
+  display:inline;
+}
+
+div.note {
+   margin-left: 2em;
+   margin-right: 2em;
+   margin-bottom: 3pt;
+   margin-top: 3pt;
+   text-indent: -1em;
+}
+
+span.noteLabel {
+    vertical-align: super;
+    font-size: smaller;
+    font-style: italic;
+}
+span.note:before {
+    content: " [";
+}
+span.note:after {
+    content: "] ";
+}
+
+span.note {
+    font-size: smaller;
+}
+/* images */
+img.display {
+   margin-top: 10pt;
+   margin-bottom: 10pt;
+   display: block;
+}
+
+.floatimage {
+   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;
+}
+/* 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.docImprint {
+    margin-top: 6pt;
+    display: block;
+    font-style: italic;
+}
+div.docDate {
+   font-style: italic;
+}
+div.docTitle {
+    display: block;
+    margin-top: 6pt;
+    font-weight: bold;
+    margin-bottom: 18pt;
+}
+div.docAuthor {
+    font-style: italic;
+}
+
+div.byline {
+    display: block;
+}
+
+div.dateline{
+   text-align: right;
+}
+
+/* paragraphs */
+p, div.p {
+ margin-top: 0.3em;
+}
+div.p blockquote p {
+ margin-top: 0.0em;
+-webkit-margin-before: 0em;
+-webkit-margin-after: 0em;
+-webkit-margin-start: 0px;
+-webkit-margin-end: p0px;
+}
+p.box {
+   border: 1pt solid #000000;
+}
+
+/* verse */
+div.lg {
+   margin-left: 10px;
+   margin-bottom: 10px;
+}
+div.l {
+    text-align:left;
+    margin-left: 1em;
+}
+/* misc */
+div.epigraph {
+    margin: 20pt;
+}
+div.numbering {
+    float:left;
+    font-size:smaller;
+    width: 2em;
+}
+
+div.linenumber { }
+
+div.signed {
+    text-align:left;
+}
+div.salute {
+    text-align:left;
+}
+div.indent1 {
+   margin-left: 1em;
+}
+div.indent2 {
+   margin-left: 2em;
+}
+div.indent3 {
+   margin-left: 3em;
+}
+div.indent4 {
+   margin-left: 4em;
+}
+div.indent5 {
+   margin-left: 5em;
+}
+div.indent6 {
+   margin-left: 6em;
+}
+
+td.label {
+   font-weight: bold;
+   background-color: #AAAAAA;
+}
+tr.label td {
+   font-weight: bold;
+   background-color: #AAAAAA;
+}
+
+span.label {
+    font-weight: bold;
+}
+
+h5 {
+   font-size: 100%;
+}
+h6 {
+   font-size: 100%;
+}
+
+div.tocFront {
+   border-bottom: 1pt solid #000000;
+}
+div.tocBack {
+   border-bottom: 1pt solid #000000;
+}
+div.tocBody {
+   border-bottom: 1pt solid #000000;
+}
+/* a listBibl rend='labels' */
+div.listBibl {
+margin-top: 6pt;
+margin-bottom: 6pt;
+}
+span.bibl {
+    font-style: italic;
+}
+div.bibl {
+   margin-left: 0.5em;
+   text-indent: -0.5em;
+}
+div.biblfree {
+   font-size: smaller;
+   margin-left: 0.5em;
+   text-indent: -0.5em;
+   margin-bottom: 6pt;
+}
+
+span.biblLabel {
+    font-weight: bold;
+    margin-right: 1em;
+}
+
+/* a <bibl> inside a <cit> */
+div.citbibl:before {
+    content: "(";
+}
+div.citbibl:after {
+    content: ")";
+}
+div.citbibl {
+   font-style: italic;
+   font-size: smaller;
+}
+/* a <quote> inside a <cit> */
+div.citquote {
+   margin-left: 10pt;
+   margin-right: 10pt;
+}
+
+/* gloss lists with bold labels */
+dt {
+   font-weight: bold;
+}
+/* quotation */
+div.blockquote
+ {
+   margin-top: 10pt;
+   margin-bottom: 10pt;
+   margin-left: 40px;
+   margin-right: 40px;
+}
+/* opener */
+div.opener
+ {
+   margin: 10pt;
+}
+div.q {
+   margin: 10pt;
+}
+/* figures */
+.figure {
+    display: block;
+    border-top: solid 1pt blue;
+    border-bottom: solid 1pt blue;
+}
+.caption {
+    margin-top: 6pt;
+    margin-bottom: 12pt;
+    display: block;
+    font-style: italic;
+}
+/* inline quote */
+span.q {
+}
+
+/* from drama */
+/* speeches in drama */
+div.p-in-sp {
+    margin-left: 1em;
+    }
+div.sp {
+    margin-top: 4pt;
+}
+div.spProse {
+    text-indent: -1em;
+    margin-left: 1em;
+}
+div.speaker {
+    font-weight: bold;
+}
+span.speaker {
+    font-style: italic;
+}
+
+span.actor {
+font-style:italic;
+}
+span.camera {
+ font-style: italic;
+}
+span.role {
+ font-style: italic;
+}
+span.set {
+ font-style: italic;
+}
+span.sound {
+ font-style: italic;
+}
+span.stage {
+ font-style: italic;
+}
+span.tech {
+ font-style: italic;
+}
+span.view {
+ font-style: italic;
+}
+span.nextLink {
+   font-style: italic;
+}
+span.previousLink {
+   font-style: italic;
+}
+span.upLink {
+   font-style: italic;
+}
+/* bibl */
+span.titlem {
+    font-style: italic;
+}
+span.titlej {
+    font-style: italic;
+}
+span.titleu {
+}
+span.titles {
+}
+
+span.notemargin,
+span.notemarginOuter,
+span.notemarginLeft,
+span.notemarginRight,
+span.notemargin,div.notemargin {
+             display: block;
+font-size: smaller;
+clear: right;
+padding: 4pt;
+font-style: italic;
+width: 10%;
+border: solid green 1pt;
+margin: 6pt;
+}
+span.notemargin,
+span.notemarginOuter,
+span.notemarginRight,
+span.notemargin,div.notemargin {
+    float:right;
+}
+span.notemarginLeft {
+    float:left;
+}
+
+div.floatingText_back {
+    border-top: solid black 1pt;
+}
+div.floatingText_front {
+    border-top: solid black 1pt;
+}
+div.floatingText {
+    margin: 6pt;
+    border: solid black 1pt;
+}
+div.pagebreak,span.pagebreak {
+    display: block;
+    color: grey;
+    float: right;
+}
+span.element {
+    font-weight: bold;
+    color: black;
+}
+span.unclear {
+    font-style: italic;
+}
+span.wordtypeNN, span.wordtypeNNS {
+    color: green;
+    }
+span.wordtypeVVD,span.wordtypeVVN,span.wordtypeVVN,span.wordtypeVVZ,span.wordtypeVVG, span.wordtypeVV {
+    color: red;
+    }
+
+li.headless {
+    display: none;
+}
+
+div.footer {
+    border-top: solid black 1pt;
+}
+
+div.stdfooter {
+    clear:both;
+    border-top: solid black 1pt;
+    border-bottom: solid black 1pt;
+}
+
+div.altfigure {
+    border-top: solid black 1pt;
+    border-bottom: solid black 1pt;
+}
+
+table.table, table.table tr, table.table td {
+    border: solid black 1pt;
+}
+table.table td {
+    padding: 1ex 1ex 1ex 1ex;
+}
+p.mainAuthor {
+    display: block;
+    margin: 1ex 0ex 1ex 0ex;
+}
+p.mainEditor {
+    display: block;
+    margin: 1ex 0ex 1ex 0ex;
+}
+
+/* ODD-specific styles */
+/* tables for reference display */
+table.wovenodd {
+    width: 100%;
+    clear: both;
+}
+td.wovenodd-col1 {
+    width:15%;
+    vertical-align: top;
+}
+td.wovenodd-col2 {
+    width:85%;
+}
+table.wovenodd tr td {
+    border: 1px solid #555;
+    padding:1%;
+}
+table.wovenodd {
+    border-spacing:0px;
+    border-collapse:collapse;
+}
+table.wovenodd tr td {
+    border-spacing:0px;
+}
+table.wovenodd tr {
+    border-spacing:0px;
+    border-collapse:collapse;
+}
+table.wovenodd tr td table.attList {
+    border-spacing:0px;
+    border:none;
+}
+table.wovenodd tr td table.attList tr {
+    border-spacing:0px;
+    border:none;
+}
+table.wovenodd tr td table.attList tr td {
+    border-spacing:0px;
+    border:none;
+}
+table.attList {
+    table-layout: fixed;
+    width: 100%;
+    margin: 0pt;
+    padding: 0pt;
+}
+td.odd_label {
+    vertical-align: top;
+    width: 10%;
+    font-weight: bold;
+}
+td.odd_value {
+    vertical-align: top;
+    width: 90%;
+}
+table.attDef {
+    table-layout: fixed;
+    width: 100%;
+}
+table.attDef td.odd_label {
+    width: 10%;
+    vertical-align: top;
+    font-weight: normal;
+}
+table.attDef td.odd_value {
+    vertical-align: top;
+    width: 90%;
+}
+table.attList td.odd_label:before {
+    content: "@";
+}
+table.attDef td.odd_label:before {
+    content: "";
+}
+table.valList td.odd_label:before {
+    content: "";
+}
+table.valList {
+    table-layout: fixed;
+    width: 100%;
+}
+table.valList td.odd_label {
+    width: 10%;
+    vertical-align: top;
+    font-style: normal;
+    font-weight: normal;
+}
+table.valList td.odd_value {
+    vertical-align: top;
+    width: 90%;
+}
+table.specDesc td.Attribute {
+    font-weight: bold;
+    vertical-align: top;
+}
+table.specDesc {
+    margin-left: 1em;
+}
+td p {
+    margin-top: 0pt;
+    margin-bottom: 2pt;
+}
+
+div.cdata {
+    white-space: pre;
+    clear:both;
+}
+
+span.tag:before {
+     
+}
+span.tag:after {
+     
+}
+span.gi,span.tag {
+}
+span.att {
+     
+}
+span.att:before {
+    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-file, span.ident-ns {
+    font-style: italic;
+}
+
+button.displayRelaxButton {
+    margin-right: 2px;
+    margin-top: 2px;
+    font-size: 70%;
+    float: right;
+    cursor: pointer;
+}
+pre.RNG_XML {
+display: none;
+}
+
+span.RNG_XML {
+display: none;
+}
+
+/* pretty printing of XML */
+td.classSpec, td.macroSpec {
+    font-weight: bold;
+}
+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_class:link,a.link_odd_class:visited {
+
+}
+span.element {
+    font-weight: bold;
+    color: black;
+}
+td.elementSpec,span.elementname {
+    font-weight: bold;
+    color: #222288;
+}
+span.highlightelementname {
+    color: red;
+}
+
+span.attribute {
+    color: #222288;
+}
+span.attributevalue {
+    font-weight: normal;
+    color: black;
+}
+span.comment {
+    color: black;
+    font-style:italic;
+}
+span.namespace {
+    color: #222288;
+}
+/* pretty print rnc */
+span.rnc_nc {
+    color: #006400;
+}
+span.rnc_decl {
+    color: green;
+}
+span.rnc_prefix {
+    color: blue;
+}
+span.rnc_param {
+    color: gray;
+}
+span.rnc_atom {
+    color: yellow;
+}
+span.rnc_annot {
+    color: #FF8040;
+}
+span.rnc_comment {
+    color: #FF00FF;
+}
+span.rnc_annot {
+    color: #00FFFF;
+}
+span.rnc_type {
+    color: purple;
+}
+span.rnc_keyword {
+    color: teal;
+}
+span.defaultVal {
+    font-weight: bold;
+}
+span.required {
+    font-weight: bold;
+}
+div.moduleSpec {
+    padding: 1px;
+    margin: 1px;
+    background-color: #C0C0C0;
+    color:inherit;
+    clear:right;
+}
+span.moduleSpecHead {
+    font-style: italic;
+}
+ul.specList li {
+    list-style: none;
+}
+span.specList-macroSpec {
+    font-weight: bold;
+}
+span.specList-elementSpec {
+    font-weight: bold;
+}
+span.specList-elementSpec:before {
+    content: "<";
+     
+}
+span.specList-elementSpec:after {
+    content: ">";
+     
+}
+span.specList-classSpec {
+    font-weight: bold;
+}
+span.specName {
+    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;
+}
+#azindex p {
+    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;
+}
+.index li {
+    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;
+}
+li.showall, li.showall a:visited,li.showall a:link {
+    width: 10em;
+}
+* html .index li {
+    margin: 0.2em 0.2em;
+}
+ul.index li a:hover {
+    background-color: #93D1E4;
+    color: #fff;
+    text-decoration: underline;
+}
+div.atozwrapper {
+   float: left;
+   width: 70%;
+}
+div.atoz {
+   clear: left;
+   float: left;
+}
+#byMod {
+   margin-top: 12px;
+   clear: left;
+}
+ul.atoz {
+    list-style: none;
+    text-align:left;
+    margin: 2px;
+    padding: 2px;
+    background-color: #eef;
+    color:inherit;
+}
+.atoz li {
+    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;
+}
+/* End of A - Z styles */
+div.specChildren {
+    margin: 0em;
+    padding: 0em;
+}
+span.specChildModule {
+    font-weight: bold;
+}
+div.specChild {
+    margin-bottom: 4pt;
+    margin-left: 25px;
+    text-indent: -30px;
+}
+span.emptySlash:after {
+    content: "/";
+}
+/* status notation */
+.status_deprecated:after {
+    content: " (deprecated)";
+    color: red;
+}
+.status_changed:after {
+    content: " (changed)";
+    color: blue;
+}
+.status_unstable:after {
+    content: " (unstable)";
+    color: orange;
+}
+.status_deprecated {
+    border: solid red 1pt;
+}
+.status_changed {
+    border: solid blue 1pt;
+}
+.status_unstable {
+    border: solid orange 1pt;
+}
+/* for ePub */
+div.EpubCoverPage {
+    -webkit-hyphens:none;
+    font-family: serif;
+    height:860;
+    font-size:30pt;
+    font-weight: bold;
+    padding-top: 15pt;
+    margin: 12pt;
+    border: solid red 1pt;
+    text-align:center;
+   }
+/* general purpose block aligns */
+.centerbold {
+    text-align:center;
+    font-weight: bold;
+}
+.center {
+    text-align:center;
+}
+.right {
+    text-align:right;
+}
+.left {
+    text-align:left;
+}
+
+/* <hi> rend values */
+span.typewriter{
+    font-family: monospace;
+}
+span.normalweight{
+    font-weight: normal;
+}
+span.smallcaps{
+    font-variant: small-caps;
+}
+span.bold{
+    font-weight: bold;
+}
+span.italic{
+    font-style:italic;
+}
+span.capsall{
+    text-transform: uppercase;
+}
+span.strikethrough{
+    text-decoration: line-through;
+}
+span.strikedoublethrough{
+    text-decoration: line-through;
+}
+span.underline{
+    text-decoration: underline;
+}
+span.underwavyline{
+    text-decoration-line: underline;
+    text-decoration-style: wavy;
+}
+span.underdoubleline{
+    text-decoration: underline;
+}
+span.superscript {
+    vertical-align: super;
+    font-size: smaller;
+}
+span.subscript {
+    vertical-align: bottom;
+    font-size: smaller;
+}
+span.numberParagraph:before {
+    content:"[";
+}
+span.numberParagraph:after {
+    content:"] ";
+}
+span.numberParagraph {
+    font-size: smaller;
+    color: grey;
+}
+
+/* misc inline*/
+
+span.foreign {
+    font-style: italic;
+}
+
+/* generic rendition */
+.plain {
+   text-decoration: none;
+}
+
+.small {
+   font-size: small;
+}
+.term {
+    font-style: italic;
+    }
+.hi {
+    font-style: italic;
+    }
+.emph {
+    font-weight: bold;
+    }
+.label {
+    font-weight: bold;
+}
+.mentioned {
+   font-style: italic;
+}
+
+/* transcription */
+
+div.sourceDoc {
+}
+
+div.surfaceGrp {
+    border-bottom-width: 1pt;
+    border-bottom-color: green;
+    border-bottom-style: solid;
+    clear:both;
+}
+
+div.surface {
+    clear:both;
+    border-width: 1pt;
+    border-style: solid;
+    border-color: grey;
+    margin-bottom: 1ex;
+}
+
+div.zone {
+    border-width: 1pt;
+    border-style: solid;
+    border-color: lightgrey;
+    margin-bottom: 0.5ex;
+}
+
+div.line {
+}
+
+div.facsimage {
+    float: right;
+}
+div.facsimage img {
+    max-height: 100%;
+    width: auto
+}
+
+span.damage {
+   border-bottom: 1px dashed red;
+}
+/* app crit */
+div.appcrit {
+    border-top: solid black 1pt;
+    margin-top: 2pt;
+    padding-top: 2pt;
+    margin-bottom: 2pt;
+    margin-left: 1em;
+}
+div.app {
+    margin-top: 1pt;
+    font-size: smaller;
+}
+span.lemma {
+}
+span.lemmawitness {
+    font-weight: bold;
+}
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/css/tei.css
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/css/txm.css
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/css/txm.css	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/css/txm.css	(revision 728)
@@ -0,0 +1,124 @@
+.txmeditionpage{
+ position:relative;
+   color: #000000;
+   background-color: #FFFFFF;
+   margin-left: 15px;
+   padding:0;
+   font-family: Junicode, Arial, Helvetica, sans-serif;
+}
+
+.editionpage {
+    display:block;
+    text-align:center;
+    color:gray;
+}
+.editionpageverse {
+    position:relative;
+    left:-10px;
+    page-break-before:always;
+    color:gray;
+    display:block;
+    text-align:center;
+}
+
+.footnote {
+    font-size:75%;
+    position:relative;
+}
+
+.footnotes {
+    display:block;
+    border-top-style:solid;
+    border-top-width:1px;
+    border-top-color:gray;
+    padding-top:5px
+}
+
+.footnotenumber {
+    position:absolute;
+    left:-6ex;
+    width:4ex;
+    text-align:right;
+}
+
+.head {
+   color:#4B0082; /*indigo*/
+   font-weight:bold;
+}
+
+/*.hyphen {}*/
+
+.note, span.note {
+    display:block;
+    position:relative;
+}
+
+.note, span.note:before {
+    content:""
+}
+
+.note, span.note:after {
+    content:""
+}
+
+.noteinline {
+     color:gray;
+     font-size:90%;
+     font-style:italic;
+     font-family:Times, serif;
+ }
+
+.noteref {
+    position:relative;
+    top:-1.5ex;
+    font-size:50%;
+    }
+
+.noteref+.noteref:before {
+    content:", "
+    }
+
+
+.pagenumber {
+    color:gray;
+    font-size:80%
+}
+
+.sp > p, .sp > .l {
+    display:block;
+    margin-left:20px;
+}
+
+.speaker {
+    display:block;
+    font-weight:bold;
+    color:gray;
+}
+.verseline {
+	position:relative;
+}
+
+.verseline:before {
+    content:"Â ";
+}
+
+.verselinenumber {
+	position:absolute;
+	left:-8ex;
+	width:5ex;
+	top:0.5ex;;
+	font-size:80%;
+	text-align:right;
+	color:gray;
+}
+
+/*.verseline:before {
+position:absolute;
+left:-50px;
+top:-14px;
+width:25px;
+text-align:right;
+color:gray;
+content:attr(title);
+}
+*/
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/css/txm.css
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-nesle-oriflammsxml.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-nesle-oriflammsxml.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-nesle-oriflammsxml.xsl	(revision 728)
@@ -0,0 +1,371 @@
+<?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"
+  xmlns:xi="http://www.w3.org/2001/XInclude" 
+  xmlns:svg="http://www.w3.org/2000/svg" 
+  xmlns:math="http://www.w3.org/1998/Math/MathML"
+  exclude-result-prefixes="tei edate xd txm xi svg math" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="no"/>
+  
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille permet de convertir les transcription des 
+      Chartes de Fontenay au format XML-TEI du projet Oriflamms.
+    </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 (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+  <!--<xsl:strip-space elements="*"/>-->
+  
+  <xsl:param name="baseMsSiglum">A</xsl:param>
+  
+  <xsl:variable name="baseMsPattern"><xsl:value-of select="concat('^#?',$baseMsSiglum,'| #?',$baseMsSiglum)"/></xsl:variable>
+  
+  <xsl:template match="*|comment()">
+    <!-- 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="processing-instruction()"/>
+
+  <!-- On supprime les attributs par dÃ©faut de la DTD TEI -->
+  
+  <xsl:template match="@*">
+    <xsl:choose>
+      <xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/>
+      <xsl:otherwise><xsl:copy/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<xsl:template match="@facs">
+  <xsl:attribute name="facs"><xsl:value-of select="replace(.,'\.tif$','.png','i')"/></xsl:attribute>
+</xsl:template>
+
+  <xsl:template match="tei:teiHeader">    
+      <xsl:copy>
+        <xsl:apply-templates select="@*"/>
+        <xsl:apply-templates/>
+      </xsl:copy>    
+  </xsl:template>
+    
+
+<xsl:template match="tei:revisionDesc">
+  <xsl:copy>
+  <xsl:apply-templates select="@*"/>
+    <change xmlns="http://www.tei-c.org/ns/1.0" when="2007-01-01" who="#DS">Publication du document original</change>
+    <!-- information rÃ©cupÃ©rÃ©e Ã  partir de /TEI/text[1]/front[1]/titlePage[1]/docDate[1] -->
+    <change xmlns="http://www.tei-c.org/ns/1.0" when="{format-date(current-date(),'[Y]-[M01]-[D01]')}" who="#auto">Conversion automatique au format XML-TEI-Oriflamms</change>
+  <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+  
+  <xsl:template match="tei:encodingDesc">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+      <xsl:if test="not(//tei:prefixDef[@ident='ori'])">
+        <listPrefixDef xmlns="http://www.tei-c.org/ns/1.0">
+          <prefixDef xmlns="http://www.tei-c.org/ns/1.0" ident="ori" 
+            matchPattern="([a-z]+)" 
+            replacementPattern="oriflamms-annotation-scheme.xml#$1">
+            <p>In the context of this project, private URIs with the prefix
+              "ori" point to <gi>interp</gi> elements in the project's
+              oriflamms-annotation-scheme.xml file.
+            </p>
+          </prefixDef>
+        </listPrefixDef>
+      </xsl:if>
+    </xsl:copy>
+  </xsl:template>
+
+<!-- On restructure le document pour avoir un TEI par charte -->
+  
+  <!-- TEI devient teiCorpus -->
+  
+  <xsl:template match="tei:TEI">
+    <xsl:element name="teiCorpus" xmlns="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+
+  <!-- on supprime l'Ã©lÃ©ment text de niveau 1 et travaille directement sur le niveau 2 (l'Ã©lÃ©ment group intermÃ©diaire disparait)-->
+  
+<!--  <xsl:template match="tei:TEI/tei:text">
+    <xsl:apply-templates select="descendant::tei:text"/>
+  </xsl:template>-->
+
+ 
+  <xsl:template match="tei:text[descendant::tei:text]">
+    
+<!--    <teiCorpus xmlns="http://www.tei-c.org/ns/1.0">
+      <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+        <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <title xmlns="http://www.tei-c.org/ns/1.0">
+              <xsl:value-of select="tei:group[1]/tei:head[1]"/>
+            </title>            
+          </titleStmt>
+          <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+          </publicationStmt>
+          <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+          </sourceDesc>
+        </fileDesc>
+        <profileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <!-\- argument devient profileDesc/abstract -\->
+          <xsl:apply-templates select="descendant::tei:argument[1]"/>
+        </profileDesc>        
+      </teiHeader>
+      <xsl:apply-templates/>
+    </teiCorpus>-->
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  <xsl:template match="tei:text[descendant::tei:text]/tei:front">
+    <xsl:choose>
+      <xsl:when test="descendant::tei:div">
+        <TEI xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no">
+          <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+            <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+              <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+                <title xmlns="http://www.tei-c.org/ns/1.0">
+                  <xsl:text>Introduction chercheur</xsl:text>
+                </title>
+              </titleStmt>
+              <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+                <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+              </publicationStmt>
+              <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+                <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+              </sourceDesc>
+            </fileDesc>
+          </teiHeader>
+          <text xmlns="http://www.tei-c.org/ns/1.0">
+            <body xmlns="http://www.tei-c.org/ns/1.0">
+              <xsl:apply-templates select="descendant::tei:div"/>
+            </body>
+            
+          </text>
+        </TEI>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:comment><xsl:copy-of select="."/></xsl:comment>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="tei:text[descendant::tei:text]/tei:back">
+    <xsl:choose>
+      <xsl:when test="descendant::tei:div">
+        <TEI xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no">
+          <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+            <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+              <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+                <title xmlns="http://www.tei-c.org/ns/1.0">
+                  <xsl:text>Annexes</xsl:text>
+                </title>
+              </titleStmt>
+              <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+                <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+              </publicationStmt>
+              <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+                <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+              </sourceDesc>
+            </fileDesc>
+          </teiHeader>
+          <text xmlns="http://www.tei-c.org/ns/1.0">
+            <body xmlns="http://www.tei-c.org/ns/1.0">
+              <xsl:apply-templates select="descendant::tei:div"/>
+            </body>
+            
+          </text>
+        </TEI>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:comment><xsl:copy-of select="."/></xsl:comment>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="tei:group[@n='edition']|tei:group[@n='recueil']">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  <xsl:template match="tei:group[@n='edition']/ tei:group[@n='introduction']">
+    <TEI xmlns="http://www.tei-c.org/ns/1.0">
+      <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+        <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <title xmlns="http://www.tei-c.org/ns/1.0">
+              <xsl:text>Introduction</xsl:text>
+            </title>
+          </titleStmt>
+          <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+          </publicationStmt>
+          <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+          </sourceDesc>
+        </fileDesc>
+      </teiHeader>
+      <xsl:apply-templates/>
+    </TEI>
+    
+  </xsl:template>
+  
+  <xsl:template match="tei:group[@n='edition']/ tei:group[@n='table']">
+    <TEI xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no">
+      <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+        <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <title xmlns="http://www.tei-c.org/ns/1.0">
+              <xsl:text>Table</xsl:text>
+            </title>
+          </titleStmt>
+          <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+          </publicationStmt>
+          <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+          </sourceDesc>
+        </fileDesc>
+      </teiHeader>
+      <text xmlns="http://www.tei-c.org/ns/1.0">
+        <xsl:copy-of select="."/>
+      </text>
+    </TEI>
+    
+  </xsl:template>
+
+  <xsl:template match="tei:group[@n='edition']/tei:group[@n='recueil']/tei:text">
+    
+    <TEI xmlns="http://www.tei-c.org/ns/1.0">
+      <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+        <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <title xmlns="http://www.tei-c.org/ns/1.0">
+              <xsl:value-of select="descendant::tei:docTitle[1]"></xsl:value-of>
+            </title>
+            <xsl:if test="descendant::tei:docAuthor">
+              <author xmlns="http://www.tei-c.org/ns/1.0">
+                <xsl:value-of select="descendant::tei:docAuthor[1]"></xsl:value-of>
+              </author>              
+            </xsl:if>
+            
+          </titleStmt>
+          <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+          </publicationStmt>
+          <!-- les Ã©lÃ©ments listWit et listBibl sont placÃ©s dans sourceDesc -->
+          <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+          </sourceDesc>
+        </fileDesc>
+        <profileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <!-- docDate devient profileDesc/creation/date[@type='documentCreation'] -->
+          <creation xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates select="descendant::tei:docDate/tei:date"/></creation>
+        </profileDesc>
+      </teiHeader>
+      <text xmlns="http://www.tei-c.org/ns/1.0">
+        <xsl:if test="preceding-sibling::*[1][self::tei:milestone]">
+          <xsl:copy-of select="preceding-sibling::tei:milestone[1]"></xsl:copy-of>
+        </xsl:if>
+        <xsl:apply-templates/>
+      </text>
+    </TEI>
+  </xsl:template>
+  
+  <xsl:template match="tei:text[not(descendant::tei:text)]/tei:front">
+  </xsl:template>
+
+<xsl:template match="tei:argument"/>
+  
+
+
+  
+  <xsl:template match="tei:milestone">
+    <xsl:choose>
+      <xsl:when test="parent::tei:group"/>
+      <xsl:otherwise>
+        <xsl:copy-of select="."/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<xsl:template match="tei:group/tei:head"/>
+
+  <!-- on supprime listWit du corps du texte (cf. l'entÃªte) -->
+  <xsl:template match="tei:listWit"/>
+
+<!-- on supprime les entÃªtes et pied de pages (non alignables) -->
+  
+  <xsl:template match="tei:fw">
+    <xsl:comment>fw : <xsl:copy-of select="."/></xsl:comment>
+  </xsl:template>
+
+  <!-- on ajoute un attribut pour faciliter l'identification des segments Ã  ne pas aligner -->
+  
+  <xsl:template match="tei:choice/tei:expan|tei:choice/tei:corr|tei:supplied|tei:note">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="ana">ori:align-no</xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="tei:pb">
+    <xsl:variable name="facs">
+      <xsl:value-of select="@facs"/>
+    </xsl:variable>
+    <xsl:if test="//tei:zone[@xml:id=substring-after($facs,'#')] and not(preceding::tei:pb[@facs=$facs])">
+      <milestone xmlns="http://www.tei-c.org/ns/1.0" unit="surface">
+        <xsl:attribute name="facs">
+          <xsl:value-of select="//tei:surface[tei:zone[@xml:id=substring-after($facs,'#')]][1]/tei:graphic/@url"/>
+        </xsl:attribute>
+      </milestone>
+    </xsl:if>
+    <xsl:copy-of select="."/>
+  </xsl:template>
+  
+
+<xsl:template match="text()[following-sibling::*[1][self::tei:milestone or self::tei:pb or self::tei:cb or self::tei:lb] and following-sibling::tei:lb[1][@break='no']]">
+  <xsl:choose>
+    <!-- patch d'espace blanc devant les sauts de ligne Ã  l'intÃ©rieur de mots -->
+    <xsl:when test="matches(.,'\s+$')"><xsl:value-of select="replace(.,'\s+$','')"/></xsl:when>
+    <xsl:otherwise><xsl:copy/></xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+  
+  <xsl:template match="tei:witDetail">
+    <xsl:text> </xsl:text>
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="ana">ori:align-no</xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-nesle-oriflammsxml.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-tokenize-chars-2-identify.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-tokenize-chars-2-identify.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-tokenize-chars-2-identify.xsl	(revision 728)
@@ -0,0 +1,77 @@
+<?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:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
+
+	<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: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: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:variable name="filenameresult">
+		<xsl:value-of select="replace($filename,'(-ori)?-w$','')"/>
+	</xsl:variable>
+	
+	<xsl:variable name="path">
+		<xsl:value-of select="concat($filedir,'/',$filenameresult,'-c-temp/?select=*.xml;recurse=yes;on-error=warning')"/>
+	</xsl:variable>
+	
+	<xsl:variable name="files" select="collection($path)"/>
+		
+	<xsl:template match="/">
+		<root>Processing files from <xsl:value-of select="$filedir/$filenameresult"/>-c-temp directory. Result files saved in <xsl:value-of select="$filedir/$filenameresult"/>-c directory.</root>
+		<xsl:for-each select="$files">
+			<xsl:variable name="filename2">
+				<xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+).xml$">
+					<xsl:matching-substring>
+						<xsl:value-of select="regex-group(2)"></xsl:value-of>
+					</xsl:matching-substring>
+				</xsl:analyze-string></xsl:variable>
+			<xsl:result-document href="{$filedir}/{$filenameresult}-c/{$filename2}-c.xml">
+				<xsl:apply-templates/>
+			</xsl:result-document>
+		</xsl:for-each>
+	</xsl:template>
+-->
+
+
+<xsl:template match="tei:c">
+	<xsl:variable name="w-id">
+		<xsl:choose>
+			<xsl:when test="ancestor::tei:pc"><xsl:value-of select="ancestor::tei:pc[1]/@xml:id"/></xsl:when>
+			<xsl:when test="ancestor::tei:w"><xsl:value-of select="ancestor::tei:w[1]/@xml:id"/></xsl:when>
+			<xsl:when test="ancestor::tei:seg[@type='deleted']"><xsl:value-of select="ancestor::tei:seg[@type='deleted'][1]/@xml:id"/></xsl:when>
+		</xsl:choose>
+	</xsl:variable>
+	<xsl:variable name="position"><xsl:number from="tei:w|tei:pc|tei:seg[@type='deleted']" level="any"/></xsl:variable>
+	<xsl:copy>
+		<xsl:apply-templates select="@*"/>
+		<xsl:attribute name="xml:id"><xsl:value-of select="concat('c_',$w-id,'_',$position)"/></xsl:attribute>
+		<xsl:apply-templates/>
+	</xsl:copy>
+</xsl:template>
+
+	
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-tokenize-chars-2-identify.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/1-oriflamms-split-surfaces.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/1-oriflamms-split-surfaces.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/1-oriflamms-split-surfaces.xsl	(revision 728)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet
+		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"
+		version="2.0" xpath-default-namespace="http://www.tei-c.org/ns/1.0">
+
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille permet de dÃ©couper un fichier XML TEI Oriflamms en pages
+      avant de procÃ©der Ã  la tokÃ©nisation au niveau de caractÃ¨re.
+    </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 XML TEI Oriflamms file
+      into pages for further tokenizatrion at character level.
+      
+    </xd:detail>
+    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
+    <xd:copyright>2015, CNRS / ICAR (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+  
+  
+  <xsl:output indent="no" method="xml"/>
+
+
+  <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: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:variable name="filenameresult">
+    <xsl:value-of select="replace($filename,'(-ori)?-w$','')"/>
+  </xsl:variable>-->
+
+  <xsl:param name="output-directory"><xsl:value-of select="concat($filedir,'/out')"/></xsl:param>
+
+ 
+  <xsl:template match="teiHeader">
+    <!--<xsl:copy-of select="."/>-->
+  </xsl:template>
+  
+  <xsl:template match="TEI|teiCorpus|group|text">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
+    </xsl:copy>
+  </xsl:template>
+
+
+  <xsl:template match="text/body|text/back|text/front">
+      <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>
+  </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="milestone[@unit='surface']">
+    <xsl:copy-of select="."/>
+  </xsl:template>
+
+  <xsl:template name="checkpb">
+    <xsl:param name="eName"/>
+    <xsl:choose>
+      <xsl:when test="not(.//milestone[@unit='surface'])">
+        <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="milestone[@unit='surface']">
+      <xsl:choose>
+        <xsl:when test="self::milestone[@unit='surface']">
+          <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:template match="*[milestone[@unit='surface']]" mode="pass2" >
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:for-each-group select="*" group-starting-with="milestone[@unit='surface']">
+        <xsl:choose>
+          <xsl:when test="self::milestone[@unit='surface']">
+          	<xsl:comment> Page <xsl:value-of select="@xml:id"/> enregistrÃ©e dans <xsl:value-of select="concat($output-directory,'/',$filename,'_',@xml:id,'.xml')"/></xsl:comment>
+            <xsl:text>&#xA;</xsl:text>
+          	<xsl:result-document href="{$output-directory}/{$filename}_{@xml:id}.xml" indent="yes">
+          	<TEI>
+          	  <teiHeader>
+          	    <fileDesc>
+          	      <titleStmt>
+          	        <title>Page <xsl:value-of select="@xml:id"/> of <xsl:value-of select="$filename"/> tokenized at character level.</title>
+          	      </titleStmt>
+          	      <publicationStmt>
+          	        <p>Oriflamms project (http://oriflamms.hypotheses.org)</p>
+          	      </publicationStmt>
+          	      <sourceDesc>
+          	        <p>Converted from <xsl:value-of select="$filename"/>.</p>
+          	      </sourceDesc>
+          	    </fileDesc>
+          	    <revisionDesc>
+          	      <change when="{current-dateTime()}">File created.</change>
+          	    </revisionDesc>
+          	  </teiHeader>
+          	  <text>
+          	    <body>
+          	      <xsl:copy-of select="."/>
+        	        <xsl:copy-of select="current-group() except ."/>
+          	    </body>
+          	  </text>
+          	</TEI>
+          	</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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/1-oriflamms-split-surfaces.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/icons/in.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/icons/in.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/icons/out.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/icons/out.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/icons/help.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/icons/help.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/icons/movement-controls.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/icons/movement-controls.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/icons/center.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/icons/center.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/flags/en.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/flags/en.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/flags/Thumbs.db
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/flags/Thumbs.db
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/flags/fr.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/flags/fr.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/flags/us.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/flags/us.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/flags/de.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/flags/de.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/flags/it.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/flags/it.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/loading.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/loading.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/down_Over.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/down_Over.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/question_Over.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/question_Over.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/up.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/up.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/down.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/down.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/question.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/question.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/up_Disabled.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/up_Disabled.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/up_Down.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/up_Down.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/down_Disabled.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/down_Disabled.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/down_Down.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/down_Down.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/question_Disabled.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/question_Disabled.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/question_Down.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/question_Down.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/up_Over.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/pickers/up_Over.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/spinner.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/spinner.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/toolbar/center.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/toolbar/center.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/toolbar/thanks-to.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/toolbar/thanks-to.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/toolbar/thanks-to.txt	(revision 728)
@@ -0,0 +1 @@
+Thanks to http://led24.de/iconset for the toolbar images.
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/toolbar/thanks-to.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/toolbar/in.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/toolbar/in.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/toolbar/out.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/toolbar/out.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/toolbar/help.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/toolbar/help.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/toolbar/movement-controls.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/toolbar/movement-controls.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/Banniere.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/images/Banniere.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-fontenay-oriflammsxml.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-fontenay-oriflammsxml.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-fontenay-oriflammsxml.xsl	(revision 728)
@@ -0,0 +1,200 @@
+<?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"
+  xmlns:xi="http://www.w3.org/2001/XInclude" 
+  xmlns:svg="http://www.w3.org/2000/svg" 
+  xmlns:math="http://www.w3.org/1998/Math/MathML"
+  exclude-result-prefixes="tei edate xd txm xi svg math" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="yes"/>
+  
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille permet de convertir les transcription des 
+      Chartes de Fontenay au format XML-TEI du projet Oriflamms.
+    </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 (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+  <xsl:strip-space elements="*"/>
+  
+  <xsl:param name="baseMsSiglum">A</xsl:param>
+  
+  <xsl:variable name="baseMsPattern"><xsl:value-of select="concat('^#?',$baseMsSiglum,'| #?',$baseMsSiglum)"/></xsl:variable>
+  
+  <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>
+
+  <!-- On supprime les attributs par dÃ©faut de la DTD TEI -->
+  
+  <xsl:template match="@*">
+    <xsl:choose>
+      <xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/>
+      <xsl:otherwise><xsl:copy/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="@facs">
+    <xsl:attribute name="facs">
+      <xsl:value-of select="replace(.,'\tif$','.png')"/>
+    </xsl:attribute>
+  </xsl:template>
+
+  <xsl:template match="tei:teiHeader">    
+      <xsl:copy>
+        <xsl:apply-templates select="@*"/>
+        <xsl:apply-templates/>
+      </xsl:copy>    
+  </xsl:template>
+    
+
+<xsl:template match="tei:revisionDesc">
+  <xsl:copy>
+  <xsl:apply-templates select="@*"/>
+    <change xmlns="http://www.tei-c.org/ns/1.0" when="2007-01-01" who="#DS">Publication du document original</change>
+    <!-- information rÃ©cupÃ©rÃ©e Ã  partir de /TEI/text[1]/front[1]/titlePage[1]/docDate[1] -->
+    <change xmlns="http://www.tei-c.org/ns/1.0" when="{format-date(current-date(),'[Y]-[M01]-[D01]')}" who="#auto">Conversion automatique au format XML-TEI-Oriflamms</change>
+  <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+  
+  <xsl:template match="tei:encodingDesc">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+      <xsl:if test="not(//tei:prefixDef[@ident='ori'])">
+        <listPrefixDef xmlns="http://www.tei-c.org/ns/1.0">
+          <prefixDef xmlns="http://www.tei-c.org/ns/1.0" ident="ori" 
+            matchPattern="([a-z]+)" 
+            replacementPattern="oriflamms-annotation-scheme.xml#$1">
+            <p>In the context of this project, private URIs with the prefix
+              "ori" point to <gi>interp</gi> elements in the project's
+              oriflamms-annotation-scheme.xml file.
+            </p>
+          </prefixDef>
+        </listPrefixDef>
+      </xsl:if>
+    </xsl:copy>
+  </xsl:template>
+
+<!-- On restructure le document pour avoir un TEI par charte -->
+  
+  <!-- TEI devient teiCorpus -->
+  
+  <xsl:template match="tei:TEI">
+    <xsl:element name="teiCorpus" xmlns="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+
+  <!-- on supprime l'Ã©lÃ©ment text de niveau 1 et travaille directement sur le niveau 2 (l'Ã©lÃ©ment group intermÃ©diaire disparait)-->
+  
+  <xsl:template match="tei:TEI/tei:text">
+    <xsl:apply-templates select="descendant::tei:text"/>
+  </xsl:template>
+
+  <xsl:template match="tei:text//tei:text">
+    
+    <TEI xmlns="http://www.tei-c.org/ns/1.0">
+      <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+        <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <title xmlns="http://www.tei-c.org/ns/1.0"><xsl:text>Acte original </xsl:text>
+              <xsl:value-of select="substring-after(preceding-sibling::comment()[contains(.,'acte original')][1],'acte original ')"/></title>
+            <author xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="descendant::tei:docAuthor"/></author>
+          </titleStmt>
+          <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the teiCorpus</p>
+          </publicationStmt>
+          <!-- les Ã©lÃ©ments listWit et listBibl sont placÃ©s dans sourceDesc -->
+          <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <xsl:copy-of select="descendant::tei:listWit"/>
+            <xsl:copy-of select="descendant::tei:listBibl[1]"></xsl:copy-of>
+          </sourceDesc>
+        </fileDesc>
+        <profileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <!-- docDate devient profileDesc/creation/date[@type='documentCreation'] -->
+          <creation xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates select="descendant::tei:docDate"/></creation>
+          <!-- argument devient profileDesc/abstract -->
+          <xsl:apply-templates select="descendant::tei:argument"/>
+        </profileDesc>
+      </teiHeader>
+      <text xmlns="http://www.tei-c.org/ns/1.0">
+        <body xmlns="http://www.tei-c.org/ns/1.0">
+          <xsl:apply-templates select="descendant::tei:div1"/>
+        </body>
+      </text>
+    </TEI>
+  </xsl:template>
+  
+  <xsl:template match="tei:docDate[ancestor::tei:group]">
+    <date type="documentCreation" xmlns="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+    </date>
+  </xsl:template>
+  
+  <xsl:template match="tei:argument">
+    <abstract xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates/></abstract>
+  </xsl:template>
+
+  
+  <!-- patch of the wrong use of @break -->
+
+<xsl:template match="tei:lb[@break='yes']">
+  <xsl:copy>
+    <xsl:apply-templates select="@*"/>
+    <xsl:attribute name="break">no</xsl:attribute>
+  </xsl:copy>
+</xsl:template>
+
+  <!-- on ajoute un attribut pour faciliter l'identification des segments Ã  ne pas aligner -->
+  
+  <xsl:template match="tei:choice/tei:expan|tei:choice/tei:corr">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="ana">ori:align-no</xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="tei:rdg[not(matches(@wit,$baseMsPattern))]">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="ana">ori:align-no</xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+
+<xsl:template match="text()[following-sibling::*[1][self::tei:milestone or self::tei:pb or self::tei:cb or self::tei:lb] and following-sibling::tei:lb[1][@break]]">
+  <xsl:choose>
+    <!-- patch d'espace blanc devant les sauts de ligne Ã  l'intÃ©rieur de mots -->
+    <xsl:when test="matches(.,'\s+$')"><xsl:value-of select="replace(.,'\s+$','')"/></xsl:when>
+    <xsl:otherwise><xsl:copy/></xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-fontenay-oriflammsxml.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-inscriptions-oriflammsxml.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-inscriptions-oriflammsxml.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-inscriptions-oriflammsxml.xsl	(revision 728)
@@ -0,0 +1,223 @@
+<?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"
+  xmlns:xi="http://www.w3.org/2001/XInclude" 
+  xmlns:svg="http://www.w3.org/2000/svg" 
+  xmlns:math="http://www.w3.org/1998/Math/MathML"
+  exclude-result-prefixes="tei edate xd txm xi svg math" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="yes"/>
+  
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille permet de convertir la transcription tokÃ©nisÃ©e des 
+      Chartes de Fontenay au format XML-TEI du projet Oriflamms.
+    </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 (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+
+  <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:strip-space elements="*"/>
+  <xsl:template match="/">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  
+  <xsl:template match="*">
+        <xsl:copy>
+          <xsl:apply-templates select="@*"/>
+          <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
+        </xsl:copy>
+  </xsl:template>
+
+  <xsl:template match="comment()|text()">
+    <xsl:copy/>
+  </xsl:template>
+  
+  <xsl:template match="processing-instruction()"/>
+
+  <!-- On supprime les attributs par dÃ©faut de la DTD TEI -->
+  
+  <xsl:template match="@*">
+    <xsl:choose>
+      <xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/>
+<!--      <xsl:when test="matches(name(.),'rend')">
+        <xsl:choose>
+          <xsl:when test="matches(.,'^aggl$')"><xsl:attribute name="rend">space-after(none)</xsl:attribute></xsl:when>
+          <xsl:otherwise><xsl:copy/></xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>-->
+      <xsl:otherwise><xsl:copy/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="tei:teiHeader">    
+      <xsl:copy>
+        <xsl:apply-templates select="@*"/>
+        <xsl:apply-templates/>
+      </xsl:copy>    
+  </xsl:template>
+    
+
+<xsl:template match="tei:revisionDesc">
+  <xsl:copy>
+  <xsl:apply-templates select="@*"/>
+    <change xmlns="http://www.tei-c.org/ns/1.0" when="2007-01-01" who="#DS">Publication du document original</change>
+    <!-- information rÃ©cupÃ©rÃ©e Ã  partir de /TEI/text[1]/front[1]/titlePage[1]/docDate[1] -->
+    <change xmlns="http://www.tei-c.org/ns/1.0" when="{format-date(current-date(),'[Y]-[M01]-[D01]')}" who="#auto">Conversion automatique au format XML-TEI-Oriflamms</change>
+  <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+  
+  <xsl:template match="tei:encodingDesc">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+      <xsl:if test="not(//tei:prefixDef[@ident='ori'])">
+        <listPrefixDef xmlns="http://www.tei-c.org/ns/1.0">
+          <prefixDef xmlns="http://www.tei-c.org/ns/1.0" ident="ori" 
+            matchPattern="([a-z]+)" 
+            replacementPattern="oriflamms-annotation-scheme.xml#$1">
+            <p>In the context of this project, private URIs with the prefix
+              "ori" point to <gi>interp</gi> elements in the project's
+              oriflamms-annotation-scheme.xml file.
+            </p>
+          </prefixDef>
+        </listPrefixDef>
+      </xsl:if>
+    </xsl:copy>
+  </xsl:template>
+
+<!-- On restructure le document pour avoir un TEI par charte -->
+  
+  <!-- TEI devient teiCorpus -->
+  
+  <xsl:template match="tei:TEI">
+    <xsl:element name="teiCorpus" xmlns="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates select="tei:teiHeader"/>
+      <facsimile xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates select="tei:facsimile"/></facsimile>
+      <xsl:apply-templates select="tei:text"/>
+    </xsl:element>
+  </xsl:template>
+
+<xsl:template match="tei:facsimile">
+  <xsl:apply-templates/>
+</xsl:template>
+  
+  
+  <!-- on supprime l'Ã©lÃ©ment text de niveau 1 et travaille directement sur le niveau 2 (l'Ã©lÃ©ment group intermÃ©diaire disparait)-->
+  
+  <xsl:template match="tei:TEI/tei:text">
+    <xsl:apply-templates select="descendant::tei:text"/>
+  </xsl:template>
+
+  <xsl:template match="tei:text//tei:text[descendant::*[@facs]]">
+    
+    <TEI xmlns="http://www.tei-c.org/ns/1.0">
+      <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+        <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <title xmlns="http://www.tei-c.org/ns/1.0"><xsl:text>Acte original </xsl:text>
+              <xsl:value-of select="substring-after(preceding-sibling::comment()[contains(.,'acte original')][1],'acte original ')"/></title>
+            <author xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="descendant::tei:docAuthor"/></author>
+          </titleStmt>
+          <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the teiCorpus</p>
+          </publicationStmt>
+          <!-- les Ã©lÃ©ments listWit et listBibl sont placÃ©s dans sourceDesc -->
+          <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <xsl:copy-of select="descendant::tei:listWit"/>
+            <xsl:copy-of select="descendant::tei:listBibl[1]"></xsl:copy-of>
+          </sourceDesc>
+        </fileDesc>
+        <profileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <!-- docDate devient profileDesc/creation/date[@type='documentCreation'] -->
+          <creation xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates select="descendant::tei:docDate"/></creation>
+          <!-- argument devient profileDesc/abstract -->
+          <xsl:apply-templates select="descendant::tei:argument"/>
+        </profileDesc>
+      </teiHeader>
+      <text xmlns="http://www.tei-c.org/ns/1.0">
+        <xsl:apply-templates select="@*"/>
+        <xsl:variable name="facsID">
+          <xsl:value-of select="replace(descendant::*[@facs][1]/@facs,'^#','')"/>
+        </xsl:variable>
+        <milestone xmlns="http://www.tei-c.org/ns/1.0" unit="surface">
+          <xsl:attribute name="xml:id">
+            <xsl:value-of select="concat('surf_',$filename,'_',translate($facsID,' ()','_--'))"/>
+          </xsl:attribute>
+        </milestone>
+        <xsl:if test="not(descendant::tei:pb[@facs])">
+          <pb xmlns="http://www.tei-c.org/ns/1.0">
+            <xsl:attribute name="facs">
+              <xsl:choose>
+                <xsl:when test="matches(descendant::*[@facs][1]/@facs,'^#')">
+                  <xsl:value-of select="//tei:graphic[following-sibling::tei:zone[@xml:id=$facsID]]/@url"/>
+                  <!--<xsl:value-of select="$facsID"/>-->
+                </xsl:when>
+                <xsl:otherwise><xsl:value-of select="descendant::*[@facs][1]/@facs"/></xsl:otherwise>
+              </xsl:choose>
+            </xsl:attribute>
+          </pb>
+        </xsl:if>
+        <body xmlns="http://www.tei-c.org/ns/1.0">
+          <xsl:apply-templates select="descendant::tei:div1"/>
+        </body>
+      </text>
+    </TEI>
+  </xsl:template>
+  
+  <xsl:template match="tei:text//tei:text[not(descendant::*[@facs])]">
+    <xsl:comment>No facs attribute provided for any element in this text (n="<xsl:value-of select="@n"/>")!</xsl:comment>
+    <xsl:comment><xsl:copy-of select="."/></xsl:comment>
+  </xsl:template>
+  
+  <xsl:template match="tei:docDate[ancestor::tei:group]">
+    <date type="documentCreation" xmlns="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+    </date>
+  </xsl:template>
+  
+  <xsl:template match="tei:argument">
+    <abstract xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates/></abstract>
+  </xsl:template>
+
+  <!-- on ajoute un attribut pour faciliter l'identification des segments Ã  ne pas aligner -->
+
+  <xsl:template match="tei:choice/tei:expan|tei:choice/tei:corr|tei:div1[@type='edition']">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="ana">ori:align-no</xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+  
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-inscriptions-oriflammsxml.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/BuildAllProjectsMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/BuildAllProjectsMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/BuildAllProjectsMacro.groovy	(revision 728)
@@ -0,0 +1,24 @@
+// STANDARD DECLARATIONS
+package org.txm.macro.oriflamms.prepare
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+File projectsDirectory = new File("/home/mdecorde/TEMP/testori/corpus/")
+File xslDirectory = new File("/home/mdecorde/TXM/scripts/macro/org/txm/macro/oriflamms/prepare")
+
+def todo = [
+"CHARETTE":["xmlFile":new File(projectsDirectory, "Charrette_Ms_A.xml"),xslFile:new File(projectsDirectory, "oriflamms-convert-mss-dates-oriflammsxml.xsl"),imageDirectory:new File(projectsDirectory, "images"), createArchive:false],
+"CHARETTEBIS":["xmlFile":new File(projectsDirectory, "Charrette_Ms_A.xml"),xslFile:new File(projectsDirectory, "oriflamms-convert-mss-dates-oriflammsxml.xsl"),imageDirectory:new File(projectsDirectory, "images"), createArchive:false],
+]
+
+for (def k : todo.keySet()) {
+	println "*** BUILD $k ***"
+	try {
+		gse.runMacro(TEI2ProjectMacro, todo.get(k))
+	} catch(Exception e) { 
+		println "ERROR WHILE PROCESSING $k: "+e; 
+		e.printStackTrace();
+	}
+} 
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-patch-milestones.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-patch-milestones.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-patch-milestones.xsl	(revision 728)
@@ -0,0 +1,119 @@
+<?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"
+  xmlns:xi="http://www.w3.org/2001/XInclude" 
+  xmlns:svg="http://www.w3.org/2000/svg" 
+  xmlns:math="http://www.w3.org/1998/Math/MathML"
+  exclude-result-prefixes="tei edate xd txm xi svg math" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="no"/>
+  
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille permet de rajouter les Ã©lÃ©ments milestone et cb, et les identifiants 
+      manquant sur lb
+    </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 (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+  <!--<xsl:strip-space elements="*"/>-->
+  
+  <xsl:variable name="textID">
+    <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:apply-templates/>
+  </xsl:template>
+  
+  
+  <xsl:template match="*">
+        <xsl:copy>
+          <xsl:apply-templates select="@*"/>
+          <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
+        </xsl:copy>
+  </xsl:template>
+
+<xsl:template match="processing-instruction()"></xsl:template>
+
+  <xsl:template match="comment()|text()">
+    <xsl:copy/>
+  </xsl:template>
+
+  <!-- On supprime les attributs par dÃ©faut de la DTD TEI -->
+  
+  <xsl:template match="@*">
+    <xsl:choose>
+      <xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/>
+      <!--      <xsl:when test="matches(name(.),'rend')">
+        <xsl:choose>
+          <xsl:when test="matches(.,'^aggl$')"><xsl:attribute name="rend">space-after(none)</xsl:attribute></xsl:when>
+          <xsl:otherwise><xsl:copy/></xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>-->
+      <xsl:otherwise><xsl:copy/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="tei:pb[not(ancestor::tei:supplied)]">
+    <xsl:variable name="facs"><xsl:value-of select="@facs"/></xsl:variable>
+    <xsl:if test="matches(@facs,'\.(tiff?|png|jpg)$','i') and not(preceding-sibling::*[position() lt 3][self::tei:milestone[@unit='surface']]) and not(preceding::tei:pb[@facs=$facs])">
+      <milestone xmlns="http://www.tei-c.org/ns/1.0" unit="surface" facs="{@facs}"/>
+    </xsl:if>
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+    </xsl:copy>
+    <xsl:if test="not(following::*[position() lt 5][self::tei:cb])">
+      <xsl:comment>cb added automatically</xsl:comment>
+      <cb xmlns="http://www.tei-c.org/ns/1.0"/>
+    </xsl:if>
+    <xsl:if test="not(following::*[position() lt 5][self::tei:lb or self::tei:cb])">
+      <lb xmlns="http://www.tei-c.org/ns/1.0"/>
+      <xsl:comment>lb added automatically</xsl:comment>
+    </xsl:if>
+  </xsl:template>
+  
+  <xsl:template match="tei:cb[not(ancestor::tei:supplied)]">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+    </xsl:copy>
+    <xsl:if test="not(following::*[position() lt 5][self::tei:lb])">
+      <lb xmlns="http://www.tei-c.org/ns/1.0"/>
+    </xsl:if>
+  </xsl:template>
+  
+  <xsl:template match="tei:lb">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:if test="matches(@rend,'^(right|center|centre)#')">
+        <xsl:attribute name="type">rejet</xsl:attribute>
+      </xsl:if>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="tei:milestone[@unit='surface' and @facs=preceding::tei:milestone[@unit='surface']/@facs]">
+    <xsl:comment>Doublon Ã©liminÃ© <xsl:value-of select="@xml:id"/></xsl:comment>
+  </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-patch-milestones.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-graalc-oriflammsxml.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-graalc-oriflammsxml.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-graalc-oriflammsxml.xsl	(revision 728)
@@ -0,0 +1,385 @@
+<?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 xd txm" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="no"/>
+  
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille permet de convertir la transcription compacte de la 
+      Queste del saint Graal au format XML-TEI du projet Oriflamms.
+    </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 (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+  <xsl:template match="/">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  
+  <xsl:template match="*">
+        <xsl:copy>
+          <xsl:apply-templates select="@*"/>
+          <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
+        </xsl:copy>
+  </xsl:template>
+
+  <xsl:template match="comment()|text()">
+    <xsl:copy/>
+  </xsl:template>
+  
+  <xsl:template match="processing-instruction()"></xsl:template>
+
+  <!-- On supprime les attributs par dÃ©faut de la DTD TEI -->
+  
+  <xsl:template match="@*">
+    <xsl:choose>
+      <xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/>
+      <xsl:when test="matches(name(.),'rend')">
+        <xsl:choose>
+          <xsl:when test="matches(.,'^aggl$')"><xsl:attribute name="rend">space-after(none)</xsl:attribute></xsl:when>
+          <xsl:otherwise><xsl:copy/></xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise><xsl:copy/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="tei:teiHeader">    
+      <xsl:copy>
+        <xsl:apply-templates select="@*"/>
+        <xsl:apply-templates/>
+      </xsl:copy>    
+  </xsl:template>
+
+<xsl:template match="tei:revisionDesc">
+  <xsl:copy>
+  <xsl:apply-templates select="@*"/>
+  <change xmlns="http://www.tei-c.org/ns/1.0" when="{format-date(current-date(),'[Y]-[M01]-[D01]')}" who="#auto">Conversion automatique au format XML-TEI-Oriflamms</change>
+  <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+  
+  <xsl:template match="tei:encodingDesc">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+      <xsl:if test="not(//tei:prefixDef[@ident='ori'])">
+        <listPrefixDef xmlns="http://www.tei-c.org/ns/1.0">
+          <prefixDef xmlns="http://www.tei-c.org/ns/1.0" ident="ori" 
+            matchPattern="([a-z]+)" 
+            replacementPattern="oriflamms-annotation-scheme.xml#$1">
+            <p>In the context of this project, private URIs with the prefix
+              "ori" point to <gi>interp</gi> elements in the project's
+              oriflamms-annotation-scheme.xml file.
+            </p>
+          </prefixDef>
+        </listPrefixDef>
+      </xsl:if>
+    </xsl:copy>
+  </xsl:template>
+
+
+<xsl:template match="tei:cb[@rend='hidden']">
+  <xsl:comment>cb factice supprimÃ©</xsl:comment>
+</xsl:template>
+
+<xsl:template match="tei:note|tei:supplied">
+  <xsl:copy>
+    <xsl:apply-templates select="@*"/>
+    <xsl:attribute name="ana">
+      <xsl:if test="@ana"><xsl:value-of select="concat(@ana,' ')"/></xsl:if>
+      <xsl:text>ori:align-no</xsl:text>
+    </xsl:attribute>
+    <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+
+<!--<xsl:template match="tei:pb[not(preceding-sibling::*[1][self::tei:milestone[@unit='surface']] or ancestor::tei:supplied)]">
+  <milestone xmlns="http://www.tei-c.org/ns/1.0" unit="surface" facs="{@facs}"/>
+  <xsl:copy>
+    <xsl:apply-templates select="@*"/>
+  </xsl:copy>
+</xsl:template>-->
+
+<xsl:template match="tei:w[matches(@type,'^PON')]">
+  <pc xmlns="http://www.tei-c.org/ns/1.0">
+    <xsl:apply-templates select="@*"/>
+    <xsl:analyze-string select="." regex="^(.*)%(.*)%(.*)$">
+      <xsl:matching-substring>
+        <xsl:choose>
+          <xsl:when test="matches(regex-group(3),'^$')">
+            <xsl:attribute name="ana">ori:align-no</xsl:attribute>
+            <reg xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no"><xsl:value-of select="regex-group(1)"/></reg>
+          </xsl:when>
+          <xsl:when test="matches(regex-group(1),'^$')">
+            <orig xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="regex-group(3)"/></orig>
+          </xsl:when>
+          <xsl:otherwise>
+            <choice xmlns="http://www.tei-c.org/ns/1.0">
+              <reg xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no"><xsl:value-of select="regex-group(1)"/></reg>
+              <orig xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="regex-group(3)"/></orig>
+            </choice>
+          </xsl:otherwise>
+        </xsl:choose>        
+      </xsl:matching-substring>
+      <xsl:non-matching-substring><xsl:value-of select="."/></xsl:non-matching-substring>
+    </xsl:analyze-string>
+  </pc>
+</xsl:template>
+
+  <xsl:template match="tei:orig">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+
+
+  <xsl:template match="tei:w[not(matches(@type,'^PON'))]//text()|tei:del[not(ancestor::tei:w or descendant::tei:w)]//text()">
+    <xsl:choose>
+      <xsl:when test="matches(.,'^\s*$')"><xsl:copy/></xsl:when>
+      <xsl:otherwise>
+        <xsl:analyze-string select="." regex="#?\*[ijuvIJUVÃ­]|#[A-Za-zÃ€-Ã¿Å¿]|\{{\{{[^}}]+\}}\}}|#?\(\([^)]+\)\).?|_">
+          <xsl:matching-substring>
+            <xsl:choose>
+              <xsl:when test="matches(.,'#\*([ij])')">
+                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-j"><xsl:value-of select="upper-case(regex-group(1))"/></g>
+              </xsl:when>
+              <xsl:when test="matches(.,'#\*([uv])')">
+                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-v"><xsl:value-of select="upper-case(regex-group(1))"/></g>
+              </xsl:when>
+              <xsl:when test="matches(.,'\*Ã­')">
+                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-i ori:facs-iacute">j</g>
+              </xsl:when>
+              <xsl:when test="matches(.,'\*([ij])')">
+                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-j"><xsl:value-of select="regex-group(1)"/></g>
+              </xsl:when>
+              <xsl:when test="matches(.,'\*([uv])')">
+                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-v"><xsl:value-of select="regex-group(1)"/></g>
+              </xsl:when>
+              <xsl:when test="matches(.,'#\*([IJ])')">
+                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-I"><xsl:value-of select="lower-case(regex-group(1))"/></g>
+              </xsl:when>
+              <xsl:when test="matches(.,'#\*([UV])')">
+                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-V"><xsl:value-of select="lower-case(regex-group(1))"/></g>
+              </xsl:when>
+              <xsl:when test="matches(.,'\*([IJ])')">
+                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-I"><xsl:value-of select="regex-group(1)"/></g>
+              </xsl:when>
+              <xsl:when test="matches(.,'\*([UV])')">
+                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-V"><xsl:value-of select="regex-group(1)"/></g>
+              </xsl:when>
+              <xsl:when test="matches(.,'#Å¿')">
+                <xsl:analyze-string select="." regex="^#(.)">
+                  <xsl:matching-substring>
+                    <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-caps ori:facs-slong">S</g>
+                  </xsl:matching-substring>
+                </xsl:analyze-string>
+              </xsl:when>
+              <!-- ï…˜ -->
+<!--              <xsl:when test="matches(.,'#ï…˜')">
+                <xsl:analyze-string select="." regex="^#(.)">
+                  <xsl:matching-substring>
+                    <choice xmlns="http://www.tei-c.org/ns/1.0">
+                      <abbr xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="regex-group(1)"/></abbr>
+                      <expan xmlns="http://www.tei-c.org/ns/1.0"><ex xmlns="http://www.tei-c.org/ns/1.0"><g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-small">E</g>t</ex></expan>
+                    </choice>
+                  </xsl:matching-substring>
+                </xsl:analyze-string>
+              </xsl:when>              -->
+              <xsl:when test="matches(.,'#[A-Z]')">
+                <xsl:analyze-string select="." regex="^#(.)">
+                  <xsl:matching-substring>
+                    <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-caps"><xsl:value-of select="lower-case(regex-group(1))"/></g>
+                  </xsl:matching-substring>
+                </xsl:analyze-string>
+              </xsl:when>
+              <xsl:when test="matches(.,'#[^(]')">
+                <xsl:analyze-string select="." regex="^#(.+)$">
+                  <xsl:matching-substring>
+                    <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-small"><xsl:value-of select="upper-case(regex-group(1))"/></g>
+                  </xsl:matching-substring>
+                </xsl:analyze-string>
+              </xsl:when>
+              <xsl:when test="matches(.,'\{\{([^}}]+)\}\}')">
+                <xsl:analyze-string select="." regex="^\{{\{{([^:]*):([^:]*):([^:]*):([^:]*):?([^:]*)\}}\}}$">
+                  <xsl:matching-substring>
+                    <xsl:variable name="lettrine"><xsl:value-of select="regex-group(1)"/></xsl:variable>
+                    <xsl:variable name="size"><xsl:value-of select="regex-group(2)"/></xsl:variable>
+                    <xsl:variable name="sizeAct"><xsl:value-of select="regex-group(3)"/></xsl:variable>
+                    <xsl:variable name="color"><xsl:value-of select="regex-group(4)"/></xsl:variable>
+                    <xsl:variable name="deco"><xsl:value-of select="regex-group(5)"/></xsl:variable>
+                    <xsl:variable name="rend">
+                      <xsl:value-of select="concat('size(',$size,')')"/>
+                      <xsl:if test="matches($sizeAct,'.+')"><xsl:value-of select="concat(' sizeAct(',$sizeAct,')')"/></xsl:if>
+                      <xsl:if test="matches($color,'.+')"><xsl:value-of select="concat(' color(',$color,')')"/></xsl:if>
+                      <xsl:if test="matches($deco,'.+')"><xsl:value-of select="concat(' deco(',$deco,')')"/></xsl:if>
+                    </xsl:variable>
+                    <g xmlns="http://www.tei-c.org/ns/1.0" type="lettrine" rend="{$rend}"><xsl:value-of select="$lettrine"/></g>
+                  </xsl:matching-substring>
+                </xsl:analyze-string>
+              </xsl:when>
+              <xsl:when test="matches(.,'\(\(')">
+                <xsl:analyze-string select="." regex="^#?\(\(([^\)]+)\)\)(.?)$">
+                  <xsl:matching-substring>
+                    <xsl:variable name="capitalize">
+                      <xsl:choose>
+                        <xsl:when test="matches(.,'^#')">yes</xsl:when>
+                        <xsl:otherwise>no</xsl:otherwise>
+                      </xsl:choose>
+                    </xsl:variable>
+                    <xsl:variable name="abbrexpan"><xsl:value-of select="regex-group(1)"/></xsl:variable>
+                    <xsl:variable name="nextLetter"><xsl:value-of select="regex-group(2)"/></xsl:variable>
+                    <xsl:variable name="abbr">
+                      <xsl:choose>
+                        <xsl:when test="matches($abbrexpan,'_')"><xsl:value-of select="substring-before($abbrexpan,'_')"/></xsl:when>
+                        <xsl:when test="matches($abbrexpan,'^(.&#x0305;|.&#x0363;|.&#x0364;|.&#x0365;|bn&#x0305;|ch&#x02BC;&#xA75B;|ch&#x0305;&#xA75B;|ch&#xA75B;&#x0305;|gn&#x0363;t|qn&#x0363;t|&#x035B;|&#x1DD1;|&#x204A;|&#x223B;|&#xA76F;|&#xA770;|&#xF153;|&#xF158;|&#xF1C8;)$')">
+                          <xsl:value-of select="$abbrexpan"/>
+                        </xsl:when>
+                        <xsl:otherwise/>
+                      </xsl:choose>
+                    </xsl:variable>
+                    <xsl:variable name="expannocap" as="element()">
+                      <expan xmlns="http://www.tei-c.org/ns/1.0">
+                        <xsl:choose>
+                        <xsl:when test="matches($abbrexpan,'_')">
+                          <xsl:analyze-string select="substring-after($abbrexpan,'_')" regex="\[([^\]]+)\]">
+                            <xsl:matching-substring>
+                              <ex xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="regex-group(1)"/></ex>
+                            </xsl:matching-substring>
+                            <xsl:non-matching-substring>
+                              <xsl:copy/>
+                            </xsl:non-matching-substring>
+                          </xsl:analyze-string>
+                        </xsl:when>
+                          <xsl:when test="matches($abbrexpan,'^bn&#x0305;$')">b<ex xmlns="http://www.tei-c.org/ns/1.0">ie</ex>n</xsl:when>
+                          <xsl:when test="matches($abbrexpan,'^(ch&#x02BC;&#xA75B;|ch&#x0305;&#xA75B;|ch&#xA75B;&#x0305;)$')">ch<ex xmlns="http://www.tei-c.org/ns/1.0">evalie</ex>r</xsl:when>
+                          <xsl:when test="matches($abbrexpan,'gn&#x0363;t')">g<ex xmlns="http://www.tei-c.org/ns/1.0">r</ex><c xmlns="http://www.tei-c.org/ns/1.0" rend="position(combsup)">a</c>nt</xsl:when>
+                          <xsl:when test="matches($abbrexpan,'qn&#x0363;t')">q<ex xmlns="http://www.tei-c.org/ns/1.0">u</ex><c xmlns="http://www.tei-c.org/ns/1.0" rend="position(combsup)">a</c>nt</xsl:when>
+                        <xsl:when test="matches($abbrexpan,'.&#x0305;$')">
+                          <xsl:value-of select="substring($abbrexpan,1,1)"/>
+                          <xsl:choose>
+                            <xsl:when test="matches($abbrexpan,'^[aeiou]') and matches($nextLetter,'[bmnp]')"><ex xmlns="http://www.tei-c.org/ns/1.0">m</ex></xsl:when>
+                            <xsl:when test="matches($abbrexpan,'^[aeiou]')"><ex xmlns="http://www.tei-c.org/ns/1.0">n</ex></xsl:when>
+                            <xsl:when test="matches($abbrexpan,'^[q]')"><ex xmlns="http://www.tei-c.org/ns/1.0">ue</ex></xsl:when>
+                            <xsl:when test="matches($abbrexpan,'^[p]')"><ex xmlns="http://www.tei-c.org/ns/1.0">re</ex></xsl:when>
+                            <xsl:otherwise>â€¹barâ€º</xsl:otherwise>
+                          </xsl:choose>
+                        </xsl:when>
+                          <xsl:when test="matches($abbrexpan,'.&#x0363;')">
+                            <xsl:value-of select="substring($abbrexpan,1,1)"/>
+                            <xsl:choose>
+                              <xsl:when test="matches($abbrexpan,'^[Qq]')"><ex xmlns="http://www.tei-c.org/ns/1.0">u</ex></xsl:when>
+                              <xsl:otherwise><ex xmlns="http://www.tei-c.org/ns/1.0">r</ex></xsl:otherwise>
+                            </xsl:choose>
+                            <c xmlns="http://www.tei-c.org/ns/1.0" rend="position(combsup)">a</c>
+                          </xsl:when>
+                          <xsl:when test="matches($abbrexpan,'.&#x0364;')">
+                            <xsl:value-of select="substring($abbrexpan,1,1)"/>
+                            <xsl:choose>
+                              <xsl:when test="matches($abbrexpan,'^[Qq]')"><ex xmlns="http://www.tei-c.org/ns/1.0">u</ex></xsl:when>
+                              <xsl:otherwise><ex xmlns="http://www.tei-c.org/ns/1.0">r</ex></xsl:otherwise>
+                            </xsl:choose>
+                            <c xmlns="http://www.tei-c.org/ns/1.0" rend="position(combsup)">e</c>
+                          </xsl:when>
+                          <xsl:when test="matches($abbrexpan,'.&#x0365;')">
+                            <xsl:value-of select="substring($abbrexpan,1,1)"/>
+                            <xsl:choose>
+                              <xsl:when test="matches($abbrexpan,'^[Qq]')"><ex xmlns="http://www.tei-c.org/ns/1.0">u</ex></xsl:when>
+                              <xsl:otherwise><ex xmlns="http://www.tei-c.org/ns/1.0">r</ex></xsl:otherwise>
+                            </xsl:choose>
+                            <c xmlns="http://www.tei-c.org/ns/1.0" rend="position(combsup)">i</c>
+                          </xsl:when>
+                          <xsl:when test="matches($abbrexpan,'&#xA76F;') and matches($nextLetter,'[bmnp]')">
+                            <ex xmlns="http://www.tei-c.org/ns/1.0">com</ex>
+                          </xsl:when>
+                          <xsl:when test="matches($abbrexpan,'&#xA76F;')">
+                            <ex xmlns="http://www.tei-c.org/ns/1.0">con</ex>
+                          </xsl:when>
+                          <xsl:when test="matches($abbrexpan,'&#x035B;|&#xF1C8;')">
+                            <ex xmlns="http://www.tei-c.org/ns/1.0">er</ex>
+                          </xsl:when>
+                          <xsl:when test="matches($abbrexpan,'&#x204A;|&#xF158;')">
+                            <ex xmlns="http://www.tei-c.org/ns/1.0">et</ex>
+                          </xsl:when>
+                          <xsl:when test="matches($abbrexpan,'&#x1DD1;|&#xF153;')">
+                            <ex xmlns="http://www.tei-c.org/ns/1.0">ur</ex>
+                          </xsl:when>
+                          <xsl:when test="matches($abbrexpan,'&#xA770;')">
+                            <ex xmlns="http://www.tei-c.org/ns/1.0">us</ex>
+                          </xsl:when>
+                          <xsl:otherwise>
+                            <ex xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="$abbrexpan"/></ex><!--<xsl:comment>Unknown expan!</xsl:comment>-->
+                          </xsl:otherwise>
+                        </xsl:choose></expan>
+                    </xsl:variable>
+                    <xsl:variable name="expan">
+                      <xsl:choose>
+                        <xsl:when test="$capitalize eq 'yes'">
+                          <expan xmlns="http://www.tei-c.org/ns/1.0">
+                            <xsl:for-each select="$expannocap/node()">
+                            <xsl:choose>
+                              <xsl:when test="self::text()[not(preceding-sibling::*)]">
+                                <g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-small"><xsl:value-of select="upper-case(substring(.,1,1))"/></g><xsl:value-of select="substring(.,2)"/>
+                              </xsl:when>
+                              <xsl:when test="self::*[not(preceding-sibling::text())]">
+                                <xsl:copy><g xmlns="http://www.tei-c.org/ns/1.0" ana="ori:dipl-small"><xsl:value-of select="upper-case(substring(.,1,1))"/></g><xsl:value-of select="substring(.,2)"/></xsl:copy>
+                              </xsl:when>
+                              <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
+                            </xsl:choose>
+                          </xsl:for-each>
+                          </expan>
+                        </xsl:when>
+                        <xsl:otherwise><xsl:copy-of select="$expannocap"/></xsl:otherwise>
+                      </xsl:choose>
+                    </xsl:variable>
+                    <xsl:choose>
+                      <xsl:when test="matches($abbr,'.+')">
+                        <choice xmlns="http://www.tei-c.org/ns/1.0">
+                          <abbr xmlns="http://www.tei-c.org/ns/1.0"><xsl:copy-of select="$abbr"/></abbr>
+                          <xsl:copy-of select="$expan"/>
+                        </choice>
+                      </xsl:when>
+                      <xsl:otherwise><xsl:copy-of select="$expan"/><!--<xsl:comment>Unknown abbr!</xsl:comment>--></xsl:otherwise>
+                    </xsl:choose>
+                    <xsl:value-of select="$nextLetter"/>
+                  </xsl:matching-substring>
+                </xsl:analyze-string>
+              </xsl:when>
+              <xsl:when test="matches(.,'__')">
+                <space xmlns="http://www.tei-c.org/ns/1.0" ana="ori:figement"/>
+              </xsl:when>
+              <xsl:when test="matches(.,'_')">
+                <space xmlns="http://www.tei-c.org/ns/1.0"/>
+              </xsl:when>              
+              <xsl:otherwise>Match: <xsl:copy/></xsl:otherwise>
+            </xsl:choose>
+          </xsl:matching-substring>
+          <xsl:non-matching-substring>
+            <xsl:copy/>
+          </xsl:non-matching-substring>
+        </xsl:analyze-string>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-graalc-oriflammsxml.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/js/viewer/toolbar-ext.js
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/js/viewer/toolbar-ext.js	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/js/viewer/toolbar-ext.js	(revision 728)
@@ -0,0 +1,136 @@
+viewer.toolbarImages="images/toolbar"
+viewer.toolbar = function(self) {
+	var toolbar = document.createElement('div');
+	toolbar.className='toolbar';
+	
+	var isEnterKey = function(event) {
+		var keyCode;
+		if(event.keyCode) // IE
+			keyCode = event.keyCode, event.returnValue = false;
+		else if(event.which) // Netscape/Firefox/Opera
+			keyCode = event.which, event.preventDefault();
+		return keyCode==13;
+	}
+	
+	var zoomIn = document.createElement('img');
+	zoomIn.className='toolbarButton';
+	zoomIn.title='Zoom in';
+	zoomIn.tabIndex="1";
+	zoomIn.src=viewer.toolbarImages+'/in.png';
+	zoomIn.onclick = zoomIn.onkeypress = function(event) {
+		event=event?event:window.event;
+		if (event.type == 'keypress') 
+			if(!isEnterKey(event))
+				return;
+		var frameDimension = self.getFrameDimension();
+		self.zoomTo(self.getZoomLevel()+1, frameDimension[0]/2,frameDimension[1]/2);
+	}
+	
+	var zoomOut = document.createElement('img');
+	zoomOut.className='toolbarButton';
+	zoomOut.title='Zoom out';
+	zoomOut.tabIndex="1";
+	zoomOut.src=viewer.toolbarImages+'/out.png';
+	zoomOut.onclick = zoomOut.onkeypress = function(event) {
+		event=event?event:window.event;
+		if (event.type == 'keypress') 
+			if(!isEnterKey(event))
+				return;
+		
+		var frameDimension = self.getFrameDimension();
+		self.zoomTo(self.getZoomLevel()-1, frameDimension[0]/2,frameDimension[1]/2);
+	}
+	
+	var center = document.createElement('img');
+	center.className='toolbarButton';
+	center.title='Center image';
+	center.tabIndex="1";
+	center.src=viewer.toolbarImages+'/center.png';
+	center.onclick = center.onkeypress = function(event) {
+		event=event?event:window.event;
+		if (event.type == 'keypress') 
+			if(!isEnterKey(event))
+				return;
+		self.reset();
+	}
+	
+	var help = document.createElement('img');
+	help.className='toolbarButton';
+	help.tabIndex="1";
+	help.src=viewer.toolbarImages+'/help.png';
+	var helpText = document.createElement('div');
+	helpText.className='helpText';
+	helpText.style.display='none';
+	helpText.innerHTML = '<h5 style="color:#40C0FF; font-size:12px; margin:2px 0;">How to use the image viewer?</h5>';
+	helpText.innerHTML = helpText.innerHTML + "Zooming<hr> Use the mouse wheel or the toolbar to zoom in/out. You can also zoom IN using '+','x' or '=' keys and zoom OUT using '-' or 'z' keys using the keyboard.";
+	helpText.innerHTML = helpText.innerHTML + "<br><br>Panning<hr> Click and drag the mouse to pan the image or use 'w','s','a' and 'd' keys for moving up,down,left and right respectively.<br>Alternatively you can use the arrow buttons to pan the image.";
+	helpText.innerHTML = helpText.innerHTML + "<br><br>Center Image<hr> Click on the 'Center image' icon on the toolbar or press 'c' to center image.";
+	
+	help.onclick = help.onkeypress = function(event) {
+		event=event?event:window.event;
+		if (event.type == 'keypress') 
+			if(!isEnterKey(event))
+				return;
+		if (helpText.style.display == 'none')
+			helpText.style.display = 'block';
+		else
+			helpText.style.display = 'none';
+	}
+	
+	var controls = document.createElement('img');
+	controls.className='movement-controls';
+	controls.src=viewer.toolbarImages+'/movement-controls.png';
+	controls.useMap="#controls";
+	var map = document.createElement('map');
+	map.name="controls";
+	
+	var up=document.createElement('area');
+	up.shape='rect';
+	up.coords="17,1,31,17";
+	up.style.cursor='pointer';
+	up.onmousedown = function() {
+		var dimension = self.getFrameDimension();
+		self.moveBy(0,dimension[1]*0.1); //10%
+	}
+	map.appendChild(up);
+	
+	var down=document.createElement('area');
+	down.shape='rect';
+	down.coords="17,31,31,47";
+	down.style.cursor='pointer';
+	down.onmousedown = function() {
+		var dimension = self.getFrameDimension();
+		self.moveBy(0,-1*dimension[1]*0.1);
+	}
+	map.appendChild(down);
+	
+	var left=document.createElement('area');
+	left.shape='rect';
+	left.coords="1,17,17,31";
+	left.style.cursor='pointer';
+	left.onmousedown = function() {
+		var dimension = self.getFrameDimension();
+		self.moveBy(dimension[0]*0.1,0);
+	}
+	map.appendChild(left);
+	
+	var right=document.createElement('area');
+	right.shape='rect';
+	right.coords="31,17,47,31";
+	right.style.cursor='pointer';
+	right.onmousedown = function() {
+		var dimension = self.getFrameDimension();
+		self.moveBy(-1*dimension[0]*0.1,0);
+	}
+	map.appendChild(right);
+	
+	toolbar.appendChild(zoomIn);
+	toolbar.appendChild(zoomOut);
+	toolbar.appendChild(center);
+	toolbar.appendChild(help);
+	toolbar.appendChild(helpText);
+	
+	self.frameElement.appendChild(toolbar);
+	self.frameElement.appendChild(controls);
+	self.frameElement.appendChild(map);
+}
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/js/viewer/toolbar-ext.js
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/js/viewer/Simple_Viewer_beta_1.1-min.js
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/js/viewer/Simple_Viewer_beta_1.1-min.js	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/js/viewer/Simple_Viewer_beta_1.1-min.js	(revision 728)
@@ -0,0 +1,630 @@
+/**
+ *  Simple Javascript Image 
+
+    Copyright (C) 2010  Munawwar Firoz
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program 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 General Public License for more details (http://www.gnu.org/licenses/)
+*/
+function getObjectXY(object) {
+	var left,top;
+	objectCopy=object;
+	if (object.offsetParent) {
+		left=top=0;
+		do {
+			left += object.offsetLeft;
+			if(object.style.borderLeftWidth!='')
+				left+=parseInt(object.style.borderLeftWidth);
+			else
+				object.style.borderLeftWidth='0px';
+			top += object.offsetTop;
+			if(object.style.borderTopWidth!='')
+				top+=parseInt(object.style.borderTopWidth);
+			else
+				object.style.borderTopWidth='0px';
+		}
+		while (object = object.offsetParent);
+	}
+	return [left-parseInt(objectCopy.style.borderLeftWidth),top-parseInt(objectCopy.style.borderLeftWidth)];
+}
+
+//String compare (Case-sensitive)
+function strcmp(string1,string2) {
+	return (string1.length===string2.length && string1.indexOf(string2)!=-1);
+}
+//String compare (Case-insensitive)
+function strcmpi(string1,string2) {
+	return (string1.length===string2.length && string1.toLowerCase().indexOf(string2.toLowerCase())!=-1);
+}
+//string1 should end with string2 to return true (Case-insensitive)
+function strEndsWith(string1,string2) {
+	var index=string1.length-string2.length;
+	return (string1.toLowerCase().lastIndexOf(string2.toLowerCase(),index)==index);
+}
+//Returns the constructor (which is a function) name
+function returnDataType(object) {
+	if(typeof object==='undefined')
+		return 'undefined';
+	if(typeof object==='null')
+		return 'null';
+	code=new String(object.constructor);
+	return code.substring( code.indexOf(' ')+1, code.indexOf('(') );
+}
+//Verifies wether the datatype of a variable is as you expect it to be
+function verifyDataType(object,Datatype_expected_in_string) {
+	return strcmpi( returnDataType(object), Datatype_expected_in_string );
+}
+function retInt(str, suffix) {
+	if(typeof str=='number')
+		return str;
+	var result=str.indexOf(suffix);
+	return parseInt(str.substring(0,(result!=-1)?result:str.length))
+}
+
+/*Mouse related functions*/
+//Used to retrieve the mouse cursor position on screen (but event is needed as argument)
+function getMouseXY(event) {
+	var posx = 0, posy = 0;
+	if (!event) event = window.event;	//firefox
+	if (event.pageX || event.pageY) {
+		posx = event.pageX;
+		posy = event.pageY;
+	}
+	else if (event.clientX || event.clientY) {	//IE
+		posx = event.clientX + document.body.scrollLeft
+			+ document.documentElement.scrollLeft;
+		posy = event.clientY + document.body.scrollTop
+			+ document.documentElement.scrollTop;
+	}
+	return [posx,posy];
+}
+
+function mouseWheel() {
+	var self=this;
+	/*Event handlers*/
+	/*Mouse wheel functions*/
+
+	//Default mouse wheel callback function
+	//Variable local to 'this'
+	var wheelCallback = function(event,object,delta){
+		/*Override this function and write your code there*/
+		/*
+			delta=-1 when mouse wheel is rolled backwards (towards yourself)
+			delta=1 when mouse wheel is rolled forward (away from one's self)
+			Note: Here is where you can call the getMouseXY function using the 'event' argument
+		*/
+	}
+	//Mouse wheel event handler
+	self.wheelHandler = function (event){
+		var delta = 0;
+		if (!event) //For IE
+			event = window.event;
+		if (event.wheelDelta) 	//IE
+		{
+			delta = event.wheelDelta/120;
+			//if (window.opera) delta = -delta; //for Opera...hmm I read somewhere opera 9 need the delta sign inverted...tried in opera 10 and it doesnt require this!?
+		}
+		else if (event.detail) //firefox
+			delta = -event.detail/3;
+
+		if (event.preventDefault)
+			event.preventDefault();
+		event.returnValue = false;
+		if (delta)
+			wheelCallback(event,this,delta);	//callback function
+	}
+	//Mouse wheel initialization
+	self.init = function(object,callback) {
+		if (object.addEventListener) //For firefox
+			object.addEventListener('DOMMouseScroll', this.wheelHandler, false); //Mouse wheel initialization
+		//For IE
+		object.onmousewheel = this.wheelHandler; //Mouse wheel initialization
+		wheelCallback=callback;
+	}
+	this.setCallback = function(callback){
+		wheelCallback=callback;
+	}
+}
+
+//Debugging
+function debug_msgs() {
+	this.counter=0;
+	this.clear=function() {
+		var div=document.getElementById('debug');
+		div.innerHTML='';
+		this.counter=0;
+	}
+	this.print=function(string) {
+	var div=document.getElementById('debug');
+		div.innerHTML+=string;
+	}
+	this.println=function(string) {
+		var div=document.getElementById('debug');
+		div.innerHTML+=string+'<br>';
+		this.counter++;
+	}
+}
+var debug=new debug_msgs();
+
+/*-------------The image viewer--------------*/
+function viewer(arguments) //argument array
+{
+	var self=this;
+
+	/*Properties*/
+	//Public access
+	self.outerFrame=null;
+	
+	//Private access
+	var image=null,imageSource=null,parent=null,replace=null,preLoader=null;
+	var frame=['400px','400px',true]; //Format: ['width in px or % (number)','height in px or % (number)', auto adjust frameElement to image (boolean)]
+	var borderClass=null;
+	var zoomFactor='10%'; //10% increase per zoom in			
+	var maxZoom='300%'; //Either 'percentage' or ['max width in pixel', 'max height in pixel']
+
+	/*Set user defined properties and configurations*/
+	/*
+		The following configurations are for pure javascript image viewers:
+			imageSource : string - Source to the image you want to show
+			
+			parent : HTMLElement - The parent element of the image viewer
+			or
+			replace: HTMLElement - The image viewer replace this HTML element
+			(Exactly one of the above two properties is absolutly needed)
+			
+			preLoader (optional) : string - Source to a pre-loader image. Useful in case of large images
+			
+		The following configurations are for partial javascript/partial HTML image viewers:
+			image - HTMLElement - The reference to the image HTML element
+		
+		Common to both:
+			frame - An array of format [width, height, widthIsMax, heightIsMax]
+				width and height are strings like '400px' or '100%'. width and height can be in px or %
+				widthIsMax and heightIsMax are optional boolean values. 
+				Say if widthIsMax is set to true, it treats the width as the maximum width limit.
+				So if the zoomed image isn't fitting exactly into the frameElement, the frameElement dimension is reduced and adjusted to fit the image.
+			
+			zoomFactor (optional) - number - Decides the amount zoomed per zoom event. Default is set to 10 (in %)
+			maxZoom (optional) - Sets the makimum image zoom in percentage or pixels. Format :Either 'percentage' or ['max width in pixel', 'max height in pixel']
+				Example: '150%' or ['500px,'500px']
+	*/
+	var key;
+	for (key in arguments) {
+		var temp=arguments[key];
+		eval(key + '=temp;');
+	}
+
+	/*Internal states,HTML elements and properties*/
+	self.frameElement = null;
+	var orignalW,orignalH, zoomLevel=1;
+	var lastMousePosition=null, speed=5;
+	var mouseWheelObject=null;
+	
+	/*Methods*/
+	self.getFrameDimension =  function() {
+		return [self.frameElement.clientWidth,self.frameElement.clientHeight];
+	}				
+	self.setDimension = function(width,height) { //width and height of image
+		image.width=Math.round(width);
+		image.height=Math.round(height);
+	}
+	self.getDimension =  function() {
+		return [image.width,image.height];
+	}
+	self.setPosition = function(x,y) { //x and y coordinate of image
+		image.style.left=(Math.round(x)+'px');
+		image.style.top=(Math.round(y)+'px');
+	}
+	self.getPosition = function() {
+		return [retInt(image.style.left,'px'),retInt(image.style.top,'px')];
+	}
+	self.setMouseCursor = function() {
+		var dimension = self.getDimension();
+		var frameDimension =  self.getFrameDimension();
+		
+		var cursor='crosshair';
+		if(dimension[0]>frameDimension[0] && dimension[1]>frameDimension[1])
+			cursor='move';
+		else if(dimension[0]>frameDimension[0])
+			cursor='e-resize';
+		else if(dimension[1]>frameDimension[1])
+			cursor='n-resize';
+		
+		image.style.cursor=cursor;
+	}
+	self.maxZoomCheck = function(width,height) {
+		if(typeof width=='undefined' || typeof height=='undefined') {
+			var temp = self.getDimension();
+			width=temp[0], height=temp[1];
+		}
+		if(typeof maxZoom=='number') {
+			return ((width/orignalW)>maxZoom || (height/orignalH)>maxZoom);
+		}
+		else if(typeof maxZoom=='object') {
+			return (width>maxZoom[0] || height>maxZoom[1]);
+		}
+	}
+	self.fitToFrame = function(width, height) { //width and height of image
+		if(typeof width=='undefined' || typeof height=='undefined') {
+			width=orignalW, height=orignalH;
+		}
+		var frameDimension = self.getFrameDimension(), newWidth,newHeight;
+		
+		newWidth = frameDimension[0];
+		newHeight = Math.round((newWidth*height)/width);
+		if(newHeight>(frameDimension[1])) {
+			newHeight = frameDimension[1];
+			newWidth = Math.round((newHeight*width)/height); 
+		}
+		return [newWidth,newHeight];
+		//return [width, height]; // to not resize the image but can't set zoom < 100%
+	}
+	self.getZoomLevel = function() {
+		return zoomLevel;
+	}
+	self.zoomTo = function(newZoomLevel, x, y) {
+		var frameDimension = self.getFrameDimension();
+		//check if x and y coordinate is within the self.frameElement
+		if(newZoomLevel<0 || x<0 || y<0 || x>=frameDimension[0] || y>=frameDimension[1])
+			return false;
+		
+		var dimension = self.fitToFrame(orignalW,orignalH);
+		for(var i=newZoomLevel; i>0;i--) {
+			dimension[0] *= zoomFactor, dimension[1] *= zoomFactor;
+
+		}
+		
+		//Calculate percentage increase/decrease and fix the image over given x,y coordinate
+		var curWidth=image.width, curHeight=image.height;
+		var position = self.getPosition();
+		
+		//The Maths
+		/*
+			New point/Old point = New image width/Old image width
+		=>	New point = New width/Old width * Old point
+			
+			Difference between new and old point 
+			= New point - Old point
+			= New width/Old width * Old point - Old point
+			= Old Point * (New width/Old width - 1)
+			
+			Moving the image by this difference brings the zoomed image to the same (pivot) point.
+			
+			The point (x,y) sent into this function is relative to the self.frameElement. However, it should be relative to the image for the above formula to work.
+			Hence, point = (x-left, y-top).
+		*/
+		position[0]-=((x-position[0])*((dimension[0]/curWidth)-1)), position[1]-=((y-position[1])*((dimension[1]/curHeight)-1)); //Applying the above formula
+		
+		
+		//Center image
+		position = self.centerImage(dimension[0],dimension[1], position[0],position[1]);
+		
+		//Set dimension and position
+		if(!self.maxZoomCheck(dimension[0],dimension[1])) {
+			zoomLevel = newZoomLevel;
+			self.setDimension(dimension[0],dimension[1]);
+			self.setPosition(position[0],position[1]);
+			self.setMouseCursor();
+		}
+		else
+			return false;
+		return true;
+	}
+	self.centerImage = function(width,height, x,y) { //width and height of image and (x,y) is the (left,top) of the image
+		if(typeof width=='undefined' || typeof height=='undefined') {
+			var temp = self.getDimension();
+			width=temp[0], height=temp[1];
+		}
+		if(typeof x=='undefined' || typeof y=='undefined') {
+			var temp = self.getPosition();
+			x=temp[0], y=temp[1];
+		}
+			
+		var frameDimension = self.getFrameDimension();
+		
+		if(width<=frameDimension[0])
+			x = Math.round((frameDimension[0] - width)/2);
+		if(height<=frameDimension[1])
+			y = Math.round((frameDimension[1] - height)/2);
+
+		if(width>frameDimension[0]) {
+			if(x>0)
+				x=0;
+			else
+			if((x+width)<frameDimension[0])
+				x=frameDimension[0]-width;
+		}
+
+		if(height>frameDimension[1]) {
+			if(y>0)
+				y=0;
+			else
+			if((y+height)<frameDimension[1])
+				y=frameDimension[1]-height;
+		}
+
+		return [x,y];
+	}
+	self.relativeToAbsolute = function(x,y) {
+		if(x<0 || y<0 || x>=self.frameElement.clientWidth || y>=self.frameElement.clientHeight)
+			return null;
+		return [x-retInt(image.style.left,'px'),y-retInt(image.style.top,'px')];
+	}
+	self.reset = function() {
+		var dimension = self.fitToFrame(orignalW,orignalH);
+		var position = self.centerImage(dimension[0],dimension[1], 0,0);
+		self.setDimension(dimension[0],dimension[1]);
+		self.setPosition(position[0],position[1]);
+		zoomLevel=0;
+	}
+	self.moveBy = function(x,y) {
+		var position = self.getPosition();
+		position = self.centerImage(image.width,image.height, position[0]+x,position[1]+y);
+		self.setPosition(position[0],position[1]);
+	}
+	self.hide = function() {
+		if(self.outerFrame)
+			self.outerFrame.style.display='none';
+		else
+			self.frameElement.style.display = 'none';
+	}
+	self.show = function() {
+		if(self.outerFrame)
+			self.outerFrame.style.display='block';
+		else
+			self.frameElement.style.display = 'block';
+	}
+	//Experimental
+	self.moveTo = function(x,y) { //Coordinates relative to (left,top) of image
+		if(x<0 || y<0 || x>=image.width || y>=image.height)
+			return;
+		var left = self.frameElement.clientWidth/2-x, top = self.frameElement.clientHeight/2-y;
+		var position = self.centerImage(image.width,image.height, left,top);
+		self.setPosition(position[0],position[1]);
+	}
+
+	/*User defined events*/
+	//Non-static events
+	self.onload = null;
+	
+	/*Event handlers*/
+	self.onmousewheel = function(event,object,direction) {
+		self.frameElement.focus();
+		if (!event) //For IE
+			event=window.event, event.returnValue = false;
+		else
+		if (event.preventDefault)
+			event.preventDefault();
+		
+		if((zoomLevel+direction)>=0) {
+			var mousePos = getMouseXY(event);
+			var framePos = getObjectXY(self.frameElement);
+			self.zoomTo(zoomLevel+direction, mousePos[0]-framePos[0], mousePos[1]-framePos[1]);
+		}
+	}
+	self.onmousemove = function(event) {
+		if (!event) //For IE
+			event=window.event, event.returnValue = false;
+		else
+		if (event.preventDefault)
+			event.preventDefault();
+		
+		var mousePosition=getMouseXY(event);
+		var position = self.getPosition();
+		position[0]+=(mousePosition[0]-lastMousePosition[0]), position[1]+=(mousePosition[1]-lastMousePosition[1]);
+		lastMousePosition=mousePosition;
+		
+		position = self.centerImage(image.width,image.height, position[0],position[1]);
+		self.setPosition(position[0],position[1]);
+	}
+	self.onmouseup_or_out = function(event) {
+		if (!event) //For IE
+			event=window.event, event.returnValue = false;
+		else
+		if (event.preventDefault)
+			event.preventDefault();
+		
+		image.onmousemove=image.onmouseup=image.onmouseout=null;
+		image.onmousedown=self.onmousedown;
+	}
+	self.onmousedown =  function(event) {
+		self.frameElement.focus();
+		if (!event) //For IE
+			event=window.event, event.returnValue = false;
+		else
+		if (event.preventDefault)
+			event.preventDefault();
+	
+		lastMousePosition=getMouseXY(event);
+		image.onmousemove = self.onmousemove;
+		image.onmouseup=image.onmouseout=self.onmouseup_or_out;
+	}
+	self.onkeypress = function(event) {
+		var keyCode;
+		if(window.event) // IE
+			event=window.event, keyCode = event.keyCode, event.returnValue = false;
+		else
+		if(event.which) // Netscape/Firefox/Opera
+			keyCode = event.which, event.preventDefault();
+		
+		keyCode = String.fromCharCode(keyCode);
+		
+		var position = self.getPosition();
+		var LEFT='a',UP='w',RIGHT='d',DOWN='s', CENTER_IMAGE='c', ZOOMIN='=', ZOOMOUT='-'; ///Keys a,w,d,s
+		if(keyCode==LEFT)
+			position[0]+=speed;
+		else if(keyCode==UP)
+			position[1]+=speed;
+		else if(keyCode==RIGHT)
+			position[0]-=speed;
+		else if(keyCode==DOWN)
+			position[1]-=speed;
+		else if(keyCode==CENTER_IMAGE || keyCode=='C')
+			self.reset();
+		else if(keyCode==ZOOMIN || keyCode=='+' || keyCode=='x' || keyCode=='X')
+			self.zoomTo(zoomLevel+1, self.frameElement.clientWidth/2, self.frameElement.clientHeight/2);
+		else if( (keyCode==ZOOMOUT || keyCode=='z' || keyCode=='Z') && zoomLevel>0)
+			self.zoomTo(zoomLevel-1, self.frameElement.clientWidth/2, self.frameElement.clientHeight/2);
+		
+		if(keyCode==LEFT || keyCode==UP || keyCode==RIGHT || keyCode==DOWN) {
+			position = self.centerImage(image.width,image.height, position[0],position[1]);
+			self.setPosition(position[0],position[1]);
+			speed+=2;
+		}
+	}
+	self.onkeyup = function(event) {
+		speed=5;
+	}
+	/*Initializaion*/
+	self.setZoomProp = function(newZoomFactor,newMaxZoom) {
+		if(newZoomFactor==null)
+			zoomFactor=10;
+		zoomFactor=1 + retInt(newZoomFactor,'%')/100;
+		
+		if(typeof newMaxZoom=='string')
+			maxZoom = retInt(newMaxZoom,'%')/100;
+		else if(typeof newMaxZoom=='object' && newMaxZoom!=null) {
+			maxZoom[0]=retInt(newMaxZoom[0],'px');
+			maxZoom[1]=retInt(newMaxZoom[1],'px');
+		}
+		else maxZoom='300%';
+	}
+	self.setFrameProp = function(newFrameProp) {
+		self.frameElement.style.width=newFrameProp[0];
+		self.frameElement.style.height=newFrameProp[1];
+	}
+	self.initImage = function() {
+		image.style.maxWidth=image.style.width=image.style.maxHeight=image.style.height=null;
+		orignalW=image.width;
+		orignalH=image.height;
+
+		var dimension=self.fitToFrame(orignalW, orignalH);
+		self.setDimension(dimension[0],dimension[1]);
+		
+		if(frame[2]==true)
+			self.frameElement.style.width=(Math.round(dimension[0])+ 'px');
+		if(frame[3]==true)
+			self.frameElement.style.height=(Math.round(dimension[1]) + 'px');
+		var pos = self.centerImage(dimension[0],dimension[1], 0,0);
+		self.setPosition(pos[0],pos[1]);
+		self.setMouseCursor();
+		
+		var fitImageWidthToFrame = true;
+		if (fitImageWidthToFrame) {
+			var firstZoom = 0;
+			var widthLimit = self.getFrameDimension()[0];
+			var dimW = dimension[0]		
+			for(var i=1; i<20;i++) {
+				firstZoom +=1
+				dimW *= zoomFactor
+				if (dimW >= widthLimit) i = 21;
+			}
+			self.zoomTo(firstZoom -1, 0, 0);
+		}
+
+		//Set mouse handlers
+		mouseWheelObject = new mouseWheel();
+		mouseWheelObject.init(image, self.onmousewheel);
+		image.onmousedown = self.onmousedown;
+		
+		//Set keyboard handlers
+		self.frameElement.onkeypress = self.onkeypress;
+		self.frameElement.onkeyup = self.onkeyup;
+		
+		if(viewer.onload!=null)
+			viewer.onload(self);
+		if(self.onload!=null)
+			self.onload();
+	}
+	self.preInitImage = function() { //Triggers after pre-Loader image has been loaded					
+		if(preLoader!=null) 
+		{
+			image.style.left=((self.frameElement.clientWidth-image.width)/2) + 'px';
+			image.style.top=((self.frameElement.clientHeight-image.height)/2) + 'px';
+		}
+		image.onload=self.initImage;
+		image.src=imageSource;
+	}				
+	self.setNewImage = function(newImageSource,newPreLoader) {
+		if(typeof newImageSource=='undefined')
+			return;
+		imageSource=newImageSource;
+		if(typeof newPreLoader!=='undefined')
+			preLoader=newPreLoader;
+		if(preLoader!=null) {
+			image.onload=self.preInitImage;
+			image.src=preLoader;
+			return;
+		}
+		image.onload=self.initImage;
+		image.src=imageSource;
+	}
+
+	
+	/*Set a base*/
+	self.setZoomProp(zoomFactor,maxZoom);
+	//Create self.frameElement - One time initialization
+	self.frameElement=document.createElement('div');
+	self.frameElement.style.width=frame[0];
+	self.frameElement.style.height=frame[1];
+	self.frameElement.style.border="0px solid #000";
+	self.frameElement.style.margin="0px";
+	self.frameElement.style.padding="0px";
+	self.frameElement.style.overflow="hidden";
+	self.frameElement.style.position="relative";
+	self.frameElement.style.zIndex=2;
+	self.frameElement.tabIndex=1;
+			
+	if(image!=null) {
+		if (parent != null) {
+			image.parentNode.removeChild(image);
+			parent.appendChild(self.frameElement);
+		}
+		else if (replace != null) {
+			image.parentNode.removeChild(image);
+			replace.parentNode.replaceChild(self.frameElement, replace);
+		}
+		else
+			image.parentNode.replaceChild(self.frameElement,image);
+		
+		image.style.margin=image.style.padding="0";
+		image.style.borderWidth="0px";
+		image.style.position='absolute';
+		image.style.zIndex=3;
+		self.frameElement.appendChild(image);
+		
+		if(imageSource!=null)
+			self.preInitImage();
+		else
+			self.initImage();
+	}
+	else {		
+		if(parent!=null)
+			parent.appendChild(self.frameElement);
+		else if(replace!=null)
+			replace.parentNode.replaceChild(self.frameElement,replace);
+			
+		image=document.createElement('img');
+		image.style.position='absolute';
+		image.style.zIndex=3;
+		self.frameElement.appendChild(image);
+		
+		self.setNewImage(imageSource);
+	}
+	//Experimental
+	if(borderClass!=null) { //Browser rendering of borders with padding have been a problem.
+		self.outerFrame = document.createElement('div');
+		self.outerFrame.className=borderClass;
+		self.frameElement.parentNode.replaceChild(self.outerFrame,self.frameElement);
+		self.outerFrame.appendChild(self.frameElement);
+	}
+}
+//Static events
+viewer.onload = null;
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/js/viewer/Simple_Viewer_beta_1.1-min.js
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/js/viewer/toolbar-ext.css
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/js/viewer/toolbar-ext.css	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/js/viewer/toolbar-ext.css	(revision 728)
@@ -0,0 +1,43 @@
+.toolbar {
+	display: inline-block;
+	position: absolute;
+	right: 3px;
+	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;
+	z-index: 5;
+}
+.toolbar hr {
+	border-top: 0px solid #fff;
+	border-left: 0px solid #fff;
+	border-right: 0px solid #fff;
+	border-bottom: 1px dotted #808080;
+	margin: 1px 0px 7px 0px;
+}
+.movement-controls {
+	position: absolute;
+	right: 3px;
+	bottom: 3px;
+	z-index: 4;
+	border: 0 solid #FFFFFF;
+}
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/js/viewer/toolbar-ext.css
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/txm-front-teioriflamms-xtz.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/txm-front-teioriflamms-xtz.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/txm-front-teioriflamms-xtz.xsl	(revision 728)
@@ -0,0 +1,225 @@
+<?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"
+  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+  exclude-result-prefixes="tei edate bfm me" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
+  
+
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille XSLT prÃ©pare les fichiers au format TEI Oriflamms
+      (tokÃ©nisÃ©s par mot) Ã  l'imppportation dans TXM avec le module XTZ
+      (Ã©tape 2 "front").
+    </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>2016, CNRS / ICAR (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+
+  <xsl:template match="*" mode="#all">
+    <xsl:copy>
+      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="#current"/>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="comment()|processing-instruction()|text()|@*">
+    <xsl:copy>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="comment()|processing-instruction()|@*" mode="expan letters-all 
+    letters-alignable characters-alignable">
+    <xsl:copy>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+
+  <xsl:variable name="filename">
+    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)-w\.xml$">
+      <xsl:matching-substring>
+        <xsl:value-of select="regex-group(2)"/>
+      </xsl:matching-substring>
+    </xsl:analyze-string>
+  </xsl:variable>
+  
+<xsl:template match="tei:teiCorpus">
+  <TEI xmlns="http://www.tei-c.org/ns/1.0">
+    <text>
+      <!-- on ajoute des attributs utiles pour la crÃ©ation de partitions et de sous-corpus -->
+      <xsl:apply-templates/>
+    </text>
+  </TEI>
+</xsl:template>
+
+
+<xsl:template match="tei:TEI[ancestor::tei:teiCorpus]">
+<xsl:apply-templates/>
+</xsl:template>
+  
+  <xsl:template match="tei:teiHeader">
+    <!--<xsl:copy-of select="."/>-->
+  </xsl:template>
+  
+  <xsl:template match="tei:text[not(ancestor::tei:teiCorpus)]">
+    <xsl:element name="text" namespace="http://www.tei-c.org/ns/1.0">
+      <!-- on ajoute des attributs utiles pour la crÃ©ation de partitions et de sous-corpus -->
+      <xsl:apply-templates select="@*"/>
+     <xsl:apply-templates/> 
+    </xsl:element>
+  </xsl:template>
+  
+  <xsl:template match="tei:text[ancestor::tei:teiCorpus]">
+    <div type="text" id="{$filename}-{count(preceding::tei:text) + 1}" xmlns="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*|node()"/>
+    </div>
+  </xsl:template>
+
+<xsl:template match="tei:w[not(tei:seg[@type='wp'])]">
+  <xsl:element name="w" namespace="http://www.tei-c.org/ns/1.0">
+    <xsl:apply-templates select="@*"/>
+    <xsl:attribute name="expan"><xsl:apply-templates mode="expan"/></xsl:attribute>
+    <xsl:attribute name="letters-all"><xsl:apply-templates mode="letters-all"/></xsl:attribute>
+    <xsl:attribute name="letters-alignable"><xsl:apply-templates mode="letters-alignable"/></xsl:attribute>
+    <xsl:attribute name="characters"><xsl:apply-templates mode="characters-alignable"/></xsl:attribute>
+    <xsl:attribute name="abbr-n">
+      <xsl:value-of select="count(descendant::tei:abbr)"/>
+    </xsl:attribute>
+    <xsl:attribute name="ref"><xsl:value-of select="concat($filename,', p. ',preceding::tei:pb[1]/@n,', col. ',preceding::tei:cb[1]/@n,', l. ',preceding::tei:lb[1]/@n)"/></xsl:attribute>
+    <xsl:apply-templates/>
+  </xsl:element>
+</xsl:template>
+  
+  <xsl:template match="tei:w[tei:seg[@type='wp']]">
+    <xsl:element name="w-lb" namespace="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="expan"><xsl:apply-templates mode="expan"/></xsl:attribute>
+      <xsl:attribute name="letters-all"><xsl:apply-templates mode="letters-all"/></xsl:attribute>
+      <xsl:attribute name="letters-alignable"><xsl:apply-templates mode="letters-alignable"/></xsl:attribute>
+      <xsl:attribute name="characters"><xsl:apply-templates mode="characters-alignable"/></xsl:attribute>
+      <xsl:attribute name="abbr-n">
+        <xsl:value-of select="count(descendant::tei:abbr)"/>
+      </xsl:attribute>
+      <xsl:attribute name="ref"><xsl:value-of select="concat($filename,', p. ',preceding::tei:pb[1]/@n,', col. ',preceding::tei:cb[1]/@n,', l. ',preceding::tei:lb[1]/@n)"/></xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+  
+  <xsl:template match="tei:seg[@type='wp']">
+    <xsl:element name="w" namespace="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="expan"><xsl:apply-templates mode="expan"/></xsl:attribute>
+      <xsl:attribute name="letters-all"><xsl:apply-templates mode="letters-all"/></xsl:attribute>
+      <xsl:attribute name="letters-alignable"><xsl:apply-templates mode="letters-alignable"/></xsl:attribute>
+      <xsl:attribute name="characters"><xsl:apply-templates mode="characters-alignable"/></xsl:attribute>
+      <xsl:attribute name="abbr-n">
+        <xsl:value-of select="count(descendant::tei:abbr)"/>
+      </xsl:attribute>
+      <xsl:attribute name="ref"><xsl:value-of select="concat($filename,', p. ',preceding::tei:pb[1]/@n,', col. ',preceding::tei:cb[1]/@n,', l. ',preceding::tei:lb[1]/@n)"/></xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+  
+  <xsl:template match="tei:pc[not(child::tei:reg or @ana='ori:align-no')]">
+    <xsl:element name="w" namespace="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="type">pc</xsl:attribute>
+      <xsl:attribute name="expan"><xsl:apply-templates/></xsl:attribute>
+      <xsl:attribute name="letters-all"/>
+      <xsl:attribute name="letters-alignable"/>
+      <xsl:attribute name="characters"><xsl:apply-templates mode="characters-alignable"/></xsl:attribute>
+      <xsl:attribute name="abbr-n">
+        <xsl:value-of select="0"/>
+      </xsl:attribute>
+      <xsl:attribute name="ref"><xsl:value-of select="concat($filename,', p. ',preceding::tei:pb[1]/@n,', col. ',preceding::tei:cb[1]/@n,', l. ',preceding::tei:lb[1]/@n)"/></xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+  
+  <xsl:template match="tei:pc[child::tei:reg or @ana='ori:align-no']">
+    <xsl:comment><xsl:copy-of select="."/></xsl:comment>
+  </xsl:template>
+
+  <xsl:template match="tei:choice[tei:abbr]">
+    <xsl:apply-templates select="tei:abbr"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:choice[tei:abbr]" mode="expan">
+    <xsl:apply-templates select="tei:expan" mode="#current"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:choice[tei:abbr]" mode="letters-all">
+    <xsl:apply-templates select="tei:expan" mode="#current"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:choice[tei:abbr]" mode="letters-alignable">
+    <xsl:apply-templates select="tei:expan" mode="#current"/>
+  </xsl:template>
+
+  <xsl:template match="tei:choice[tei:abbr]" mode="characters-alignable">
+    <xsl:apply-templates select="tei:abbr" mode="#current"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:choice[tei:orig]" mode="#all">
+    <xsl:apply-templates select="tei:orig" mode="#current"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:reg" mode="#all"></xsl:template>
+  
+  <xsl:template match="tei:orig" mode="#all">
+    <xsl:apply-templates mode="#current"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:ex" mode="expan">
+    <xsl:text>(</xsl:text>
+    <xsl:value-of select="."/>
+    <xsl:text>)</xsl:text>
+  </xsl:template>
+  
+  <xsl:template match="tei:ex" mode="letters-all">
+    <xsl:value-of select="."/>
+  </xsl:template>
+  
+  <xsl:template match="tei:ex" mode="letters-alignable"/>
+  
+  <xsl:template match="tei:ex" mode="characters-alignable">
+    <xsl:choose>
+      <xsl:when test="matches(.,'^(cum|com|con)$','i')">&#xA76F;</xsl:when>
+      <xsl:when test="matches(.,'^et$','i')">&#x204A;</xsl:when>
+      <xsl:when test="matches(.,'^est$','i')">&#x223B;</xsl:when>
+      <xsl:when test="matches(.,'^us$','i')">&#xA770;</xsl:when>
+      <xsl:otherwise/>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="tei:supplied"></xsl:template>
+  
+  
+
+
+<xsl:template match="tei:w//text()" mode="letters-alignable characters-alignable">
+  <xsl:analyze-string select="." regex="\p{{M}}">
+    <xsl:matching-substring/>
+    <xsl:non-matching-substring><xsl:value-of select="."/></xsl:non-matching-substring>
+  </xsl:analyze-string>
+</xsl:template>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/txm-front-teioriflamms-xtz.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-mss-dates-oriflammsxml.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-mss-dates-oriflammsxml.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-mss-dates-oriflammsxml.xsl	(revision 728)
@@ -0,0 +1,179 @@
+<?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"
+  xmlns:xi="http://www.w3.org/2001/XInclude" 
+  xmlns:svg="http://www.w3.org/2000/svg" 
+  xmlns:math="http://www.w3.org/1998/Math/MathML"
+  exclude-result-prefixes="tei edate xd txm xi svg math" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="no"/>
+  
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille permet de convertir les transcription des 
+      Chartes de Fontenay au format XML-TEI du projet Oriflamms.
+    </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 (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+  <!--<xsl:strip-space elements="*"/>-->
+  
+  <xsl:param name="baseMsSiglum">A</xsl:param>
+  
+  <xsl:variable name="baseMsPattern"><xsl:value-of select="concat('^#?',$baseMsSiglum,'| #?',$baseMsSiglum)"/></xsl:variable>
+  
+  <xsl:template match="*|comment()">
+    <!-- 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="processing-instruction()"/>
+
+  <!-- On supprime les attributs par dÃ©faut de la DTD TEI -->
+  
+  <xsl:template match="@*">
+    <xsl:choose>
+      <xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/>
+      <xsl:otherwise><xsl:copy/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<xsl:template match="@facs">
+  <xsl:attribute name="facs"><xsl:value-of select="replace(.,'\.tif$','.png','i')"/></xsl:attribute>
+</xsl:template>
+
+  <xsl:template match="tei:teiHeader">    
+      <xsl:copy>
+        <xsl:apply-templates select="@*"/>
+        <xsl:apply-templates/>
+      </xsl:copy>    
+  </xsl:template>
+    
+
+<xsl:template match="tei:revisionDesc">
+  <xsl:copy>
+  <xsl:apply-templates select="@*"/>
+    <change xmlns="http://www.tei-c.org/ns/1.0" when="2007-01-01" who="#DS">Publication du document original</change>
+    <!-- information rÃ©cupÃ©rÃ©e Ã  partir de /TEI/text[1]/front[1]/titlePage[1]/docDate[1] -->
+    <change xmlns="http://www.tei-c.org/ns/1.0" when="{format-date(current-date(),'[Y]-[M01]-[D01]')}" who="#auto">Conversion automatique au format XML-TEI-Oriflamms</change>
+  <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+  
+  <xsl:template match="tei:encodingDesc">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+      <xsl:if test="not(//tei:prefixDef[@ident='ori'])">
+        <listPrefixDef xmlns="http://www.tei-c.org/ns/1.0">
+          <prefixDef xmlns="http://www.tei-c.org/ns/1.0" ident="ori" 
+            matchPattern="([a-z]+)" 
+            replacementPattern="oriflamms-annotation-scheme.xml#$1">
+            <p>In the context of this project, private URIs with the prefix
+              "ori" point to <gi>interp</gi> elements in the project's
+              oriflamms-annotation-scheme.xml file.
+            </p>
+          </prefixDef>
+        </listPrefixDef>
+      </xsl:if>
+    </xsl:copy>
+  </xsl:template>
+
+<!-- On restructure le document pour avoir un TEI par charte -->
+  
+  <!-- TEI devient teiCorpus -->
+  
+  <xsl:template match="tei:TEI">
+    <xsl:element name="teiCorpus" xmlns="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+
+  <!-- on supprime l'Ã©lÃ©ment text de niveau 1 et travaille directement sur le niveau 2 (l'Ã©lÃ©ment group intermÃ©diaire disparait)-->
+  
+  <xsl:template match="tei:TEI/tei:text">
+    <xsl:apply-templates select="descendant::tei:text"/>
+  </xsl:template>
+
+  <xsl:template match="tei:text//tei:text">
+    
+    <TEI xmlns="http://www.tei-c.org/ns/1.0">
+      <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+        <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <title xmlns="http://www.tei-c.org/ns/1.0"><xsl:text>Acte original </xsl:text>
+              <xsl:value-of select="substring-after(preceding-sibling::comment()[contains(.,'acte original')][1],'acte original ')"/></title>
+            <author xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="descendant::tei:docAuthor"/></author>
+          </titleStmt>
+          <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the teiCorpus</p>
+          </publicationStmt>
+          <!-- les Ã©lÃ©ments listWit et listBibl sont placÃ©s dans sourceDesc -->
+          <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <xsl:copy-of select="descendant::tei:listWit"/>
+            <xsl:copy-of select="descendant::tei:listBibl[1]"></xsl:copy-of>
+          </sourceDesc>
+        </fileDesc>
+        <profileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <!-- docDate devient profileDesc/creation/date[@type='documentCreation'] -->
+          <creation xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates select="descendant::tei:docDate"/></creation>
+          <!-- argument devient profileDesc/abstract -->
+          <xsl:apply-templates select="descendant::tei:argument"/>
+        </profileDesc>
+      </teiHeader>
+      <text xmlns="http://www.tei-c.org/ns/1.0">
+          <xsl:apply-templates/>
+      </text>
+    </TEI>
+  </xsl:template>
+  
+  <!-- on supprime listWit du corps du texte (cf. l'entÃªte) -->
+  <xsl:template match="tei:listWit"/>
+
+<!-- on supprime les entÃªtes et pied de pages (non alignables) -->
+  
+  <xsl:template match="tei:fw">
+    <xsl:comment>fw : <xsl:copy-of select="."/></xsl:comment>
+  </xsl:template>
+
+  <!-- on ajoute un attribut pour faciliter l'identification des segments Ã  ne pas aligner -->
+  
+  <xsl:template match="tei:choice/tei:expan|tei:choice/tei:corr|tei:supplied|tei:note">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="ana">ori:align-no</xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+  
+
+<xsl:template match="text()[following-sibling::*[1][self::tei:milestone or self::tei:pb or self::tei:cb or self::tei:lb] and following-sibling::tei:lb[1][@break='no']]">
+  <xsl:choose>
+    <!-- patch d'espace blanc devant les sauts de ligne Ã  l'intÃ©rieur de mots -->
+    <xsl:when test="matches(.,'\s+$')"><xsl:value-of select="replace(.,'\s+$','')"/></xsl:when>
+    <xsl:otherwise><xsl:copy/></xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-mss-dates-oriflammsxml.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/txm-front-teioriflammsc-xtz.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/txm-front-teioriflammsc-xtz.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/txm-front-teioriflammsc-xtz.xsl	(revision 728)
@@ -0,0 +1,418 @@
+<?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"
+  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+  exclude-result-prefixes="tei edate bfm me" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
+  
+
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille XSLT prÃ©pare les fichiers au format TEI Oriflamms
+      (tokÃ©nisÃ©s par mot) Ã  l'imppportation dans TXM avec le module XTZ
+      (Ã©tape 2 "front").
+    </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>2016, CNRS / ICAR (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+
+  <xsl:template match="*" mode="#all">
+    <xsl:copy>
+      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="#current"/>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="comment()|processing-instruction()|text()|@*">
+    <xsl:copy>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="comment()|processing-instruction()|@*" mode="expan letters-all 
+    letters-alignable characters-alignable">
+    <xsl:copy>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+
+  <xsl:variable name="filename">
+    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.xml$">
+      <xsl:matching-substring>
+        <xsl:value-of select="replace(regex-group(2),'-c$','')"/>
+      </xsl:matching-substring>
+    </xsl:analyze-string>
+  </xsl:variable>
+  
+  <xsl:template match="tei:facsimile"/>
+  
+<xsl:template match="tei:teiCorpus">
+  <TEI xmlns="http://www.tei-c.org/ns/1.0">
+    <text>
+      <!-- on ajoute des attributs utiles pour la crÃ©ation de partitions et de sous-corpus -->
+      <xsl:apply-templates/>
+    </text>
+  </TEI>
+</xsl:template>
+
+
+<xsl:template match="tei:TEI[ancestor::tei:teiCorpus]">
+<xsl:apply-templates/>
+</xsl:template>
+  
+  <xsl:template match="tei:teiHeader">
+    <!--<xsl:copy-of select="."/>-->
+  </xsl:template>
+  
+  <xsl:template match="tei:text[not(ancestor::tei:teiCorpus)]">
+    <xsl:element name="text" namespace="http://www.tei-c.org/ns/1.0">
+      <!-- on ajoute des attributs utiles pour la crÃ©ation de partitions et de sous-corpus -->
+      <xsl:apply-templates select="@*"/>
+     <xsl:apply-templates/> 
+    </xsl:element>
+  </xsl:template>
+  
+  <xsl:template match="tei:text[ancestor::tei:teiCorpus]">
+    <div type="text" id="{$filename}-{count(preceding::tei:text) + 1}" xmlns="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*|node()"/>
+    </div>
+  </xsl:template>
+
+<xsl:template match="tei:milestone[@unit='surface']">
+  <pb xmlns="http://www.tei-c.org/ns/1.0" n="{following::tei:pb[1]/@n}" facs="{@facs}" xml:id="{@xml:id}"/>
+</xsl:template>
+  
+  <xsl:template match="tei:pb">
+    <milestone unit="ms-page">
+      <xsl:apply-templates select="@*"/>
+    </milestone>
+  </xsl:template>
+
+<xsl:template match="tei:w[not(tei:seg[@type='wp'])]">
+  <xsl:element name="w" namespace="http://www.tei-c.org/ns/1.0">
+    <xsl:apply-templates select="@*"/>
+    <xsl:attribute name="expan"><xsl:apply-templates mode="expan" select="descendant::tei:c"/></xsl:attribute>
+    <xsl:attribute name="letters-all"><xsl:apply-templates mode="letters-all" select="descendant::tei:c"/></xsl:attribute>
+    <xsl:attribute name="letters-alignable"><xsl:apply-templates mode="letters-alignable" select="descendant::tei:c"/></xsl:attribute>
+    <xsl:attribute name="characters"><xsl:apply-templates mode="characters-alignable" select="descendant::tei:c"/></xsl:attribute>
+    <xsl:attribute name="abbr-n">
+      <xsl:choose>
+        <xsl:when test="descendant::tei:abbr">
+          <xsl:value-of select="count(descendant::tei:abbr)"/>
+        </xsl:when>
+        <xsl:when test="descendant::tei:expan">
+          <xsl:value-of select="count(descendant::tei:expan)"/>
+        </xsl:when>
+        <xsl:when test="descendant::tei:ex">
+          <xsl:value-of select="count(descendant::tei:ex)"/>
+        </xsl:when>
+        <xsl:otherwise>0</xsl:otherwise>
+      </xsl:choose>
+    </xsl:attribute>
+    <xsl:attribute name="ref"><xsl:value-of select="concat($filename,', f. ',preceding::tei:pb[1]/@n,', col. ',preceding::tei:cb[1]/@n,', l. ',preceding::tei:lb[1]/@n)"/></xsl:attribute>
+    <xsl:apply-templates/>
+  </xsl:element>
+</xsl:template>
+  
+  <xsl:template match="tei:w[tei:seg[@type='wp']]">
+    <xsl:element name="w-lb" namespace="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="expan"><xsl:apply-templates mode="expan" select="descendant::tei:c"/></xsl:attribute>
+      <xsl:attribute name="letters-all"><xsl:apply-templates mode="letters-all" select="descendant::tei:c"/></xsl:attribute>
+      <xsl:attribute name="letters-alignable"><xsl:apply-templates mode="letters-alignable" select="descendant::tei:c"/></xsl:attribute>
+      <xsl:attribute name="characters"><xsl:apply-templates mode="characters-alignable" select="descendant::tei:c"/></xsl:attribute>
+      <xsl:attribute name="abbr-n">
+        <xsl:choose>
+          <xsl:when test="descendant::tei:abbr">
+            <xsl:value-of select="count(descendant::tei:abbr)"/>
+          </xsl:when>
+          <xsl:when test="descendant::tei:expan">
+            <xsl:value-of select="count(descendant::tei:expan)"/>
+          </xsl:when>
+          <xsl:when test="descendant::tei:ex">
+            <xsl:value-of select="count(descendant::tei:ex)"/>
+          </xsl:when>
+          <xsl:otherwise>0</xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>      <xsl:attribute name="ref"><xsl:value-of select="concat($filename,', f. ',preceding::tei:pb[1]/@n,', col. ',preceding::tei:cb[1]/@n,', l. ',preceding::tei:lb[1]/@n)"/></xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+  
+  <xsl:template match="tei:seg[@type='wp']">
+    <xsl:element name="w" namespace="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="expan"><xsl:apply-templates mode="expan" select="descendant::tei:c"/></xsl:attribute>
+      <xsl:attribute name="letters-all"><xsl:apply-templates mode="letters-all" select="descendant::tei:c"/></xsl:attribute>
+      <xsl:attribute name="letters-alignable"><xsl:apply-templates mode="letters-alignable" select="descendant::tei:c"/></xsl:attribute>
+      <xsl:attribute name="characters"><xsl:apply-templates mode="characters-alignable" select="descendant::tei:c"/></xsl:attribute>
+      <xsl:attribute name="abbr-n">
+        <xsl:choose>
+          <xsl:when test="descendant::tei:abbr">
+            <xsl:value-of select="count(descendant::tei:abbr)"/>
+          </xsl:when>
+          <xsl:when test="descendant::tei:expan">
+            <xsl:value-of select="count(descendant::tei:expan)"/>
+          </xsl:when>
+          <xsl:when test="descendant::tei:ex">
+            <xsl:value-of select="count(descendant::tei:ex)"/>
+          </xsl:when>
+          <xsl:otherwise>0</xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:attribute name="ref"><xsl:value-of select="concat($filename,', f. ',preceding::tei:pb[1]/@n,', col. ',preceding::tei:cb[1]/@n,', l. ',preceding::tei:lb[1]/@n)"/></xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+  
+  <xsl:template match="tei:pc[not(child::tei:reg or @ana='ori:align-no')]">
+    <xsl:element name="w" namespace="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="type">pc</xsl:attribute>
+      <xsl:attribute name="expan"><xsl:apply-templates/></xsl:attribute>
+      <xsl:attribute name="letters-all"/>
+      <xsl:attribute name="letters-alignable"/>
+      <xsl:attribute name="characters"><xsl:apply-templates mode="characters-alignable" select="descendant::tei:c"/></xsl:attribute>
+      <xsl:attribute name="abbr-n">
+        <xsl:value-of select="0"/>
+      </xsl:attribute>
+      <xsl:attribute name="ref"><xsl:value-of select="concat($filename,', f. ',preceding::tei:pb[1]/@n,', col. ',preceding::tei:cb[1]/@n,', l. ',preceding::tei:lb[1]/@n)"/></xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+  
+  <xsl:template match="tei:pc[child::tei:reg or @ana='ori:align-no']">
+    <xsl:comment><xsl:copy-of select="."/></xsl:comment>
+  </xsl:template>
+
+  <xsl:template match="tei:choice[tei:abbr]">
+    <xsl:apply-templates select="tei:abbr"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:choice[tei:abbr]" mode="expan">
+    <xsl:apply-templates select="tei:expan" mode="#current"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:choice[tei:abbr]" mode="letters-all">
+    <xsl:apply-templates select="tei:expan" mode="#current"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:choice[tei:abbr]" mode="letters-alignable">
+    <xsl:apply-templates select="tei:expan" mode="#current"/>
+  </xsl:template>
+
+  <xsl:template match="tei:choice[tei:abbr]" mode="characters-alignable">
+    <xsl:apply-templates select="tei:abbr" mode="#current"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:choice[tei:orig]" mode="#all">
+    <xsl:apply-templates select="tei:orig" mode="#current"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:reg" mode="#all"></xsl:template>
+  
+  <xsl:template match="tei:orig" mode="#all">
+    <xsl:apply-templates mode="#current"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:ex" mode="expan">
+    <xsl:text>(</xsl:text>
+    <xsl:value-of select="."/>
+    <xsl:text>)</xsl:text>
+  </xsl:template>
+  
+  <xsl:template match="tei:ex" mode="letters-all">
+    <xsl:value-of select="."/>
+  </xsl:template>
+  
+  <xsl:template match="tei:ex" mode="letters-alignable"/>
+  
+  <xsl:template match="tei:ex" mode="characters-alignable">
+    <xsl:choose>
+      <xsl:when test="matches(.,'^\s*(cum|com|con)\s*$','i')">&#xA76F;</xsl:when>
+      <xsl:when test="matches(.,'^\s*et\s*$','i')">&#x204A;</xsl:when>
+      <xsl:when test="matches(.,'^\sest\s*$','i')">&#x223B;</xsl:when>
+      <xsl:when test="matches(.,'^\s*us\s*$','i')">&#xA770;</xsl:when>
+      <xsl:otherwise/>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="tei:supplied"></xsl:template>
+  
+
+
+
+  <xsl:template match="tei:w//text()" mode="expan letters-all">
+    <xsl:choose>
+      <xsl:when test="ancestor::tei:c">
+        <xsl:value-of select="."></xsl:value-of>
+      </xsl:when>
+      <xsl:otherwise/>
+    </xsl:choose>
+  </xsl:template>
+
+
+<xsl:template match="tei:c">
+  <xsl:element name="c" namespace="http://www.tei-c.org/ns/1.0">
+    <xsl:apply-templates select="@*"/>
+    <xsl:attribute name="expan">
+      <xsl:apply-templates select="." mode="expan"/>
+    </xsl:attribute>
+    <xsl:attribute name="letters-all">
+      <xsl:apply-templates select="." mode="letters-all"/>
+    </xsl:attribute>
+    <xsl:attribute name="letters-alignable">
+      <xsl:apply-templates select="." mode="letters-alignable"></xsl:apply-templates>
+    </xsl:attribute>
+    <xsl:attribute name="characters">
+      <xsl:apply-templates mode="characters-alignable"/>
+    </xsl:attribute>
+    <xsl:attribute name="abbr-n">
+      <xsl:choose>
+        <xsl:when test="ancestor::tei:abbr and not(following-sibling::tei:c)">1</xsl:when>
+        <xsl:when test="ancestor::tei:expan and not(following-sibling::tei:c)">1</xsl:when>
+        <!--<xsl:when test="ancestor::tei:ex and not(following-sibling::tei:c)">1</xsl:when>-->
+        <xsl:otherwise>0</xsl:otherwise>
+      </xsl:choose>
+    </xsl:attribute>
+    <xsl:attribute name="ref"><xsl:value-of select="concat($filename,', f. ',preceding::tei:pb[1]/@n,', col. ',preceding::tei:cb[1]/@n,', l. ',preceding::tei:lb[1]/@n)"/></xsl:attribute>
+    <xsl:apply-templates/>
+  </xsl:element>
+</xsl:template>
+  
+  <xsl:template match="tei:c" mode="expan">
+    <xsl:if test="not(@type='am') and not(ancestor::tei:abbr[parent::tei:choice/tei:expan[not(tei:ex)]])">
+      <xsl:apply-templates mode="letters-alignable"/>
+    </xsl:if>
+    <xsl:choose>
+      <xsl:when test="not(following-sibling::tei:c) and ancestor::tei:abbr[parent::tei:choice/tei:expan/tei:ex]">
+        <xsl:text>(</xsl:text>
+        <xsl:value-of select="ancestor::tei:choice/tei:expan/tei:ex"/>
+        <xsl:text>)</xsl:text>
+      </xsl:when>
+      <xsl:when test="not(following-sibling::tei:c) and ancestor::tei:abbr[parent::tei:choice/tei:expan[not(tei:ex)]]">
+        <xsl:text>(</xsl:text>
+        <xsl:value-of select="ancestor::tei:choice/tei:expan"/>
+        <xsl:text>)</xsl:text>
+      </xsl:when>
+      <xsl:when test="not(following-sibling::tei:c) and following-sibling::*[1][self::tei:choice[tei:abbr[not(child::node())]]]">
+        <xsl:text>(</xsl:text>
+        <xsl:value-of select="following-sibling::tei:choice[1]//tei:ex"/>
+        <xsl:text>)</xsl:text>
+      </xsl:when>
+      <xsl:otherwise/>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="tei:c" mode="letters-all">
+    <xsl:if test="not(@type='am') and not(ancestor::tei:abbr[parent::tei:choice/tei:expan[not(tei:ex)]])">
+      <xsl:apply-templates mode="letters-alignable"/>
+    </xsl:if>
+    <xsl:choose>
+      <xsl:when test="not(following-sibling::tei:c) and ancestor::tei:abbr[parent::tei:choice/tei:expan/tei:ex]">
+        <xsl:value-of select="ancestor::tei:choice/tei:expan/tei:ex"/>
+      </xsl:when>
+      <xsl:when test="not(following-sibling::tei:c) and ancestor::tei:abbr[parent::tei:choice/tei:expan[not(tei:ex)]]">
+        <xsl:value-of select="ancestor::tei:choice/tei:expan"/>
+      </xsl:when>
+      <xsl:when test="not(following-sibling::tei:c) and following-sibling::*[1][self::tei:choice[tei:abbr[not(child::node())]]]">
+        <xsl:value-of select="following-sibling::tei:choice[1]//tei:ex"/>
+      </xsl:when>
+      <xsl:otherwise/>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="tei:c" mode="letters-alignable">
+    <xsl:choose>
+      <xsl:when test="@type='am' and not(ancestor::tei:abbr[parent::tei:choice/tei:expan[not(tei:ex)]])"/>
+      <xsl:otherwise><xsl:apply-templates mode="letters-alignable"/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="tei:c" mode="characters-alignable">
+    <xsl:apply-templates mode="characters-alignable"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:g[@type='am']" mode="letters-alignable letters-all"></xsl:template>
+  
+  <xsl:template match="tei:g[@type='am' and matches(.,'\p{M}')]" mode="characters-alignable"></xsl:template>
+
+
+<!--  <xsl:template match="tei:w//text()" mode="letters-alignable characters-alignable">
+    <xsl:choose>
+      <xsl:when test="ancestor::tei:c">
+        <xsl:analyze-string select="." regex="\p{{M}}">
+          <xsl:matching-substring/>
+          <xsl:non-matching-substring><xsl:value-of select="."/></xsl:non-matching-substring>
+        </xsl:analyze-string>      
+      </xsl:when>
+      <xsl:otherwise/>
+    </xsl:choose>
+  </xsl:template>
+-->
+
+  <xsl:template match="tei:w//text()" mode="characters-alignable">
+    <xsl:choose>
+      <xsl:when test="ancestor::tei:c">
+        <xsl:analyze-string select="." regex="\p{{M}}|\s">
+          <xsl:matching-substring/>
+          <xsl:non-matching-substring><xsl:value-of select="."/></xsl:non-matching-substring>
+        </xsl:analyze-string>        
+      </xsl:when>
+      <xsl:otherwise/>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="tei:w//text()" mode="letters-alignable">
+    <xsl:choose>
+      <xsl:when test="ancestor::tei:c">
+        <xsl:analyze-string select="." regex=".">
+          <xsl:matching-substring>
+            <xsl:choose>
+              <xsl:when test="matches(.,'\p{M}|\s')"></xsl:when>
+              <xsl:when test="matches(.,$alignable-abbreviation-marks)"/>
+              <xsl:when test="matches(.,$modified-letters)">
+                <xsl:call-template name="modified-letters"/>
+              </xsl:when>
+              <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
+            </xsl:choose>
+          </xsl:matching-substring>
+        </xsl:analyze-string>
+      </xsl:when>
+      <xsl:otherwise/>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:variable name="modified-letters">^(&#x0141;|&#x0142;|[&#xA748;-&#xA759;])$</xsl:variable>
+  <xsl:variable name="alignable-abbreviation-marks">^(&amp;|&#x204A;|&#x2079;|&#x223B;|&#xA76F;|&#xA770;|&#xF1A6;|&#xF1AC;)$</xsl:variable>
+  
+  <xsl:template name="modified-letters">
+    <xsl:choose>
+      <xsl:when test="matches(.,'&#x0141;|&#xA748;')">L</xsl:when>
+      <xsl:when test="matches(.,'&#x0142;|&#xA749;')">l</xsl:when>
+      <xsl:when test="matches(.,'&#xA750;|&#xA752;|&#xA754;')">P</xsl:when>
+      <xsl:when test="matches(.,'&#xA751;|&#xA753;|&#xA755;')">p</xsl:when>
+      <xsl:when test="matches(.,'&#xA756;|&#xA758;')">Q</xsl:when>
+      <xsl:when test="matches(.,'&#xA757;|&#xA759;')">q</xsl:when>
+      <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/txm-front-teioriflammsc-xtz.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-pontfraud-oriflammsxml.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-pontfraud-oriflammsxml.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-pontfraud-oriflammsxml.xsl	(revision 728)
@@ -0,0 +1,201 @@
+<?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"
+  xmlns:xi="http://www.w3.org/2001/XInclude" 
+  xmlns:svg="http://www.w3.org/2000/svg" 
+  xmlns:math="http://www.w3.org/1998/Math/MathML"
+  xmlns:functx="http://www.functx.com"
+  exclude-result-prefixes="#all" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="yes"/>
+  
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille permet de convertir l'Ã©dition Pontfraud
+      au format XML-TEI du projet Oriflamms.
+    </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 (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+  <xsl:strip-space elements="*"/>
+  
+  <xsl:param name="baseMsSiglum">A</xsl:param>
+  
+  <xsl:variable name="baseMsPattern"><xsl:value-of select="concat('^#?',$baseMsSiglum,'| #?',$baseMsSiglum)"/></xsl:variable>
+  
+  <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>
+
+  <!-- On supprime les attributs par dÃ©faut de la DTD TEI -->
+  
+  <xsl:template match="@*">
+    <xsl:choose>
+      <xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/>
+      <xsl:otherwise><xsl:copy/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="@facs">
+    <xsl:attribute name="facs">
+      <xsl:value-of select="replace(.,'\tif$','.png')"/>
+    </xsl:attribute>
+  </xsl:template>
+
+  <xsl:template match="tei:teiHeader">    
+      <xsl:copy>
+        <xsl:apply-templates select="@*"/>
+        <xsl:apply-templates/>
+      </xsl:copy>    
+  </xsl:template>
+    
+
+<xsl:template match="tei:revisionDesc">
+  <xsl:copy>
+  <xsl:apply-templates select="@*"/>
+    <change xmlns="http://www.tei-c.org/ns/1.0" when="2007-01-01" who="#DS">Publication du document original</change>
+    <!-- information rÃ©cupÃ©rÃ©e Ã  partir de /TEI/text[1]/front[1]/titlePage[1]/docDate[1] -->
+    <change xmlns="http://www.tei-c.org/ns/1.0" when="{format-date(current-date(),'[Y]-[M01]-[D01]')}" who="#auto">Conversion automatique au format XML-TEI-Oriflamms</change>
+  <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+  
+  <xsl:template match="tei:encodingDesc">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+      <xsl:if test="not(//tei:prefixDef[@ident='ori'])">
+        <listPrefixDef xmlns="http://www.tei-c.org/ns/1.0">
+          <prefixDef xmlns="http://www.tei-c.org/ns/1.0" ident="ori" 
+            matchPattern="([a-z]+)" 
+            replacementPattern="oriflamms-annotation-scheme.xml#$1">
+            <p>In the context of this project, private URIs with the prefix
+              "ori" point to <gi>interp</gi> elements in the project's
+              oriflamms-annotation-scheme.xml file.
+            </p>
+          </prefixDef>
+        </listPrefixDef>
+      </xsl:if>
+    </xsl:copy>
+  </xsl:template>
+
+<!-- On restructure le document pour avoir un TEI par charte -->
+  
+  <!-- TEI devient teiCorpus -->
+  
+  <xsl:template match="tei:TEI">
+    <xsl:element name="teiCorpus" xmlns="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+
+  <!-- on supprime l'Ã©lÃ©ment text de niveau 1 et travaille directement sur le niveau 2 (l'Ã©lÃ©ment group intermÃ©diaire disparait)-->
+  
+  <xsl:template match="tei:TEI/tei:text">
+    <xsl:apply-templates select="descendant::tei:text"/>
+  </xsl:template>
+
+  <xsl:template match="tei:text//tei:text">
+    
+    <TEI xmlns="http://www.tei-c.org/ns/1.0">
+      <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+        <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <title xmlns="http://www.tei-c.org/ns/1.0"><xsl:text>Acte original </xsl:text>
+              <xsl:value-of select="substring-after(preceding-sibling::comment()[contains(.,'acte original')][1],'acte original ')"/></title>
+            <author xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="descendant::tei:docAuthor"/></author>
+          </titleStmt>
+          <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the teiCorpus</p>
+          </publicationStmt>
+          <!-- les Ã©lÃ©ments listWit et listBibl sont placÃ©s dans sourceDesc -->
+          <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <xsl:copy-of select="descendant::tei:listWit"/>
+            <xsl:copy-of select="descendant::tei:listBibl[1]"></xsl:copy-of>
+          </sourceDesc>
+        </fileDesc>
+        <profileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <!-- docDate devient profileDesc/creation/date[@type='documentCreation'] -->
+          <creation xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates select="descendant::tei:docDate"/></creation>
+          <!-- argument devient profileDesc/abstract -->
+          <xsl:apply-templates select="descendant::tei:argument"/>
+        </profileDesc>
+      </teiHeader>
+      <text xmlns="http://www.tei-c.org/ns/1.0">
+        <body xmlns="http://www.tei-c.org/ns/1.0">
+          <xsl:apply-templates select="descendant::tei:div1"/>
+        </body>
+      </text>
+    </TEI>
+  </xsl:template>
+  
+  <xsl:template match="tei:docDate[ancestor::tei:group]">
+    <date type="documentCreation" xmlns="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+    </date>
+  </xsl:template>
+  
+  <xsl:template match="tei:argument">
+    <abstract xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates/></abstract>
+  </xsl:template>
+
+
+  <xsl:template match="tei:div1[@type='translation']|tei:note">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="ana">ori:align-no</xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+
+
+  <!-- on ajoute un attribut pour faciliter l'identification des segments Ã  ne pas aligner -->
+  
+  <xsl:template match="tei:choice/tei:expan|tei:choice/tei:corr">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="ana">ori:align-no</xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="tei:rdg[not(matches(@wit,$baseMsPattern))]">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="ana">ori:align-no</xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+
+<xsl:template match="text()[following-sibling::*[1][self::tei:milestone or self::tei:pb or self::tei:cb or self::tei:lb] and following-sibling::tei:lb[1][@break]]">
+  <xsl:choose>
+    <!-- patch d'espace blanc devant les sauts de ligne Ã  l'intÃ©rieur de mots -->
+    <xsl:when test="matches(.,'\s+$')"><xsl:value-of select="replace(.,'\s+$','')"/></xsl:when>
+    <xsl:otherwise><xsl:copy/></xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-pontfraud-oriflammsxml.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-tokenize-words-1-tag.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-tokenize-words-1-tag.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-tokenize-words-1-tag.xsl	(revision 728)
@@ -0,0 +1,126 @@
+<?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 xd txm" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="no"/>
+  
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille XSLT permet de prÃ©-tokeniser par mot des fichiers au format
+      XML-TEI Oriflamms brut
+    </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 (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+<!--  <xsl:template match="/">
+    <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()|processing-instruction()|text()">
+    <xsl:copy/>
+  </xsl:template>
+
+  <!-- On supprime les attributs par dÃ©faut de la DTD TEI -->
+  
+  <xsl:template match="@*">
+    <xsl:choose>
+      <xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/>
+      <xsl:otherwise><xsl:copy/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<!--  <xsl:template match="tei:teiHeader">    
+      <xsl:copy-of select="."/>    
+  </xsl:template>
+-->
+  <xsl:template match="tei:text/tei:body/tei:div1[@type='original']//tei:p//text()">
+  <xsl:choose>
+    <!--<xsl:when test="not(ancestor::tei:text/tei:body/tei:div1/tei:p)"><xsl:copy/></xsl:when>-->
+    <xsl:when test="matches(.,'^\s*$')"><xsl:copy/></xsl:when>
+    <xsl:when test="matches(local-name(parent::*),'^(abbr|expan|sic|corr)$')"><xsl:copy/></xsl:when>
+    <xsl:when test="matches(ancestor::*/@*,'ori:align-no')"><xsl:copy/></xsl:when>
+    <xsl:when test="ancestor::tei:note"><xsl:copy/></xsl:when>
+    <xsl:when test="parent::tei:hi and matches(.,'\w+') and not(matches(.,'\s'))"><xsl:copy/></xsl:when>
+    <xsl:when test="parent::tei:am"><xsl:copy/></xsl:when>
+    <xsl:when test="parent::tei:rdg[not(matches(@wit,'^#?A'))]"><xsl:copy/></xsl:when>
+    <xsl:when test="ancestor::tei:pc"><xsl:copy/></xsl:when>
+    <xsl:otherwise>
+      <xsl:analyze-string select="." regex="\w+|\p{{P}}+|\s+">
+        <xsl:matching-substring>
+          <xsl:choose>
+            <xsl:when test="matches(.,'^\w+$')"><w xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="."/></w></xsl:when>
+<!--            <xsl:when test="matches(.,'^\p{P}+$')"><orig xmlns="http://www.tei-c.org/ns/1.0"><pc xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="."/></pc></orig></xsl:when>-->
+            <xsl:when test="matches(.,'^\p{P}+$')"><pc xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="."/></pc></xsl:when>
+            <xsl:otherwise><xsl:copy/></xsl:otherwise>
+          </xsl:choose>
+        </xsl:matching-substring>
+        <xsl:non-matching-substring>
+          <xsl:comment>Type de caractÃ¨re non reconnu</xsl:comment><xsl:copy/>
+        </xsl:non-matching-substring>
+      </xsl:analyze-string>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="tei:choice">
+  <xsl:choose>
+    <xsl:when test="descendant::tei:pc">
+      <pc xmlns="http://www.tei-c.org/ns/1.0">
+        <xsl:apply-templates select="descendant::tei:pc[1]/@*"/>
+        <xsl:copy>
+          <xsl:apply-templates/>
+        </xsl:copy>
+      </pc>
+    </xsl:when>
+    <xsl:otherwise><w xmlns="http://www.tei-c.org/ns/1.0"><xsl:copy-of select="."/></w></xsl:otherwise>
+  </xsl:choose>  
+</xsl:template>
+  
+<!--  <xsl:template match="tei:pc[ancestor::tei:choice]">
+    <xsl:apply-templates/>
+  </xsl:template>
+-->
+  
+  <xsl:template match="tei:choice/tei:orig[child::tei:pc]|tei:choice/tei:reg[child::tei:pc]">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:value-of select="normalize-space(.)"/>
+    </xsl:copy>
+  </xsl:template>
+  
+<xsl:template match="tei:hi[matches(.,'\w+') and not(matches(.,'\s'))]|tei:am">
+  <w xmlns="http://www.tei-c.org/ns/1.0"><xsl:copy-of select="."/></w>
+</xsl:template>
+
+
+
+  <xsl:template match="tei:sic[not(parent::tei:choice)]|tei:corr[not(parent::tei:choice)]">
+  <w xmlns="http://www.tei-c.org/ns/1.0"><xsl:copy-of select="."/></w>
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-tokenize-words-1-tag.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/1-default-html.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/1-default-html.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/1-default-html.xsl	(revision 728)
@@ -0,0 +1,395 @@
+<?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"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                exclude-result-prefixes="#all" version="2.0">
+                
+	<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: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: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:matching-substring>
+				<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/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>
+		<xsl:if test="$word-element='w'">
+			<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/>
+				<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:if>
+		<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/>
+		</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: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="@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>
+				</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>
+				</xsl:when>
+				<xsl:otherwise>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:if>-->
+		<xsl:if test="@n"><span class="verseline"><span class="verselinenumber"><xsl:value-of select="@n"/></span></span></xsl:if>
+	</xsl:template>
+	
+	<!-- 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:when>
+				<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>
+				<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:choose>
+		</xsl:variable>
+		
+		
+		<xsl:variable name="editionpagetype">
+			<xsl:choose>
+				<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: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: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()=$pagination-element][1][count(preceding::*[local-name()=$pagination-element]) = $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>
+		<a class="txm-page" title="{count(preceding::*[local-name()=$pagination-element]) + $page-number-adjust}" next-word-id="{$next-word-id}"/>
+		<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: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:text> </xsl:text>
+						</xsl:if>
+					</xsl:for-each>
+				</xsl:when>
+				<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"/>                                
+	</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:if test="@id">
+                					<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>
+                				<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:for-each>
+                					</xsl:when>
+                					<xsl:otherwise>
+                						<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>                                		
+                			</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:template match="//tei:c[descendant::txm:form]">
+		<span class="c">
+			<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:if>
+				<xsl:choose>
+					<xsl:when test="descendant::txm:ana">	
+						<xsl:for-each select="descendant::txm:ana">
+							<xsl:if test="matches(@type,'expan|characters|letters-all|letters-alignable|abbr-n')">
+								<xsl:value-of select="concat(' ',substring-after(@type,'#'),' : ',.)"/>
+							</xsl:if>							
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:otherwise>
+						<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>                                		
+			</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: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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/1-default-html.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-actesroyaux-oriflammsxml.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-actesroyaux-oriflammsxml.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-actesroyaux-oriflammsxml.xsl	(revision 728)
@@ -0,0 +1,286 @@
+<?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"
+  xmlns:xi="http://www.w3.org/2001/XInclude" 
+  xmlns:svg="http://www.w3.org/2000/svg" 
+  xmlns:math="http://www.w3.org/1998/Math/MathML"
+  exclude-result-prefixes="tei edate xd txm xi svg math" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="no"/>
+  
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille permet de convertir les transcription des 
+      Chartes de Fontenay au format XML-TEI du projet Oriflamms.
+    </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 (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+  <!--<xsl:strip-space elements="*"/>-->
+  
+  <xsl:param name="baseMsSiglum">A</xsl:param>
+  
+  <xsl:variable name="baseMsPattern"><xsl:value-of select="concat('^#?',$baseMsSiglum,'| #?',$baseMsSiglum)"/></xsl:variable>
+  
+  <xsl:template match="*|comment()">
+    <!-- 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="processing-instruction()"/>
+
+  <!-- On supprime les attributs par dÃ©faut de la DTD TEI -->
+  
+  <xsl:template match="@*">
+    <xsl:choose>
+      <xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/>
+      <xsl:otherwise><xsl:copy/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<xsl:template match="@facs">
+  <xsl:attribute name="facs"><xsl:value-of select="replace(.,'\.tif$','.png','i')"/></xsl:attribute>
+</xsl:template>
+
+  <xsl:template match="tei:teiHeader">    
+      <xsl:copy>
+        <xsl:apply-templates select="@*"/>
+        <xsl:apply-templates/>
+      </xsl:copy>    
+  </xsl:template>
+    
+
+<xsl:template match="tei:revisionDesc">
+  <xsl:copy>
+  <xsl:apply-templates select="@*"/>
+    <change xmlns="http://www.tei-c.org/ns/1.0" when="2007-01-01" who="#DS">Publication du document original</change>
+    <!-- information rÃ©cupÃ©rÃ©e Ã  partir de /TEI/text[1]/front[1]/titlePage[1]/docDate[1] -->
+    <change xmlns="http://www.tei-c.org/ns/1.0" when="{format-date(current-date(),'[Y]-[M01]-[D01]')}" who="#auto">Conversion automatique au format XML-TEI-Oriflamms</change>
+  <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+  
+  <xsl:template match="tei:encodingDesc">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+      <xsl:if test="not(//tei:prefixDef[@ident='ori'])">
+        <listPrefixDef xmlns="http://www.tei-c.org/ns/1.0">
+          <prefixDef xmlns="http://www.tei-c.org/ns/1.0" ident="ori" 
+            matchPattern="([a-z]+)" 
+            replacementPattern="oriflamms-annotation-scheme.xml#$1">
+            <p>In the context of this project, private URIs with the prefix
+              "ori" point to <gi>interp</gi> elements in the project's
+              oriflamms-annotation-scheme.xml file.
+            </p>
+          </prefixDef>
+        </listPrefixDef>
+      </xsl:if>
+    </xsl:copy>
+  </xsl:template>
+
+<!-- On restructure le document pour avoir un TEI par charte -->
+  
+  <!-- TEI devient teiCorpus -->
+  
+  <xsl:template match="tei:TEI">
+    <xsl:element name="teiCorpus" xmlns="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+
+  <!-- on supprime l'Ã©lÃ©ment text de niveau 1 et travaille directement sur le niveau 2 (l'Ã©lÃ©ment group intermÃ©diaire disparait)-->
+  
+<!--  <xsl:template match="tei:TEI/tei:text">
+    <xsl:apply-templates select="descendant::tei:text"/>
+  </xsl:template>-->
+
+ 
+  <xsl:template match="tei:text[descendant::tei:text]">
+    
+    <teiCorpus xmlns="http://www.tei-c.org/ns/1.0">
+      <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+        <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <title xmlns="http://www.tei-c.org/ns/1.0">
+              <xsl:value-of select="tei:group[1]/tei:head[1]"/>
+            </title>            
+          </titleStmt>
+          <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+          </publicationStmt>
+          <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+          </sourceDesc>
+        </fileDesc>
+        <profileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <!-- argument devient profileDesc/abstract -->
+          <xsl:apply-templates select="descendant::tei:argument[1]"/>
+        </profileDesc>        
+      </teiHeader>
+      <xsl:apply-templates/>
+    </teiCorpus>
+  </xsl:template>
+  
+  <xsl:template match="tei:text[descendant::tei:text]/tei:front">
+    <xsl:choose>
+      <xsl:when test="descendant::tei:div">
+        <TEI xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no">
+          <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+            <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+              <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+                <title xmlns="http://www.tei-c.org/ns/1.0">
+                  <xsl:text>Introduction</xsl:text>
+                </title>
+              </titleStmt>
+              <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+                <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+              </publicationStmt>
+              <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+                <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+              </sourceDesc>
+            </fileDesc>
+          </teiHeader>
+          <text xmlns="http://www.tei-c.org/ns/1.0">
+            <body xmlns="http://www.tei-c.org/ns/1.0">
+              <xsl:apply-templates select="descendant::tei:div"/>
+            </body>
+            
+          </text>
+        </TEI>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:comment><xsl:copy-of select="."/></xsl:comment>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="tei:text//tei:text[not(descendant::tei:text)]">
+    
+    <TEI xmlns="http://www.tei-c.org/ns/1.0">
+      <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+        <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <title xmlns="http://www.tei-c.org/ns/1.0">
+              <xsl:text>Acte </xsl:text>
+              <xsl:value-of select="descendant::tei:head[1]"></xsl:value-of>
+            </title>            
+          </titleStmt>
+          <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+          </publicationStmt>
+          <!-- les Ã©lÃ©ments listWit et listBibl sont placÃ©s dans sourceDesc -->
+          <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <xsl:copy-of select="descendant::tei:listWit"/>
+            <xsl:copy-of select="descendant::tei:listBibl[1]"></xsl:copy-of>
+          </sourceDesc>
+        </fileDesc>
+        <profileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <!-- docDate devient profileDesc/creation/date[@type='documentCreation'] -->
+          <creation xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates select="descendant::tei:docDate/tei:date"/></creation>
+          <!-- argument devient profileDesc/abstract -->
+          <abstract xmlns="http://www.tei-c.org/ns/1.0">
+            <xsl:apply-templates select="descendant::tei:argument/node()"/>
+          </abstract>
+          <textClass xmlns="http://www.tei-c.org/ns/1.0">
+            <keywords xmlns="http://www.tei-c.org/ns/1.0">
+              <xsl:copy-of select="descendant::tei:term"></xsl:copy-of>
+            </keywords>
+          </textClass>
+        </profileDesc>
+      </teiHeader>
+      <text xmlns="http://www.tei-c.org/ns/1.0">
+        <xsl:if test="preceding-sibling::*[1][self::tei:milestone]">
+          <xsl:copy-of select="preceding-sibling::tei:milestone[1]"></xsl:copy-of>
+        </xsl:if>
+        <xsl:apply-templates/>
+      </text>
+    </TEI>
+  </xsl:template>
+  
+  <xsl:template match="tei:text[not(descendant::tei:text)]/tei:front">
+  </xsl:template>
+
+<xsl:template match="tei:argument"/>
+  
+
+
+<xsl:template match="tei:group">
+  <xsl:apply-templates/>
+</xsl:template>
+  
+  <xsl:template match="tei:milestone">
+    <xsl:choose>
+      <xsl:when test="parent::tei:group"/>
+      <xsl:otherwise>
+        <xsl:copy-of select="."/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<xsl:template match="tei:group/tei:head"/>
+
+  <!-- on supprime listWit du corps du texte (cf. l'entÃªte) -->
+  <xsl:template match="tei:listWit"/>
+
+<!-- on supprime les entÃªtes et pied de pages (non alignables) -->
+  
+  <xsl:template match="tei:fw">
+    <xsl:comment>fw : <xsl:copy-of select="."/></xsl:comment>
+  </xsl:template>
+
+  <!-- on ajoute un attribut pour faciliter l'identification des segments Ã  ne pas aligner -->
+  
+  <xsl:template match="tei:choice/tei:expan|tei:choice/tei:corr|tei:supplied|tei:note">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="ana">ori:align-no</xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="tei:pb">
+    <xsl:variable name="facs">
+      <xsl:value-of select="@facs"/>
+    </xsl:variable>
+    <xsl:if test="//tei:zone[@xml:id=substring-after($facs,'#')] and not(preceding::tei:pb[@facs=$facs])">
+      <milestone xmlns="http://www.tei-c.org/ns/1.0" unit="surface">
+        <xsl:attribute name="facs">
+          <xsl:value-of select="//tei:surface[tei:zone[@xml:id=substring-after($facs,'#')]][1]/tei:graphic/@url"/>
+        </xsl:attribute>
+      </milestone>
+    </xsl:if>
+    <xsl:copy-of select="."/>
+  </xsl:template>
+  
+
+<xsl:template match="text()[following-sibling::*[1][self::tei:milestone or self::tei:pb or self::tei:cb or self::tei:lb] and following-sibling::tei:lb[1][@break='no']]">
+  <xsl:choose>
+    <!-- patch d'espace blanc devant les sauts de ligne Ã  l'intÃ©rieur de mots -->
+    <xsl:when test="matches(.,'\s+$')"><xsl:value-of select="replace(.,'\s+$','')"/></xsl:when>
+    <xsl:otherwise><xsl:copy/></xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-actesroyaux-oriflammsxml.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-tokenize-chars-1-tag.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-tokenize-chars-1-tag.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-tokenize-chars-1-tag.xsl	(revision 728)
@@ -0,0 +1,479 @@
+<?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 xd txm" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="no"/>
+  
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille permet de tokÃ©niser un document TEI-Oriflamms au
+      niveau de caractÃ¨re.
+    </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 (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+  <!--<xsl:param name="spacing-am">&#xA76F;|&#x204A;|&#xF158;|&#x223B;|&#x035B;|&#xF1C8;|&#x1DD1;|&#xF153;|&#xA770;</xsl:param>-->
+  <!-- on utilise la classe unicode 'combibning mark' \p{M} pour repÃ©rer les diacritiques -->
+  
+  
+<!--  <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: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:variable name="filenameresult">
+    <xsl:value-of select="replace($filename,'(-ori)?-w$','')"/>
+  </xsl:variable>
+  
+  
+  <xsl:variable name="path">
+    <xsl:value-of select="concat($filedir,'/',$filenameresult,'-w/?select=*.xml;recurse=yes;on-error=warning')"/>
+  </xsl:variable>
+  
+  <xsl:variable name="files" select="collection($path)"/>
+  -->
+  
+<!--  <xsl:template match="/">
+    <root>Processing files from <xsl:value-of select="$filedir/$filenameresult"/>-w directory. Result files saved in <xsl:value-of select="$filedir/$filenameresult"/>-c-temp directory.</root>
+    <xsl:for-each select="$files">
+      <xsl:variable name="filename2">
+        <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)$">
+          <xsl:matching-substring>
+            <xsl:value-of select="regex-group(2)"></xsl:value-of>
+          </xsl:matching-substring>
+        </xsl:analyze-string></xsl:variable>
+      <xsl:result-document href="{$filedir}/{$filenameresult}-c-temp/{$filename2}">
+        <xsl:apply-templates/>
+      </xsl:result-document>
+    </xsl:for-each>
+  </xsl:template>
+-->  
+
+<xsl:param name="exclude-no-alignable">no</xsl:param>
+
+
+  <xsl:template match="*">
+        <xsl:copy>
+          <xsl:apply-templates select="@*"/>
+          <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
+        </xsl:copy>
+  </xsl:template>
+
+  <xsl:template match="@*|comment()|processing-instruction()|text()">
+    <xsl:copy/>
+  </xsl:template>
+  
+  <xsl:param name="editorialDeclPatch" as="element()">
+    <p xmlns="http://www.tei-c.org/ns/1.0">Fichier tokÃ©nisÃ© au niveau des caractÃ¨res dans le cadre du projet ANR Oriflamms, http://oriflamms.hypotheses.org</p>
+  </xsl:param>
+  
+  <!-- Ob ajoute les infos sur le traitement du fichier dans teiHeader -->
+  
+  <xsl:template match="tei:teiHeader">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:choose>
+        <xsl:when test="child::tei:encodingDesc">
+          <xsl:apply-templates/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="tei:fileDesc|tei:profileDesc"/>
+          <encodingDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <editorialDecl xmlns="http://www.tei-c.org/ns/1.0">
+              <xsl:copy-of select="$editorialDeclPatch"></xsl:copy-of>
+            </editorialDecl>
+          </encodingDesc>
+          <xsl:apply-templates select="tei:revisionDesc"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="tei:encodingDesc">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:choose>
+        <xsl:when test="child::tei:editorialDecl">
+          <xsl:apply-templates/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates/>
+            <editorialDecl xmlns="http://www.tei-c.org/ns/1.0">
+              <xsl:copy-of select="$editorialDeclPatch"></xsl:copy-of>
+            </editorialDecl>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="tei:editorialDecl">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+      <xsl:copy-of select="$editorialDeclPatch"></xsl:copy-of>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="tei:supplied">
+    <gap reason="supplied" xmlns="http://www.tei-c.org/ns/1.0"><xsl:comment><xsl:copy-of select="."></xsl:copy-of></xsl:comment></gap>
+  </xsl:template>
+
+<xsl:template match="tei:w|tei:pc|tei:seg[@type='wp']|tei:seg[@type='deleted']">
+  <xsl:copy>
+    <xsl:apply-templates select="@*"/>
+    <xsl:for-each select="child::node()">
+      <xsl:choose>
+        <xsl:when test="self::tei:choice and $exclude-no-alignable='yes'">
+          <xsl:apply-templates select="tei:abbr|tei:orig|tei:sic"/>
+        </xsl:when>
+        <xsl:when test="self::text()">
+          <xsl:if test="matches(.,'\S') and not(ancestor::*[@ana='ori:align-no'])"><xsl:call-template name="tokenise-chars"/></xsl:if>
+        </xsl:when>
+        <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+  </xsl:copy>
+</xsl:template>
+
+  <xsl:template match="tei:orig|tei:sic">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:choose>
+        <xsl:when test="ancestor::tei:w|ancestor::tei:pc">
+          <xsl:for-each select="child::node()">
+            <xsl:choose>
+              <xsl:when test="self::text() and not(ancestor::*[@ana='ori:align-no'])">
+                <xsl:if test="matches(.,'\S')"><xsl:call-template name="tokenise-chars"/></xsl:if>
+              </xsl:when>
+              <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </xsl:when>
+        <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
+      </xsl:choose>
+    </xsl:copy>
+  </xsl:template>
+  
+
+  <xsl:template match="tei:abbr">
+    <xsl:choose>
+      <xsl:when test="matches(.,'\P{M}')">
+        <xsl:copy>
+          <xsl:apply-templates select="@*"/>
+          <xsl:choose>
+            <xsl:when test="ancestor::tei:w">
+              <xsl:for-each select="child::node()">
+                <xsl:choose>
+                  <xsl:when test="self::text()">
+                    <xsl:if test="matches(.,'\S') and not(ancestor::*[@ana='ori:align-no'])"><xsl:call-template name="tokenise-chars"/></xsl:if>
+                  </xsl:when>
+                  <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
+                </xsl:choose>
+              </xsl:for-each>
+            </xsl:when>
+            <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
+          </xsl:choose>
+        </xsl:copy>        
+      </xsl:when>
+      <xsl:otherwise><!-- on supprime les abrÃ©viations consistant uniquement de caractÃ¨res modifieurs --></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  
+  <xsl:template match="tei:g">
+    <xsl:choose>
+      <xsl:when test="ancestor::*[@ana='ori:align-no']">
+        <xsl:copy-of select="."/>
+      </xsl:when>
+      <xsl:otherwise>
+        <c xmlns="http://www.tei-c.org/ns/1.0">
+          <xsl:if test="matches(@type,'initiale?|lettrine')">
+            <xsl:attribute name="type">initiale</xsl:attribute>
+          </xsl:if>
+          <xsl:copy-of select="."/>
+        </c>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="tei:c">
+    <xsl:choose>
+      <xsl:when test="ancestor::*[@ana='ori:align-no'] or ancestor::tei:expan[parent::tei:choice]">
+        <xsl:copy-of select="child::node()"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:copy-of select="."></xsl:copy-of>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="tei:am">
+    <xsl:choose>
+      <xsl:when test="matches(.,'\P{M}')">
+        <!-- \p{M} est la classe unicode de caractÃ¨res combinants => \P{M} = tout sauf combinant -->
+        <c xmlns="http://www.tei-c.org/ns/1.0" type="am">
+          <xsl:apply-templates select="@*"/>
+          <xsl:apply-templates/>
+        </c>        
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+  
+  
+  <xsl:template match="*[@ana='ori:align-no']">
+    <xsl:choose>
+      <xsl:when test="$exclude-no-alignable='yes'">
+        <xsl:comment><xsl:value-of select="."/></xsl:comment>
+      </xsl:when>
+      <xsl:otherwise>
+        <!--<xsl:copy-of select="."/>-->
+        <xsl:copy>
+          <xsl:apply-templates select="@*|node()"/>
+        </xsl:copy>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="tei:ex[not(ancestor-or-self::*[@ana='ori:align-no']) and not(parent::tei:expan/parent::tei:choice/tei:abbr)]">
+    <xsl:choose>
+      <xsl:when test="$exclude-no-alignable='yes'">
+        <xsl:choose>
+          <xsl:when test="matches(.,'^(et|cum|co[mn]|est|ur|us)$','i')">
+            <c xmlns="http://www.tei-c.org/ns/1.0"><g xmlns="http://www.tei-c.org/ns/1.0" type="am"><xsl:call-template name="abbreviate"/></g></c>
+          </xsl:when>
+          <xsl:otherwise><xsl:comment><xsl:copy-of select="."/></xsl:comment></xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+        <choice xmlns="http://www.tei-c.org/ns/1.0">
+          <abbr xmlns="http://www.tei-c.org/ns/1.0">
+            <xsl:choose>
+              <xsl:when test="matches(.,'^(et|cum|co[mn]|est|ur|us)$','i')">
+                <c xmlns="http://www.tei-c.org/ns/1.0"><g xmlns="http://www.tei-c.org/ns/1.0" type="am"><xsl:call-template name="abbreviate"/></g></c>
+              </xsl:when>
+              <xsl:otherwise/>
+            </xsl:choose>
+          </abbr>
+          <expan  xmlns="http://www.tei-c.org/ns/1.0">
+            <xsl:copy-of select="."/>
+          </expan>
+        </choice>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<xsl:template name="abbreviate">
+  <xsl:choose>
+    <xsl:when test="matches(.,'^(cum|com|con)$','i')">&#xA76F;</xsl:when>
+    <xsl:when test="matches(.,'^et$','i')">&#x204A;</xsl:when>
+    <xsl:when test="matches(.,'^est$','i')">&#x223B;</xsl:when>
+    <xsl:when test="matches(.,'^us$','i')">&#xA770;</xsl:when>
+    <xsl:otherwise>Â¤</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+  <!--<xsl:template match="tei:ex[parent::tei:expan/parent::tei:choice/tei:abbr and not(ancestor-or-self::*[@ana='ori:align-no'])]">
+    <xsl:copy-of select="."/>
+  </xsl:template>-->
+  
+  <xsl:template match="tei:expan[parent::tei:choice/tei:abbr and not(ancestor-or-self::*[@ana='ori:align-no'])]">
+    <xsl:copy-of select="."/>
+  </xsl:template>
+
+
+  <xsl:template match="tei:w//tei:hi[matches(@rend,'suscrit|enclavÃ©')]">
+    <!-- les lettres suscrites et enclavÃ©es sont regroupÃ©es avec le caractÃ¨re prÃ©cÃ©dent -->
+  </xsl:template>
+  
+  <xsl:template match="tei:w//tei:hi[matches(@rend,'ligature|fusionnÃ©es')]">
+    <xsl:choose>
+      <xsl:when test="descendant::*">
+        <xsl:copy>
+          <xsl:apply-templates select="@*"/>
+          <xsl:for-each select="child::node()">
+            <xsl:choose>
+              <xsl:when test="self::text()">
+                <xsl:if test="matches(.,'\S') and not(ancestor::*[@ana='ori:align-no'])"><xsl:call-template name="tokenise-chars"/></xsl:if>
+              </xsl:when>
+              <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </xsl:copy>
+      </xsl:when>
+      <xsl:otherwise><c xmlns="http://www.tei-c.org/ns/1.0"><g xmlns="http://www.tei-c.org/ns/1.0" type="{@rend}"><xsl:apply-templates/></g></c></xsl:otherwise>
+    </xsl:choose>    
+  </xsl:template>
+  
+  <xsl:template match="tei:w//tei:hi[matches(@rend,'lettre majuscule')]">
+    <c xmlns="http://www.tei-c.org/ns/1.0"><g xmlns="http://www.tei-c.org/ns/1.0" type="{replace(@rend,' ','_')}"><xsl:apply-templates/></g></c>
+  </xsl:template>
+  
+  <xsl:template match="tei:w//tei:hi[matches(@rend,'initiale?|lettrine')]">
+    <xsl:choose>
+      <xsl:when test="tei:choice/tei:abbr and tei:choice/tei:expan">
+        <choice xmlns="http://www.tei-c.org/ns/1.0">
+          <abbr xmlns="http://www.tei-c.org/ns/1.0">
+            <c type="initiale" xmlns="http://www.tei-c.org/ns/1.0"><g xmlns="http://www.tei-c.org/ns/1.0" type="initiale"><xsl:value-of select="tei:choice/tei:abbr"/></g></c>
+          </abbr>
+          <xsl:copy-of select="descendant::tei:expan"/>
+        </choice>
+      </xsl:when>
+      <xsl:otherwise>
+        <c type="initiale" xmlns="http://www.tei-c.org/ns/1.0"><g xmlns="http://www.tei-c.org/ns/1.0" type="initiale"><xsl:apply-templates/></g></c>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="tei:w//tei:hi[matches(@rend,'lettres allongÃ©es|red|sup|highlight')]">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="rend"><xsl:value-of select="replace(@rend,' ','_')"/></xsl:attribute>
+      <xsl:for-each select="child::node()">
+        <xsl:choose>
+          <xsl:when test="self::text()">
+            <xsl:if test="matches(.,'\S') and not(ancestor::*[@ana='ori:align-no'])"><xsl:call-template name="tokenise-chars"/></xsl:if>
+          </xsl:when>
+          <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
+        </xsl:choose>
+      </xsl:for-each>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="*[ancestor::tei:w and not(ancestor-or-self::*[@ana='ori:align-no'])]" priority="-0.1">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:for-each select="child::node()">
+        <xsl:choose>
+          <xsl:when test="self::tei:choice and $exclude-no-alignable='yes'">
+            <xsl:apply-templates select="tei:abbr|tei:orig|tei:sic"/>
+          </xsl:when>          
+          <xsl:when test="self::text()">
+            <xsl:if test="matches(.,'\S')"><xsl:call-template name="tokenise-chars"/></xsl:if>
+          </xsl:when>
+          <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
+        </xsl:choose>
+      </xsl:for-each>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="tei:choice[ancestor::tei:w and matches(tei:abbr,'^\p{M}+$')]" priority="1">
+    <xsl:comment>abrÃ©viation dÃ©placÃ©e : <xsl:copy-of select="."/></xsl:comment>
+  </xsl:template>
+  
+  <xsl:template name="tokenise-chars">
+    
+    <xsl:variable name="following-am">
+      <xsl:if test="following-sibling::node()[1][self::tei:abbr] and not(matches(following-sibling::node()[1][self::tei:abbr],'\P{M}'))">
+        <g xmlns="http://www.tei-c.org/ns/1.0" type="am"><xsl:value-of select="following-sibling::tei:abbr[1]"/></g>
+      </xsl:if>
+      <xsl:if test="following-sibling::node()[1][self::tei:choice[tei:abbr]] and not(matches(following-sibling::node()[1][self::tei:choice]/tei:abbr[1],'\P{M}'))">
+        <g xmlns="http://www.tei-c.org/ns/1.0" type="am"><xsl:value-of select="following::tei:abbr[1]"/></g>
+      </xsl:if>
+      <xsl:if test="following-sibling::node()[1][self::tei:am] and not(matches(following-sibling::node()[1][self::tei:am],'\P{M}'))">
+        <g xmlns="http://www.tei-c.org/ns/1.0" type="am"><xsl:value-of select="following-sibling::tei:am[1]"/></g>
+      </xsl:if>
+      <xsl:if test="following-sibling::node()[1][self::tei:hi[@rend='suscrit']]">
+        <g xmlns="http://www.tei-c.org/ns/1.0" type="suscrit"><xsl:value-of select="following-sibling::tei:hi[1]"/></g>
+      </xsl:if>
+      <xsl:if test="following-sibling::node()[1][self::tei:hi[@rend='enclavÃ©']]">
+        <g xmlns="http://www.tei-c.org/ns/1.0" type="enclavÃ©"><xsl:value-of select="following-sibling::tei:hi[1]"/></g>
+      </xsl:if>
+    </xsl:variable>
+    
+    <xsl:variable name="following-expan">
+      <xsl:if test="following-sibling::node()[1][self::tei:choice[tei:expan]] and not(matches(following-sibling::node()[1][self::tei:choice]/tei:abbr[1],'\P{M}')) and not($exclude-no-alignable='yes')">
+        <expan xmlns="http://www.tei-c.org/ns/1.0">
+          <xsl:value-of select="substring(.,string-length(.))"/>
+          <xsl:apply-templates select="following-sibling::tei:choice[1]/tei:expan[1]/node()"/>
+        </expan>
+      </xsl:if>
+    </xsl:variable>
+    
+    <xsl:choose>
+      <xsl:when test="ancestor::*[@ana='ori:align-no'] 
+        or ancestor::tei:expan[parent::tei:choice]
+        or ancestor::tei:corr[parent::tei:choice]
+        or ancestor::tei:reg[parent::tei:choice]">
+        <xsl:copy-of select="."/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:analyze-string select="." regex="^(.*)(\P{{M}})(\p{{M}}*)">
+          <xsl:matching-substring>
+            <xsl:variable name="chars"><xsl:value-of select="replace(regex-group(1),'[''â€™]','')"/></xsl:variable>
+            <xsl:variable name="last-char"><xsl:value-of select="replace(regex-group(2),'[''â€™]','')"/></xsl:variable>
+            <xsl:variable name="last-comb-mark"><xsl:value-of select="regex-group(3)"/></xsl:variable>
+            <xsl:analyze-string select="$chars" regex="(\P{{M}})(\p{{M}}*)">
+              <xsl:matching-substring>
+                <c xmlns="http://www.tei-c.org/ns/1.0">
+                  <xsl:value-of select="regex-group(1)"/>
+                  <xsl:if test="matches(regex-group(2),'.+')">
+                    <g xmlns="http://www.tei-c.org/ns/1.0" type="am"><xsl:value-of select="regex-group(2)"/></g>
+                  </xsl:if>
+                </c>
+              </xsl:matching-substring>
+            </xsl:analyze-string>
+            <xsl:if test="matches($last-char,'.+')">
+              <xsl:choose>
+                <xsl:when test="matches($following-expan,'.+')">
+                  <choice xmlns="http://www.tei-c.org/ns/1.0">
+                    <abbr xmlns="http://www.tei-c.org/ns/1.0">
+                      <c xmlns="http://www.tei-c.org/ns/1.0">
+                        <xsl:value-of select="$last-char"/>
+                        <xsl:if test="matches($last-comb-mark,'.+')">
+                          <g xmlns="http://www.tei-c.org/ns/1.0" type="am"><xsl:value-of select="$last-comb-mark"/></g>
+                        </xsl:if>
+                        <xsl:copy-of select="$following-am"/>
+                      </c>
+                    </abbr>
+                    <xsl:copy-of select="$following-expan"/>
+                  </choice>
+                </xsl:when>
+                <xsl:otherwise>
+                  <c xmlns="http://www.tei-c.org/ns/1.0">
+                    <xsl:value-of select="$last-char"/>
+                    <xsl:if test="matches($last-comb-mark,'.+')">
+                      <g xmlns="http://www.tei-c.org/ns/1.0" type="am"><xsl:value-of select="$last-comb-mark"/></g>
+                    </xsl:if>
+                    <xsl:copy-of select="$following-am"/>
+                  </c>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:if>
+          </xsl:matching-substring>
+        </xsl:analyze-string>
+      </xsl:otherwise>
+    </xsl:choose>
+    
+  </xsl:template>
+
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-tokenize-chars-1-tag.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-patch-words-with-lb.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-patch-words-with-lb.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-patch-words-with-lb.xsl	(revision 728)
@@ -0,0 +1,63 @@
+<?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:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
+
+	<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 name="wp1">
+		<xsl:for-each select="child::node()[not(self::tei:pb or self::tei:cb or self::tei:milestone) and following-sibling::*[descendant-or-self::tei:lb]]">
+			<xsl:apply-templates select="."/>
+		</xsl:for-each>
+		<xsl:for-each select="child::*[descendant::tei:lb]">
+			<xsl:copy>
+				<xsl:apply-templates select="@*"/>
+				<xsl:call-template name="wp1"/>
+			</xsl:copy>
+		</xsl:for-each>
+	</xsl:template>
+	
+	<xsl:template name="wp2">
+		<xsl:for-each select="child::*[descendant::tei:lb]">
+			<xsl:copy>
+				<xsl:apply-templates select="@*"/>
+				<xsl:call-template name="wp2"/>
+			</xsl:copy>
+		</xsl:for-each>		
+		<xsl:for-each select="child::node()[not(self::tei:pb or self::tei:cb or self::tei:milestone) and preceding-sibling::*[descendant-or-self::tei:lb]]">
+			<xsl:apply-templates select="."/>
+		</xsl:for-each>
+	</xsl:template>
+
+	<xsl:template match="tei:w[not(ancestor::tei:w or ancestor::tei:pc)]">
+		<xsl:copy>
+			<xsl:apply-templates select="@*"/>
+			<xsl:choose>
+				<xsl:when test="descendant::tei:lb and not(descendant::tei:seg[@type='wp'])">
+					<seg xmlns="http://www.tei-c.org/ns/1.0" type="wp" part="I">
+						<xsl:call-template name="wp1"/>
+					</seg>
+					<xsl:apply-templates select="descendant::tei:milestone|descendant::tei:pb|descendant::tei:cb|descendant::tei:lb"/>
+					<seg xmlns="http://www.tei-c.org/ns/1.0" type="wp" part="F">
+						<xsl:call-template name="wp2"/>
+					</seg>
+				</xsl:when>
+				<xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
+			</xsl:choose>      
+		</xsl:copy>
+	</xsl:template>
+	
+	<!-- on supprime les w et pc imbriquÃ©s -->
+	<xsl:template match="tei:w[ancestor::tei:w or ancestor::tei:pc]|tei:pc[ancestor::tei:w or ancestor::tei:pc]">
+		<xsl:apply-templates/>
+	</xsl:template>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-patch-words-with-lb.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/3-facsimile-pager.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/3-facsimile-pager.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/3-facsimile-pager.xsl	(revision 728)
@@ -0,0 +1,168 @@
+<?xml version="1.0"?>
+<xsl:stylesheet
+	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="#all"
+	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$
+     
+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"/>
+	
+	<xsl:param name="css-name-txm">txm</xsl:param>
+	<xsl:param name="css-name">tei</xsl:param>
+	<xsl:param name="edition-name">facs</xsl:param>
+	<xsl:param name="number-words-per-page">999999</xsl:param>
+	<xsl:param name="pagination-element">pb</xsl:param>
+	<xsl:param name="output-directory"><xsl:value-of select="concat($current-file-directory,'/',$edition-name)"/></xsl:param>
+	<xsl:param name="image-directory">/home/alavrent/Bureau/Oriflamms_sources/mss-dates/mss-dates/img</xsl:param>
+	<xsl:param name="word-element">w</xsl:param>
+	
+	<!-- /home/alavrent/Bureau/Oriflamms_sources/mss-dates/mss-dates/img -->
+	
+	<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 as="xs:integer" name="page-number-adjust">
+		<xsl:choose>
+			<xsl:when test="$word-element='c'">1</xsl:when>
+			<xsl:otherwise>2</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
+	
+	
+	
+	<xsl:template match="/">
+		<dummy><xsl:apply-templates select="descendant::*[local-name()=$pagination-element]"/></dummy>
+		<xsl:if test="$word-element='w'">
+			<xsl:result-document href="{$output-directory}/{$current-file-name}_1.html">
+				<html>
+					<head>
+						<meta name="txm:first-word-id" content="w_0"/>
+						<title><xsl:value-of select="concat($current-file-name,', Page de garde')"/></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">
+							<h2><xsl:value-of select="$current-file-name"/></h2>
+							<h3>Reproductions des pages</h3>
+							
+						</div>
+					</body>
+				</html>
+			</xsl:result-document>			
+		</xsl:if>		
+	</xsl:template>
+	
+	
+	<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:when>
+				<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>
+				<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:choose>
+		</xsl:variable>
+		<xsl:variable name="pageId"><xsl:value-of select="@id"/></xsl:variable>
+						<xsl:comment> Page <xsl:value-of select="@id"/> enregistrÃ©e dans <xsl:value-of select="concat($output-directory,'/',$current-file-name,'_',count(preceding::*[local-name()=$pagination-element]) + $page-number-adjust,'.html')"/></xsl:comment>
+		<xsl:result-document href="{$output-directory}/{$current-file-name}_{count(preceding::*[local-name()=$pagination-element]) + $page-number-adjust}.html">
+							<html>
+								<head>
+									<meta name="txm:first-word-id" content="{$next-word-id}"/>
+									<title><xsl:value-of select="concat($current-file-name,', Page ',@n)"/></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>
+									<script type="text/javascript" src="js/viewer/Simple_Viewer_beta_1.1-min.js"><xsl:text> </xsl:text></script>
+									<script type="text/javascript" src="js/viewer/toolbar-ext.js"><xsl:text> </xsl:text></script>
+									<link rel="stylesheet" type="text/css" href="js/viewer/toolbar-ext.css" />
+									<!--<xsl:copy-of select="$style"/>-->
+								</head>
+								<body>
+									<div class="txmeditionpage">
+										<img src="{$image-directory}/{@facs}"
+											alt="Image {@id} indisponible" onLoad="viewer.toolbarImages='images/icons';viewer.onload=viewer.toolbar;new viewer({{image: this, frame: ['100%','100%']}});"></img>
+										<!--<span class="invisible" id="{following::tei:w[1]/@id}"></span>-->
+										<span class="invisible" id="{$next-word-id}"></span>
+										
+									</div>
+								</body>
+							</html>
+						</xsl:result-document>
+						
+	</xsl:template>
+	
+		
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/3-facsimile-pager.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/TEI2ProjectMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/TEI2ProjectMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/TEI2ProjectMacro.groovy	(revision 728)
@@ -0,0 +1,212 @@
+// STANDARD DECLARATIONS
+package org.txm.macro.oriflamms.prepare
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.*
+import org.txm.utils.*
+import org.txm.importer.*
+import org.txm.utils.logger.*
+import org.txm.doc.Zip;
+
+@Field @Option(name="xmlFile", usage="Raw XML-TEI Oriflamm", widget="File", required=true, def="file.xml")
+File xmlFile
+@Field @Option(name="xslFile", usage="Optional XSL file applied", widget="File", required=false, def="file.xsl")
+File xslFile
+@Field @Option(name="imagesDirectory", usage="Optional images directory", widget="Folder", required=false, def="images")
+File imagesDirectory
+@Field @Option(name="createArchive", usage="Optional zip the project", widget="Boolean", required=false, def="false")
+boolean createArchive
+if (!ParametersDialog.open(this)) return;
+
+if (!xmlFile.exists()) {
+	println "Could not read input XML input file: $xmlFile"
+	return;
+}
+
+File oriflammsMacroDirectory = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "scripts/macro/org/txm/macro/oriflamms/prepare")
+if (!oriflammsMacroDirectory.exists()) {
+	println "Oriflamms macro directory not found: "+oriflammsMacroDirectory
+	return;
+}
+File xslTokenizer = new File(oriflammsMacroDirectory, "oriflamms-tokenize-words.xsl");
+File xslPatchLbInWords = new File(oriflammsMacroDirectory,"oriflamms-patch-words-with-lb.xsl");
+File xslMissingMilestones = new File(oriflammsMacroDirectory, "oriflamms-patch-milestones.xsl");
+File xslCharactersTokenizer = new File(oriflammsMacroDirectory, "oriflamms-tokenize-chars-1-tag.xsl");
+File xslCharactersIdentifier = new File(oriflammsMacroDirectory, "oriflamms-tokenize-chars-2-identify.xsl");
+File xslZones = new File(oriflammsMacroDirectory, "oriflamms-convert-transcriptions-orizones.xsl");
+
+if (!xslTokenizer.exists()  || !xslPatchLbInWords.exists() || !xslMissingMilestones.exists() ||	
+!xslCharactersTokenizer.exists() || !xslCharactersIdentifier.exists() || !xslZones.exists()) {
+	println "Could not find one of TXM's XSL file : "+
+		[xslTokenizer, xslPatchLbInWords, xslMissingMilestones, 
+		xslCharactersTokenizer, xslCharactersIdentifier, xslZones];
+		
+	println ""+[xslTokenizer.exists(), xslPatchLbInWords.exists(), xslMissingMilestones.exists()
+	, xslCharactersTokenizer.exists(), xslCharactersIdentifier.exists(), xslZones.exists()]
+	return;
+}
+
+File xmlFileParentDirectory = xmlFile.getParentFile()
+String projectName = xmlFile.getName()
+if (projectName.indexOf(".") > 0) projectName = projectName.substring(0, projectName.indexOf("."))
+File projectDirectory = new File(xmlFileParentDirectory, projectName)
+projectDirectory.deleteDir()
+if (projectDirectory.exists()) {
+	println "Could not delete previous project directory: $projectDirectory"
+	return;
+}
+
+projectDirectory.mkdir()
+
+if (!projectDirectory.exists()) {
+	println "Could not create project directory: $projectDirectory"
+	return;
+}
+
+println "Oriflamms project directory: $projectDirectory"
+
+File xmlFileCopy = new File(projectDirectory, xmlFile.getName())
+println "Copying XML files: $xmlFile to $projectDirectory"
+CopyXMLFiles cdf = new CopyXMLFiles(xmlFile)
+projectDirectory.mkdir()
+println "Files copied: "+cdf.copy(projectDirectory)
+if (!xmlFileCopy.exists()) {
+	println "Could not copy input XML input file: $xmlFile to $xmlFileCopy"
+	return;
+}
+
+if (xslFile != null) {
+	if (xslFile.exists()) {
+		println "Applying $xslFile to $xmlFileCopy..."
+		ApplyXsl2 builder = new ApplyXsl2(xslFile);
+		if (!builder.process(xmlFileCopy, xmlFileCopy)) {
+			System.out.println("Failed to process "+xmlFileCopy+" with "+xslFile);
+			return;
+		}
+	}
+}
+
+File textsDirectory = new File(projectDirectory, "texts")
+File imgDirectory = new File(projectDirectory, "img")
+File img_linksDirectory = new File(projectDirectory, "img_links")
+File ontologiesDirectory = new File(projectDirectory, "ontologies")
+File ontologies_linksDirectory = new File(projectDirectory, "ontologies_links")
+File zonesDirectory = new File(projectDirectory, "zones")
+textsDirectory.mkdir()
+imgDirectory.mkdir()
+img_linksDirectory.mkdir()
+ontologiesDirectory.mkdir()
+ontologies_linksDirectory.mkdir()
+zonesDirectory.mkdir()
+
+File xmlWFile = new File(textsDirectory, projectName+"-w.xml")
+File xmlWCFile = new File(textsDirectory, projectName+"-c.xml")
+
+try {
+
+println "Applying $xslMissingMilestones to $xmlWFile..."
+if (monitor != null) monitor.worked(1, "Applying $xslMissingMilestones to $xmlWFile...")
+builder = new ApplyXsl2(xslMissingMilestones);
+if (!builder.process(xmlFileCopy, xmlWFile)) {
+	System.out.println("Failed to process "+xmlWFile+" with "+xslMissingMilestones);
+	return;
+}
+
+println "Applying $xslTokenizer to $xmlWFile..."
+if (monitor != null) monitor.worked(15, "Applying $xslTokenizer to $xmlWFile...")
+builder = new ApplyXsl2(xslTokenizer);
+if (!builder.process(xmlWFile, xmlWFile)) {
+	System.out.println("Failed to process "+xmlFileCopy+" with "+xslTokenizer);
+	return;
+}
+
+println "Merging words <w/><w>"
+if (monitor != null) monitor.worked(15, "Merging words <w/><w>")
+String content = xmlWFile.getText("UTF-8")
+content = content.replaceAll("</w><w[^>]*>", "")
+content = content.replaceAll("</w>\\s*(<milestone[^>]*>)?\\s*(<pb[^>]*>)?\\s*(<cb[^>]*>)?\\s*(<lb[^>]*break=\"no\"[^>]*>)\\s*<w[^>]*>", '$1$2$3$4')
+try {
+	def writer = xmlWFile.newWriter("UTF-8")
+	writer.print(content)
+	writer.close()
+} catch (Exception e2) {
+	println "Error while fixing words: $e2"
+	return;
+}
+
+println "Applying $xslPatchLbInWords to $xmlWFile..."
+if (monitor != null) monitor.worked(15, "Applying $xslPatchLbInWords to $xmlWFile...")
+builder = new ApplyXsl2(xslPatchLbInWords);
+if (!builder.process(xmlWFile, xmlWFile)) {
+	System.out.println("Failed to process "+xmlFileCopy+" with "+xslPatchLbInWords);
+	return;
+}
+
+println "Fixing 'id' and 'n' attributes in $xmlWFile..."
+if (monitor != null) monitor.worked(15, "Fixing 'id' and 'n' attributes in $xmlWFile...")
+WriteIdAndNAttributes wiana = new WriteIdAndNAttributes(xmlWFile, projectName)
+File tmp = new File(xmlWFile.getParentFile(), "tmp_"+xmlWFile.getName())
+if (!wiana.process(tmp)) {
+	System.out.println("Failed to fix id and n attributes with of $xmlWFile file")
+	return;
+} else {
+	xmlWFile.delete()
+	tmp.renameTo(xmlWFile)
+	if (tmp.exists()) {
+		System.out.println("Fail to replace $xmlWFile with result file $tmp")
+		return;
+	}
+}
+
+println "Applying $xslCharactersTokenizer to $xmlWFile..."
+if (monitor != null) monitor.worked(15, "Applying $xslCharactersTokenizer to $xmlWFile...")
+builder = new ApplyXsl2(xslCharactersTokenizer);
+if (!builder.process(xmlWFile, xmlWCFile)) {
+	System.out.println("Failed to process "+xmlWFile+" with "+xslCharactersTokenizer);
+	return;
+} 
+
+println "Applying $xslCharactersIdentifier to $xmlWCFile..."
+if (monitor != null) monitor.worked(1, "Applying $xslCharactersIdentifier to $xmlWCFile...")
+builder = new ApplyXsl2(xslCharactersIdentifier);
+if (!builder.process(xmlWCFile, xmlWCFile)) {
+	System.out.println("Failed to process "+xmlWCFile+" with "+xslCharactersIdentifier);
+	return;
+}
+
+println "Applying $xslZones to $xmlWFile..."
+if (monitor != null) monitor.worked(15, "Applying $xslZones to $xmlWFile...")
+builder = new ApplyXsl2(xslZones);
+if (!builder.process(xmlWFile, null)) {
+	System.out.println("Failed to process "+xmlFileCopy+" with "+xslZones);
+	return;
+}
+
+if (imagesDirectory.exists() && imagesDirectory.listFiles().size() > 0) {
+	println "Copying images files from $imagesDirectory to $imgDirectory..."
+	FileCopy.copyFiles(imagesDirectory, imgDirectory);
+	def files = imgDirectory.listFiles()
+	if (files != null) println ""+files.size()+" images copied."
+}
+
+if (createArchive) {
+	if (monitor != null) monitor.worked(15, "Building Oriflamms binary project... ")
+	File zipFile = new File(xmlFileParentDirectory, projectName+".oriflamms")
+	zipFile.delete()
+	Zip.compress(projectDirectory, zipFile)
+	
+	if (zipFile.exists()) {
+		println "Project oriflamms exported to $zipFile"
+		projectDirectory.deleteDir()
+	} else {
+		println "Fail to export project $projectDirectory"
+	}
+}
+
+} catch (Exception e) {
+	println "Error while applying a XSL file: "+e
+	Log.printStackTrace(e)
+}
+if (monitor != null) monitor.done()
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-psautiers-oriflammsxml.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-psautiers-oriflammsxml.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-psautiers-oriflammsxml.xsl	(revision 728)
@@ -0,0 +1,188 @@
+<?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"
+  xmlns:xi="http://www.w3.org/2001/XInclude" 
+  xmlns:svg="http://www.w3.org/2000/svg" 
+  xmlns:math="http://www.w3.org/1998/Math/MathML"
+  exclude-result-prefixes="tei edate xd txm xi svg math" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="no"/>
+  
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille permet de convertir les transcription des 
+      Psautiers au format XML-TEI du projet Oriflamms.
+    </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 (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+  <!--<xsl:strip-space elements="*"/>-->
+  
+  <xsl:param name="baseMsSiglum">A</xsl:param>
+  
+  <xsl:variable name="baseMsPattern"><xsl:value-of select="concat('^#?',$baseMsSiglum,'| #?',$baseMsSiglum)"/></xsl:variable>
+  
+  <xsl:template match="*|comment()">
+    <!-- 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="processing-instruction()"/>
+
+  <!-- On supprime les attributs par dÃ©faut de la DTD TEI -->
+  
+  <xsl:template match="@*">
+    <xsl:choose>
+      <xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/>
+      <xsl:otherwise><xsl:copy/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<xsl:template match="@facs">
+ <xsl:attribute name="facs">
+   <xsl:choose>
+     <xsl:when test="matches(.,'^http:')">
+       <xsl:value-of select="substring-after(.,'nomFichier=')"/>    
+     </xsl:when>
+     <xsl:otherwise>
+       <xsl:value-of select="."/>
+     </xsl:otherwise>
+   </xsl:choose>
+   </xsl:attribute>
+</xsl:template>
+
+  <xsl:template match="tei:teiHeader">    
+      <xsl:copy>
+        <xsl:apply-templates select="@*"/>
+        <xsl:apply-templates/>
+      </xsl:copy>    
+  </xsl:template>
+    
+
+<xsl:template match="tei:revisionDesc">
+  <xsl:copy>
+  <xsl:apply-templates select="@*"/>
+    <change xmlns="http://www.tei-c.org/ns/1.0" when="2007-01-01" who="#DS">Publication du document original</change>
+    <!-- information rÃ©cupÃ©rÃ©e Ã  partir de /TEI/text[1]/front[1]/titlePage[1]/docDate[1] -->
+    <change xmlns="http://www.tei-c.org/ns/1.0" when="{format-date(current-date(),'[Y]-[M01]-[D01]')}" who="#auto">Conversion automatique au format XML-TEI-Oriflamms</change>
+  <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+  
+  <xsl:template match="tei:encodingDesc">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+      <xsl:if test="not(//tei:prefixDef[@ident='ori'])">
+        <listPrefixDef xmlns="http://www.tei-c.org/ns/1.0">
+          <prefixDef xmlns="http://www.tei-c.org/ns/1.0" ident="ori" 
+            matchPattern="([a-z]+)" 
+            replacementPattern="oriflamms-annotation-scheme.xml#$1">
+            <p>In the context of this project, private URIs with the prefix
+              "ori" point to <gi>interp</gi> elements in the project's
+              oriflamms-annotation-scheme.xml file.
+            </p>
+          </prefixDef>
+        </listPrefixDef>
+      </xsl:if>
+    </xsl:copy>
+  </xsl:template>
+
+<!-- On restructure le document pour avoir un TEI par charte -->
+  
+  <!-- TEI devient teiCorpus -->
+  
+  <xsl:template match="tei:TEI">
+    <xsl:element name="teiCorpus" xmlns="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+
+  <!-- on supprime l'Ã©lÃ©ment text de niveau 1 et travaille directement sur le niveau 2 (l'Ã©lÃ©ment group intermÃ©diaire disparait)-->
+  
+  <xsl:template match="tei:TEI/tei:text">
+    <xsl:apply-templates select="descendant::tei:text"/>
+  </xsl:template>
+
+  <xsl:template match="tei:text//tei:text">
+    
+    <TEI xmlns="http://www.tei-c.org/ns/1.0">
+      <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+        <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <title xmlns="http://www.tei-c.org/ns/1.0"><xsl:text>Acte original </xsl:text>
+              <xsl:value-of select="substring-after(preceding-sibling::comment()[contains(.,'acte original')][1],'acte original ')"/></title>
+            <author xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="descendant::tei:docAuthor"/></author>
+          </titleStmt>
+          <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the teiCorpus</p>
+          </publicationStmt>
+          <!-- les Ã©lÃ©ments listWit et listBibl sont placÃ©s dans sourceDesc -->
+          <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <xsl:copy-of select="descendant::tei:listWit"/>
+            <xsl:copy-of select="descendant::tei:listBibl[1]"></xsl:copy-of>
+          </sourceDesc>
+        </fileDesc>
+        <profileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <!-- docDate devient profileDesc/creation/date[@type='documentCreation'] -->
+          <creation xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates select="descendant::tei:docDate"/></creation>
+          <!-- argument devient profileDesc/abstract -->
+          <xsl:apply-templates select="descendant::tei:argument"/>
+        </profileDesc>
+      </teiHeader>
+      <text xmlns="http://www.tei-c.org/ns/1.0">
+          <xsl:apply-templates/>
+      </text>
+    </TEI>
+  </xsl:template>
+  
+  <!-- on supprime listWit du corps du texte (cf. l'entÃªte) -->
+  <xsl:template match="tei:listWit"/>
+
+<!-- on supprime les entÃªtes et pied de pages (non alignables) -->
+  
+  <xsl:template match="tei:fw">
+    <xsl:comment>fw : <xsl:copy-of select="."/></xsl:comment>
+  </xsl:template>
+
+  <!-- on ajoute un attribut pour faciliter l'identification des segments Ã  ne pas aligner -->
+  
+  <xsl:template match="tei:choice/tei:expan|tei:choice/tei:corr|tei:supplied|tei:note">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="ana">ori:align-no</xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+  
+
+<xsl:template match="text()[following-sibling::*[1][self::tei:milestone or self::tei:pb or self::tei:cb or self::tei:lb] and following-sibling::tei:lb[1][@break='no']]">
+  <xsl:choose>
+    <!-- patch d'espace blanc devant les sauts de ligne Ã  l'intÃ©rieur de mots -->
+    <xsl:when test="matches(.,'\s+$')"><xsl:value-of select="replace(.,'\s+$','')"/></xsl:when>
+    <xsl:otherwise><xsl:copy/></xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-psautiers-oriflammsxml.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-transcriptions-orizones.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-transcriptions-orizones.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-transcriptions-orizones.xsl	(revision 728)
@@ -0,0 +1,143 @@
+<?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 xd txm" version="2.0">
+  
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="yes"/>
+  
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille permet de convertir les donnÃ©es de zonage d'image produites 
+      par le logiciel Oriflamms (0.3.2) vers le format XML-TEI-Oriflamms.
+    </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 (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+  <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: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:variable name="corpusid">
+  <xsl:value-of select="replace($filename,'-w$','')"/>
+</xsl:variable>
+
+  <!--  <xsl:variable name="filenameresult">
+    <xsl:value-of select="replace($filename,'(-ori)?-w$','')"/>
+  </xsl:variable>-->
+  
+  <!--<xsl:param name="textFileName"><xsl:value-of select="$filename"/></xsl:param>-->
+  
+  <xsl:param name="imageZoneFileName"><xsl:value-of select="concat($filename,'-zones.xml')"/></xsl:param>
+  
+  <xsl:template match="*">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="@*|comment()|processing-instruction()|text()">
+    <xsl:copy/>
+  </xsl:template>
+  
+<xsl:template match="/">
+<dummy>Les rÃ©sultats sont enregistrÃ©s dans les dossiers zones et img-links</dummy>
+  <xsl:apply-templates select="//tei:milestone[@unit='surface']"/>
+</xsl:template>
+
+
+  <xsl:template match="tei:milestone[@unit='surface' and not(ancestor::tei:supplied)]">
+    
+    <!--<xsl:variable name="fileid">
+      <xsl:value-of select="replace(@xml:id,'^surf_','')"/>
+    </xsl:variable>-->
+    
+    <xsl:result-document href="{$filedir}/../zones/{$corpusid}_{@xml:id}-zones.xml">
+      <TEI xmlns="http://www.tei-c.org/ns/1.0">
+        <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+          <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+              <title xmlns="http://www.tei-c.org/ns/1.0">Image zones for <xsl:value-of select="@xml:id"/></title>
+            </titleStmt>
+            <publicationStmt xmlns="http://www.tei-c.org/ns/1.0"><p xmlns="http://www.tei-c.org/ns/1.0">Oriflamms project</p></publicationStmt>
+            <sourceDesc xmlns="http://www.tei-c.org/ns/1.0"><p>Converted from Oriflamms XML-TEI transcription file</p></sourceDesc>
+          </fileDesc>
+          <revisionDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <change when="{format-date(current-date(),'[Y]-[M01]-[D01]')}" xmlns="http://www.tei-c.org/ns/1.0">File created</change>
+          </revisionDesc>
+        </teiHeader>
+        <facsimile xml:base="../img/" xmlns="http://www.tei-c.org/ns/1.0">
+          <surface xmlns="http://www.tei-c.org/ns/1.0" xml:id="{replace(@xml:id,'^surf_','surf_img')}">
+            <!--<graphic url="{replace(following::tei:pb[1]/@facs,'\.tif$','.jpg')}"/>-->
+            <graphic url="{following::tei:pb[1]/@facs}"/>
+          </surface>
+        </facsimile>
+      </TEI>
+    </xsl:result-document>
+    <xsl:result-document href="{$filedir}/../img_links/{$corpusid}_{@xml:id}-links.xml">
+      <TEI xmlns="http://www.tei-c.org/ns/1.0">
+        <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+          <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+              <title xmlns="http://www.tei-c.org/ns/1.0">Linking data for document transcriptions and image zones (<xsl:value-of select="$filename"/>)</title>
+            </titleStmt>
+            <publicationStmt xmlns="http://www.tei-c.org/ns/1.0"><p xmlns="http://www.tei-c.org/ns/1.0">Oriflamms project ((http://oriflamms.hypotheses.org))</p></publicationStmt>
+            <sourceDesc xmlns="http://www.tei-c.org/ns/1.0"><p>Converted from Oriflamms XML-TEI transcription file</p></sourceDesc>
+          </fileDesc>
+          <encodingDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <listPrefixDef xmlns="http://www.tei-c.org/ns/1.0">
+              <prefixDef xmlns="http://www.tei-c.org/ns/1.0" ident="txt" matchPattern="([a-z]+)" replacementPattern="../texts/{$corpusid}-c.xml#$1"/>
+              <prefixDef xmlns="http://www.tei-c.org/ns/1.0" ident="img" matchPattern="([a-z]+)" replacementPattern="../zones/{$corpusid}_{@xml:id}-zones.xml#$1"/>
+            </listPrefixDef>
+          </encodingDesc>
+          <revisionDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <change when="{format-date(current-date(),'[Y]-[M01]-[D01]')}" xmlns="http://www.tei-c.org/ns/1.0">File created</change>
+          </revisionDesc>
+        </teiHeader>
+        <text xmlns="http://www.tei-c.org/ns/1.0">
+          <body xmlns="http://www.tei-c.org/ns/1.0">
+            <ab type="linking" xmlns="http://www.tei-c.org/ns/1.0">
+              <linkGrp type="surfaces" xmlns="http://www.tei-c.org/ns/1.0"/>
+              <linkGrp type="pages" xmlns="http://www.tei-c.org/ns/1.0"/>
+              <linkGrp type="columns" xmlns="http://www.tei-c.org/ns/1.0"/>
+              <linkGrp type="lines" xmlns="http://www.tei-c.org/ns/1.0"/>
+              <linkGrp type="words" xmlns="http://www.tei-c.org/ns/1.0"/>
+              <linkGrp type="characters" xmlns="http://www.tei-c.org/ns/1.0"/>
+            </ab>
+          </body>
+        </text>
+      </TEI>
+    </xsl:result-document>
+  </xsl:template>
+  
+  
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-transcriptions-orizones.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/CopyXMLFiles.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/CopyXMLFiles.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/CopyXMLFiles.groovy	(revision 728)
@@ -0,0 +1,61 @@
+package org.txm.macro.oriflamms.prepare
+
+import java.io.File;
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLResolver;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.events.DTD;
+import javax.xml.stream.events.EntityReference;
+import org.txm.utils.*
+
+public class CopyXMLFiles {
+	File xmlFile;
+	File outDir;
+	def dtdFiles = []
+	
+	public CopyXMLFiles(File xmlFile) {
+		this.xmlFile = xmlFile;
+	}
+	
+	public def copy(File outDir) {
+		XMLInputFactory factory;
+		XMLStreamReader parser;
+		InputStream inputData = xmlFile.toURI().toURL().openStream();
+		factory = XMLInputFactory.newInstance();
+		factory.setXMLResolver(new XMLResolver() {
+			@Override
+			public Object resolveEntity(String publicID, String systemID,
+					String baseURI, String namespace) throws XMLStreamException {
+				//println "Resolving $publicID $systemID $baseURI $namespace"
+				File srcFile = new File(xmlFile.getParentFile(), systemID);
+				dtdFiles << srcFile
+				return srcFile.toURI().toURL().openStream();
+			}
+		});
+	
+		parser = factory.createXMLStreamReader(inputData);
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			
+		}
+		
+		dtdFiles << xmlFile
+		for (File dtd : dtdFiles) {
+			File cpy = new File(outDir, dtd.getName());
+			FileCopy.copy(dtd, cpy);
+		}
+		return dtdFiles
+	}
+	
+	public static void main(def args) {
+		File xmlFile = new File("/home/mdecorde/TÃ©lÃ©chargements/Inscriptions1.xml")
+		File outDir = new File("/home/mdecorde/TÃ©lÃ©chargements/test")
+		outDir.mkdir()
+		CopyXMLFiles cdf = new CopyXMLFiles(xmlFile)
+		println cdf.copy(outDir)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/OntologiesProjection.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/OntologiesProjection.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/OntologiesProjection.groovy	(revision 728)
@@ -0,0 +1,399 @@
+package org.txm.macro.oriflamms.prepare
+
+import java.util.regex.Pattern
+import org.codehaus.groovy.transform.trait.SuperCallTraitTransformer;
+import org.txm.importer.StaxIdentityParser;
+import org.txm.importer.StaxParser;
+
+class OntologiesProjection extends StaxIdentityParser {
+
+	File xmlFile
+
+	String wordTag
+	String textname
+	String milestone
+	String group
+
+	HashMap links = [:]
+	HashMap prefixDefsPatterns = [:]
+	HashMap<String, HashMap> ggly_ontologies = [:]
+	HashMap<String, HashMap> lgly_ontologies = [:]
+
+	String current_ontology_link_file_name
+
+	File ontologies_links_directory;
+
+	public OntologiesProjection(File xmlFile, File corpusDirectory) {
+		super(xmlFile)
+
+		this.xmlFile = xmlFile
+		this.ontologies_links_directory = new File(corpusDirectory, "ontologies_links")
+
+		textname = xmlFile.getName()
+		int idx = textname.lastIndexOf(".xml")
+		if (idx > 0) textname = textname.substring(0, idx)
+		textname = textname.replaceAll("-c", "")
+
+		this.wordTag = "c";
+	}
+
+	public def buildGGlyOntology(String prefix) {
+		String path = prefixDefsPatterns.get(prefix)[1];
+		int idx = path.indexOf("#")
+		if (idx > 0) path = path.substring(0, idx)
+
+		File ggly_ontology_file = new File(xmlFile.getParentFile(), "../"+path)
+		//println "ggly_ontology_file=$ggly_ontology_file "+ggly_ontology_file.exists()
+		if (!ggly_ontology_file.exists()) {
+			println "WARNING: cannot found global ontology file: $ggly_ontology_file"
+			return false
+		}
+		def global_ontologies = [:]
+		def unicode_global_ontologies = [:]
+		//println "parse $ggly_ontology_file"
+		StaxParser pontologies = new StaxParser(ggly_ontology_file) {
+					boolean startChar = false, startLocalName = false, startValue = false, startMapping = false;
+					String unicodeChar, standardizedChar, subtype, type;
+					String id, charLocalName, charValue;
+					StringBuilder c = new StringBuilder();
+
+					void processStartElement() {
+						if (localname.equals("char")) {
+							// get id
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+								if (parser.getAttributeLocalName(i).equals("id")) {
+									id = parser.getAttributeValue(i)
+									break;
+								}
+							}
+							startChar = true;
+							c.setLength(0);
+						} else if (localname.equals("mapping")) {
+							subtype = "";
+							type = "";
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+								if (parser.getAttributeLocalName(i).equals("subtype")) {
+									subtype = parser.getAttributeValue(i)
+								} else if (parser.getAttributeLocalName(i).equals("type")) {
+									type = parser.getAttributeValue(i)
+								}
+							}
+							startMapping = true;
+							c.setLength(0);
+						} else if (localname.equals("localName")) {
+							startLocalName = true;
+							c.setLength(0);
+						} else if (localname.equals("value")) {
+							startLocalName = true;
+							c.setLength(0);
+						}
+					}
+
+					void processCharacters() {
+						//if (startChar) c.append(parser.getText());
+						if (startMapping) c.append(parser.getText());
+						else if (startLocalName) c.append(parser.getText());
+						else if (startValue) c.append(parser.getText());
+					}
+
+					void processEndElement() {
+						if (localname.equals("char")) {
+							startChar = false;
+							global_ontologies[id] = ["standard":standardizedChar, "unicode":unicodeChar, "value":charValue, "localname":charLocalName];
+							unicode_global_ontologies[unicodeChar] = standardizedChar
+						} else if (localname.equals("mapping")) {
+							if (subtype.equals("Unicode")) {
+								unicodeChar = c.toString().trim();
+							} else if (type.equals("standardized")) {
+								standardizedChar = c.toString().trim();
+							}
+							startMapping = false;
+						} else if (localname.equals("localName")) {
+							charLocalName = c.toString().trim()
+							startLocalName = false;
+						} else if (localname.equals("value")) {
+							charValue = c.toString().trim()
+							startValue = false;
+						}
+					}
+				};
+		pontologies.process();
+		ggly_ontologies[prefix] = [global_ontologies, unicode_global_ontologies]
+		//println ggly_ontologies
+		return true
+	}
+
+	public def buildLGlyOntology(String prefix) {
+		String path = prefixDefsPatterns.get(prefix)[1];
+		int idx = path.indexOf("#")
+		if (idx > 0) path = path.substring(0, idx)
+
+		//File lgly_ontology_file = new File(xmlFile.getParentFile(), "../"+path) // add "../" because we are in txm/<corpus>-c directory
+		File lgly_ontology_file = new File(ontologies_links_directory, textname+"-ontolinks.xml") // add "../" because we are in txm/<corpus>-c directory
+		//println "lgly_ontology_file=$lgly_ontology_file "+lgly_ontology_file.exists()
+		if (!lgly_ontology_file.exists()) {
+			println "WARNING: cannot find Local ontology file $lgly_ontology_file"
+			return false
+		}
+
+		def local_ontologies = [:]
+		//println "parse $lgly_ontology_file"
+		StaxParser pontologies = new StaxParser(lgly_ontology_file) {
+					boolean startNote = false
+					String id, change, parent;
+					StringBuilder c = new StringBuilder();
+					def glyph = [:]
+
+					void processStartElement() {
+						if (localname.equals("glyph")) {
+							// get id
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+								change = ""
+								if (parser.getAttributeLocalName(i).equals("id")) {
+									id = parser.getAttributeValue(i)
+								} else if (parser.getAttributeLocalName(i).equals("change")) {
+									change = parser.getAttributeValue(i)
+								}
+							}
+							glyph = ["change":change, "id":id] // new glyph
+							parent = null
+						} else if (localname.equals("note")) {
+							startNote = true;
+							c.setLength(0);
+						}
+					}
+
+					void processCharacters() {
+						if (startNote) c.append(parser.getText());
+					}
+
+					void processEndElement() {
+						if (localname.equals("char")) {
+							if (parent != null)
+								glyph["parent"] = local_ontologies[parent]
+							local_ontologies[id] = glyph
+						} else if (localname.equals("note")) {
+							parent = c.toString().trim()
+							startNote = false;
+						}
+					}
+				};
+		pontologies.process();
+		lgly_ontologies[prefix] = local_ontologies
+
+		return true
+	}
+
+	public def loadOntologyLinkFile(String name) {
+		links = [:]
+		prefixDefsPatterns = ["ggly":[Pattern.compile("([a-z]+)"), '../../charDecl.xml#$1'],
+			"lgly":[Pattern.compile("([a-z]+)"), '../ontologies/'+textname+'.xml#$1'],
+			"txt":[Pattern.compile("([a-z]+)"), '../texts/'+textname+'.xml#$1']]
+			
+		lgly_ontologies = [:]
+		ggly_ontologies = [:]
+		File ontology_link_file = new File(ontologies_links_directory, name)
+		if (!ontology_link_file.exists()) {
+			println "WARNING: no ontology link file: "+ontology_link_file
+			return
+		}
+
+		StaxParser pLinks = new StaxParser(ontology_link_file) {
+					void processStartElement() {
+						if (localname.equals("linkGrp")) {
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+								if (parser.getAttributeLocalName(i).equals("type")) {
+									group = parser.getAttributeValue(i)
+									break
+								}
+							}
+						} else if (localname.equals("prefixDef")) {
+							String ident, matchPattern, replacementPattern;
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+								if (parser.getAttributeLocalName(i).equals("ident")) {
+									ident = parser.getAttributeValue(i)
+								} else if (parser.getAttributeLocalName(i).equals("matchPattern")) {
+									matchPattern = parser.getAttributeValue(i)
+								} else if (parser.getAttributeLocalName(i).equals("replacementPattern")) {
+									replacementPattern = parser.getAttributeValue(i)
+								}
+							}
+							if (!ident.equals("txt")) {
+								prefixDefsPatterns[ident] = [Pattern.compile(matchPattern), replacementPattern];
+								OntologiesProjection.this.getOntology(ident)
+							}
+						} else if (localname.equals("link")) {
+							String target = "";
+
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+								if (parser.getAttributeLocalName(i).equals("target")) {
+									target = parser.getAttributeValue(i)
+									break
+								}
+							}
+
+							def split = target.split(" ", 2) // first part word id next part are the ontologies id
+							links[split[0].substring(4)] = split[1].split(" ")
+						}
+					}
+				};
+		pLinks.process();
+		//		println "links size: "+links.size()
+		//		println "ggly_ontologies size: "+ggly_ontologies.size()
+		//		println "lgly_ontologies size: "+lgly_ontologies.size()
+	}
+
+	public def getOntology(String prefix) {
+		if (prefix.startsWith("ggly")) {
+			if (!ggly_ontologies.containsKey(prefix)) buildGGlyOntology(prefix);
+			return ggly_ontologies.get(prefix)
+		} else if (prefix.startsWith("lgly")) {
+			if (!lgly_ontologies.containsKey(prefix)) buildLGlyOntology(prefix);
+			return lgly_ontologies.get(prefix)
+		}
+	}
+
+	public void processStartElement() {
+		super.processStartElement();
+		if (localname.equals("milestone")) {
+			String id = "";
+			String unit= "";
+			for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+				if (parser.getAttributeLocalName(i).equals("id")) {
+					id = parser.getAttributeValue(i)
+				} else if (parser.getAttributeLocalName(i).equals("unit")) {
+					unit = parser.getAttributeValue(i)
+				}
+			}
+
+			if (unit.equals("surface")) {
+				milestone = id;
+			}
+		} else if (localname.equals(wordTag)) {
+			String id = "";
+			String characters = "";
+			for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+				if (parser.getAttributeLocalName(i).equals("id")) {
+					id = parser.getAttributeValue(i)
+				} else if (parser.getAttributeLocalName(i).equals("characters")) {
+					characters = parser.getAttributeValue(i)
+				}
+			}
+
+			String ontology_link_file_name = textname+"-ontolinks.xml"
+			if (!current_ontology_link_file_name.equals(ontology_link_file_name)) { // rebuild hashmaps
+				current_ontology_link_file_name = ontology_link_file_name
+				loadOntologyLinkFile(ontology_link_file_name);
+				getOntology("ggly")
+			}
+
+			String sign = null, allographExpert = null, allographAutomatic = null; // default value is attribute characters
+
+			//AUTO ALLOGRAPH
+			if (links.containsKey(id))
+				for (String link : links[id]) { // automatic allograph loop
+					if (link.startsWith("lgly")) {
+						int idx = link.indexOf(":")
+						link = link.substring(idx+1);
+						if (link.startsWith("auto_")) { // automatic lgly
+							if (allographAutomatic == null) allographAutomatic = link.substring(5)
+							else if (allographAutomatic.length()+5 < link.length()) allographAutomatic = link.substring(5)
+						} else { // manual lgly
+
+						}
+					}
+				}
+			if (allographAutomatic == null) allographAutomatic = characters;
+
+			//EXPERT ALLOGRAPH
+			if (links.containsKey(id))
+				for (String link : links[id]) { // expert allograph loop, try to find a ggly entity
+					//getOntology("ggly")
+					if (link.startsWith("ggly")) {
+						int idx = link.indexOf(":")
+						def prefix = link.substring(0, idx);
+						link = link.substring(idx+1);
+
+						def onto = getOntology(prefix)
+						if (onto != null) {
+							def charOnto = onto[0][link];
+							if (charOnto != null) {
+								String localname = charOnto["localname"]
+								String value =  charOnto["value"]
+								if ("entity".equals(localname)) {
+									allographExpert = value
+								}
+							}
+						}
+					}
+				}
+			if (allographExpert == null)
+				if (links.containsKey(id))
+					for (String link : links[id]) { // expert allograph loop, try to find the longest non-autolgly entity
+						if (link.startsWith("lgly")) {
+							int idx = link.indexOf(":")
+							link = link.substring(idx+1);
+							if (!link.startsWith("auto_")) { // non automatic lgly
+								//println "link= "+link
+								if (allographExpert == null) allographExpert = link
+								else if (allographExpert.length()+5 < link.length()) allographExpert = link
+							}
+						}
+					}
+			if (allographExpert == null) allographExpert = allographAutomatic;
+
+			//SIGN
+			if (sign == null)
+				if (links.containsKey(id))
+					for (String link : links[id]) { // expert allograph loop, try to find the shortest ggly entity
+						//getOntology("ggly")
+						if (link.startsWith("ggly")) {
+							int idx = link.indexOf(":")
+							def prefix = link.substring(0, idx);
+							link = link.substring(idx+1);
+
+							def onto = getOntology(prefix)
+							if (onto != null) {
+								def charOnto = onto[0][link];
+								if (charOnto != null) {
+									sign = charOnto["standard"]
+								}
+							}
+						}
+					}
+			if (sign == null)
+				if (links.containsKey(id))
+					for (String link : links[id]) { // sign loop, try to find the shortest non-autolgly entity
+						if (link.startsWith("lgly")) {
+							int idx = link.indexOf(":")
+							link = link.substring(idx+1);
+							if (!link.startsWith("auto_")) { // non automatic lgly
+								if (sign == null) sign = link
+								else if (sign.length()+5 > link.length()) sign = link
+							}
+						}
+					}
+			if (sign == null) {
+				for (def ggly : ggly_ontologies.values()) {
+					def chars = ggly[1]
+					if (chars.containsKey(characters)) sign = chars[characters];
+				}
+			}
+			if (sign == null) sign = characters.toLowerCase();
+
+			//println "write characters attributes characters=$characters sign=$sign allograph-expert=$allographExpert allograph-auto=$allographAutomatic"
+			writer.writeAttribute("sign", sign)
+			writer.writeAttribute("allograph-expert", allographExpert)
+			writer.writeAttribute("allograph-auto", allographAutomatic)
+		}
+	}
+
+	public static void main(String[] args) {
+		File corpusDirectory = new File("/home/mdecorde/TEMP/testori/qgraal_cmTest")
+		File xmlFile = new File(corpusDirectory, "txm/qgraal_cmTest-c/qgraal_cmTest-c_surf_qgraal_cmTest_lyonbm_pa77-160.xml")
+		File outputFile = new File(corpusDirectory, "txm/qgraal_cmTest-c/out.xml")
+
+		OntologiesProjection cp = new OntologiesProjection(xmlFile, corpusDirectory);
+		println cp.process(outputFile)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/Project2XTZMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/Project2XTZMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/Project2XTZMacro.groovy	(revision 728)
@@ -0,0 +1,274 @@
+package org.txm.macro.oriflamms.prepare;
+
+import org.kohsuke.args4j.*
+
+import groovy.transform.Field
+
+import org.txm.objects.BaseParameters;
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.*
+import org.txm.utils.*
+import org.txm.importer.*
+import org.txm.utils.logger.*
+import org.txm.doc.Zip;
+
+File oriflammsMacroDirectory = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "scripts/macro/org/txm/macro/oriflamms/prepare")
+if (!oriflammsMacroDirectory.exists()) {
+	println "Oriflamms macro directory not found: $oriflammsMacroDirectory. Aborting"
+	return;
+}
+File wFrontXSLFile = new File(oriflammsMacroDirectory, "txm-front-teioriflammsw-xtz.xsl")
+if (!wFrontXSLFile.exists()) {
+	println "Oriflamms to XML-XTZ front XSL file is missing: $wFrontXSLFile. Aborting"
+	return;
+}
+File cFrontXSLFile = new File(oriflammsMacroDirectory, "txm-front-teioriflammsc-xtz.xsl")
+if (!cFrontXSLFile.exists()) {
+	println "Oriflamms to XML-XTZ front XSL file is missing: $cFrontXSLFile. Aborting"
+	return;
+}
+
+File cSplitXSLFile = new File(oriflammsMacroDirectory, "1-oriflamms-split-surfaces.xsl")
+if (!cSplitXSLFile.exists()) {
+	println "Oriflamms to XML-XTZ split XSL file is missing: $cSplitXSLFile. Aborting"
+	return;
+}
+
+File editionXSLFile1 = new File(oriflammsMacroDirectory, "1-default-html.xsl")
+if (!editionXSLFile1.exists()) {
+	println "Oriflamms to XML-XTZ edition XSL file is missing: $editionXSLFile1."
+	return;
+}
+File editionXSLFile2 = new File(oriflammsMacroDirectory, "2-default-pager.xsl")
+if (!editionXSLFile2.exists()) {
+	println "Oriflamms to XML-XTZ edition XSL file is missing: $editionXSLFile2."
+	return;
+}
+File editionXSLFile3 = new File(oriflammsMacroDirectory, "3-facsimile-pager.xsl")
+if (!editionXSLFile3.exists()) {
+	println "Oriflamms to XML-XTZ edition XSL file is missing: $editionXSLFile3."
+	return;
+}
+File cssDirectory = new File(oriflammsMacroDirectory, "css")
+if (!cssDirectory.exists()) {
+	println "Oriflamms css directory is missing: $cssDirectory."
+	return;
+}
+File jsDirectory = new File(oriflammsMacroDirectory, "js")
+if (!jsDirectory.exists()) {
+	println "Oriflamms js directory is missing: $jsDirectory."
+	return;
+}
+File imagesDirectory = new File(oriflammsMacroDirectory, "images")
+if (!imagesDirectory.exists()) {
+	println "Oriflamms images directory is missing: $imagesDirectory."
+	return;
+}
+
+@Field @Option(name="projectDirectory", usage="Oriflamms' project directory", widget="Folder", required=true, def="project")
+File projectDirectory
+
+if (!ParametersDialog.open(this)) return;
+
+File textDirectory = new File(projectDirectory, "texts")
+
+File txmDirectory = new File(projectDirectory, "txm");
+if (txmDirectory.exists()) txmDirectory.deleteDir();
+txmDirectory.mkdir()
+if (!txmDirectory.exists()) {
+	println "Error: the 'txm' directory could not be created: $txmDirectory. Aborting."
+	return
+}
+
+File wDirectory = null
+File cDirectory = null
+File wFile = null
+File cFile = null
+
+def xmlFiles = textDirectory.listFiles()
+if (xmlFiles == null) return;
+
+for (File xmlFile : xmlFiles) {
+	if (xmlFile.getName().endsWith("-w.xml")) {
+		String name = xmlFile.getName().substring(0, xmlFile.getName().indexOf(".xml"))
+		wDirectory = new File(txmDirectory, name)
+		wFile = xmlFile
+	} else if (xmlFile.getName().endsWith("-c.xml")) {
+		String name = xmlFile.getName().substring(0, xmlFile.getName().indexOf(".xml"))
+		cDirectory = new File(txmDirectory, name)
+		cFile = xmlFile
+	}
+}
+
+if (wDirectory == null) {
+	println "The Word corpus XML file was not found in $textDirectory. Aborting."
+	return
+}
+if (cDirectory == null) {
+	println "The Letter corpus XML file was not found in $textDirectory. Aborting."
+	return
+}
+
+//Create XML-XTZ source directories
+wDirectory.mkdirs()
+cDirectory.mkdirs()
+
+// Copy XML files and split character XML file
+FileCopy.copy(wFile, new File(wDirectory, wFile.getName()));
+
+ApplyXsl2 builder = new ApplyXsl2(cSplitXSLFile);
+def xslParams = ["output-directory":cDirectory.getAbsoluteFile().toURI().toString()];
+for (String name : xslParams.keySet()) builder.setParam(name, xslParams.get(name));
+if (!builder.process(cFile, null)) {
+	println "Error: fail to split $cFile"
+	return false
+}
+if (!ApplyXsl2.processImportSources(cFrontXSLFile, cDirectory.listFiles(), [:])) {
+	println "Error: fail to apply front XSL with $cDirectory files"
+	return false
+}
+// INJECT ontologies 
+
+println "Injecting ontologies..."
+for (File f : cDirectory.listFiles()) {
+	if (f.getName().startsWith(cDirectory.getName())) {
+		OntologiesProjection cp = new OntologiesProjection(f, projectDirectory);
+		File outputFile = new File(cDirectory, "temp.xml")
+		cp.process(outputFile)
+		if (outputFile.exists() && f.delete() && outputFile.renameTo(f)) {
+		
+		} else {
+			println "Failed to replace XML file $f with $outputFile"
+			return;
+		}
+	}
+}
+
+// INJECT word's coordinates
+println "Injecting coordinates..."
+File xmlFile = new File(wDirectory, wFile.getName())
+File img_links_directory = new File(projectDirectory, "img_links")
+File zones_directory = new File(projectDirectory, "zones")
+File outputFile = new File(wDirectory, "temp.xml")
+CoordsProjection cp = new CoordsProjection(xmlFile, img_links_directory, zones_directory, "w");
+if (cp.process(outputFile)) {
+	if (outputFile.exists() && xmlFile.delete() && outputFile.renameTo(xmlFile)) {
+		
+	} else {
+		println "Failed to replace XML file $xmlFile with $outputFile"
+		return;
+	}
+} else {
+	println "Coordinates injection failed. Aborting"
+	return;
+}
+
+// Create XSL directories
+
+File wXSLDirectory = new File(wDirectory, "xsl")
+File cXSLDirectory = new File(cDirectory, "xsl")
+
+//File cSplitXSLDirectory = new File(cXSLDirectory, "1-split-merge")
+//cSplitXSLDirectory.mkdirs()
+
+File wFrontXSLDirectory = new File(wXSLDirectory, "2-front")
+//File cFrontXSLDirectory = new File(cXSLDirectory, "2-front")
+wFrontXSLDirectory.mkdirs()
+//cFrontXSLDirectory.mkdirs()
+
+// Copy Split XSL file
+//File newCSplitXSLFile = new File(cSplitXSLDirectory, cSplitXSLFile.getName())
+//FileCopy.copy(cSplitXSLFile, newCSplitXSLFile);
+
+// Copy Front XSL file
+File newWFrontXSLFile = new File(wFrontXSLDirectory, wFrontXSLFile.getName())
+//File newCFrontXSLFile = new File(cFrontXSLDirectory, cFrontXSLFile.getName())
+FileCopy.copy(wFrontXSLFile, newWFrontXSLFile);
+//FileCopy.copy(cFrontXSLFile, newCFrontXSLFile);
+
+// Copy edition XSL file
+File wEditionXSLDirectory = new File(wXSLDirectory, "4-edition")
+File cEditionXSLDirectory = new File(cXSLDirectory, "4-edition")
+wEditionXSLDirectory.mkdirs()
+cEditionXSLDirectory.mkdirs()
+File newWEditionXSLFile1 = new File(wEditionXSLDirectory, editionXSLFile1.getName())
+File newCEditionXSLFile1 = new File(cEditionXSLDirectory, editionXSLFile1.getName())
+FileCopy.copy(editionXSLFile1, newWEditionXSLFile1);
+FileCopy.copy(editionXSLFile1, newCEditionXSLFile1);
+File newWEditionXSLFile2 = new File(wEditionXSLDirectory, editionXSLFile2.getName())
+File newCEditionXSLFile2 = new File(cEditionXSLDirectory, editionXSLFile2.getName())
+FileCopy.copy(editionXSLFile2, newWEditionXSLFile2);
+FileCopy.copy(editionXSLFile2, newCEditionXSLFile2);
+File newWEditionXSLFile3 = new File(wEditionXSLDirectory, editionXSLFile3.getName())
+File newCEditionXSLFile3 = new File(cEditionXSLDirectory, editionXSLFile3.getName())
+FileCopy.copy(editionXSLFile3, newWEditionXSLFile3);
+FileCopy.copy(editionXSLFile3, newCEditionXSLFile3);
+
+//patch XSL files with image directory path and set the 'word-element' xsl param
+File projectImgDirectory = new File(projectDirectory, "img")
+def parameters = ["image-directory":projectImgDirectory.getAbsolutePath(), "word-element":"w"]
+println "update $newWEditionXSLFile3 with $parameters"
+UpdateXSLParameters p = new UpdateXSLParameters(newWEditionXSLFile3);
+if (!p.process(parameters)) {
+	println "Fail to patch $newWEditionXSLFile3"
+	return
+}
+parameters = ["image-directory":projectImgDirectory.getAbsolutePath(), "word-element":"c"]
+println "update $newCEditionXSLFile3 with $parameters"
+UpdateXSLParameters p2 = new UpdateXSLParameters(newCEditionXSLFile3);
+if (!p2.process(parameters)) {
+	println "Fail to patch $newCEditionXSLFile3"
+	return
+}
+
+// Copy js and images directories
+File wCSSDirectory =  new File(wDirectory, cssDirectory.getName())
+wCSSDirectory.mkdir()
+File wJsDirectory =  new File(wDirectory, jsDirectory.getName())
+wJsDirectory.mkdir()
+File wImagesDirectory =  new File(wDirectory, imagesDirectory.getName())
+wImagesDirectory.mkdir()
+File cCSSDirectory =  new File(cDirectory, cssDirectory.getName())
+cCSSDirectory.mkdir()
+File cJsDirectory =  new File(cDirectory, jsDirectory.getName())
+cJsDirectory.mkdir()
+File cImagesDirectory =  new File(cDirectory, imagesDirectory.getName())
+cImagesDirectory.mkdir()
+FileCopy.copyFiles(cssDirectory, wCSSDirectory);
+FileCopy.copyFiles(jsDirectory, wJsDirectory);
+FileCopy.copyFiles(imagesDirectory, wImagesDirectory);
+FileCopy.copyFiles(cssDirectory, cCSSDirectory);
+FileCopy.copyFiles(jsDirectory, cJsDirectory);
+FileCopy.copyFiles(imagesDirectory, cImagesDirectory);
+
+// Prepare import.xml files
+File wImportXMLFile = new File(wDirectory, "import.xml")
+File cImportXMLFile = new File(cDirectory, "import.xml")
+
+BaseParameters.createEmptyParams(wImportXMLFile, AsciiUtils.buildId(wDirectory.getName()).toUpperCase())
+BaseParameters wParams = new BaseParameters(wImportXMLFile)
+wParams.load()
+wParams.setSkipTokenization(true);
+wParams.setWordElement("w")
+wParams.setDoAnnotation(false)
+wParams.setAnnotationLang("fr")
+wParams.setWordsPerPage(9999999)
+wParams.setTextualPlans("", "note", "teiHeader,facsimile","pb,cb,lb")
+wParams.getCorpusElement().setAttribute("font", "Junicode");
+wParams.getEditionsElement(wParams.getCorpusElement()).setAttribute("default", "default,facsimile")
+wParams.getCorpusElement().setAttribute("name", AsciiUtils.buildId(wDirectory.getName()).toUpperCase());
+wParams.save();
+
+BaseParameters.createEmptyParams(cImportXMLFile, AsciiUtils.buildId(cDirectory.getName()).toUpperCase())
+BaseParameters cParams = new BaseParameters(cImportXMLFile)
+cParams.load()
+cParams.setSkipTokenization(true);
+cParams.setWordElement("c")
+cParams.setDoAnnotation(false)
+cParams.setAnnotationLang("fr")
+cParams.setWordsPerPage(9999999)
+cParams.setTextualPlans("", "note", "teiHeader,facsimile","pb,cb,lb")
+cParams.getCorpusElement().setAttribute("font", "Junicode");
+cParams.getEditionsElement(cParams.getCorpusElement()).setAttribute("default", "default,facsimile")
+cParams.getCorpusElement().setAttribute("name", AsciiUtils.buildId(cDirectory.getName()).toUpperCase());
+cParams.save();
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/txm-front-teioriflammsw-xtz.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/txm-front-teioriflammsw-xtz.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/txm-front-teioriflammsw-xtz.xsl	(revision 728)
@@ -0,0 +1,303 @@
+<?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"
+  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
+  exclude-result-prefixes="tei edate bfm me" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
+  
+
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille XSLT prÃ©pare les fichiers au format TEI Oriflamms
+      (tokÃ©nisÃ©s par mot) Ã  l'imppportation dans TXM avec le module XTZ
+      (Ã©tape 2 "front").
+    </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>2016, CNRS / ICAR (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+
+  <xsl:template match="*" mode="#all">
+    <xsl:copy>
+      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()" mode="#current"/>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="comment()|processing-instruction()|text()|@*">
+    <xsl:copy>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="comment()|processing-instruction()|@*" mode="expan letters-all 
+    letters-alignable characters-alignable">
+    <xsl:copy>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+
+  <xsl:variable name="filename">
+    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)-w\.xml$">
+      <xsl:matching-substring>
+        <xsl:value-of select="regex-group(2)"/>
+      </xsl:matching-substring>
+    </xsl:analyze-string>
+  </xsl:variable>
+  
+  <xsl:template match="tei:facsimile"/>
+  
+<xsl:template match="tei:teiCorpus">
+  <TEI xmlns="http://www.tei-c.org/ns/1.0">
+    <text>
+      <!-- on ajoute des attributs utiles pour la crÃ©ation de partitions et de sous-corpus -->
+      <xsl:apply-templates/>
+    </text>
+  </TEI>
+</xsl:template>
+
+
+<xsl:template match="tei:TEI[ancestor::tei:teiCorpus]">
+<xsl:apply-templates/>
+</xsl:template>
+  
+  <xsl:template match="tei:teiHeader">
+    <!--<xsl:copy-of select="."/>-->
+  </xsl:template>
+  
+  <xsl:template match="tei:text[not(ancestor::tei:teiCorpus)]">
+    <xsl:element name="text" namespace="http://www.tei-c.org/ns/1.0">
+      <!-- on ajoute des attributs utiles pour la crÃ©ation de partitions et de sous-corpus -->
+      <xsl:apply-templates select="@*"/>
+     <xsl:apply-templates/> 
+    </xsl:element>
+  </xsl:template>
+  
+  <xsl:template match="tei:text[ancestor::tei:teiCorpus]">
+    <div type="text" id="{$filename}-{count(preceding::tei:text) + 1}" xmlns="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*|node()"/>
+    </div>
+  </xsl:template>
+
+<xsl:template match="tei:milestone[@unit='surface']">
+  <pb xmlns="http://www.tei-c.org/ns/1.0" n="{following::tei:pb[1]/@n}" facs="{@facs}" xml:id="{@xml:id}"/>
+</xsl:template>
+  
+  <xsl:template match="tei:pb">
+    <milestone unit="ms-page">
+      <xsl:apply-templates select="@*"/>
+    </milestone>
+  </xsl:template>
+
+<xsl:template match="tei:w[not(tei:seg[@type='wp'])]">
+  <xsl:element name="w" namespace="http://www.tei-c.org/ns/1.0">
+    <xsl:apply-templates select="@*"/>
+    <xsl:attribute name="expan"><xsl:apply-templates mode="expan"/></xsl:attribute>
+    <xsl:attribute name="letters-all"><xsl:apply-templates mode="letters-all"/></xsl:attribute>
+    <xsl:attribute name="letters-alignable"><xsl:apply-templates mode="letters-alignable"/></xsl:attribute>
+    <xsl:attribute name="characters"><xsl:apply-templates mode="characters-alignable"/></xsl:attribute>
+    <xsl:attribute name="abbr-n">
+      <xsl:choose>
+        <xsl:when test="descendant::tei:abbr">
+          <xsl:value-of select="count(descendant::tei:abbr)"/>
+        </xsl:when>
+        <xsl:when test="descendant::tei:expan">
+          <xsl:value-of select="count(descendant::tei:expan)"/>
+        </xsl:when>
+        <xsl:when test="descendant::tei:ex">
+          <xsl:value-of select="count(descendant::tei:ex)"/>
+        </xsl:when>
+        <xsl:otherwise>0</xsl:otherwise>
+      </xsl:choose>
+    </xsl:attribute>
+    <xsl:attribute name="ref"><xsl:value-of select="concat($filename,', f. ',preceding::tei:pb[1]/@n,', col. ',preceding::tei:cb[1]/@n,', l. ',preceding::tei:lb[1]/@n)"/></xsl:attribute>
+    <xsl:apply-templates/>
+  </xsl:element>
+</xsl:template>
+  
+  <xsl:template match="tei:w[tei:seg[@type='wp']]">
+    <xsl:element name="w-lb" namespace="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="expan"><xsl:apply-templates mode="expan"/></xsl:attribute>
+      <xsl:attribute name="letters-all"><xsl:apply-templates mode="letters-all"/></xsl:attribute>
+      <xsl:attribute name="letters-alignable"><xsl:apply-templates mode="letters-alignable"/></xsl:attribute>
+      <xsl:attribute name="characters"><xsl:apply-templates mode="characters-alignable"/></xsl:attribute>
+      <xsl:attribute name="abbr-n">
+        <xsl:choose>
+          <xsl:when test="descendant::tei:abbr">
+            <xsl:value-of select="count(descendant::tei:abbr)"/>
+          </xsl:when>
+          <xsl:when test="descendant::tei:expan">
+            <xsl:value-of select="count(descendant::tei:expan)"/>
+          </xsl:when>
+          <xsl:when test="descendant::tei:ex">
+            <xsl:value-of select="count(descendant::tei:ex)"/>
+          </xsl:when>
+          <xsl:otherwise>0</xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:attribute name="ref"><xsl:value-of select="concat($filename,', f. ',preceding::tei:pb[1]/@n,', col. ',preceding::tei:cb[1]/@n,', l. ',preceding::tei:lb[1]/@n)"/></xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+  
+  <xsl:template match="tei:seg[@type='wp']">
+    <xsl:element name="w" namespace="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="expan"><xsl:apply-templates mode="expan"/></xsl:attribute>
+      <xsl:attribute name="letters-all"><xsl:apply-templates mode="letters-all"/></xsl:attribute>
+      <xsl:attribute name="letters-alignable"><xsl:apply-templates mode="letters-alignable"/></xsl:attribute>
+      <xsl:attribute name="characters"><xsl:apply-templates mode="characters-alignable"/></xsl:attribute>
+      <xsl:attribute name="abbr-n">
+        <xsl:value-of select="count(descendant::tei:abbr)"/>
+      </xsl:attribute>
+      <xsl:attribute name="ref"><xsl:value-of select="concat($filename,', f. ',preceding::tei:pb[1]/@n,', col. ',preceding::tei:cb[1]/@n,', l. ',preceding::tei:lb[1]/@n)"/></xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+  
+  <xsl:template match="tei:pc[not(child::tei:reg or @ana='ori:align-no')]">
+    <xsl:element name="w" namespace="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="type">pc</xsl:attribute>
+      <xsl:attribute name="expan"><xsl:apply-templates/></xsl:attribute>
+      <xsl:attribute name="letters-all"><xsl:apply-templates mode="letters-all"/></xsl:attribute>
+      <xsl:attribute name="letters-alignable"><xsl:apply-templates mode="letters-alignable"/></xsl:attribute>
+      <xsl:attribute name="characters"><xsl:apply-templates mode="characters-alignable"/></xsl:attribute>
+      <xsl:attribute name="abbr-n">
+        <xsl:value-of select="0"/>
+      </xsl:attribute>
+      <xsl:attribute name="ref"><xsl:value-of select="concat($filename,', f. ',preceding::tei:pb[1]/@n,', col. ',preceding::tei:cb[1]/@n,', l. ',preceding::tei:lb[1]/@n)"/></xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+  
+  <xsl:template match="tei:pc[child::tei:reg or @ana='ori:align-no']">
+    <xsl:comment><xsl:copy-of select="."/></xsl:comment>
+  </xsl:template>
+
+  <xsl:template match="tei:choice[tei:abbr]">
+    <xsl:apply-templates select="tei:abbr"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:choice[tei:abbr]" mode="expan">
+    <xsl:apply-templates select="tei:expan" mode="#current"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:choice[tei:abbr]" mode="letters-all">
+    <xsl:apply-templates select="tei:expan" mode="#current"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:choice[tei:abbr]" mode="letters-alignable">
+    <xsl:choose>
+      <xsl:when test="tei:expan[tei:ex]">
+        <xsl:apply-templates select="tei:expan" mode="#current"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates select="tei:abbr" mode="#current"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="tei:choice[tei:abbr]" mode="characters-alignable">
+    <xsl:apply-templates select="tei:abbr" mode="#current"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:choice[tei:orig]" mode="#all">
+    <xsl:apply-templates select="tei:orig" mode="#current"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:abbr" mode="letters-alignable">
+    <xsl:apply-templates select="descendant::text()" mode="letters-alignable"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:reg" mode="#all"></xsl:template>
+  
+  <xsl:template match="tei:orig" mode="#all">
+    <xsl:apply-templates mode="#current"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:ex" mode="expan">
+    <xsl:text>(</xsl:text>
+    <xsl:value-of select="normalize-space(.)"/>
+    <xsl:text>)</xsl:text>
+  </xsl:template>
+  
+  <xsl:template match="tei:ex" mode="letters-all">
+    <xsl:value-of select="normalize-space(.)"/>
+  </xsl:template>
+  
+  <xsl:template match="tei:ex" mode="letters-alignable"/>
+  
+  <xsl:template match="tei:ex" mode="characters-alignable">
+    <xsl:choose>
+      <xsl:when test="matches(.,'^(cum|com|con)$','i')">&#xA76F;</xsl:when>
+      <xsl:when test="matches(.,'^et$','i')">&#x204A;</xsl:when>
+      <xsl:when test="matches(.,'^est$','i')">&#x223B;</xsl:when>
+      <xsl:when test="matches(.,'^us$','i')">&#xA770;</xsl:when>
+      <xsl:otherwise/>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="tei:supplied"></xsl:template>
+  
+  
+  <xsl:template match="text()" mode="expan letters-all">
+    <xsl:value-of select="normalize-space(.)"/>
+  </xsl:template>
+
+
+<xsl:template match="tei:w//text()" mode="characters-alignable">
+  <xsl:analyze-string select="." regex="\p{{M}}|\s">
+    <xsl:matching-substring/>
+    <xsl:non-matching-substring><xsl:value-of select="."/></xsl:non-matching-substring>
+  </xsl:analyze-string>
+</xsl:template>
+  
+  <xsl:template match="tei:w//text()" mode="letters-alignable">
+    <xsl:analyze-string select="." regex=".">
+      <xsl:matching-substring>
+        <xsl:choose>
+          <xsl:when test="matches(.,'\p{M}|\s')"></xsl:when>
+          <xsl:when test="matches(.,$alignable-abbreviation-marks)"/>
+          <xsl:when test="matches(.,$modified-letters)">
+            <xsl:call-template name="modified-letters"/>
+          </xsl:when>
+          <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
+        </xsl:choose>
+      </xsl:matching-substring>
+    </xsl:analyze-string>
+  </xsl:template>
+
+  <xsl:variable name="modified-letters">^(&#x0141;|&#x0142;|[&#xA748;-&#xA759;])$</xsl:variable>
+  <xsl:variable name="alignable-abbreviation-marks">^(&amp;|&#x204A;|&#x2079;|&#x223B;|&#xA76F;|&#xA770;|&#xF1A6;|&#xF1AC;)$</xsl:variable>
+  
+  <xsl:template name="modified-letters">
+    <xsl:choose>
+      <xsl:when test="matches(.,'&#x0141;|&#xA748;')">L</xsl:when>
+      <xsl:when test="matches(.,'&#x0142;|&#xA749;')">l</xsl:when>
+      <xsl:when test="matches(.,'&#xA750;|&#xA752;|&#xA754;')">P</xsl:when>
+      <xsl:when test="matches(.,'&#xA751;|&#xA753;|&#xA755;')">p</xsl:when>
+      <xsl:when test="matches(.,'&#xA756;|&#xA758;')">Q</xsl:when>
+      <xsl:when test="matches(.,'&#xA757;|&#xA759;')">q</xsl:when>
+      <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/txm-front-teioriflammsw-xtz.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/TEI2ProjectMacro.properties
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/TEI2ProjectMacro.properties	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/TEI2ProjectMacro.properties	(revision 728)
@@ -0,0 +1,6 @@
+#
+#Thu Feb 04 15:32:51 CET 2016
+imagesDirectory=/home/mdecorde/TEMP/testori/img/P1719
+xmlFile=/home/mdecorde/TEMP/testori/P1719.xml
+createArchive=false
+xslFile=xsl

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/TEI2ProjectMacro.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/CoordsProjection.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/CoordsProjection.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/CoordsProjection.groovy	(revision 728)
@@ -0,0 +1,186 @@
+package org.txm.macro.oriflamms.prepare
+
+import org.txm.importer.StaxIdentityParser;
+import org.txm.importer.StaxParser;
+
+class CoordsProjection extends StaxIdentityParser {
+
+	File xmlFile
+	File img_links_directory
+	File zones_directory
+
+	String wordTag
+	String textname
+	String milestone
+
+	String current_img_file = ""
+	String current_zone_file = ""
+
+	String xmlType;
+	String group
+
+	HashMap<String, String> zones = [:]
+	HashMap<String, String> links = [:]
+
+	public CoordsProjection(File xmlFile, File img_links_directory, File zones_directory, String wordTag) {
+		super(xmlFile)
+
+		this.xmlFile = xmlFile
+		this.img_links_directory = img_links_directory
+		this.zones_directory = zones_directory
+		this.wordTag = wordTag;
+
+		textname = xmlFile.getName()
+		int idx = textname.indexOf(".xml")
+		if (idx > 0) textname = textname.substring(0, idx)
+
+		idx = textname.indexOf("-w")
+		if (idx > 0) {
+			textname = textname.substring(0, idx)
+			xmlType = "word"
+		}
+
+		idx = textname.indexOf("-c")
+		if (idx > 0) {
+			textname = textname.substring(0, idx)
+			xmlType = "character"
+		}
+	}
+
+	public void processStartElement() {
+		super.processStartElement();
+		if (localname.equals("milestone")) {
+			String id = "";
+			String unit= "";
+			for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+				if (parser.getAttributeLocalName(i).equals("id")) {
+					id = parser.getAttributeValue(i)
+				} else if (parser.getAttributeLocalName(i).equals("unit")) {
+					unit = parser.getAttributeValue(i)
+				}
+			}
+
+			if (unit.equals("surface")) {
+				milestone = id;
+			}
+		} else if (localname.equals(wordTag)) {
+			String id = "";
+			for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+				if (parser.getAttributeLocalName(i).equals("id")) {
+					id = parser.getAttributeValue(i)
+					break;
+				}
+			}
+
+			// load next data if needed
+			String img_file_name = textname+"_"+milestone+"-links.xml"
+			if (!current_img_file.equals(img_file_name)) { // rebuild hashmaps
+				String zone_file_name = textname+"_"+milestone+"-zones.xml"
+				loadNextData(img_file_name, zone_file_name);
+			}
+
+			//			println "Find coords for word_id="+id+" in "+img_file_name+" and "+zone_file_name
+			//			println "zone: "+links[id]
+			//			println "coords: "+zones[links[id]]
+			if (zones.size() > 0 && links.size() > 0) {
+				def coords = zones[links[id]]
+				if (coords != null) {
+					if (coords[0] == null || coords[1] == null || coords[2] == null || coords[3] == null) {
+						println "WARNING one of coordinates is missing: $coords"
+					} else {
+						writer.writeAttribute("x1", coords[0])
+						writer.writeAttribute("y1", coords[1])
+						writer.writeAttribute("x2", coords[2])
+						writer.writeAttribute("y2", coords[3])
+					}
+				} else {
+					println "WARNING No group for word id="+id+" and link id="+links[id]+" in text "+textname
+				}
+			}
+		}
+	}
+
+	protected void loadNextData(String img_file_name, String zone_file_name) {
+		File img_link_file = new File(img_links_directory, img_file_name)
+		File zone_file = new File(zones_directory, zone_file_name)
+
+		zones.clear()
+		links.clear()
+		if (zone_file.exists()) {
+			StaxParser pZones = new StaxParser(zone_file) {
+						void processStartElement() {
+							if (localname.equals("zone")) {
+								String type = "";
+								String idZone = "";
+								String ulx, uly, lrx, lry;
+
+								for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+									if (parser.getAttributeLocalName(i).equals("id")) {
+										idZone = parser.getAttributeValue(i)
+									} else if (parser.getAttributeLocalName(i).equals("type")) {
+										type = parser.getAttributeValue(i)
+									} else if (parser.getAttributeLocalName(i).equals("ulx")) {
+										ulx = parser.getAttributeValue(i)
+									} else if (parser.getAttributeLocalName(i).equals("uly")) {
+										uly = parser.getAttributeValue(i)
+									} else if (parser.getAttributeLocalName(i).equals("lrx")) {
+										lrx = parser.getAttributeValue(i)
+									} else if (parser.getAttributeLocalName(i).equals("lry")) {
+										lry = parser.getAttributeValue(i)
+									}
+								}
+
+								if (type.equals(xmlType)) {
+									zones[idZone] = [ulx, uly, lrx, lry]
+								}
+
+							}
+						}
+					};
+			pZones.process();
+		}
+		if (img_link_file.exists()) {
+			StaxParser pLinks = new StaxParser(img_link_file) {
+						void processStartElement() {
+							if (localname.equals("linkGrp")) {
+								for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+									if (parser.getAttributeLocalName(i).equals("type")) {
+										group = parser.getAttributeValue(i)
+										break
+									}
+								}
+							} else if (localname.equals("link") && group.startsWith(xmlType)) {
+								String target = "";
+
+								for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+									if (parser.getAttributeLocalName(i).equals("target")) {
+										target = parser.getAttributeValue(i)
+										break
+									}
+								}
+
+								def split = target.split(" ")
+								links[split[0].substring(4)] = split[1].substring(4)
+							}
+						}
+					};
+			pLinks.process();
+		}
+		//println "zones size: "+zones.size()
+		//println "links size: "+links.size()
+
+		current_img_file = img_file_name
+	}
+
+	public static void main(String[] args) {
+		File corpusDirectory = new File("/home/mdecorde/TEMP/testori/FontenatTestAlignement")
+		File xmlFile = new File(corpusDirectory, "txm/FontenayTest-w/FontenayTest-w.xml")
+		File img_links_directory = new File(corpusDirectory, "img_links")
+		File zones_directory = new File(corpusDirectory, "zones")
+
+		File outputFile = new File(corpusDirectory, "txm/FontenayTest-w/FontenayTest-w-coords.xml")
+
+		CoordsProjection cp = new CoordsProjection(xmlFile, img_links_directory, zones_directory, "w");
+		println cp.process(outputFile)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/Project2XTZMacro.properties
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/Project2XTZMacro.properties	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/Project2XTZMacro.properties	(revision 728)
@@ -0,0 +1,3 @@
+#
+#Sun Feb 07 12:53:04 CET 2016
+projectDirectory=project

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/Project2XTZMacro.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-charrettenew-oriflammsxml.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-charrettenew-oriflammsxml.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-charrettenew-oriflammsxml.xsl	(revision 728)
@@ -0,0 +1,155 @@
+<?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 xd txm" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="no"/>
+  
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille permet de convertir la transcription compacte de la 
+      Queste del saint Graal au format XML-TEI du projet Oriflamms.
+    </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 (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+  <xsl:template match="/">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  
+  <xsl:template match="*">
+        <xsl:copy>
+          <xsl:apply-templates select="@*"/>
+          <xsl:apply-templates select="*|processing-instruction()|comment()|text()"/>
+        </xsl:copy>
+  </xsl:template>
+
+  <xsl:template match="comment()|text()">
+    <xsl:copy/>
+  </xsl:template>
+  
+  <xsl:template match="processing-instruction()"></xsl:template>
+
+  <!-- On supprime les attributs par dÃ©faut de la DTD TEI -->
+  
+  <xsl:template match="@*">
+    <xsl:choose>
+      <xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/>
+      <xsl:when test="matches(name(.),'rend')">
+        <xsl:choose>
+          <xsl:when test="matches(.,'^aggl$')"><xsl:attribute name="rend">space-after(none)</xsl:attribute></xsl:when>
+          <xsl:otherwise><xsl:copy/></xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise><xsl:copy/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="tei:teiHeader">    
+      <xsl:copy>
+        <xsl:apply-templates select="@*"/>
+        <xsl:apply-templates/>
+      </xsl:copy>    
+  </xsl:template>
+
+<xsl:template match="tei:revisionDesc">
+  <xsl:copy>
+  <xsl:apply-templates select="@*"/>
+  <change xmlns="http://www.tei-c.org/ns/1.0" when="{format-date(current-date(),'[Y]-[M01]-[D01]')}" who="#auto">Conversion automatique au format XML-TEI-Oriflamms</change>
+  <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+  
+  <xsl:template match="tei:encodingDesc">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+      <xsl:if test="not(//tei:prefixDef[@ident='ori'])">
+        <listPrefixDef xmlns="http://www.tei-c.org/ns/1.0">
+          <prefixDef xmlns="http://www.tei-c.org/ns/1.0" ident="ori" 
+            matchPattern="([a-z]+)" 
+            replacementPattern="oriflamms-annotation-scheme.xml#$1">
+            <p>In the context of this project, private URIs with the prefix
+              "ori" point to <gi>interp</gi> elements in the project's
+              oriflamms-annotation-scheme.xml file.
+            </p>
+          </prefixDef>
+        </listPrefixDef>
+      </xsl:if>
+    </xsl:copy>
+  </xsl:template>
+
+
+<xsl:template match="tei:div3[@facs]">
+  <xsl:variable name="facs">
+    <xsl:value-of select="@facs"/>
+  </xsl:variable>
+  <xsl:if test="not(preceding::tei:div3/@facs=$facs)">
+    <milestone unit="surface" xmlns="http://www.tei-c.org/ns/1.0" facs="{@facs}"/>
+  </xsl:if>
+    
+  <pb xmlns="http://www.tei-c.org/ns/1.0" facs="{@facs}" n="{parent::div2/@n}{@n}"/>
+  <xsl:copy>
+    <xsl:apply-templates select="@*|node()"/>
+  </xsl:copy>
+</xsl:template>
+  
+  <xsl:template match="tei:div3[not(@facs)]">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="ana"><xsl:text>ori:align-no</xsl:text></xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="tei:div4">
+    <cb xmlns="http://www.tei-c.org/ns/1.0" n="{@n}"/>
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+  </xsl:template>
+
+  <xsl:template match="tei:l">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <lb xmlns="http://www.tei-c.org/ns/1.0" n="{@n}"/>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>  
+
+<xsl:template match="tei:note|tei:supplied|tei:head">
+  <xsl:copy>
+    <xsl:apply-templates select="@*"/>
+    <xsl:attribute name="ana">
+      <xsl:if test="@ana"><xsl:value-of select="concat(@ana,' ')"/></xsl:if>
+      <xsl:text>ori:align-no</xsl:text>
+    </xsl:attribute>
+    <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+  
+<xsl:template match="tei:c[@type='lettrine']">
+  <g xmlns="http://www.tei-c.org/ns/1.0" n="{@n}">
+    <xsl:apply-templates select="@*|node()"/>
+  </g>
+</xsl:template>
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-charrettenew-oriflammsxml.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-cartulaireblanc-oriflammsxml.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-cartulaireblanc-oriflammsxml.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-cartulaireblanc-oriflammsxml.xsl	(revision 728)
@@ -0,0 +1,344 @@
+<?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"
+  xmlns:xi="http://www.w3.org/2001/XInclude" 
+  xmlns:svg="http://www.w3.org/2000/svg" 
+  xmlns:math="http://www.w3.org/1998/Math/MathML"
+  exclude-result-prefixes="tei edate xd txm xi svg math" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="no"/>
+  
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille permet de convertir les transcription du 
+      Cartulaire Blanc de Saint-Denis au format XML-TEI du projet Oriflamms.
+    </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 (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+  <!--<xsl:strip-space elements="*"/>-->
+  
+  <xsl:param name="baseMsSiglum">CB</xsl:param>
+  
+  <xsl:variable name="baseMsPattern"><xsl:value-of select="concat('^#?',$baseMsSiglum,'| #?',$baseMsSiglum)"/></xsl:variable>
+  
+  <xsl:template match="*|comment()">
+    <!-- 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="processing-instruction()"/>
+
+  <!-- On supprime les attributs par dÃ©faut de la DTD TEI -->
+  
+  <xsl:template match="@*">
+    <xsl:choose>
+      <xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/>
+      <xsl:otherwise><xsl:copy/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<xsl:template match="@facs">
+  <xsl:attribute name="facs"><xsl:value-of select="replace(.,'\.tif$','.png','i')"/></xsl:attribute>
+</xsl:template>
+
+  <xsl:template match="tei:teiHeader">    
+      <xsl:copy>
+        <xsl:apply-templates select="@*"/>
+        <xsl:apply-templates/>
+      </xsl:copy>    
+  </xsl:template>
+    
+
+<xsl:template match="tei:revisionDesc">
+  <xsl:copy>
+  <xsl:apply-templates select="@*"/>
+    <change xmlns="http://www.tei-c.org/ns/1.0" when="2007-01-01" who="#DS">Publication du document original</change>
+    <!-- information rÃ©cupÃ©rÃ©e Ã  partir de /TEI/text[1]/front[1]/titlePage[1]/docDate[1] -->
+    <change xmlns="http://www.tei-c.org/ns/1.0" when="{format-date(current-date(),'[Y]-[M01]-[D01]')}" who="#auto">Conversion automatique au format XML-TEI-Oriflamms</change>
+  <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+  
+  <xsl:template match="tei:encodingDesc">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+      <xsl:if test="not(//tei:prefixDef[@ident='ori'])">
+        <listPrefixDef xmlns="http://www.tei-c.org/ns/1.0">
+          <prefixDef xmlns="http://www.tei-c.org/ns/1.0" ident="ori" 
+            matchPattern="([a-z]+)" 
+            replacementPattern="oriflamms-annotation-scheme.xml#$1">
+            <p>In the context of this project, private URIs with the prefix
+              "ori" point to <gi>interp</gi> elements in the project's
+              oriflamms-annotation-scheme.xml file.
+            </p>
+          </prefixDef>
+        </listPrefixDef>
+      </xsl:if>
+    </xsl:copy>
+  </xsl:template>
+
+<xsl:template match="tei:sourceDesc">
+  <xsl:copy>
+    <xsl:apply-templates select="@*"/>
+    <msDesc xmlns="http://www.tei-c.org/ns/1.0">
+      <msIdentifier xmlns="http://www.tei-c.org/ns/1.0" xml:id="CB">
+        <country xmlns="http://www.tei-c.org/ns/1.0">France</country>
+        <settlement xmlns="http://www.tei-c.org/ns/1.0">Paris</settlement>
+        <institution xmlns="http://www.tei-c.org/ns/1.0">Archives nationales</institution>
+        <idno xmlns="http://www.tei-c.org/ns/1.0">LL 1157</idno>
+      </msIdentifier>
+    </msDesc>
+    <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+
+<!-- On restructure le document pour avoir un TEI par charte -->
+  
+  <!-- TEI devient teiCorpus -->
+  
+  <xsl:template match="tei:TEI">
+    <xsl:element name="teiCorpus" xmlns="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+
+  <!-- on supprime l'Ã©lÃ©ment text de niveau 1 et travaille directement sur le niveau 2 (l'Ã©lÃ©ment group intermÃ©diaire disparait)-->
+  
+<!--  <xsl:template match="tei:TEI/tei:text">
+    <xsl:apply-templates select="descendant::tei:text"/>
+  </xsl:template>-->
+
+ 
+  <xsl:template match="tei:text[descendant::tei:text]">
+    <xsl:apply-templates/>
+<!--    <teiCorpus xmlns="http://www.tei-c.org/ns/1.0">
+      <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+        <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <title xmlns="http://www.tei-c.org/ns/1.0">
+              <xsl:value-of select="tei:group[1]/tei:head[1]"/>
+            </title>            
+          </titleStmt>
+          <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+          </publicationStmt>
+          <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+          </sourceDesc>
+        </fileDesc>
+        <profileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <!-\- argument devient profileDesc/abstract -\->
+          <xsl:apply-templates select="descendant::tei:argument[1]"/>
+        </profileDesc>        
+      </teiHeader>
+      <xsl:apply-templates/>
+    </teiCorpus>-->
+  </xsl:template>
+  
+  <xsl:template match="tei:text[descendant::tei:text]/tei:front">
+    <xsl:choose>
+      <xsl:when test="descendant::tei:div">
+        <TEI xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no">
+          <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+            <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+              <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+                <title xmlns="http://www.tei-c.org/ns/1.0">
+                  <xsl:text>Introduction</xsl:text>
+                </title>
+              </titleStmt>
+              <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+                <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+              </publicationStmt>
+              <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+                <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+              </sourceDesc>
+            </fileDesc>
+          </teiHeader>
+          <text xmlns="http://www.tei-c.org/ns/1.0">
+            <body xmlns="http://www.tei-c.org/ns/1.0">
+              <xsl:apply-templates select="tei:div"/>
+            </body>
+            
+          </text>
+        </TEI>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:comment><xsl:copy-of select="."/></xsl:comment>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="tei:text[descendant::tei:text]/tei:back">
+    <xsl:choose>
+      <xsl:when test="descendant::tei:div">
+        <TEI xmlns="http://www.tei-c.org/ns/1.0" ana="ori:align-no">
+          <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+            <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+              <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+                <title xmlns="http://www.tei-c.org/ns/1.0">
+                  <xsl:text>Appendices</xsl:text>
+                </title>
+              </titleStmt>
+              <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+                <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+              </publicationStmt>
+              <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+                <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+              </sourceDesc>
+            </fileDesc>
+          </teiHeader>
+          <text xmlns="http://www.tei-c.org/ns/1.0">
+            <body xmlns="http://www.tei-c.org/ns/1.0">
+              <xsl:apply-templates select="descendant::tei:div"/>
+            </body>
+            
+          </text>
+        </TEI>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:comment><xsl:copy-of select="."/></xsl:comment>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="tei:text//tei:text[not(descendant::tei:text) and descendant::tei:div[@type='transcription']]">
+    <TEI xmlns="http://www.tei-c.org/ns/1.0">
+      <teiHeader xmlns="http://www.tei-c.org/ns/1.0">
+        <fileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <titleStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <title xmlns="http://www.tei-c.org/ns/1.0">
+              <xsl:text>Acte </xsl:text>
+              <xsl:value-of select="descendant::tei:head[1]"></xsl:value-of>
+            </title>            
+          </titleStmt>
+          <publicationStmt xmlns="http://www.tei-c.org/ns/1.0">
+            <p xmlns="http://www.tei-c.org/ns/1.0">See the header of the top level teiCorpus</p>
+          </publicationStmt>
+          <!-- les Ã©lÃ©ments listWit et listBibl sont placÃ©s dans sourceDesc -->
+          <sourceDesc xmlns="http://www.tei-c.org/ns/1.0">
+            <!--<xsl:copy-of select="descendant::tei:listWit[1]"/>-->
+            <xsl:choose>
+              <xsl:when test="descendant::tei:div[@type='tradition']">
+                <xsl:copy-of select="descendant::tei:div[@type='tradition']/node()[not(self::tei:div[@type='comments'])]"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <p>Aucune information</p>
+              </xsl:otherwise>
+            </xsl:choose>
+            
+            <!--<xsl:copy-of select="descendant::tei:listBibl[1]"></xsl:copy-of>-->
+          </sourceDesc>
+        </fileDesc>
+        <profileDesc xmlns="http://www.tei-c.org/ns/1.0">
+          <!-- docDate devient profileDesc/creation/date[@type='documentCreation'] -->
+          <creation xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates select="descendant::tei:docDate/tei:date"/></creation>
+          <!-- front/div[@type="summary"] devient profileDesc/abstract -->
+          <xsl:if test="descendant::tei:div[@type='short-summary']">
+            <abstract xmlns="http://www.tei-c.org/ns/1.0" rend="short-summary">
+              <xsl:apply-templates select="descendant::tei:div[@type='short-summary']/node()"/>
+            </abstract>            
+          </xsl:if>
+        </profileDesc>
+      </teiHeader>
+      <text xmlns="http://www.tei-c.org/ns/1.0">
+        <xsl:apply-templates/>
+      </text>
+    </TEI>
+  </xsl:template>
+  
+  <xsl:template match="tei:text//tei:text[not(descendant::tei:text) and not(descendant::tei:div[@type='transcription'])]">
+    <xsl:comment>Texte sans transcription !</xsl:comment>
+    <xsl:comment><xsl:copy-of select="."/></xsl:comment>
+  </xsl:template>
+  
+  <xsl:template match="tei:text[not(descendant::tei:text)]/tei:front
+    |tei:text[not(descendant::tei:text)]/tei:back
+    |tei:div[matches(@type,'comments|notes')]">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="ana">ori:align-no</xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:copy>    
+  </xsl:template>
+  
+
+<xsl:template match="tei:group">
+  <xsl:apply-templates/>
+</xsl:template>
+  
+  <xsl:template match="tei:milestone">
+    <xsl:choose>
+      <xsl:when test="parent::tei:group"/>
+      <xsl:otherwise>
+        <xsl:copy-of select="."/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<xsl:template match="tei:group/tei:head"/>
+
+  <!-- on supprime listWit du corps du texte (cf. l'entÃªte) -->
+  <xsl:template match="tei:listWit|tei:div[@type='tradition']"/>
+
+<!-- on supprime les entÃªtes et pied de pages (non alignables) -->
+  
+  <xsl:template match="tei:fw">
+    <xsl:comment>fw : <xsl:copy-of select="."/></xsl:comment>
+  </xsl:template>
+
+  <!-- on ajoute un attribut pour faciliter l'identification des segments Ã  ne pas aligner -->
+  
+  <xsl:template match="tei:choice/tei:expan|tei:choice/tei:corr|tei:supplied|tei:note|tei:witDetail|tei:lem[@resp='#OGJ']">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:attribute name="ana">ori:align-no</xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="tei:milestone[@unit='page']">
+    <xsl:if test="@facs">
+      <milestone xmlns="http://www.tei-c.org/ns/1.0" unit="surface">
+        <xsl:attribute name="facs">
+          <xsl:value-of select="@facs"/>
+        </xsl:attribute>
+      </milestone>
+    </xsl:if>
+    <pb xmlns="http://www.tei-c.org/ns/1.0">
+      <xsl:apply-templates select="@*[not(name()='unit')]"/>
+    </pb>
+  </xsl:template>
+  
+
+<!--<xsl:template match="text()[following-sibling::*[1][self::tei:milestone or self::tei:pb or self::tei:cb or self::tei:lb] and following-sibling::tei:lb[1][@break='no']]">
+  <xsl:choose>
+    <!-\- patch d'espace blanc devant les sauts de ligne Ã  l'intÃ©rieur de mots -\->
+    <xsl:when test="matches(.,'\s+$')"><xsl:value-of select="replace(.,'\s+$','')"/></xsl:when>
+    <xsl:otherwise><xsl:copy/></xsl:otherwise>
+  </xsl:choose>
+</xsl:template>-->
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-convert-cartulaireblanc-oriflammsxml.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-tokenize-words.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-tokenize-words.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-tokenize-words.xsl	(revision 728)
@@ -0,0 +1,175 @@
+<?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 xd txm" version="2.0">
+
+  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="no"/>
+  
+  <xd:doc type="stylesheet">
+    <xd:short>
+      Cette feuille XSLT permet de prÃ©-tokeniser par mot des fichiers au format
+      XML-TEI Oriflamms brut
+    </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 (Ã‰quipe CACTUS)</xd:copyright>
+  </xd:doc>
+  
+<!--  <xsl:template match="/">
+    <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()|processing-instruction()|text()">
+    <xsl:copy/>
+  </xsl:template>
+
+  <!-- On supprime les attributs par dÃ©faut de la DTD TEI -->
+  
+  <xsl:template match="@*">
+    <xsl:choose>
+      <xsl:when test="matches(name(.),'^(part|instant|anchored|full)$')"/>
+      <xsl:otherwise><xsl:copy/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<!--  <xsl:template match="tei:teiHeader">    
+      <xsl:copy-of select="."/>    
+  </xsl:template>
+-->
+  
+  <xsl:template match="tei:w|tei:pc">
+    <xsl:copy-of select="."/>
+  </xsl:template>
+  
+  <xsl:template match="tei:text//text()">
+  <xsl:choose>
+    <!--<xsl:when test="not(ancestor::tei:text/tei:body/tei:div1/tei:p)"><xsl:copy/></xsl:when>-->
+    <xsl:when test="matches(.,'^\s*$')"><xsl:copy/></xsl:when>
+    <xsl:when test="matches(local-name(parent::*),'^(abbr|expan|sic|corr)$')"><xsl:copy/></xsl:when>
+    <xsl:when test="ancestor::*/@ana[contains(.,'ori:align-no')]"><xsl:copy/></xsl:when>
+    <xsl:when test="ancestor::tei:note"><xsl:copy/></xsl:when>
+    <xsl:when test="ancestor::tei:witDetail"><xsl:copy/></xsl:when>
+    <xsl:when test="parent::tei:hi and matches(.,'\w+') and not(matches(.,'\s')) and not(preceding-sibling::* or following-sibling::*)"><xsl:copy/></xsl:when>
+    <xsl:when test="parent::tei:am|parent::tei:ex"><xsl:copy/></xsl:when>
+    <!--<xsl:when test="parent::tei:rdg[not(matches(@wit,'^#?A'))]"><xsl:copy/></xsl:when>-->
+    <xsl:when test="ancestor::tei:pc|ancestor::tei:w"><xsl:copy/></xsl:when>
+    <xsl:otherwise>
+      <xsl:analyze-string select="." regex="\w+|\p{{P}}+|\s+">
+        <xsl:matching-substring>
+          <xsl:choose>
+            <xsl:when test="matches(.,'^\w+$')"><w xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="."/></w></xsl:when>
+<!--            <xsl:when test="matches(.,'^\p{P}+$')"><orig xmlns="http://www.tei-c.org/ns/1.0"><pc xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="."/></pc></orig></xsl:when>-->
+            <xsl:when test="matches(.,'^\p{P}+$')"><pc xmlns="http://www.tei-c.org/ns/1.0"><xsl:value-of select="."/></pc></xsl:when>
+            <xsl:otherwise><xsl:copy/></xsl:otherwise>
+          </xsl:choose>
+        </xsl:matching-substring>
+        <xsl:non-matching-substring>
+          <xsl:comment>Type de caractÃ¨re non reconnu</xsl:comment><xsl:copy/>
+        </xsl:non-matching-substring>
+      </xsl:analyze-string>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="tei:choice">
+  <xsl:choose>
+    <xsl:when test="descendant::tei:pc">
+      <pc xmlns="http://www.tei-c.org/ns/1.0">
+        <xsl:apply-templates select="descendant::tei:pc[1]/@*"/>
+        <xsl:copy>
+          <xsl:apply-templates/>
+        </xsl:copy>
+      </pc>
+    </xsl:when>
+    <xsl:when test="descendant::tei:w">
+      <xsl:copy>
+        <xsl:apply-templates select="@*"/>
+        <xsl:apply-templates/>
+      </xsl:copy>
+    </xsl:when>
+    <xsl:when test="ancestor::tei:pc|ancestor::tei:w">
+      <xsl:copy-of select="."/>
+    </xsl:when>
+    <xsl:otherwise><w xmlns="http://www.tei-c.org/ns/1.0"><xsl:copy-of select="."/></w></xsl:otherwise>
+  </xsl:choose>  
+</xsl:template>
+  
+  
+  
+<!--  <xsl:template match="tei:pc[ancestor::tei:choice]">
+    <xsl:apply-templates/>
+  </xsl:template>
+-->
+  
+  <xsl:template match="tei:choice/tei:orig[child::tei:pc]|tei:choice/tei:reg[child::tei:pc]">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:value-of select="normalize-space(.)"/>
+    </xsl:copy>
+  </xsl:template>
+
+
+  <!-- <xsl:template match="tei:hi[matches(.,'\w+') and not(matches(.,'\s')) and not(descendant::tei:w) and not(ancestor::*/@ana[contains(.,'ori:align-no')])]|tei:am|tei:ex"> -->
+  
+  <!--<xsl:template match="*[ancestor::tei:text and descendant::text()[matches(.,'\w')] and not(descendant::text()[matches(.,'\S\s|\s\S|\p{P}')])]">-->
+  
+
+  <xsl:template match="*[matches(.,'\w+') 
+    and ancestor::tei:text 
+    and not(matches(local-name(),'^(front|body|back|div.*|head|closer|p|ab|lg|l|.*[Nn]ame|num|cell|row|q|w|pc|title|term|emph|note|witDetail|foreign|ref|app|lem|rdg)$'))
+    and not(matches(local-name(parent::*),'^(choice|subst|app)$'))
+    and not(descendant::text()[matches(.,'\S\s|\s\S|\p{P}')]) 
+    and not(descendant::tei:w or descendant::tei:pc) 
+    and not(ancestor::*/@ana[contains(.,'ori:align-no')])]|tei:am|tei:ex">
+  <w xmlns="http://www.tei-c.org/ns/1.0"><xsl:copy-of select="."/></w>
+</xsl:template>
+ 
+  <!-- <xsl:template match="*[matches(local-name(),'[Nn]ame$') and not(descendant::text()[matches(.,'\S\s|\s\S|\p{P}')])]"> -->
+ 
+  
+  <xsl:template match="*[matches(local-name(),'^.*[Nn]ame$') 
+    and ancestor::tei:text 
+    and not(descendant::*[matches(local-name(),'^(.*[Nn]ame|w|pc|num|term|ref)$')]) 
+    and not(descendant::text()[matches(.,'\S\s|\s\S|\p{P}')])]">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+<!--      <xsl:for-each select="child::text()">
+        <xsl:value-of select="concat('[',.,']')"/>
+      </xsl:for-each>-->
+      <w xmlns="http://www.tei-c.org/ns/1.0">
+        <xsl:for-each select="child::node()">
+          <xsl:copy-of select="."/>
+        </xsl:for-each>
+      </w>
+    </xsl:copy>
+    
+  </xsl:template>
+  
+
+  <!--<xsl:template match="tei:sic[not(parent::tei:choice or descendant::tei:w or ancestor::*/@ana[contains(.,'ori:align-no')])]|tei:corr[not(parent::tei:choice or descendant::tei:w or ancestor::*/@ana[contains(.,'ori:align-no')])]">
+  <w xmlns="http://www.tei-c.org/ns/1.0"><xsl:copy-of select="."/></w>
+</xsl:template>-->
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-tokenize-words.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-addxmlid.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-addxmlid.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-addxmlid.xsl	(revision 728)
@@ -0,0 +1,86 @@
+<?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:xs="http://www.w3.org/2001/XMLSchema"
+  exclude-result-prefixes="tei edate" 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="@*|processing-instruction()|comment()|text()">
+    <xsl:copy/>
+  </xsl:template>
+
+<xsl:param name="elements">w|lb|cb|pb|pc|milestone|seg</xsl:param>
+  
+  <xsl:variable name="elementsregex"><xsl:value-of select="concat('^(',$elements,')$')"/></xsl:variable>
+  
+  <xsl:variable name="filename">
+    <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)$">
+      <xsl:matching-substring>
+        <xsl:value-of select="replace(regex-group(2),'(-ori)?(-wp?)?\.[^.]+$','')"/>
+      </xsl:matching-substring>
+    </xsl:analyze-string></xsl:variable>
+  
+  
+<xsl:template match="*[matches(local-name(),$elementsregex)]">
+  <xsl:variable name="elementname">
+    <xsl:value-of select="local-name()"></xsl:value-of>
+  </xsl:variable>
+  <xsl:variable name="number" as="xs:integer">
+    <xsl:number level="any"/>
+  </xsl:variable>
+  <xsl:copy>
+    <xsl:if test="not(@xml:id)">
+      <xsl:attribute name="xml:id">
+        <xsl:choose>
+          <xsl:when test="$elementname='milestone' and @unit='surface'">
+            <xsl:value-of select="concat('surf_',$filename,'_',substring-before(@facs,'.'))"/>
+          </xsl:when>
+          <xsl:when test="$elementname='pb'">
+            <xsl:value-of select="concat('page_',$filename,'_',$number)"/>
+          </xsl:when>
+          <xsl:when test="$elementname='cb'">
+            <xsl:value-of select="concat('col_',$filename,'_',$number)"/>
+          </xsl:when>
+          <xsl:when test="$elementname='lb'">
+            <xsl:value-of select="concat('line_',$filename,'_',$number)"/>
+          </xsl:when>
+          <xsl:when test="$elementname='seg' and @type='wp'">
+            <xsl:value-of select="concat('wp_',$filename,'_',$number)"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="concat($elementname,'_',$filename,'_',$number)"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+    </xsl:if>
+    <xsl:if test="not(@n) and not(matches($elementname,'^(w|pc|seg)$'))">
+      <xsl:attribute name="n"><xsl:value-of select="$number"/></xsl:attribute>
+    </xsl:if>
+    <xsl:if test="$elementname='lb' and @type='rejet' and not(@corresp)">
+      <xsl:attribute name="corresp">
+<!--        <xsl:choose>
+          <xsl:when test="@n">
+            <xsl:value-of select="concat('#line_',$filename,'_',@n)"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="concat('#line_',$filename,'_',$number + 1)"/>
+          </xsl:otherwise>
+        </xsl:choose>-->
+        <xsl:value-of select="concat('#line_',$filename,'_',$number + 1)"/>
+      </xsl:attribute>      
+    </xsl:if>
+    <xsl:apply-templates select="@*"/>
+    <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+
+
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/oriflamms/prepare/oriflamms-addxmlid.xsl
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/csv/CSV2XMLMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/csv/CSV2XMLMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/csv/CSV2XMLMacro.groovy	(revision 728)
@@ -0,0 +1,113 @@
+package org.txm.macro.csv
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import java.nio.charset.Charset
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.utils.*
+import javax.xml.stream.*
+import java.net.URL
+
+@Field @Option(name="inputFile", usage="CSV File", widget="File", required=false, def="file.csv")
+File inputFile;
+
+@Field @Option(name="columnSeparator", usage="column columnSeparator", widget="String", required=false, def="\t")
+def columnSeparator;
+
+@Field @Option(name="characterEncoding", usage="File characterEncoding", widget="String", required=false, def="UTF-8")
+def characterEncoding;
+
+@Field @Option(name="rootTag", usage="Root tag name", widget="String", required=false, def="root")
+def rootTag;
+
+@Field @Option(name="textTag", usage="Text tag name", widget="String", required=false, def="unit")
+def textTag;
+
+@Field @Option(name="metadataColumnList", usage="metadataColumnList column list separated with comma", widget="String", required=false, def="meta1,meta2")
+def metadataColumnList;
+
+@Field @Option(name="textColumnList", usage="textColumnList column list separated with comma", widget="String", required=false, def="textColumnList1,textColumnList2")
+def textColumnList;
+
+if (!ParametersDialog.open(this)) return;
+
+metadataColumnList = metadataColumnList.split(",")
+textColumnList = textColumnList.split(",")
+textTag = textTag.trim()
+rootTag = rootTag.trim()
+
+
+
+CsvReader reader = new CsvReader(inputFile.getAbsolutePath(), columnSeparator.charAt(0), Charset.forName(characterEncoding));
+if (!reader.readHeaders()) {
+	println "Error: no header"
+	return
+}
+def headers = Arrays.asList(reader.getHeaders()) 
+
+println "root tag: $rootTag"
+println "textColumnList tag: $textTag"
+println "columns: $headers"
+println "metadataColumnList columns: $metadataColumnList"
+println "textColumnList columns: $textColumnList"
+
+def ok = true
+for (String m : metadataColumnList) {
+	m = m.trim()
+	if (!headers.contains(m)) {
+		println "Error: missing metadataColumnList column: $m"
+		ok = false
+	}
+}
+for (String t : textColumnList) {
+	t = t.trim()
+	if (!headers.contains(t)) {
+		println "Error: missing textColumnList column: $t"
+	}
+}
+
+if (!ok) { return; }
+
+String name = inputFile.getName()
+int idx = name.lastIndexOf(".")
+if (idx > 0) name = name.substring(0, idx)
+File outputfile = new File(inputFile.getParentFile(), name+".xml")
+XMLOutputFactory factory = XMLOutputFactory.newInstance()
+FileOutputStream output = new FileOutputStream(outputfile)
+XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8")
+
+writer.writeStartDocument("UTF-8","1.0")
+writer.writeCharacters("\n") // simple XML formating
+writer.writeStartElement(rootTag)
+
+int pb_n = 1;
+while (reader.readRecord()) {
+	
+	writer.writeCharacters("\n") // simple XML formating
+	
+	writer.writeEmptyElement("pb") // <pb/>
+	writer.writeAttribute("n", ""+pb_n++)
+	
+	writer.writeCharacters("\n") // simple XML formating
+	
+	writer.writeStartElement(textTag)
+	
+	for (String m : metadataColumnList) {
+		m = m.trim()
+		writer.writeAttribute(m, reader.get(m))
+	}
+	
+	for (String t : textColumnList) {
+		t = t.trim()
+		writer.writeStartElement(t)
+		writer.writeCharacters(reader.get(t)) // get textColumnList content
+		writer.writeEndElement() // t
+	}
+	
+	writer.writeEndElement() // textTag
+}
+
+writer.writeEndElement() // rootTag
+writer.close()
+output.close()
+reader.close()
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/AddFacsAttributeMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/AddFacsAttributeMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/AddFacsAttributeMacro.groovy	(revision 728)
@@ -0,0 +1,90 @@
+package org.txm.macro.edition
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+try { println "ARGS=$args";} catch(Exception e) {args = [:]}
+
+// BEGINNING OF PARAMETERS
+@Field @Option(name="sourceDirectory", usage="Directory containig XML-TXM or XML SRC files", widget="Folder", required=true, def="src")
+def sourceDirectory
+
+@Field @Option(name="imageDirectory", usage="directory containing the ordered images files in subdirectories", widget="Folder", required=true, def="img")
+def imageDirectory
+
+@Field @Option(name="outputDirectory", usage="Output directory", widget="Folder", required=true, def="out")
+def outputDirectory
+
+@Field @Option(name="element", usage="The element to upgrade", widget="String", required=true, def="pb")
+def element
+
+@Field @Option(name="attribute", usage="The attribute to add", widget="String", required=true, def="facs")
+def attribute
+
+@Field @Option(name="prefix", usage="The image path prefix, if empty then the absolute file path is used", widget="String", required=true, def="../img/")
+def prefix
+
+// Open the parameters input dialog box
+if (args.size() == 0) {
+	if (!ParametersDialog.open(this)) return;
+} else {
+	monitor = args["monitor"];
+	sourceDirectory = args["sourceDirectory"]
+	imageDirectory = args["imageDirectory"]
+	outputDirectory = args["outputDirectory"]
+	element = args["element"]
+	attribute = args["attribute"]
+	prefix = args["prefix"]
+}
+// END OF PARAMETERS
+
+println "Parameters: "
+println " sourceDirectory: $sourceDirectory"
+println " imageDirectory: $imageDirectory"
+println " outputDirectory: $outputDirectory"
+println " element: $element"
+println " attribute: $attribute"
+
+assert(sourceDirectory.exists())
+assert(imageDirectory.exists())
+
+outputDirectory.deleteDir()
+outputDirectory.mkdir()
+
+if (!outputDirectory.exists()) {
+	println "Error: failed to create $outputDirectory"
+	return;
+}
+
+def srcFiles = []
+sourceDirectory.eachFile() { file ->
+	if (!file.isDirectory() && !file.isHidden() && file.getName().endsWith(".xml") && file.getName() != "import.xml") srcFiles << file
+}
+println "srcFiles=$srcFiles"
+
+for (def subdir : imageDirectory.listFiles()) {
+	if (!subdir.isDirectory()) continue;
+	
+	String name = subdir.getName();
+	File srcFile = new File(sourceDirectory, name+".xml")
+	if (!srcFile.exists()) { println "Warning: missing source file: $srcFile"; continue }
+	
+	def imgFiles = subdir.listFiles().sort()
+	if (imgFiles.size() == 0) { println "Warning: no image in $subdir"; continue }
+	
+	def imgPaths = []
+	for (def img : imgFiles) {
+		if (img.isFile() && !img.isHidden()) {
+			if (prefix != null && prefix.length() > 0)
+				imgPaths << prefix+name+"/"+img.getName()
+			else
+				imgPaths << img.getAbsolutePath()
+		}
+	}
+	
+	println "Processing '$name' directory with "+imgPaths.size()+" images."
+	
+	AddAttributeValuesInXML builder = new AddAttributeValuesInXML(srcFile, element, attribute, imgPaths);
+	builder.process(new File(outputDirectory, srcFile.getName()));
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/BuildFacsEditions.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/BuildFacsEditions.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/BuildFacsEditions.groovy	(revision 728)
@@ -0,0 +1,166 @@
+package org.txm.macro.edition
+
+import org.txm.importer.*
+import org.xml.sax.Attributes
+import org.txm.importer.filters.*
+import java.util.ArrayList
+import javax.xml.parsers.*
+import javax.xml.stream.*
+import java.net.URL
+import org.xml.sax.InputSource
+import org.xml.sax.helpers.DefaultHandler
+
+class BuildFacsEditions {
+
+	private def url
+	private def inputData
+	private def factory
+	private XMLStreamReader parser
+	OutputStreamWriter writer
+	StaxStackWriter pagedWriter = null
+
+	File editionDir
+	File xmlFile
+	File htmlFile
+	def pages = []
+	def tag, attribute, txtname, corpusname
+	boolean firstWord
+	boolean cutBefore = true;
+	boolean debug = false;
+	
+	public BuildFacsEditions(File xmlFile, File editionDir, String corpusname, String txtname, String tag, String attribute, boolean debug) {
+		inputData = xmlFile.toURI().toURL().openStream()
+		factory = XMLInputFactory.newInstance()
+		parser = factory.createXMLStreamReader(inputData)
+		
+		this.xmlFile = xmlFile
+		this.editionDir = editionDir
+		this.tag = tag
+		this.attribute = attribute
+		this.txtname = txtname
+		this.debug = debug
+	}
+	
+	int n = 1;
+	private boolean createNextOutput()
+	{
+		try {
+			def tags = closeMultiWriter();
+			for (int i = 0 ; i < tags.size() ; i++) {
+				String tag = tags[i]
+				if ("body" != tag) {
+					tags.remove(i--)
+				} else {
+					tags.remove(i--) // remove "body"
+					break; // remove elements until "body tag
+				}
+			}
+			if (wordid != null) {//wordid = "w_0";
+				//println " add page $n $wordid, page=$pages"
+				pages << ["$n", wordid]
+				n++
+			}
+			// Page suivante
+			
+			htmlFile = new File(editionDir, "${txtname}_${n}.html")
+			firstWord = true
+	//println "SET FIRST WORD=true"
+			pagedWriter = new StaxStackWriter(htmlFile, "UTF-8");
+			if (debug) println "Create file $htmlFile"
+			pagedWriter.writeStartDocument("UTF-8", "1.0")
+			pagedWriter.writeStartElement("html");
+			pagedWriter.writeEmptyElement("meta", ["http-equiv":"Content-Type", "content":"text/html","charset":"UTF-8"]);
+			pagedWriter.writeEmptyElement("link", ["rel":"stylesheet", "type":"text/css","href":"txm.css"]);
+			pagedWriter.writeEmptyElement("link", ["rel":"stylesheet", "type":"text/css","href":"${corpusname}.css"]);
+			pagedWriter.writeStartElement("head");
+			pagedWriter.writeStartElement("title")
+			pagedWriter.writeCharacters(corpusname+" Edition - Page "+n)
+			pagedWriter.writeEndElement(); // </title>
+			pagedWriter.writeEndElement() // </head>
+			pagedWriter.writeStartElement("body") //<body>
+
+			pagedWriter.writeStartElements(tags);
+			
+			wordid = "w_0"; // default value if no word is found
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+	
+	private def closeMultiWriter()
+	{
+		if (pagedWriter != null) {
+			def tags = pagedWriter.getTagStack().clone();
+
+			if (firstWord) { // there was no words
+				pagedWriter.writeCharacters("");
+				pagedWriter.write("<span id=\"w_0\"/>");
+			}
+			pagedWriter.writeEndElements();
+			pagedWriter.close();
+			return tags;
+		} else {
+			return [];
+		}
+	}
+	
+	private writeImg(String src) {
+		pagedWriter.writeStartElement("div");
+		pagedWriter.writeEmptyElement("img", ["src":src, "width":"100%"]);
+		pagedWriter.writeEndElement(); // </div>
+	}
+	
+	String wordid = null;
+	public def process() {
+		
+		boolean start = false
+		String localname
+		
+		createNextOutput();
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch (localname) {
+						case "text":
+							start = true
+						break;
+						case "w":
+							if (firstWord) {
+								wordid = parser.getAttributeValue(null, "id");
+								//println "found word: $wordid"
+								firstWord = false;
+							}
+						break;
+						case tag:
+							if (debug) println "** TAG $tag $attribute : "+parser.getAttributeValue(null, "id");
+							String imgPath = parser.getAttributeValue(null, attribute);
+							if (imgPath == null) {
+								println "ERROR in $xmlFile no value found for $tag@$attribute at location "+parser.getLocation().getLineNumber()
+							} else {
+								if (cutBefore) {
+									if (debug) println " cut before"
+									createNextOutput()
+									if (debug) println " write img $imgPath"
+									writeImg(imgPath)
+								} else {
+									if (debug) println " write img $imgPath"
+									writeImg(imgPath)
+									if (debug) println " cut after"
+									createNextOutput()
+								}
+							}
+							//firstWord = true;
+						break;
+					}
+				break;
+			}
+		}
+		closeMultiWriter()
+		pages << ["$n", wordid] // add the last page (no pb encountered
+		return pages
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/FacsEditionBuilderMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/FacsEditionBuilderMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/FacsEditionBuilderMacro.groovy	(revision 728)
@@ -0,0 +1,207 @@
+package org.txm.macro.edition
+
+// STANDARD DECLARATIONS
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.objects.*
+import org.txm.searchengine.cqp.corpus.*;
+import org.w3c.dom.*
+import org.txm.importer.DomUtils
+import org.txm.Toolbox
+
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+import org.txm.rcpapplication.commands.*
+import javax.xml.parsers.*;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+
+try { println "ARGS=$args";} catch(Exception e) {args = [:]}
+
+def corpus = null
+if (args.size() == 0) {
+	if (!(corpusViewSelection instanceof MainCorpus)) {
+		println "This marcro works with a MainCorpus selection. Aborting"
+		return;
+	}
+	println "Working on $corpusViewSelection corpus"
+	corpus = corpusViewSelection
+} else {
+	monitor = args["monitor"];
+}
+
+// BEGINNING OF PARAMETERS
+@Field @Option(name="editionName", usage="the edition name to create", widget="String", required=true, def="facs")
+def editionName
+
+@Field @Option(name="tag", usage="The tag to upgrade", widget="String", required=true, def="pb")
+def tag
+
+@Field @Option(name="attribute", usage="The attribute to add", widget="String", required=true, def="facs")
+def attribute
+
+@Field @Option(name="debug", usage="Debug mode", widget="Boolean", required=false, def="true")
+def debug = false
+
+// END OF params
+if (args.size() == 0) {
+	if (!ParametersDialog.open(this)) return;
+} else {
+	monitor = args["monitor"];
+	attribute = args["attribute"]
+	tag = args["tag"]
+	editionName = args["editionName"]
+}
+
+if (args.size() == 0) { // the "corpus" variable exists
+	binDirectory = corpus.getBase().getBaseDirectory()
+	txmDirectory = new File(binDirectory, "txm/"+corpus.getName().toUpperCase())
+	tokenizedDirectory = new File(binDirectory, "tokenized")
+	HTMLDirectory = new File(binDirectory, "HTML")
+	newEditionDirectory = new File(HTMLDirectory, corpus.getName().toUpperCase()+"/"+editionName)
+	params = corpus.getBase().params
+} else { // the "corpus" variable does not exist, get informations from the "args" map
+	binDirectory = args["binDirectory"]
+	txmDirectory = args["txmDirectory"]
+	params = args["params"]
+	tokenizedDirectory = new File(binDirectory, "tokenized")
+	HTMLDirectory = new File(binDirectory, "HTML")
+	corpusName = params.getCorpusName()
+	newEditionDirectory = new File(HTMLDirectory, corpusName.toUpperCase()+"/"+editionName)
+}
+
+println "Parameters:"
+println "	attribute = $attribute"
+println "	tag =  $tag"
+println "	editionName =  $editionName"
+
+if (!HTMLDirectory.exists()) {
+	println "ERROR: can't find this corpus 'HTML' directory: $HTMLDirectory. Aborting"
+	return false;
+}
+
+File workDirectory = txmDirectory
+if (!workDirectory.exists()) {
+	println "XML-TXM directory ($txmDirectory) not found. Using XML tokenized directory instead: "+tokenizedDirectory
+	workDirectory = tokenizedDirectory
+}
+if (!workDirectory.exists()) {
+	println "XML tokenized directory not found: "+tokenizedDirectory
+	println "Aborting."
+	return false
+}
+
+println "Working directory=$workDirectory"
+
+//0- clean previous edition if any : html files, import.xml
+if (newEditionDirectory.exists()) {
+	println "** Old version of $editionName edition found."
+	println " removing the 'edition' reference from the corpus configuration."
+	File tempParam = new File(binDirectory, "import.xml.cpy")
+	RemoveTag rt = new RemoveTag(
+			params.root.getOwnerDocument(), // will be updated
+			null, // don't create a new import.xml
+			"//edition[@name='$editionName']"
+			)
+	println " delete $newEditionDirectory"
+	newEditionDirectory.deleteDir()
+	
+	//printDOM(params.root.getOwnerDocument())
+}
+
+//2- fix import.xml
+println "** Updating corpus configuration..."
+// for edition list
+def corpusElem = params.getCorpusElement()
+params.addEditionDefinition(corpusElem, editionName, "groovy", "FacsEditionBuilderMacro");
+
+//1- create HTML files
+println "** Building new edition HTML files..."
+
+println " Creating edition '$editionName' directory: '$newEditionDirectory'"
+newEditionDirectory.mkdir()
+for (def xmlFile : workDirectory.listFiles()) {
+	if (xmlFile.isHidden() || xmlFile.isDirectory()) continue // ignore
+	String txtname = xmlFile.getName()
+	int idx = txtname.lastIndexOf(".")
+	if (idx > 0) txtname = txtname.substring(0,idx)
+
+	// create a page per "pb" element found in the xml-txm file
+	println " Building HTML pages of text=$txtname"
+	BuildFacsEditions builder = new BuildFacsEditions(xmlFile, newEditionDirectory, params.name, txtname, tag, attribute, debug);
+	def newPages = builder.process()
+	if (newPages == null || newPages.size() == 0) {
+		println "WARNING: no edition files created with $xmlFile"
+	}
+		
+	println " Building edition references in corpus configuration"
+	
+	Element corpusElement = params.getCorpusElement();
+	//println "corpusElement $corpusElement"
+	Element textsElem = params.getTextsElement(corpusElement);
+	//println "textsElem $textsElem"
+	Element textElem = params.getTextElement(textsElem, txtname);
+	if (textElem == null) { // just in case
+		textElem = params.addText(textsElem, txtname, xmlFile)
+	}
+	//println "textElem $textElem with txtname=$txtname"
+	Element editionElem = params.addEdition(textElem, editionName, newEditionDirectory.getAbsolutePath(), "html"); // add a new edition to the "text" node
+	for (def pagedef : newPages) {
+		params.addPage(editionElem, pagedef[0], pagedef[1]);
+	}
+}
+
+//printDOM(params.root.getOwnerDocument())
+
+//3- Save and reload the corpus
+println " Saving corpus configuration..."
+File paramFile = new File(binDirectory, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);
+
+
+//4- Reload Corpora
+if (args.size() == 0) {
+	Toolbox.restart();
+	monitor.syncExec(new Runnable() {
+				public void run() {
+					RestartTXM.reloadViews();
+				}
+			});
+}
+
+//5- Done
+println "New edition created."
+
+//printDOM(params.root.getOwnerDocument())
+
+
+
+def printDOM(def doc) {
+	if (!debug) return;
+	try {
+		// CrÃ©ation de la source DOM
+		Source source = new DOMSource(doc);
+		
+		// CrÃ©ation du fichier de sortie
+		StreamResult resultat = new StreamResult(new PrintWriter(System.out));
+		
+		// Configuration du transformer
+		TransformerFactory fabrique = new net.sf.saxon.TransformerFactoryImpl();
+		Transformer transformer = fabrique.newTransformer();
+		transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
+		transformer.setOutputProperty(OutputKeys.INDENT, "yes");  //$NON-NLS-1$
+		transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");  //$NON-NLS-1$
+		
+		// Transformation
+		transformer.transform(source, resultat);
+		// writer.close();
+		return true;
+	} catch (Exception e) {
+		e.printStackTrace();
+		return false;
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/EditionUpdaterMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/EditionUpdaterMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/EditionUpdaterMacro.groovy	(revision 728)
@@ -0,0 +1,263 @@
+package org.txm.macro.edition
+// STANDARD DECLARATIONS
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.objects.*
+import org.txm.searchengine.cqp.corpus.*;
+import org.w3c.dom.*
+import org.txm.importer.*
+import org.txm.Toolbox
+import java.io.*
+
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+import org.txm.rcpapplication.commands.*
+import javax.xml.parsers.*;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import org.txm.utils.FileCopy
+
+try { println "ARGS=$args";} catch(Exception e) {args = [:]}
+
+def corpus = null
+if (args.size() == 0) {
+	if (!(corpusViewSelection instanceof MainCorpus)) {
+		println "This marcro works with a MainCorpus selection. Aborting"
+		return;
+	}
+	println "Working on $corpusViewSelection corpus"
+	corpus = corpusViewSelection
+} else {
+	monitor = args["monitor"];
+}
+
+// BEGINNING OF params
+
+@Field @Option(name="xslEdition", usage="XSL to build the HTML edition - if empty uses 'txm-edition-xtz.xsl'", widget="File", required=false, def="txm-edition-xtz.xsl")
+def xslEdition
+
+@Field @Option(name="xslPages", usage="XSL to build the edition pages - if empty uses 'txm-edition-page-split.xsl'", widget="File", required=false, def="txm-edition-page-split.xsl")
+def xslPages
+
+@Field @Option(name="editionName", usage="The edition name to produce", widget="String", required=false, def="default")
+String editionName
+
+@Field @Option(name="useTokenizedDirectory", usage="Use the 'XML/w' of the 'tokenized' directory instead of the 'XML-TXM' files", widget="Boolean", required=false, def="false")
+def useTokenizedDirectory = false
+
+@Field @Option(name="debug", usage="Enable debug mode: temporary files are not deleted", widget="Boolean", required=false, def="false")
+def debug = false
+
+// END OF params
+if (args.size() == 0) {
+	if (!ParametersDialog.open(this)) return;
+} else {
+	monitor = args["monitor"];
+	xslEdition = new File(args["xslEdition"])
+	xslPages = new File(args["xslPages"])
+	editionName = args["editionName"]
+	useTokenizedDirectory = args["useTokenizedDirectory"]
+}
+
+if (args.size() == 0) { // corpus informations
+	defaultEditionName = corpus.getDefaultEdition()
+	corpusName = corpus.getName()
+	binDirectory = corpus.getBase().getBaseDirectory()
+	txmDirectory = new File(binDirectory, "txm/"+corpusName.toUpperCase())
+	params = corpus.getBase().params
+} else { // the "corpus" variable does not exists
+	defaultEditionName = "default"
+	binDirectory = args["binDirectory"]
+	txmDirectory = args["txmDirectory"]
+	params = args["params"]
+	corpusName = params.getCorpusName()
+}
+
+if (editionName == null || editionName.length() == 0) {
+	editionName = defaultEditionName
+}
+println "Parameters:"
+println "	xslEdition = $xslEdition"
+println "	xslPages = $xslPages"
+println "	editionName = $editionName"
+println "	useTokenizedDirectory = $useTokenizedDirectory"
+
+File TXMHOME = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME))
+File xslDirectory = new File(TXMHOME, "xsl")
+if (xslEdition == null || xslEdition.getName() == "txm-edition-xtz.xsl")
+	xslEdition = new File(xslDirectory, "txm-edition-xtz.xsl")
+if (xslPages == null || xslPages.getName() == "txm-edition-page-split.xsl")
+	xslPages = new File(xslDirectory, "txm-edition-page-split.xsl")
+
+println "XSLs: "+xslEdition.getName()+" & "+ xslPages.getName()
+println ""
+
+
+if (useTokenizedDirectory) {
+	println "Using the 'tokenized' directory instead of the 'txm' directory to get XML files"
+	txmDirectory = new File(binDirectory, "tokenized")
+}
+File HTMLDirectory = new File(binDirectory, "HTML")
+File HTMLCorpusDirectory = new File(HTMLDirectory, corpusName.toUpperCase())
+File defaultEditionDirectory = new File(HTMLCorpusDirectory, editionName)
+
+File cssDirectory = new File(TXMHOME, "css")
+File cssDefaultEditionDirectory = new File(defaultEditionDirectory, "css")
+File cssTXM = new File(cssDirectory, "txm.css")
+File cssTEI = new File(cssDirectory, "tei.css")
+boolean newEdition = false;
+
+if (!txmDirectory.exists()) {
+	println "ERROR: can't find this corpus 'txm' directory: $txmDirectory. Aborting"
+	return false;
+}
+if (!defaultEditionDirectory.exists()) {
+	println "This is a new edition"
+	newEdition = true;
+	defaultEditionDirectory.mkdir()
+	if (!defaultEditionDirectory.exists()) {
+		println "HTML directory could be created: $defaultEditionDirectory. Aborting"
+		return false
+	}
+}
+if (!cssTXM.exists()) {
+	println "WARNING: can't find the $cssTXM CSS file. Aborting"
+	return false;
+}
+if (!cssTEI.exists()) {
+	println "WARNING: can't find the $cssTEI CSS file. Aborting"
+	return false;
+}
+if (!xslEdition.exists()) {
+	println "Error: can't find $xslEdition XSL file"
+	return false;
+}
+if (!xslPages.exists()) {
+	println "Error: can't find $xslPages XSL file"
+	return false;
+}
+
+defaultEditionDirectory.mkdir()
+cssDefaultEditionDirectory.mkdir()
+FileCopy.copy(cssTXM, new File(cssDefaultEditionDirectory, cssTXM.getName()))
+FileCopy.copy(cssTEI, new File(cssDefaultEditionDirectory, cssTEI.getName()))
+
+//1- Back up current "HTML" directory
+if (!newEdition) {
+	File backupDirectory = new File(binDirectory, "HTML-"+defaultEditionDirectory.getName()+"-back")
+	backupDirectory.mkdir()
+	println "Backup of $defaultEditionDirectory directory to $backupDirectory..."
+	for (File f : defaultEditionDirectory.listFiles()) {
+		String name = f.getName()
+		if (f.isDirectory() || f.isHidden()) continue
+		
+		File rez = new File(backupDirectory, f.getName())
+		
+		if (debug) println " file $f >> $rez"
+		else print "."
+		
+		if (!FileCopy.copy(f, rez)) {
+			println "Error: failed to backup $f"
+			return false;
+		}
+	}
+	println ""
+}
+
+//2- Apply edition XSL
+println "Applying XSL 1: $xslEdition..."
+ApplyXsl2 applier = new ApplyXsl2(xslEdition);
+def htmlFiles = []
+for (File f : txmDirectory.listFiles()) {
+	String name = f.getName()
+	String txtname = name.substring(0, name.lastIndexOf("."));
+	File rez = new File(HTMLCorpusDirectory, txtname+".html")
+
+	if (!f.isDirectory() && !f.isHidden() && name.endsWith(".xml") && !name.equals("import.xml")) {
+	
+		if (debug) println " file $f >> $rez"
+		else print "."
+	
+		if (!applier.process(f, rez)) {
+			println "Error: failed to process $f"
+			return false
+		} else {
+			htmlFiles << rez
+		}
+	}
+}
+println ""
+
+//3- Apply pages XSL
+println "Applying XSL 2: $xslPages..."
+ApplyXsl2 applier2 = new ApplyXsl2(xslPages);
+applier2.setParam("editionname", editionName)
+applier2.setParam("cssname", corpusName)
+for (File f : htmlFiles) {
+	String name = f.getName()
+	String txtname = name.substring(0, name.lastIndexOf("."));
+	File rez = new File(defaultEditionDirectory, txtname+"-pages.html")
+	
+	if (debug) println " file $f >> $rez"
+	else print "."
+	
+	if (!applier2.process(f, rez)) {
+		println "Error: failed to process $f"
+		return false
+	} else {
+		if (!debug) rez.delete()
+	}
+}
+println ""
+
+// clean temp files
+if (!debug) {
+	for (File f : htmlFiles) {
+		f.delete()
+	}
+}
+
+//4- register new edition if any (copy edition)
+
+if (editionName != defaultEditionName) {
+	println "Update corpus configuration"
+	
+	// remove edition declaration if any
+	RemoveTag rt = new RemoveTag(
+			params.root.getOwnerDocument(), // will be updated
+			null, // don't create a new import.xml
+			"//edition[@name='$editionName']"
+			)
+
+	def corpusElem = params.getCorpusElement()
+	params.addEditionDefinition(corpusElem, editionName, "xsl", "XSLEditionBuilder"); // declare the new edition
+	
+	for (def text : corpus.getTexts()) {
+		Element textElem = text.getSelfElement()
+		def defaultEdition = text.getEdition(defaultEditionName)
+		if (defaultEdition == null) { println "Error: no default edition with name="+defaultEditionName; return false} 
+		Element editionElem = params.addEdition(textElem, editionName, defaultEditionDirectory.getAbsolutePath(), "html");
+		def pages = defaultEdition.getPages()
+		for (int i = 1 ; i <= pages.size() ; i++) {
+			def page = pages[i-1]
+			params.addPage(editionElem, "$i", page.getWordId());
+		}
+	}
+	
+	File paramFile = new File(binDirectory, "import.xml");
+	DomUtils.save(params.root.getOwnerDocument(), paramFile);
+}
+
+//5- Reload Corpora
+if (args.size() == 0) { // the user run the macro
+	Toolbox.restart();
+	monitor.syncExec(new Runnable() {
+			public void run() {
+				RestartTXM.reloadViews();
+			}
+		});
+}
+println "New edition created."
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/AddAttributeValuesInXML.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/AddAttributeValuesInXML.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/AddAttributeValuesInXML.groovy	(revision 728)
@@ -0,0 +1,88 @@
+package org.txm.macro.edition
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import org.txm.importer.*
+
+/**
+ * Add a attribute value map in a XML file
+ * Warning: if an attribute already exists its value won't be changed
+ */
+class AddAttributeValuesInXML extends StaxIdentityParser {
+	File xmlFile;
+	String tag, attribute;
+	List<String> values;
+	HashMap<String, String> attributesMap;
+	boolean result;
+
+	public AddAttributeValuesInXML(File xmlFile, String tag, String attribute, List<String> values)
+	{
+		super(xmlFile.toURI().toURL());
+		this.xmlFile = xmlFile;
+		this.tag = tag;
+		this.attribute = attribute;
+		this.values = values;
+	}
+
+	public boolean process(File outfile) {
+		this.result = false;
+		boolean ret = super.process(outfile)
+		return this.result & ret;
+	}
+
+	
+	/**
+	 * Rewrite the processStartElement() to update/add attributes
+	 */
+	int n = 0;
+	public void processStartElement()
+	{
+		if (localname != tag) {
+			super.processStartElement()
+		} else {
+			String prefix = parser.getPrefix();
+//TODO: uncomment for TXM 0.7.6
+//			if (INCLUDE == localname && XI == prefix) {
+//				processingXInclude();
+//				return;
+//			}
+
+			if (prefix.length() > 0)
+				writer.writeStartElement(Nscontext.getNamespaceURI(prefix), localname)
+			else
+				writer.writeStartElement(localname);
+
+			for (int i = 0 ; i < parser.getNamespaceCount() ; i++) {
+				writer.writeNamespace(parser.getNamespacePrefix(i), parser.getNamespaceURI(i));
+			}
+
+			// get attributes
+			HashMap<String, String> attributes = new HashMap<String, String>();
+			for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+				attributes[parser.getAttributeLocalName(i)] = parser.getAttributeValue(i);
+			}
+			// add/update the value
+			if (n < values.size()) {
+				attributes[attribute] = values[n]; 
+			} else {
+				println "ERROR: not enough values to insert for file $xmlFile, at XML parser location: l="+parser.getLocation().getLineNumber()+",c="+parser.getLocation().getColumnNumber()+")."
+			}
+			n++
+			
+			// write attributes
+			for (def k : attributes.keySet()) {
+				writer.writeAttribute(k, attributes[k])
+			}
+		}
+	}
+	
+	@Override
+	public void after() {
+		super.after();
+		
+		if (n != values.size()) {
+			println "ERROR: number of $tag ("+n+") missmatch the number of values to insert: "+values.size()
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/BuildXTZEditions.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/BuildXTZEditions.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/BuildXTZEditions.groovy	(revision 728)
@@ -0,0 +1,144 @@
+package org.txm.macro.edition
+
+import org.txm.importer.*
+import org.xml.sax.Attributes
+import org.txm.importer.filters.*
+import java.util.ArrayList
+import javax.xml.parsers.*
+import javax.xml.stream.*
+import java.net.URL
+import org.xml.sax.InputSource
+import org.xml.sax.helpers.DefaultHandler
+
+class BuildXTZEditions {
+
+	private def url
+	private def inputData
+	private def factory
+	private XMLStreamReader parser
+	OutputStreamWriter writer
+	StaxStackWriter pagedWriter = null
+
+	File editionDir
+	File xmlFile
+	File htmlFile
+	def pages = []
+	def txtname, corpusname
+	int wordsPerPage = 500
+	boolean firstWord
+	boolean cutBefore = true;
+	
+	public BuildFacsEditions(File xmlFile, File editionDir, String corpusname, String txtname, int wordsPerPage) {
+		inputData = xmlFile.toURI().toURL().openStream()
+		factory = XMLInputFactory.newInstance()
+		parser = factory.createXMLStreamReader(inputData)
+		
+		this.xmlFile = xmlFile
+		this.editionDir = editionDir
+		this.txtname = txtname
+		this.wordsPerPage = wordsPerPage
+	}
+	
+	int n = 0;
+	private boolean createNextOutput()
+	{
+		try {
+			def tags = closeMultiWriter();
+			for (int i = 0 ; i < tags.size() ; i++) {
+				String tag = tags[i]
+				if ("body" != tag) {
+					tags.remove(i--)
+				} else {
+					tags.remove(i--) // remove "body"
+					break; // remove elements until "body tag
+				}
+			}
+			n++
+			htmlFile = new File(editionDir, "${txtname}_${n}.html")
+			firstWord = true
+
+			pagedWriter = new StaxStackWriter(htmlFile, "UTF-8");
+
+			pagedWriter.writeStartDocument("UTF-8", "1.0")
+			pagedWriter.writeStartElement("html");
+			pagedWriter.writeEmptyElement("meta", ["http-equiv":"Content-Type", "content":"text/html","charset":"UTF-8"]);
+			pagedWriter.writeEmptyElement("link", ["rel":"stylesheet", "type":"text/css","href":"txm.css"]);
+			pagedWriter.writeEmptyElement("link", ["rel":"stylesheet", "type":"text/css","href":"${corpusname}.css"]);
+			pagedWriter.writeStartElement("head");
+			pagedWriter.writeStartElement("title")
+			pagedWriter.writeCharacters(corpusname+" Edition - Page "+n)
+			pagedWriter.writeEndElement(); // </title>
+			pagedWriter.writeEndElement() // </head>
+			pagedWriter.writeStartElement("body") //<body>
+
+			pagedWriter.writeStartElements(tags);
+			return true;
+		} catch (Exception ee) {
+			System.out.println(ee);
+			return false;
+		}
+	}
+	
+	private def closeMultiWriter()
+	{
+		if (pagedWriter != null) {
+			def tags = pagedWriter.getTagStack().clone();
+
+			if (firstWord) { // there was no words
+				pagedWriter.writeCharacters("");
+				pagedWriter.write("<span id=\"w_0\"/>");
+				pages << ["$n", "w_0"]
+			}
+			pagedWriter.writeEndElements();
+			pagedWriter.close();
+			return tags;
+		} else {
+			return [];
+		}
+	}
+	
+	private writeImg(String src) {
+		pagedWriter.writeStartElement("div");
+		pagedWriter.writeEmptyElement("img", ["src":src]);
+		pagedWriter.writeEndElement(); // </div>
+	}
+	
+	public def process() {
+		String wordid = "w_0"
+		boolean start = false
+		String localname
+		
+		createNextOutput();
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch (localname) {
+						case "text":
+							start = true
+						break;
+						case "w":
+							if (firstWord) {
+								wordid = parser.getAttributeValue(null, "id");
+								firstWord = false;
+							}
+						break;
+						case "pb":
+							if (cutBefore) {
+								pages << ["$n", wordid]
+								// WRITE PB
+								createNextOutput()
+							} else {
+								createNextOutput()
+								pages << ["$n", wordid]
+								// WRITE PB
+							}
+						break;
+					}
+				break;
+			}
+		}
+		closeMultiWriter()
+		return pages
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/RemoveTag.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/RemoveTag.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/edition/RemoveTag.groovy	(revision 728)
@@ -0,0 +1,135 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.macro.edition;
+
+import javax.xml.parsers.*
+import javax.xml.transform.*
+import javax.xml.transform.dom.DOMSource
+import javax.xml.transform.stream.StreamResult
+import javax.xml.xpath.*
+
+import org.txm.metadatas.*
+import org.txm.utils.*
+import org.w3c.dom.Document
+import org.w3c.dom.Element
+
+/**
+ * Removes tags of XML file given a XPath. 
+ * @author mdecorde
+ *
+ */
+public class RemoveTag {
+	File outfile
+	String xpath
+	Document doc
+	
+	public RemoveTag(def root, def outfile, def xpath)
+	{
+		this.doc = root
+		this.outfile = outfile
+		this.xpath = xpath
+		
+		process()
+	}
+	
+	/**
+	 *
+	 * @param xmlfile the xmlfile
+	 * @param outfile the outfile
+	 * @param xpath the XPath
+	 */
+	public RemoveTag(File xmlfile, File outfile, String xpath)
+	{
+		this.outfile = outfile
+		this.xpath = xpath
+		
+		def domFactory = DocumentBuilderFactory.newInstance();
+		domFactory.setNamespaceAware(true); // never forget this!
+		DocumentBuilder builder = domFactory.newDocumentBuilder();
+		this.doc = builder.parse(xmlfile);
+		
+		process()
+	}
+	
+	private void process() {
+		def expr = XPathFactory.newInstance().newXPath().compile(xpath);
+		def nodes = expr.evaluate(doc, XPathConstants.NODESET);
+		
+		if (nodes != null)
+		for(def node : nodes)
+		{
+			//println "Remove node "+node
+			Element elem = (Element)node;
+			elem.getParentNode().removeChild(node);
+		}
+		save()
+		doc = null
+	}
+	
+	/**
+	 * Save.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean save()
+	{
+		if (outfile == null) return true;
+	
+		try {
+			// CrÃ©ation de la source DOM
+			Source source = new DOMSource(doc);
+			
+			// CrÃ©ation du fichier de sortie
+				Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8")); 
+			Result resultat = new StreamResult(writer);
+			
+			// Configuration du transformer
+			TransformerFactory fabrique = new net.sf.saxon.TransformerFactoryImpl();
+			Transformer transformer = fabrique.newTransformer();
+			transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+			transformer.setOutputProperty(OutputKeys.INDENT, "yes"); 
+			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); 
+			
+			// Transformation
+			transformer.transform(source, resultat);
+			writer.close();
+			return true;
+		} catch (Exception e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return false;
+		}
+	}
+	
+	public static void main(String[] args) {
+		RemoveTag rt = new RemoveTag(
+			new File("/home/mdecorde/TXM/corpora/graal/import.xml"),
+			new File("/home/mdecorde/TXM/corpora/graal/import-o.xml"),
+			"//edition[@name='courante']"
+			)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/misc/TXM2CoNLL2009Macro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/misc/TXM2CoNLL2009Macro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/misc/TXM2CoNLL2009Macro.groovy	(revision 728)
@@ -0,0 +1,47 @@
+package org.txm.macro.misc
+import org.txm.export.conll2009.ToCoNLL2009
+
+import java.io.File;
+import org.txm.searchengine.cqp.corpus.*
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+if (!(corpusViewSelection instanceof Corpus)) {
+	println "Select a corpus or a sub-corpus"
+	return;
+}
+def corpus = corpusViewSelection
+
+@Field @Option(name="outputFile", usage="an example file", widget="File", required=true, def="conn_export.tsv")
+File outputFile = new File("conn_export.tsv")
+@Field @Option(name="encoding", usage="sentenceProperty", widget="String", required=true, def="UTF-8")
+String encoding = "UTF-8"
+
+@Field @Option(name="sentenceProperty", usage="sentenceProperty", widget="String", required=true, def="s_id")
+String sentenceProperty = "s_id"
+@Field @Option(name="posProperty", usage="sentenceProperty", widget="String", required=true, def="pos")
+String posProperty = "frpos"
+@Field @Option(name="lemmaProperty", usage="sentenceProperty", widget="String", required=true, def="lemma")
+String lemmaProperty = "frlemma"
+
+if (!ParametersDialog.open(this)) return;
+
+outputFile = outputFile.getAbsoluteFile()
+
+def split = sentenceProperty.split("_", 2)
+StructuralUnitProperty s = corpus.getStructuralUnit(split[0]).getProperty(split[1])
+Property word = corpus.getProperty("word")
+Property lemma = corpus.getProperty(lemmaProperty)
+Property pos = corpus.getProperty(posProperty)
+
+if (s == null) { println "Error sentence property: $sentenceProperty"; return}
+if (word == null) { println "Error no word property"; return}
+if (pos == null) { println "Error pos property: $posProperty"; return}
+if (lemma == null) { println "Error lemma property: $lemmaProperty"; return}
+
+
+ToCoNLL2009 processor = new ToCoNLL2009()
+processor.process(outputFile, corpus, s, word, lemma, pos, encoding)
+
+println "Done: $outputFile"
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/misc/Specif2CoinMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/misc/Specif2CoinMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/misc/Specif2CoinMacro.groovy	(revision 728)
@@ -0,0 +1,171 @@
+// Copyright Â© 2016 ENS de Lyon
+//
+// Authors:
+// - Serge Heiden
+//
+// Licence:
+// This file is part of the TXM platform.
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+// Version:
+// $LastChangedDate: 2014-11-01 16:00:01 +0100 (sam., 1 nov. 2014) $
+// $LastChangedRevision: XXXX $
+// $LastChangedBy: sheiden $
+//
+
+/* --------------   Specif2Coin    --------------
+
+FR:
+
+Macro affichant la probabilitÃ© a priori (avant de faire les lancÃ©s) d'obtenir N faces 'pile' consÃ©cutives en lanÃ§ant une piÃ¨ce au pile ou face.
+
+On considÃ¨re qu'une piÃ¨ce a 50% de chances (1 chance sur 2) de tomber sur la face 'pile' Ã  chaque lancÃ© (les lancÃ©s sont indÃ©pendants).
+
+La probabilitÃ© est mise en regard avec la spÃ©cificitÃ© Ã©quivalente.
+
+La macro prend un seul paramÃ¨tre :
+
+* nthrows : le nombre de lancÃ©s 'pile' consÃ©cutifs
+
+La macro affiche - selon les options :
+
+* displayProba : toutes les probabilitÃ©s de 1 Ã  nthrows lancÃ©s en dÃ©taillant :
+-  n : le nombre de 'pile' consÃ©cutifs
+-  p : la probabilitÃ© correspondante
+-  % : le pourcentage correspondant
+- pe : la probabilitÃ© exprimÃ©e en notation avec exposant en base 10
+-  s : la spÃ©cificitÃ© Ã©quivalente (l'exposant de la probabilitÃ©, soit son logarithme en base 10)
+
+* onlyMainRanks : s'utilise avec l'option displayProba pour n'afficher que les probabilitÃ©s des rangs dÃ©cimaux principaux (1, 2..., 10, 20..., 100, 200...)
+
+* displayCoins : plutÃ´t que le dÃ©tail de la probabilitÃ©, liste pour une spÃ©cificitÃ© S- donnÃ©e, le nombre Ã©quivalent de lancÃ©s 'pile' consÃ©cutifs correspondants exprimÃ© sous la forme d'un intervalle : nombre de lancÃ©s minimum - nombre de lancÃ©s maximum
+Par exemple '-10 = 30-33' signifie : une spÃ©cificitÃ© S- de '-10' Ã©quivaut Ã  entre 30 et 33 lancÃ©s 'pile' consÃ©cutifs
+
+Les limites du calcul sont celles de la machine. Une machine 64-bit peut typiquement calculer la probabilitÃ© de 1023 lancÃ©s consÃ©cutifs.
+
+*/
+
+// STANDARD DECLARATIONS
+package org.txm.macro.misc
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.eclipse.ui.console.*
+
+// BEGINNING OF PARAMETERS
+
+@Field @Option(name="nthrows", usage="maximum number of throws", widget="Integer", required=true, def="99")
+def nthrows
+
+@Field @Option(name="displayProba", usage="display probabilities", widget="Boolean", required=false, def="true")
+def displayProba
+
+@Field @Option(name="onlyMainRanks", usage="only display main rank lines", widget="Boolean", required=false, def="false")
+def onlyMainRanks
+
+@Field @Option(name="displayCoins", usage="display equivalent of coin flipping", widget="Boolean", required=false, def="true")
+def displayCoins
+
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return
+
+// END OF PARAMETERS
+
+def clearConsole = { ->
+	// clear the console
+	(ConsolePlugin.getDefault().getConsoleManager().getConsoles())[0].clearConsole()
+}
+
+clearConsole()
+
+min = [:]
+max = [:]
+
+pow = 2**(nthrows)
+powd = pow.doubleValue()
+
+if (powd == Double.POSITIVE_INFINITY || powd == Double.NEGATIVE_INFINITY) {
+	println sprintf("** Impossible to calculate probabilities for this value, try a lower value (impossible to represent 2 to the power of %d with this machine). Aborting.", nthrows)
+	return
+}
+
+d = 1/powd
+
+significandSize = ((-java.lang.Math.log10(d) as double)-1 as int)+4
+
+format = sprintf("%%4d = %%%d.%df = %%0%d.%df%%%% = %%9.2e = %%4d", significandSize, significandSize-2, significandSize-1, significandSize-4)
+
+unit = 1
+dec = 1
+
+if (displayProba) {
+	println """LÃ©gende :
+-  n : le nombre de 'pile' consÃ©cutifs
+-  p : la probabilitÃ© correspondante
+-  % : le pourcentage correspondant
+- pe : la probabilitÃ© exprimÃ©e en notation avec exposant en base 10
+-  s : la spÃ©cificitÃ© Ã©quivalente (l'exposant de la probabilitÃ©, soit son logarithme en base 10)
+"""
+	spc = ' ' * (significandSize+2)
+	println "   n    p"+spc+" %"+spc+"  pe         s"
+}
+
+nthrows.times {
+    n = it+1
+	p = 1/2**(n) as double
+	s = java.lang.Math.log10(p)-1 as int
+	if (min[s]) { if (min[s] > n) min[s] = n } else min[s] = n
+	if (max[s]) { if (max[s] < n) max[s] = n } else max[s] = n
+	if (displayProba) {
+		s = sprintf(format, n, p, p*100, p, s).replaceAll(/ = 0([^,])/, ' =  $1')
+		m0 = s =~ /(....)0+ = ([^-])/
+		if (m0.count > 0) {
+			spc0 = m0[0][1] + (' ' * (m0[0][0].size()-8)) + ' = ' + m0[0][2]
+			s = m0.replaceFirst(spc0)
+		}
+		m0p = s =~ /(....)0+% = /
+		if (m0p.count > 0) {
+			spc0p = m0p[0][1] + '%' + (' ' * (m0p[0][0].size()-8)) + ' = '
+			s = m0p.replaceFirst(spc0p)
+		}
+
+		if (!onlyMainRanks || ((n % dec) == 0) || (n == nthrows)) {
+			println s
+		}
+		
+		unit = unit+1
+		if (unit >= dec * 10) {
+			dec = dec * 10
+			unit = 1
+		}
+	}
+}
+
+if (displayCoins) {
+
+	if (displayProba) {
+		println ""
+	}
+
+	println """LÃ©gende :
+- -S      : spÃ©cificitÃ© Ã©quivalente
+-  lancÃ©s : intervalle des lancÃ©s 'pile' consÃ©cutifs correspondant
+"""
+	println " -S   lancÃ©s"
+	min.each { key, value -> if (min[key] != max[key]) println sprintf("%3d = %d-%d", key, min[key], max[key]) else println sprintf("%3d = %d", key, min[key])}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/misc/EuroPress2XMLMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/misc/EuroPress2XMLMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/misc/EuroPress2XMLMacro.groovy	(revision 728)
@@ -0,0 +1,299 @@
+package org.txm.macro.misc
+// STANDARD DECLARATIONS
+
+import groovy.xml.QName
+import java.text.DecimalFormat
+import org.txm.importer.DomUtils;
+import org.txm.importer.ValidateXml;
+import org.w3c.tidy.Tidy
+import groovy.util.XmlParser
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+// BEGINNING OF PARAMETERS
+@Field @Option(name="rootDir", usage="The directory contains the 'orig' directory which contains the html files", widget="Folder", required=false, def="/path")
+File rootDir = new File("");
+
+@Field @Option(name="encoding", usage="HTML encoding", widget="String", required=false, def="iso-8859-1")
+String encoding = "iso-8859-1" // HTML files encoding
+
+@Field @Option(name="debug", usage="show debug messages. Values = true, false", widget="String", required=false, def="false")
+def debug = "true" // set true to debug the script
+
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return;
+
+debug = ("true" == debug)
+// END OF PARAMETERS
+
+String corpusName = rootDir.getName()
+File srcDir = new File(rootDir, "orig");
+File outDir = new File(rootDir, "xhtml");
+File outDir2 = new File(rootDir, corpusName);
+File rejected = new File(rootDir, "duplicates");
+File tmpDir = new File(rootDir, "tmp");
+
+
+if (!srcDir.exists()) {
+	println "STOP, srcDir does not exists $srcDir"
+	return;
+}
+
+outDir.deleteDir()
+outDir.mkdir()
+outDir2.deleteDir()
+outDir2.mkdir()
+rejected.deleteDir()
+rejected.mkdir()
+tmpDir.deleteDir()
+tmpDir.mkdir()
+
+def allTags = new HashSet<String>();
+def allStyles = new HashSet<String>();
+def allClasses = new HashSet<String>();
+def newPrefix = "NumÃ©ro de document : "
+int itext = 1;
+def formater = new DecimalFormat("0000");
+int LIMITDIFF = 10
+def metadatas = ["DocPublicationName", "DocHeader"]
+def files = []
+srcDir.eachFileMatch(~/.*\.html/){ htmlFile -> files << htmlFile}
+files = files.sort()
+
+def done = new HashSet<String>();
+def ignored = []
+def allTitles = [:]
+def dones = [:]
+def ignoreds = []
+
+def getText(def node) {
+	//if (debug) println "node: "+node
+	String s = " ";
+	if (node instanceof String) {
+		s += " "+node
+	} else {
+		for(def c : node.children())
+			s += " "+getText(c)
+	}
+	//println " "+s.replace("\n", " ").trim();
+	return " "+s.replace("\n", " ").trim();
+}
+
+println "Nb of HTML files: "+files.size()
+for (File htmlFile : files) {
+	println "Processing file $htmlFile"
+	File tmpHTML = new File(tmpDir, htmlFile.getName())
+	tmpHTML.withWriter("UTF-8") { writer -> 
+		String txt = htmlFile.getText(encoding)
+		txt = txt.replaceAll("<p></p>", " ");
+		txt = txt.replaceAll("<p> </p>", " ");
+		txt = txt.replaceAll("<br>", "<br> ");
+		writer.write(txt)
+	}
+	
+	String name = htmlFile.getName()
+	name = name.substring(0, name.lastIndexOf("."));
+
+	File xhtmlFile = new File(outDir, name+".xhtml")
+
+	Tidy tidy = new Tidy(); // obtain a new Tidy instance
+	tidy.setXHTML(true); // set desired config options using tidy setters
+	tidy.setInputEncoding("UTF-8")
+	tidy.setOutputEncoding("UTF-8")
+	tidy.setShowErrors(0)
+	tidy.setShowWarnings(false)
+	xhtmlFile.withWriter("UTF-8") { out ->
+		tidy.parse(tmpHTML.toURI().toURL().newInputStream(), out); // run tidy, providing an input and output stream
+	}
+
+	if (ValidateXml.test(xhtmlFile)) {
+		def root = new XmlParser().parse(xhtmlFile)
+		def tables = root.body.table.tbody.tr.td
+		if (tables.size() == 0) tables = root.body.table.tr.td
+		//println "Nb of txt : "+tables.size()
+
+		for (def text : tables) {
+			String sign = ""
+		
+			if (! text instanceof groovy.util.Node) { println "NOT NODE: "+text; continue; }
+			//println "TEXT "
+			//text.setName("text")
+			boolean endOfText = false;
+			def textMetadatas = [:]
+			for (String metadata : metadatas) {
+				textMetadatas[metadata] = ""
+			}
+			for (def subtable : text.table) text.remove(subtable)	
+			
+			for (def p : text.table.p) p.addChild(" ")		
+			
+			for (def child : text.span) {
+				if ("color:red; font-weight:bold".equals(child.@style)) {
+					//text.remove(child)
+					if (debug) "Found bold: "+child
+					child.replaceNode { node -> w(expFound: "y", child.text())}
+				}
+			}
+			
+			def startIgnoringText = false
+			def tmp =""
+			def ichar = 0
+			String title = "";
+			def ignoredText = ""
+			def children = text.children()
+			for (int idx = 0 ; idx < children.size() ; idx++) {
+				
+				def child  = children[idx]
+				if (debug) println "child: $child"
+			
+				if (startIgnoringText) {
+					if (debug) println "Ignoring text : "+ignoredText
+					if (child instanceof String) ignoredText += child
+					else ignoredText += child.text()
+					
+					def t = text.children().remove(idx);
+					//if (tmp.length() > 0) println "removing : "+t
+					idx--
+					continue; // next child
+				}
+			
+				if (child instanceof String) {
+					//println " "+child
+					ichar += child.length()
+				} else {
+					ichar += child.text().length()
+					//		allTags.add(child.name().getLocalPart())
+					//		allClasses.add(child.@class)
+					//		allStyles.add(child.@style)
+					def nn = child.name()
+					
+					try {nn = nn.getLocalPart()} catch(Exception e) {}
+					switch (nn) {
+						case "br": break;
+						case "span":
+						if (debug) println "Found span $child"
+							String classV = child.@class
+							String style = child.@style
+							if (classV != null) {
+								if (metadatas.contains(classV)) {
+									textMetadatas[classV] = (textMetadatas[classV] + " " + child.text()).trim()
+									text.remove(child);
+									idx--
+									//println "METADATA: "+classV + " = "+child.text().trim().length();
+								} else if ("TitreArticleVisu" == classV) {
+									title += getText(child)//.text().trim().replaceAll("\n", " ")+ " "
+									child.name = new QName(child.name().getNamespaceURI(), "head", child.name().getPrefix())
+								} else {
+									println "UNKNOWED CLASS: "+classV + " = "+child.text().trim().length();
+								}
+							} else if (style != null) {
+								if ("color:red; font-weight:bold".equals(style)) {
+									//child.replaceNode { node -> w(expFound: "test")	}
+									//println "KEYWORD: "+child.text().trim();
+								} else {
+									println "UNKNOWED STYLE: '"+style+"' = "+child.text().trim();
+								}
+							} else {
+								println "UNKNOWED SPAN: "+child.text().trim();
+							}
+							break;
+
+						case "a": break
+						case "w": break;
+						case "b":
+							startIgnoringText = true;
+							tmp = child.text()
+							//if (tmp.length() > 0) println "START REMOVING FROM : "+tmp
+							text.remove(child);
+							idx--
+							break;
+						case "i": break;
+						case "font":
+							if (debug) println "Found font $child"
+							String style = child.@style
+							if ("font-style:italic;" == style) {
+								if (debug) println "ITALIC: "+getText(child).trim();
+								child.replaceNode { node -> i(getText(child))}
+							} else if ("font-weight:bold;") {
+								if (debug) println "BOLD: "+getText(child).trim();
+								child.replaceNode { node -> b(getText(child))}
+							} else {
+								println "FSTYLE: '"+style+"' = "+getText(child).trim();
+							}
+							break;
+						default: println child.name()
+					}
+				}
+			}
+			
+			//rename td to text
+			text.name = new QName(text.name().getNamespaceURI(), "text", text.name().getPrefix())
+			
+			//Write metadatas
+			for( String metadata : metadatas) {
+				text.attributes().put(metadata, textMetadatas[metadata])
+				//sign+= " "+textMetadatas[metadata].trim()
+			}
+			
+			// get document number
+			ignoredText = ignoredText.replaceAll("\n", " ")
+			int iNo= ignoredText.indexOf(newPrefix);
+			//println ignoredText
+			if (iNo >= 0) {
+				String no =ignoredText.substring(iNo+newPrefix.length()).trim()
+				text.attributes().put("idnews", no)
+				//sign += " "+no
+				text.attributes().put("date", no.substring(5,9)+"-"+no.substring(9,11)+"-"+no.substring(11,13))
+				text.attributes().put("yyyymmdd", no.substring(5,13))
+				text.attributes().put("yyyymm", no.substring(5,11))
+				text.attributes().put("yyyy", no.substring(5,9))
+				text.attributes().put("mm", no.substring(9,11))
+				text.attributes().put("dd", no.substring(11,13))
+			}
+			
+			//sign += " "+ichar
+			sign += " "+title
+			
+			if (allTitles[title] == null) allTitles[title] = ichar
+			if (Math.abs(allTitles[title] - ichar) > LIMITDIFF) {
+				sign += " "+ichar
+			}
+			File xmlFile;
+			if (done.contains(sign)) {
+				ignored << sign
+				xmlFile = new File(rejected, name+"_"+formater.format((itext++))+".xml")
+				ignoreds << xmlFile.getName()
+			} else {
+				done << sign;
+				xmlFile = new File(outDir2, name+"_"+formater.format((itext++))+".xml")
+				dones[sign] = xmlFile
+			}
+			def writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(xmlFile) , "UTF-8")); //$NON-NLS-1$
+				writer.println "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+				new XmlNodePrinter(writer).print(text)
+		}
+	}
+}
+
+if (ignored.size() > 0) {
+	File ignoredFile = new File (rejected, "ignored.txt");
+	ignoredFile.withWriter("UTF-8") { writer ->
+		writer.println "TOTAL: "+ignored.size()
+		for (int i = 0 ; i < ignored.size() ; i++) {
+			def sign = ignored[i]
+			writer.println "\n**DUPLICATE\n "
+			writer.println "keeped="+dones[sign];
+			writer.println "rejected="+ignoreds[i];
+			writer.println "SIGN="+sign
+			writer.println "\n"
+		}
+	}
+	println "TOTAL IGNORED: "+ignored.size()
+}
+
+println "TOTAL TEXT: $itext"
+if (!debug) {
+	outDir.deleteDir()
+	tmpDir.deleteDir()
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/misc/RenameFilesMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/misc/RenameFilesMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/misc/RenameFilesMacro.groovy	(revision 728)
@@ -0,0 +1,37 @@
+// STANDARD DECLARATIONS
+package org.txm.macro.misc
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+// BEGINNING OF PARAMETERS
+
+@Field @Option(name="inputDirectory",usage="TXT directory", widget="Folder", required=false, def="txt")
+File inputDirectory;
+
+// **change this parameter**
+@Field @Option(name="extension",usage="Regexp de l'extension des fichiers Ã  modifier", widget="String", required=true, def='\\.txt')
+def extension = "\\.trs"
+
+// **change this parameter**
+@Field @Option(name="find",usage="Expression rÃ©guliÃ¨re", widget="String", required=true, def='â€™')
+def find = "Bobine"
+
+// **change this parameter**
+@Field @Option(name="replaceWith",usage="ChaÃ®ne de remplacement", widget="String", required=false, def='\'')
+def replaceWith = ""
+
+
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return;
+
+// END OF PARAMETERS
+
+println "In $inputDirectory..."
+inputDirectory.eachFileMatch(~/.*$extension/) { file ->               // for each file matching extension
+		println " renaming: "+file.getName()
+		String name = file.getName()
+		name = name.replaceAll(find, replaceWith)
+		file.renameTo(new File(file.getParentFile(), name))
+	}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/imports/OpenImportFormMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/imports/OpenImportFormMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/imports/OpenImportFormMacro.groovy	(revision 728)
@@ -0,0 +1,30 @@
+package org.txm.macro.imports
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.rcpapplication.commands.*
+
+@Field @Option(name="scriptFile", usage="an example file", widget="File", required=true, def="xxxLoader.groovy")
+File scriptFile
+
+if (!ParametersDialog.open(this)) return;
+
+File script = scriptFile // if not done, using scriptFile raise a Cast exception to 'groovy.lang.Reference'
+
+if (!script.getName().endsWith(".groovy")) {
+	println "Error: the selected file is not a Groovy script"
+	return
+}
+
+println "Opening import form with $scriptFile"
+monitor.syncExec(new Runnable() {
+	public void run() {
+		try {
+			String path = script.getAbsolutePath()
+			OpenImportForm.openfile(path);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+});
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/imports/ExecuteImportScriptMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/imports/ExecuteImportScriptMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/imports/ExecuteImportScriptMacro.groovy	(revision 728)
@@ -0,0 +1,38 @@
+package org.txm.macro.imports
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.rcpapplication.commands.*
+
+@Field @Option(name="scriptFile", usage="an example file", widget="File", required=true, def="xxxLoader.groovy")
+File scriptFile
+
+@Field @Option(name="paramFile", usage="an example file", widget="File", required=true, def="import.xml")
+File paramFile
+
+if (!ParametersDialog.open(this)) return;
+
+File script = scriptFile // if not done, using scriptFile raise a Cast exception to 'groovy.lang.Reference'
+File param = paramFile
+if (!script.getName().endsWith(".groovy")) {
+	println "Error: the selected file is not a Groovy script: $script"
+	return
+}
+if (!param.getName().endsWith(".xml")) {
+	println "Error: the selected file is not a XML import parameter file: $param"
+	return
+}
+
+println "Runnin import with $scriptFile and $paramFile"
+
+monitor.syncExec(new Runnable() {
+	public void run() {
+		try {
+			String path = script.getAbsolutePath()
+			ExecuteImportScript.executeScript(script.getAbsolutePath(), param);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+});
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/imports/metadata.properties
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/imports/metadata.properties	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/imports/metadata.properties	(revision 728)
@@ -0,0 +1,10 @@
+author=/bncDoc/teiHeader/fileDesc/sourceDesc/bibl/author/text()
+class=/bncDoc/teiHeader/profileDesc/textClass/classCode[@scheme="DLEE"]/text()
+date=/bncDoc/teiHeader/fileDesc/sourceDesc/bibl/imprint/date/text()
+extent=/bncDoc/teiHeader/fileDesc/extent/text()
+idno=/bncDoc/teiHeader/fileDesc/publicationStmt/idno[@type="bnc"]/text()
+pages=/bncDoc/teiHeader/fileDesc/sourceDesc/bibl/pp/text()
+title=/bncDoc/teiHeader/fileDesc/sourceDesc/bibl/title/text()
+title2=/bncDoc/teiHeader/fileDesc/titleStmt/title/text()
+description=//wtext/@type
+

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/imports/metadata.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/imports/TeiHeader2MetadataCSVMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/imports/TeiHeader2MetadataCSVMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/imports/TeiHeader2MetadataCSVMacro.groovy	(revision 728)
@@ -0,0 +1,102 @@
+// Copyright Â© 2017 ENS de Lyon, CNRS, University of Franche-ComtÃ©
+// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
+// @author sheiden
+
+package org.txm.macro.imports
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.importer.XPathResult
+
+@Field @Option(name="inputDirectory", usage="input directory (contains XML files)", widget="Folder", required=true, def="input")
+def inputDirectory
+
+@Field @Option(name="propertiesFile", usage="metadata=XPath properties input file", widget="File", required=true, def="import.properties")
+File propertiesFile
+
+@Field @Option(name="CSVoutputFile", usage="CSV output file", widget="File", required=true, def="metadata.csv")
+File CSVoutputFile
+
+@Field @Option(name="columnSeparator", usage="column separator for CSV file", widget="String", required=true, def=",")
+def columnSeparator
+
+@Field @Option(name="textSeparator", usage="text separator for CSV file", widget="String", required=true, def="\"")
+def textSeparator
+
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return
+
+writer = CSVoutputFile.newWriter("UTF-8")
+
+metadataXPaths = new Properties()
+if (propertiesFile.exists() && propertiesFile.canRead()) {
+	InputStreamReader input = new InputStreamReader(new FileInputStream(propertiesFile) , "UTF-8")
+	metadataXPaths.load(input)
+	input.close()
+} else {
+	println "** TeiHeader2MetadataCSV: '$propertiesFile' file not found."
+	return
+}
+
+List<File> files = inputDirectory.listFiles()
+if (files == null || files.size() == 0) {
+	println "** TeiHeader2MetadataCSV: no files found in '$inputDirectory' directory."
+	return
+}
+
+for (int i = 0 ; i < files.size() ; i++)
+	if (!(files.get(i).getName().endsWith(".xml")) || files.get(i).getName().equals("import.xml"))
+		files.remove(i--);
+
+if (files.size() == 0) {
+	println "** TeiHeader2MetadataCSV: no usefull files found in '$inputDirectory' directory."
+	return
+}
+
+// println "files = "+files
+
+writer << "id"+columnSeparator
+
+metadataNames = metadataXPaths.keySet().sort()
+
+isFirst = true
+metadataNames.each {
+
+	if (isFirst) { isFirst = false
+	} else {
+		writer << columnSeparator
+	}
+	writer << it
+}
+writer << "\n"
+
+for (File f : files) {
+	filename = f.getName()
+	filename = filename.substring(0, filename.lastIndexOf("."))
+	writer << filename+columnSeparator
+
+	metadataValues = new HashMap<String, String>()
+	def xpathprocessor = new XPathResult(f)
+	metadataNames.each { name ->
+		value = xpathprocessor.getXpathResponse(metadataXPaths.get(name), "N/A")
+		value = value.trim().replaceAll(/[ \t\n]+/, " ")
+		metadataValues.put(name, value)
+		// println sprintf("%s: %s = %s", filename, name, value)
+	}
+	xpathprocessor.close()
+
+	isFirst = true
+	metadataNames.each {
+
+		if (isFirst) { isFirst = false
+		} else {
+			writer << columnSeparator
+		}
+		writer << textSeparator+metadataValues.get(it)+textSeparator
+	}
+	writer << "\n"
+}
+
+writer.close()
+
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Contains various macro samples</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/stats/Specif2ThrowMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/stats/Specif2ThrowMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/stats/Specif2ThrowMacro.groovy	(revision 728)
@@ -0,0 +1,187 @@
+// Copyright Â© 2016 ENS de Lyon, CNRS, University of Franche-ComtÃ©
+// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
+// @author sheiden
+
+/* --------------   Specif2Throw    --------------
+
+FR:
+
+Macro affichant la probabilitÃ© a priori (avant de faire les lancÃ©s ou les tirages) d'obtenir N succÃ¨s consÃ©cutifs
+dans des jeux de lancÃ©s ou de tirages simples en regard avec des valeurs de spÃ©cificitÃ©s.
+Il s'agit de jeux de lancÃ©s ou tirages connus de tous : le lancÃ© de piÃ¨ce pour obtenir pile ou face, le lancÃ© de dÃ©
+Ã  6 faces, tirer une carte dans un jeu de 32 ou 52 cartes, etc.
+On considÃ¨re qu'une piÃ¨ce a 50% de chances (1 chance sur 2) de tomber sur la face 'pile' Ã  chaque lancÃ©.
+On considÃ¨re qu'un dÃ© a 16,6% de chances (1 chance sur 6) de tomber sur '6' Ã  chaque lancÃ©.
+On considÃ¨re qu'on a 3,1% de chances (1 chance sur 32) de tirer un as de trÃ¨fle Ã  chaque tirage dans un jeu de 32 cartes.
+On considÃ¨re qu'on a 1,9% de chances (1 chance sur 52) de tirer un as de trÃ¨fle Ã  chaque tirage dans un jeu de 52 cartes.
+etc.
+On considÃ¨re que les lancÃ©s ou les tirages sont indÃ©pendants et que les objets ne sont pas biaisÃ©s (eg le dÃ© n'est pas pipÃ©).
+
+La probabilitÃ© est mise en regard avec la spÃ©cificitÃ© Ã©quivalente pour mettre en lien
+des valeurs de spÃ©cificitÃ©s calculÃ©es par TXM et l'intuition que l'on a de chances de succÃ¨s
+dans un jeu de lancÃ© ou de tirage.
+Il s'agit bien sÃ»r uniquement d'illustrer l'ordre de grandeur de la surprise Ã  avoir en
+interprÃ©tant directement le modÃ¨le des spÃ©cificitÃ©s. Il ne s'agit en aucun cas d'illustrer
+une quelconque assimilation de l'apparition de mots dans des textes Ã  un jeu de hasard.
+
+La macro prend deux paramÃ¨tres :
+
+* cardOmega : le nombre d'issues possibles pour le jeu de lancÃ© ou de tirage considÃ©rÃ©
+              (Omega est l'univers de l'expÃ©rience alÃ©atoire, cardOmega son cardinal)
+ - pour un lancÃ© de piÃ¨ce : choisir 2 pour cardOmega
+   (Omega = {pile, face})
+ - pour un lancÃ© de dÃ© : choisir 6 pour cardOmega
+   (Omega = {1, 2, 3, 4, 5, 6})
+ - pour un tirage de carte dans un jeu de 32 cartes : choisir 32 pour cardOmega
+   (Omega = {1 de trÃ¨fle, 2 de trÃ¨fle, 3 de trÃ¨fle, 4 de trÃ¨fle, 5 de trÃ¨fle, 6 de trÃ¨fle, 7 de trÃ¨fle,
+   8 de trÃ¨fle, 9 de trÃ¨fle, 10 de trÃ¨fle, valet de trÃ¨fle, dame de trÃ¨fle, roi de trÃ¨fle, 1 de carreau,
+   2 de carreau, etc.})
+ - pour un tirage de carte dans un jeu de 52 cartes : choisir 52 pour cardOmega
+ - etc.
+* nthrows : le nombre maximum de lancÃ©s ou de tirages avec succÃ¨s consÃ©cutifs
+
+La macro affiche - selon les options :
+
+* displayProba : toutes les probabilitÃ©s de 1 Ã  nthrows lancÃ©s ou tirages en dÃ©taillant :
+-  n : le nombre de succÃ¨s consÃ©cutifs
+-  p : la probabilitÃ© correspondante
+-  % : le pourcentage correspondant
+- pe : la probabilitÃ© exprimÃ©e en notation avec exposant en base 10
+-  s : la spÃ©cificitÃ© Ã©quivalente (l'exposant de la probabilitÃ©, soit son logarithme en base 10)
+
+* onlyMainRanks : s'utilise avec l'option displayProba pour n'afficher que les probabilitÃ©s des rangs dÃ©cimaux principaux (1, 2..., 10, 20..., 100, 200...)
+
+* displayThrows : plutÃ´t que le dÃ©tail de la probabilitÃ©, liste pour une spÃ©cificitÃ© S- donnÃ©e, le nombre Ã©quivalent de lancÃ©s ou de tirages avec succÃ¨s consÃ©cutifs correspondants exprimÃ© sous la forme d'un intervalle : nombre de lancÃ©s ou tirages minimum - nombre de lancÃ©s ou tirages maximum
+Par exemple '-10 = 30-33' signifie : une spÃ©cificitÃ© S- de '-10' Ã©quivaut Ã  entre 30 et 33 lancÃ©s ou tirages avec succÃ¨s consÃ©cutifs (cas du lancÃ© de piÃ¨ce, cardOmega = 2)
+
+Les limites du calcul sont liÃ©es au modÃ¨le de la mÃ©moire de la machine. Une machine 64-bit peut typiquement calculer la probabilitÃ© de 1023 lancÃ©s de piÃ¨ce avec succÃ¨s consÃ©cutifs.
+
+*/
+
+// STANDARD DECLARATIONS
+package org.txm.macro.stats
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.eclipse.ui.console.*
+
+// BEGINNING OF PARAMETERS
+
+@Field @Option(name="cardOmega", usage="card(Î©): 2=coin, 6=dice, 32=32-card deck, 52=52-card deck, etc.", widget="Integer", required=true, def="2")
+def cardOmega
+
+@Field @Option(name="nthrows", usage="maximum number of successful throws or draws", widget="Integer", required=true, def="99")
+def nthrows
+
+@Field @Option(name="displayProba", usage="display probabilities", widget="Boolean", required=false, def="true")
+def displayProba
+
+@Field @Option(name="onlyMainRanks", usage="only display main rank lines", widget="Boolean", required=false, def="false")
+def onlyMainRanks
+
+@Field @Option(name="displayThrows", usage="display equivalent specificity value for each number or interval number of throws or draws", widget="Boolean", required=false, def="true")
+def displayThrows
+
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return
+
+// END OF PARAMETERS
+
+def clearConsole = { ->
+	// clear the console
+	(ConsolePlugin.getDefault().getConsoleManager().getConsoles())[0].clearConsole()
+}
+
+clearConsole()
+
+min = [:]
+max = [:]
+
+pow = cardOmega**(nthrows)
+powd = pow.doubleValue()
+
+if (powd == Double.POSITIVE_INFINITY || powd == Double.NEGATIVE_INFINITY) {
+	println sprintf("** Impossible to calculate probabilities for this value, try a lower value (impossible to represent cardOmega to the power of %d with this machine). Aborting.", nthrows)
+	return
+}
+
+d = 1/powd
+
+significandSize = ((-java.lang.Math.log10(d) as double)-1 as int)+4
+
+format = sprintf("%%4d = %%%d.%df = %%0%d.%df%%%% = %%9.2e = %%4d", significandSize, significandSize-2, significandSize-1, significandSize-4)
+
+unit = 1
+dec = 1
+
+println "cardOmega = "+cardOmega
+
+if (displayProba) {
+	println """LÃ©gende :
+-  n : le nombre de lancÃ©s ou tirages avec succÃ¨s consÃ©cutifs
+-  p : la probabilitÃ© correspondante
+-  % : le pourcentage correspondant
+- pe : la probabilitÃ© exprimÃ©e en notation avec exposant en base 10
+-  s : la spÃ©cificitÃ© Ã©quivalente (l'exposant de la probabilitÃ©, soit son logarithme en base 10)
+"""
+	spc = ' ' * (significandSize+2)
+	println "   n    p"+spc+" %"+spc+"  pe         s"
+}
+
+nthrows.times {
+    n = it+1
+	p = (1/cardOmega)**(n) as double
+	s = java.lang.Math.log10(p)-1 as int
+	if (min[s]) { if (min[s] > n) min[s] = n } else min[s] = n
+	if (max[s]) { if (max[s] < n) max[s] = n } else max[s] = n
+	if (displayProba) {
+		s = sprintf(format, n, p, p*100, p, s).replaceAll(/ = 0([^,])/, ' =  $1')
+		m0 = s =~ /(....)0+ = ([^-])/
+		if (m0.count > 0) {
+			spc0 = m0[0][1] + (' ' * (m0[0][0].size()-8)) + ' = ' + m0[0][2]
+			s = m0.replaceFirst(spc0)
+		}
+		m0p = s =~ /(....)0+% = /
+		if (m0p.count > 0) {
+			spc0p = m0p[0][1] + '%' + (' ' * (m0p[0][0].size()-8)) + ' = '
+			s = m0p.replaceFirst(spc0p)
+		}
+
+		if (!onlyMainRanks || ((n % dec) == 0) || (n == nthrows)) {
+			println s
+		}
+		
+		unit = unit+1
+		if (unit >= dec * 10) {
+			dec = dec * 10
+			unit = 1
+		}
+	}
+}
+
+if (displayThrows) {
+
+	if (displayProba) {
+		println ""
+	}
+
+	def x = []
+	def y = []
+	
+	println """LÃ©gende :
+- -S      : spÃ©cificitÃ© Ã©quivalente
+-  lancÃ©s : intervalle des nombres de lancÃ©s ou tirages avec succÃ¨s consÃ©cutifs correspondant
+"""
+	println " -S   lancÃ©s"
+	min.each { key, value ->
+	 if (min[key] != max[key]) println sprintf("%3d = %d-%d", key, min[key], max[key])
+	 else println sprintf("%3d = %d", key, min[key])
+	 x.push(key)
+	 y.push(min[key])
+	}
+	
+//	println "x = "+x
+//	println "y = "+y
+
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/stats/BasicVocabularyMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/stats/BasicVocabularyMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/stats/BasicVocabularyMacro.groovy	(revision 728)
@@ -0,0 +1,132 @@
+package org.txm.macro.stats
+// Copyright Â© 2010-2016 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// @author mdecorde
+// @author sheiden
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+// This macro computes the basic vocabulary of a partition
+// given a specificities table. The result is saved in a
+// TSV file.
+
+import org.txm.Toolbox
+import org.txm.functions.ca.CA
+import org.txm.searchengine.cqp.clientExceptions.*
+import org.txm.searchengine.cqp.corpus.*
+import org.txm.searchengine.cqp.corpus.query.*
+import org.txm.stat.StatException
+import org.txm.stat.data.LexicalTable
+import org.txm.stat.engine.r.RWorkspace
+import org.txm.functions.specificities.SpecificitesResult
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+if (!(corpusViewSelection instanceof SpecificitesResult)) {
+	println "** You need to select a Specificities result icon in the Corpus view before calling this macro. Aborting."
+	return
+}
+
+// PARAMETERS
+
+@Field @Option(name="outputDirectory", usage="output directory", widget="Folder", required=true, def=".")
+def outputDirectory
+
+@Field @Option(name="outputFile", usage="TSV result file", widget="String", required=true, def="banal.tsv")
+def outputFile
+
+@Field @Option(name="scoreMax", usage="score maximum threshold", widget="Float", required=false, def="1.5")
+def scoreMax
+
+//@Field @Option(name="suseSum", usage="Use the row sums : y/n", widget="String", required=false, def="n")
+def suseSum // not used
+
+// END OF PARAMETERS
+if (!ParametersDialog.open(this)) return
+
+if (suseSum == null || suseSum.length() == 0) suseSum = "n"
+boolean useSum = suseSum.toLowerCase().charAt(0) == "y"
+
+if (useSum) {
+	println "Using line sums..."
+}
+
+def output = new File(outputDirectory.toString()+"/"+outputFile)
+def writer = output.newWriter("UTF-8")
+def specif = corpusViewSelection
+def indices = specif.getSpecificitesIndex()
+def freqs = specif.getFrequency()
+def rownames = specif.getTypeNames()
+def colnames = specif.getPartShortNames()
+
+def selected = []
+
+writer.print "unit"
+writer.print "\tF"
+writer.print "\tscore_max"
+
+for (int j = 0; j < colnames.size() ; j++) {
+	writer.print "\t"+colnames[j]
+	writer.print "\tscore"
+}
+
+writer.println ""
+
+for (int i = 0; i < rownames.length ; i++) {
+	boolean add = true
+	def totF = 0
+	def totscore = 0.0
+	def maxS = 0
+
+	for (int j = 0; j < colnames.size() ; j++) {
+
+		def sp = Math.abs(indices[i][j])
+		if (sp >= scoreMax) {
+			add = false
+		} else {
+			if (sp >= maxS) maxS = sp
+		}
+		totF += freqs[i][j]
+		totscore += sp
+	}
+	
+	if (useSum) {
+		if (totscore >= scoreMax) add = false
+		else add = true
+	}
+	
+	if (add) {
+		selected << rownames[i]
+		writer.print rownames[i]
+		writer.print "\t$totF"
+		writer.print "\t$maxS"
+		for (int j = 0; j < colnames.size() ; j++) {
+			writer.print "\t"+freqs[i][j]
+			writer.print "\t"+indices[i][j]
+		}
+		writer.println ""
+	}
+}
+
+println "Selected: "+selected
+println "Saved in $output."
+
+writer.close()
+
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/FixTransanaTimings.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/FixTransanaTimings.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/FixTransanaTimings.groovy	(revision 728)
@@ -0,0 +1,220 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+package org.txm.macro.transcription
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+class FixTransanaTimings {
+
+	File trsInFile = new File("/home/mdecorde/xml/transana/out.xml")
+	File trsOutFile = new File("/home/mdecorde/xml/transana/TrP1S8_08102010.trs")
+
+	public FixTransanaTimings(File trsInFile, File trsOutFile) {
+		this.trsInFile = trsInFile;
+		this.trsOutFile = trsOutFile;
+	}
+
+	public boolean process() {
+		def slurper = new XmlParser();
+		def trs = slurper.parse(trsInFile)
+
+		def speakers = new HashSet<String>();
+		for (def turn : trs.Episode.Section.Turn) {
+			String tmp = turn.@speaker.toUpperCase();
+			speakers << tmp
+			turn.@speaker = tmp
+		}
+		for (def speakersNode : trs.Speakers) {
+			for (String spk : speakers) {
+				def speakerNode = new Node(speakersNode, 'Speaker',
+				[id:spk, name:spk, type:'unknown', check:'yes', dialect:'native', accent:'no', scope:'local'])
+			}
+			def speakerNode = new Node(speakersNode, 'Speaker',
+				[id:"none", name:"none", type:'unknown', check:'yes', dialect:'native', accent:'no', scope:'local'])
+		}
+		
+		String currentEnd = null;
+		for (def turn : trs.Episode.Section.Turn) {
+			def children = turn.children()
+	
+			if (children.size() > 0) {
+				//println "fixing turn start="+turn.@startTime+" end="+turn.@endTime+" previous end="+currentEnd
+				if (currentEnd != null && currentEnd.length() > 0 && turn.@startTime.length() == 0) { // using last Sync
+					//println "fixing with previous Turn $currentEnd"
+					turn.@startTime = currentEnd
+					setStartTime(children[0], currentEnd)
+				} else if (!(children[0] instanceof String)) { // no previous Sync, using next Sync
+					def start = getStartTime(children[0])
+					if (start != null && start.length() > 0)	turn.@startTime = start
+				}
+				currentEnd = null
+	
+				if (!(children[children.size() - 1] instanceof String)) { // this is the last Sync
+					def end = getStartTime(children[children.size() - 1])
+					if (end != null && end.length() > 0)  {
+						turn.@endTime = end
+						currentEnd = end;
+					}
+				}
+			}
+		}
+	
+		def nodes = []
+		// get Sync nodes to fix
+		for (def section : trs.Episode.Section) { // all Section
+			for (def child : section.children()) { // all Section children
+				if (!(child instanceof String)) { // is a Tag
+					switch(child.name()) {
+						case "Turn": // get Sync in Turn
+							//nodes << child;
+							for (def sync : child.Sync)
+								nodes << sync
+							break;
+						case "Sync":
+							nodes << child;
+							break;
+						default: break;
+					}
+				}
+			}
+		}
+		
+		//Fixing Sync@time
+		for (int i = 0 ; i < nodes.size() ; i++) {
+			def node = nodes[i]
+			String time = getStartTime(node)	
+			
+			if (time.length() == 0) {				
+				def list = [];
+				String previous;
+				if (i > 0) { previous = getStartTime(nodes[i-1]);
+				} else { previous = "0.0" }
+				
+				String next = null;
+				while ((next == null || next.length() == 0) && i <= nodes.size()) {
+					list << node
+					node = nodes[++i]
+					next = getStartTime(node)
+				}
+				if (next != null) {
+					if (node != null) list << node
+					fixSyncTimes(list, previous, next)
+				} else {
+					println "ERROR: no end time in the transcription"
+				}
+			}
+		}
+	
+		// fixing startTime of Turn using next Sync.@time
+		def turns = trs.Episode.Section.Turn
+		for (int i = 0 ; i < turns.size() ; i++) {
+			def turn = turns[i]
+			def syncs = turn.Sync
+			if (syncs.size() > 0) {
+				turn.@startTime = syncs[0].@time
+			} else {
+				println "Error: Turn with no Sync milestone"
+			}
+		}
+	
+		// fixing endTimes of Turn using next Turn.@startTime
+		for (int i = 0 ; i < turns.size() ; i++) {
+			def turn = turns[i]
+			//println "turn start="+turn.@startTime+" end="+turn.@endTime
+			if (i < turns.size() - 1) {
+				if (turn.@endTime.length() == 0 && turns[i+1].@startTime.length() > 0) {
+					//println "fixing turn.@endTime "+turn.@endTime+" with turns[i+1].@startTime "+(turns[i+1]);
+					turn.@endTime = turns[i+1].@startTime
+				}
+			}  else if (turn.@endTime.length() == 0) { // last turn has no timing, aproximate it 
+				Float e = Float.parseFloat(turn.@startTime)
+				e += turn.text().length()*1.0f 
+				turn.@endTime = e.toString()
+			}
+		}
+		
+		// fixing endTimes of Section using last Turn.@endTime
+		// fixing startTimes of Section using first Turn.@startTime
+		def sections = trs.Episode.Section
+		for (int i = 0 ; i < sections.size() ; i++) {
+			def t = sections[i].Turn
+			if (t.size() == 0) continue;
+			sections[i].@startTime = t[0].@startTime
+			sections[i].@endTime = t[-1].@endTime
+		}
+		
+		trsOutFile.withWriter("UTF-8") { writer ->
+			writer.write('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE Trans SYSTEM "trans-14.dtd">\n')
+			new groovy.util.XmlNodePrinter(new PrintWriter(writer)).print(trs) }
+		
+		return true;
+	}
+	
+	def getStartTime(def node) {
+		def ret = null;
+		if (node == null) return "0.0"
+		if (node.name() == null) return "0.0"
+		switch(node.name()) {
+			case "Turn":
+			case "Section":
+			//			println "Turn"
+				ret = node.@startTime
+				break
+			case "Sync":
+			//		println "Sync"
+				ret = node.@time
+				break
+			default: break;
+		}
+		//println "getStartTime "+node.name()+" $ret"
+		return ret
+	}
+
+	def setStartTime(def node, def value) {
+		switch(node.name()) {
+			case "Turn":
+			case "Section":
+				node.@startTime = ""+value
+				break;
+			
+			case "Sync":
+				return node.@time = ""+value
+			default: break;
+		}
+	}
+
+	def fixSyncTimes(def list, def start, def end) {
+		//println "Nfix: "+list.size()+" "+list
+		//println "$start $end"
+		
+		def startf = Double.parseDouble(start)
+		def endf = Double.parseDouble(end)
+		def delta = (endf-startf)/list.size()
+		//println delta
+		float c = startf;
+		for (int i = 0 ; i < list.size() ; i++) {
+			c += delta;
+			list[i].@time = ""+c
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/SetTRSTurnTimingsAndSpeakers.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/SetTRSTurnTimingsAndSpeakers.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/SetTRSTurnTimingsAndSpeakers.groovy	(revision 728)
@@ -0,0 +1,220 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+package org.txm.macro.transcription
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+class SetTRSTurnTimingsAndSpeakers {
+
+	File trsInFile = new File("/home/mdecorde/xml/transana/out.xml")
+	File trsOutFile = new File("/home/mdecorde/xml/transana/TrP1S8_08102010.trs")
+
+	public SetTRSTurnTimingsAndSpeakers(File trsInFile, File trsOutFile) {
+		this.trsInFile = trsInFile;
+		this.trsOutFile = trsOutFile;
+	}
+
+	public boolean process() {
+		def slurper = new XmlParser();
+		def trs = slurper.parse(trsInFile)
+
+		// collect speakers from Turn@speaker values
+		def speakers = new HashSet<String>();
+		for (def turn : trs.Episode.Section.Turn) {
+			String tmp = turn.@speaker.toUpperCase();
+			speakers << tmp
+			turn.@speaker = tmp
+		}
+		for (def speakersNode : trs.Speakers) {
+			for (String spk : speakers) {
+				def speakerNode = new Node(speakersNode, 'Speaker',
+				[id:spk.replace(" ", "_"), name:spk, type:'unknown', check:'yes', dialect:'native', accent:'no', scope:'local'])
+			}
+			def speakerNode = new Node(speakersNode, 'Speaker',	[id:"none", name:"none", type:'unknown', check:'yes', dialect:'native', accent:'no', scope:'local'])
+		}
+				
+		String currentEnd = null;
+		for (def turn : trs.Episode.Section.Turn) {
+			def children = turn.children()
+	
+			if (children.size() > 0) {
+				//println "fixing turn start="+turn.@startTime+" end="+turn.@endTime+" previous end="+currentEnd
+				if (currentEnd != null && currentEnd.length() > 0 && turn.@startTime.length() == 0) { // using last Sync
+					//println "fixing with previous Turn $currentEnd"
+					turn.@startTime = currentEnd
+					setStartTime(children[0], currentEnd)
+				} else if (!(children[0] instanceof String)) { // no previous Sync, using next Sync
+					def start = getStartTime(children[0])
+					if (start != null && start.length() > 0)	turn.@startTime = start
+				}
+				currentEnd = null
+	
+				if (!(children[children.size() - 1] instanceof String)) { // this is the last Sync
+					def end = getStartTime(children[children.size() - 1])
+					if (end != null && end.length() > 0)  {
+						turn.@endTime = end
+						currentEnd = end;
+					}
+				}
+			}
+		}
+	
+		def nodes = []
+		// get Sync nodes to fix
+		for (def section : trs.Episode.Section) { // all Section
+			for (def child : section.children()) { // all Section children
+				if (!(child instanceof String)) { // is a Tag
+					switch(child.name()) {
+						case "Turn": // get Sync in Turn
+							//nodes << child;
+							for (def sync : child.Sync) {
+								nodes << sync
+							}
+							break;
+						case "Sync":
+							nodes << child;
+							break;
+						default: break;
+					}
+				}
+			}
+		}
+
+		//Fixing Sync@time
+		String previousValue = "0.0"
+		for (int i = 0 ; i < nodes.size() ; i++) {
+			def node = nodes[i]
+			String time = getStartTime(node)	
+			
+			if (time.length() == 0 || time == previousValue) {				
+				def list = [];
+				String previous;
+				if (i > 0) { previous = getStartTime(nodes[i-1]);
+				} else { previous = "0.0" }
+				
+				String next = null;
+				while ((next == null || next.length() == 0 || next == previousValue) && i <= nodes.size()) {
+					list << node
+					node = nodes[i]
+					next = getStartTime(node)
+					i++
+				}
+				if (next != null) {
+					if (node != null) list << node
+					fixSyncTimes(list, previous, next)
+					previousValue = next;
+				} else {
+					println "ERROR: no end time in the transcription"
+				}
+			}
+		}
+	
+		// fixing startTime of Turn using next Sync.@time
+		def turns = trs.Episode.Section.Turn
+		for (int i = 0 ; i < turns.size() ; i++) {
+			def turn = turns[i]
+			def syncs = turn.Sync
+			if (syncs.size() > 0) {
+				turn.@startTime = syncs[0].@time
+			} else {
+				println "Error: Turn with no Sync milestone"
+			}
+		}
+	
+		// fixing endTimes of Turn using next Turn.@startTime
+		for (int i = 0 ; i < turns.size() ; i++) {
+			def turn = turns[i]
+			//println "turn start="+turn.@startTime+" end="+turn.@endTime
+			if (i < turns.size() - 1) {
+				if (turn.@endTime.length() == 0 && turns[i+1].@startTime.length() > 0) {
+					//println "fixing turn.@endTime "+turn.@endTime+" with turns[i+1].@startTime "+(turns[i+1]);
+					turn.@endTime = turns[i+1].@startTime
+				}
+			}
+		}
+		
+		// fixing endTimes of Section using last Turn.@endTime
+		// fixing startTimes of Section using first Turn.@startTime
+		def sections = trs.Episode.Section
+		for (int i = 0 ; i < sections.size() ; i++) {
+			def t = sections[i].Turn
+			if (t.size() == 0) continue;
+			sections[i].@startTime = t[0].@startTime
+			sections[i].@endTime = t[-1].@endTime
+		}
+		
+		trsOutFile.withWriter("UTF-8") { writer ->
+			writer.write('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE Trans SYSTEM "trans-14.dtd">\n')
+			new groovy.util.XmlNodePrinter(new PrintWriter(writer)).print(trs) }
+		
+		return true;
+	}
+	
+	def getStartTime(def node) {
+		def ret = null;
+		if (node == null) return "0.0"
+		if (node.name() == null) return "0.0"
+		switch(node.name()) {
+			case "Turn":
+			case "Section":
+			//			println "Turn"
+				ret = node.@startTime
+				break
+			case "Sync":
+			//		println "Sync"
+				ret = node.@time
+				break
+			default: break;
+		}
+		//println "getStartTime "+node.name()+" $ret"
+		return ret
+	}
+
+	def setStartTime(def node, def value) {
+		switch(node.name()) {
+			case "Turn":
+			case "Section":
+				node.@startTime = ""+value
+				break;
+			
+			case "Sync":
+				return node.@time = ""+value
+			default: break;
+		}
+	}
+
+	def fixSyncTimes(def list, def start, def end) {
+		println "Nfix: "+list.size()+" "+list
+		
+		def startf = Double.parseDouble(start)
+		def endf = Double.parseDouble(end)
+		def delta = (endf-startf)/list.size()
+		println "start=$start end=$end delta=$delta"
+
+		float c = startf;
+		for (int i = 0 ; i < list.size() ; i++) {
+			c += delta;
+			list[i].@time = ""+c
+		}
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/TXT2TRS.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/TXT2TRS.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/TXT2TRS.groovy	(revision 728)
@@ -0,0 +1,387 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+package org.txm.macro.transcription
+
+import org.txm.importer.DomUtils;
+import org.w3c.tidy.Tidy
+import org.txm.doc.*
+
+import javax.xml.stream.*
+
+import java.util.HashMap
+import java.util.List
+
+import org.txm.importer.*
+import org.xml.sax.Attributes
+import org.txm.importer.filters.*
+import org.txm.utils.IOUtils;
+import org.txm.utils.i18n.DetectBOM
+
+import java.io.File
+import java.io.IOException
+import java.util.ArrayList
+
+import javax.xml.parsers.SAXParserFactory
+import javax.xml.parsers.ParserConfigurationException
+import javax.xml.parsers.SAXParser
+
+import java.net.URL
+
+import org.xml.sax.InputSource
+import org.xml.sax.helpers.DefaultHandler
+
+import java.text.DecimalFormat
+import java.text.ParseException
+import java.text.SimpleDateFormat
+import java.util.Date;
+
+/**
+ * Parse a formatted a TXT file to create a TRS file.
+ * 
+ * Manage turns, syncs, locutors, section.
+ * 
+ * The parsing of the TXT file starts at the first time code
+ *  
+ * @author mdecorde, sheiden
+ *
+ */
+class TXT2TRS {
+
+	boolean inTurn = false
+	def locs = new HashSet<String>()
+	def lastTiming = "none"
+	String localname = null
+	String allTxt
+	String header = ""
+	String type = ""
+	boolean startOfP = false
+	boolean firstTurn = true
+	boolean firstSync = true
+	def loc = null
+	int time = 0;
+	boolean start= false;
+	boolean startTranscription=false
+	boolean isThemeOpened = false
+
+	def formater
+	def formater_without_ms
+	def formater2
+	StaxStackWriter pagedWriter
+	
+	
+	//                 /\([0-9]+:[0-9][0-9]?:[0-9][0-9]?(\.[0-9])?\)|(Â¤<[0-9]+>)/
+	def bullet_regex = /\([0-9]+:[0-9][0-9]?:[0-9][0-9]?(\.[0-9][0-9]?)?\)|(Â¤<[0-9]+>)/
+	def turn_with_bullet = /.+(\([0-9]+:[0-9][0-9]?:[0-9][0-9]?(\.[0-9])?\)|(Â¤<[0-9]+>))/
+	//                  /([a-zA-Z]+)="([^"]+)"/
+	def section_regex = /([a-zA-Z]+)="([^"]+)"/
+	
+	public TXT2TRS() { }
+
+	public boolean process(File txtFile, File trsFile) {
+//
+		FileInputStream input = new FileInputStream(txtFile);
+		Reader reader = new InputStreamReader(input , "UTF-8");
+		
+		for (int i = 0 ; i < new DetectBOM(txtFile).getBOMSize() ; i++) input.read();
+		def lines = reader.readLines();
+
+		formater = new SimpleDateFormat("h:mm:ss.S");
+		formater_without_ms = new SimpleDateFormat("h:mm:ss");
+		formater.setTimeZone(TimeZone.getTimeZone("GMT"));
+		formater_without_ms.setTimeZone(TimeZone.getTimeZone("GMT"));
+		formater2 = new DecimalFormat("#######.0")
+		formater2.setMaximumFractionDigits(2)
+
+		//println "Start writing TRS file..."
+		pagedWriter = new StaxStackWriter(trsFile, "UTF-8");
+		pagedWriter.writeStartDocument("UTF-8", "1.0")
+		//pagedWriter.writeDTD("<!DOCTYPE Trans SYSTEM \"trans-14.dtd\">") // removed because parser has the "no DTD" option set
+		pagedWriter.writeStartElement("Trans");
+		pagedWriter.writeAttribute("scribe", "SCRIBE");
+		pagedWriter.writeAttribute("audio_filename", "");
+		pagedWriter.writeAttribute("version", "1.0");
+		pagedWriter.writeAttribute("version_date", "110110");
+		pagedWriter.writeStartElement("Speakers");
+		pagedWriter.writeEndElement(); // Speakers
+		
+		pagedWriter.writeStartElement("Episode");
+		pagedWriter.writeAttribute("program", "NA");
+		pagedWriter.writeAttribute("air_date", "NA");
+		isThemeOpened = false
+		def firstTurn = true
+
+		// test if the transcription structure is : comment, start line, end line
+		def trslines = []
+		boolean started = false
+		for (String line : lines) {
+			line = line.trim()
+			if (line.matches(bullet_regex)) {
+				started = true;
+			}
+
+			if (started) { // get ttranscription lines
+				if (line.length() > 0) trslines << line
+			}
+		}
+
+		if (!started) {
+			println "The $txtFile file does not contain the first time bullet"
+			return false;
+		}
+		String lastLine = trslines[-1]
+		if (!lastLine.matches(bullet_regex)) {
+			// check if last turn has a bullet at the end
+			boolean bulletIsMissing = true;
+			for (int i = trslines.size() - 1 ; i > 0 ; i--) {
+				String line = trslines[i].trim()
+				def split = line.split("\t", 2)
+				//println "$line "+split.length+ " VS "+turn_with_bullet
+				if (split.length == 2) {
+				 	if (line.matches(turn_with_bullet)) {
+						bulletIsMissing = false;
+					} 
+					println "END $bulletIsMissing"
+					i=-1
+				}
+			}
+			if (bulletIsMissing) {
+				println "Error: The $txtFile file last line or last turn does not contain the end time bullet: $bullet_regex"
+				return false;
+			}
+		}
+
+		lines = trslines
+
+		def currentTime = lines[0] // get starting time
+
+		// group lines per Turn, Event, Comment...
+		def groups = [["sync", lines[0]]]
+		lines.remove(0)
+		def currentGroup = []
+
+		for (String line : lines) {
+			if (line.indexOf("\t") > 0) { // start of Turn
+				def split = line.split("\t", 2)
+				def loc = split[0]
+				def content = split[1]
+
+				if (currentGroup.size() > 0) {groups << currentGroup} // store previous group
+				currentGroup = ["turn", loc, content];
+
+			} else if (line.matches("(\\([^)]+\\) *)+")) {//("(") && line.endsWith(")")) { // comment or timing
+				if (line.matches(bullet_regex)) { // Sync in a Turn
+					if (currentGroup.size() > 0) {
+						currentGroup << line
+					} else {
+						if (currentGroup.size() > 0) {groups << currentGroup} // store previous group
+						groups << ["sync", line]
+					}
+				} else { // comment -> ignored
+					if (currentGroup.size() > 0) {groups << currentGroup} // store previous group
+					currentGroup = ["comment", line];
+				}
+			} else if (line.startsWith("[") && line.endsWith("]")) { // section, end of Turn
+				if (currentGroup.size() > 0) groups << currentGroup
+				groups << ["section", line]
+			} else { // something that happens during a Turn
+				currentGroup << line
+				
+			}
+		}
+
+		for (def g : groups) {
+			//println g
+			if (g[0] == "turn") {
+				String loc = g[1]
+				//println "process turn: "+g
+				def tokens = []
+				for (int i = 2 ; i < g.size() ; i++) {// speach starts for position 2
+					//println " process speach: "+g[i]
+					// 	tokenize time bullets, comment and speach
+
+
+					def turntokens = []
+					def toProcess = [g[i]]
+					def lastMatch = 0
+					// find Sync
+					while (toProcess.size() > 0) {
+						String txt = toProcess.pop()
+						boolean nomatch = true
+						def m = (txt =~ bullet_regex) // time
+						//if (m.size() > 0) {
+						while (m.find()) {
+							nomatch = false
+							//println "found: "+m.group()
+							// grab the string in between the end of the last match
+							// and the start of the current one (empty string if none)
+							String before = txt.substring(lastMatch, m.start())
+							if (before.length() > 0) turntokens << before
+							// grab the delimiter
+							turntokens << m.group()
+							// keep looking from the end of the current match
+							lastMatch = m.end()
+						}
+						if (nomatch) turntokens << txt
+						if (lastMatch > 0 && lastMatch < txt.length()) turntokens << txt.substring(lastMatch)
+					}
+					//println "  speach+syncs="+turntokens
+
+					// find Comments (....)
+					toProcess = turntokens
+					turntokens = []
+					
+					while (toProcess.size() > 0) {
+						String txt = toProcess.remove(0)
+						
+						boolean nomatch = true
+						def m = (txt =~ /(\([^)]+\))/) // time
+						//if (m.size() > 0) {
+						lastMatch = 0
+						while (m.find()) {
+							nomatch = false
+							//println "found: "+m.group()
+							// grab the string in between the end of the last match
+							// and the start of the current one (empty string if none)
+							String before = txt.substring(lastMatch, m.start())
+							if (before.length() > 0) turntokens << before
+							// grab the delimiter
+							turntokens << m.group()
+							// keep looking from the end of the current match
+							lastMatch = m.end()
+						}
+						if (nomatch) turntokens << txt
+						if (lastMatch > 0 && lastMatch < txt.length()) turntokens << txt.substring(lastMatch)
+					}
+					//println "  speach+syncs+comments="+turntokens
+					//					if (!processCommentAndSync(g[i])) {
+					//						println "ERROR $lastTiming 'contains ([]) but malformed' error line "+parser.getLocation().getLineNumber()+" : $allTxt"
+					//					}
+					tokens.addAll(turntokens)
+				}
+
+				if (firstTurn && !isThemeOpened) {
+					isThemeOpened = true;
+					
+					pagedWriter.writeStartElement("Section");
+					pagedWriter.writeAttribute("type", "report");
+					pagedWriter.writeAttribute("topic", "");
+					pagedWriter.writeAttribute("startTime", "0.0");
+					pagedWriter.writeAttribute("endTime", "");
+				}
+				firstTurn = false
+				pagedWriter.writeCharacters("\n")
+				pagedWriter.writeStartElement("Turn");
+				pagedWriter.writeAttribute("speaker", loc);
+				pagedWriter.writeAttribute("startTime", "");
+				pagedWriter.writeAttribute("endTime", "");
+				pagedWriter.writeCharacters("\n")
+				writeSync(currentTime)
+
+				String previousToken = ""
+				for (def t : tokens) {
+					if (t.matches(bullet_regex)) {
+						writeSync(t)
+						currentTime = t
+					}  else if (t.startsWith("(") && t.endsWith(")") ){
+						pagedWriter.writeCharacters("\n")
+						pagedWriter.writeEmptyElement("Comment")
+						pagedWriter.writeAttribute("desc", t.substring(1, t.length() -1))
+					}else {
+						pagedWriter.writeCharacters(" "+t)
+					}
+				}
+
+				pagedWriter.writeCharacters("\n")
+				pagedWriter.writeEndElement(); // Turn
+			} else if (g[0] == "sync") {
+				currentTime = g[1]
+				writeSync(currentTime)
+			} else if (g[0] == "comment") {
+//				println "process comment: "+g[1]
+				pagedWriter.writeCharacters("\n")
+				pagedWriter.writeEmptyElement("Comment")
+				pagedWriter.writeAttribute("desc", g[1].substring(1, g[1].length() -1))
+			} else if (g[0] == "section") {
+//				println "process section: "+g[1]
+				
+				def m = (g[1] =~ section_regex) // time
+				if (m.size() > 0) {
+					if (isThemeOpened) {
+						pagedWriter.writeCharacters("\n")
+						pagedWriter.writeEndElement(); // previous Section
+					}
+					isThemeOpened = true;
+					pagedWriter.writeCharacters("\n")
+					pagedWriter.writeStartElement("Section");
+					def attr = ["type":"report", "topic":"", "startTime":"", "endTime":""]
+					
+					for (def match : m) {
+						if (match.size() == 3) {
+							attr[match[1]]=match[2];
+						} else {
+							println "ERROR $lastTiming malformed section attribute "+g[1]+ "near $currentTime"
+						}
+					}
+					
+					// write attributes
+					for (def k : attr.keySet())	pagedWriter.writeAttribute(k, attr[k]);
+				} else {
+					println "ERROR $lastTiming malformed section "+g[1]
+				}
+			} else {
+				println "Error: found malformed line: "+g
+			}
+		}
+
+		boolean ret = true
+		if (isThemeOpened) { // close previous theme
+			pagedWriter.writeCharacters("\n")
+			pagedWriter.writeEndElement(); // Section
+		}
+
+		//pagedWriter.writeEndElement(); // Section
+		pagedWriter.writeCharacters("\n")
+		pagedWriter.writeEndElement(); // Episode
+		pagedWriter.writeCharacters("\n")
+		pagedWriter.writeEndElement(); // Trans
+
+		ret = true
+
+		pagedWriter.close()
+		return ret
+	}
+
+	def writeSync(String txt) {
+		//println "write time code $txt"
+		pagedWriter.writeEmptyElement("Sync");
+		if (txt.startsWith("Â¤")) { // Â¤<5648>
+			String time = txt.substring(2, txt.length()-1)
+			pagedWriter.writeAttribute("time", time.substring(0,time.length()-3)+"."+time.substring(time.length()-3));
+		} else {
+			String str = txt.substring(1, txt.length()-1)
+			Date date = null;
+			try {date = formater.parse(str);} catch(Exception e1){}
+			try {date = formater_without_ms.parse(str);} catch(Exception e2){println "Failed to parse time: "+str; return;}
+			pagedWriter.writeAttribute("time", ""+(date.getTime()/1000.0f));
+		}
+		pagedWriter.writeCharacters("\n")
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<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

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/HTML2TRS.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/HTML2TRS.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/HTML2TRS.groovy	(revision 728)
@@ -0,0 +1,349 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+package org.txm.macro.transcription
+
+import org.txm.importer.DomUtils;
+import org.w3c.tidy.Tidy
+import org.txm.doc.*
+import javax.xml.stream.*
+import java.net.URL
+import java.io.File
+import java.net.URL
+import java.util.HashMap
+import java.util.List
+import org.txm.importer.*
+import org.xml.sax.Attributes
+import org.txm.importer.filters.*
+import java.io.File
+import java.io.IOException
+import java.util.ArrayList
+import javax.xml.parsers.SAXParserFactory
+import javax.xml.parsers.ParserConfigurationException
+import javax.xml.parsers.SAXParser
+import java.net.URL
+import org.xml.sax.InputSource
+import org.xml.sax.helpers.DefaultHandler
+
+import java.text.DecimalFormat
+import java.text.ParseException
+import java.text.SimpleDateFormat
+import java.util.Date;
+
+class HTML2TRS {
+
+	boolean inTurn = false
+	def locs = new HashSet<String>()
+	def lastTiming = "none"
+	String localname = null
+	String allTxt
+	String header = ""
+	String type = ""
+	boolean startOfP = false
+	boolean firstTurn = true
+	boolean firstSync = true
+	def loc = null
+	int time = 0;
+	boolean start= false;
+	boolean startTranscription=false
+	boolean isThemeOpened = false
+
+	def inputData
+	def factory
+	def parser
+	def formater
+	def formater2
+	StaxStackWriter pagedWriter
+	public HTML2TRS() { }
+	
+	public process(File xhtmlFile, File trsFile) {
+	
+		println "remove entities and doctype"
+		String text = xhtmlFile.getText("UTF-8")
+		text = text.replaceAll("&nbsp;", " ")
+		text = text.replaceAll("""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">""", "")
+		xhtmlFile.withWriter("UTF-8") { writer ->
+			writer.write(text);
+		}
+		
+		inputData = xhtmlFile.toURI().toURL().openStream();
+		factory = XMLInputFactory.newInstance();
+		factory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
+		parser = factory.createXMLStreamReader(inputData);
+		
+		formater = new SimpleDateFormat("h:mm:ss.S");
+		formater.setTimeZone(TimeZone.getTimeZone("GMT"));
+		formater2 = new DecimalFormat("#######.0")
+		formater2.setMaximumFractionDigits(2)
+	
+		println "start writing TRS file"
+		pagedWriter = new StaxStackWriter(trsFile, "UTF-8");
+		pagedWriter.writeStartDocument("UTF-8", "1.0")
+		//pagedWriter.writeDTD("<!DOCTYPE Trans SYSTEM \"trans-14.dtd\">") // removed because parser has the "no DTD" option set
+		pagedWriter.writeStartElement("Trans");
+		pagedWriter.writeAttribute("scribe", "SCRIBE");
+		pagedWriter.writeAttribute("audio_filename", "");
+		pagedWriter.writeAttribute("version", "1.0");
+		pagedWriter.writeAttribute("version_date", "110110");
+		pagedWriter.writeStartElement("Speakers");
+		pagedWriter.writeEndElement(); // Speakers
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName()
+					//println "start elem: "+localname
+					switch (localname) {
+						case "body": println "START OF BODY";start = true;
+							break;
+						case "p":
+							loc = null
+							allTxt = ""
+							type = "";
+							startOfP = true;
+							break
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName()
+					switch (localname) {
+						case "body": start = false;
+							break
+						case "p":
+							//if (allTxt.length() > 0) allTxt = allTxt.substring(1)
+							//println "PTEXT '$allTxt'"
+							if (allTxt.indexOf("####") > 0) {
+								//println "SAY $txt"
+								if (allTxt.startsWith("\"")) allTxt = allTxt.substring(1)
+								loc = allTxt.substring(0, allTxt.indexOf("####")).trim()
+								locs.add(loc)
+								allTxt = allTxt.substring(allTxt.indexOf("####")+4) // remove " [A-Z]"
+								//println "LOC: '$loc'"
+								//println "LOC: '$allTxt'"
+							}
+							String trimedTxt = allTxt.trim()
+							if (startTranscription)
+							if (loc) {
+								inTurn = true;
+								pagedWriter.writeStartElement("Turn");
+								pagedWriter.writeAttribute("speaker", loc);
+								pagedWriter.writeAttribute("startTime", "");
+								pagedWriter.writeAttribute("endTime", "");
+								
+								// write Sync
+								if (firstTurn) {
+									writeTimeCode("(0:00:00.0)")
+									firstTurn = false;
+								} else {
+									pagedWriter.writeEmptyElement("Sync")
+									pagedWriter.writeAttribute("time", "");
+								}
+								
+								if (!processCommentAndSync(allTxt)) {
+									if (allTxt.trim().length() > 0)
+										println "ERROR $lastTiming 'contains ([]) but malformed' error line "+parser.getLocation().getLineNumber()+" : $allTxt"
+								}
+								//pagedWriter.writeCharacters(allTxt.replaceAll("\\(.+:..:..\\..+\\)", ""))
+								pagedWriter.writeEndElement(); // endTurn
+								
+								inTurn = false
+								time++;
+							} else { // Sync or Comment or Section : out of Turn 
+								if (allTxt.length() > 0)
+								if (trimedTxt.startsWith("(") && trimedTxt.endsWith(")")) {
+									if (!processCommentAndSync(allTxt)) {
+										if (allTxt.trim().length() > 0)
+											println "ERROR $lastTiming 'contains ([]) but malformed' line "+parser.getLocation().getLineNumber()+" : $allTxt"
+									}
+								} else if (trimedTxt.startsWith("[") && trimedTxt.endsWith("]")) {
+									println "SECTION: "+trimedTxt
+									def section_regex = /([a-zA-Z]+)="([^"]+)"/
+									def m = (trimedTxt =~ section_regex) // time
+									if (m.size() > 0) {
+										if (isThemeOpened)
+											pagedWriter.writeEndElement(); // previous Section
+										isThemeOpened = true;
+										pagedWriter.writeStartElement("Section");
+										pagedWriter.writeAttribute("type", "report");
+										pagedWriter.writeAttribute("topic", "");
+										pagedWriter.writeAttribute("startTime", "");
+										pagedWriter.writeAttribute("endTime", "");
+										for (def match : m) {
+											if (match.size() == 3) {
+												pagedWriter.writeAttribute(match[1], match[2]);
+											} else {
+												println "ERROR $lastTiming malformed section attribute "+trimedTxt
+											}
+										}
+									} else {
+										println "ERROR $lastTiming malformed section "+trimedTxt
+									}
+								} else if (allTxt.trim().length() > 0) {
+									println "ERROR $lastTiming 'not in Turn and not a comment' line "+parser.getLocation().getLineNumber()+" : $allTxt"
+								}
+							}
+		
+							allTxt = ""
+							break
+					}
+					break;
+					
+				case XMLStreamConstants.CHARACTERS:
+					String txt = parser.getText().replaceAll("\n", " ")
+					allTxt += txt.replaceAll("    ", "####")
+					//println allTxt+"\n\n"
+					if (!startTranscription && start && txt.matches("\\(.+:..:..\\..+\\)")) {
+						println "START with $txt"
+						startTranscription = true
+						
+						pagedWriter.writeStartElement("Episode");
+						pagedWriter.writeAttribute("program", "NA");
+						pagedWriter.writeAttribute("air_date", "NA");
+						isThemeOpened = true
+						pagedWriter.writeStartElement("Section");
+						pagedWriter.writeAttribute("type", "report");
+						pagedWriter.writeAttribute("topic", "");
+						pagedWriter.writeAttribute("startTime", "0.0");
+						pagedWriter.writeAttribute("endTime", "");
+					}
+					//println "$start $startTranscription "+txt.length()+" $startOfP"
+					if (start && startTranscription && txt.length() > 0 && startOfP) {
+						//println "first P: $txt $loc"
+						startOfP = false
+					}
+					break;
+				default: break;
+			}
+		}
+		boolean ret = true
+		if (startTranscription) {
+			if (isThemeOpened) { // close previous theme
+				pagedWriter.writeEndElement(); // Section
+			}
+			
+			//pagedWriter.writeEndElement(); // Section
+			pagedWriter.writeEndElement(); // Episode
+			pagedWriter.writeEndElement(); // Trans
+
+			ret = true
+		} else {
+			println "ERROR6: header not found"
+			ret = false;
+		}
+		pagedWriter.close()
+		return ret
+	}
+
+	def writeTimeCode(String txt) {
+		//println "write time code $txt"
+		String str = txt.substring(1, txt.length()-1)
+		Date date = formater.parse(str);
+		lastTiming = str;
+		if (inTurn || firstSync) {
+			pagedWriter.writeEmptyElement("Sync");
+			pagedWriter.writeAttribute("time", ""+(date.getTime()/1000.0f));
+		} else {
+			pagedWriter.writeStartElement("Turn");
+			pagedWriter.writeAttribute("speaker", "none");
+			pagedWriter.writeAttribute("startTime", "");
+			pagedWriter.writeAttribute("endTime", "");
+			inTurn = true
+			writeTimeCode(txt);
+			inTurn = false	
+			pagedWriter.writeEndElement(); // endTurn
+			//println "ERROR: can't write Sync out of Turn $txt at "+parser.getLocation().getLineNumber()
+		}
+		firstSync = false
+	}
+	
+	//                 /\([0-9]+:[0-9][0-9]?:[0-9][0-9]?(\.[0-9])?\)/
+	def bullet_regex = /\([0-9]+:[0-9][0-9]?:[0-9][0-9]?(\.[0-9])?\)/
+	def processCommentAndSync(String txt) {
+		if (txt.length() == 0) return true;
+		//println "process sync text: "+txt
+		boolean ret = true;
+		//find timing
+		//find comments
+		def allBySync = []
+		def all = []
+		def splits = []
+		def lastMatch = 0
+		
+		// split bullet from txt
+		def m = (txt =~ bullet_regex) // time
+		while (m.find()) {
+			//println "found: "+m.group()
+	   		// grab the string in between the end of the last match
+	   		// and the start of the current one (empty string if none)
+	   		allBySync << txt.substring(lastMatch, m.start())
+	   		// grab the delimiter
+	   		allBySync << m.group()
+	   		// keep looking from the end of the current match
+	   		lastMatch = m.end()
+		}
+		all = allBySync
+		// grab everything after the end of the last match
+		all << txt.substring(lastMatch)
+		//println "** $txt >> $all"
+		for (String str : all) {
+			if (str.trim().length() == 0) continue
+			if (str.matches(bullet_regex)) {
+				//println "TIMING: $str"
+				writeTimeCode(str)
+			} else {
+				int idxOpen = str.indexOf("(");
+				int idxClose = str.indexOf(")")
+				
+				while (idxOpen >=0 && idxClose > idxOpen) {
+					if (str.substring(0, idxOpen).length() > 0) {
+						if (loc != null) {
+							pagedWriter.writeCharacters(str.substring(0, idxOpen))
+							//println "SAY: "+str.substring(0, idxOpen)
+						} else {
+							if (str.trim().length() > 0)
+								println "WARNING $lastTiming no locutor at line "+parser.getLocation().getLineNumber()+" : $str"
+						}
+					}
+					pagedWriter.writeEmptyElement("Comment")
+					pagedWriter.writeAttribute("desc", str.substring(idxOpen+1, idxClose))
+					//println "COMMENT: "+str.substring(idxOpen+1, idxClose)
+					str = str.substring(idxClose+1)
+					idxOpen = str.indexOf("(");
+					idxClose = str.indexOf(")")
+				}
+				if (str.length() > 0) {
+					if (loc != null) {
+						pagedWriter.writeCharacters(str)
+					//	println "SAY: "+str
+					} else {
+						if (str.trim().length() > 0)
+							println "ERROR $lastTiming 'not in turn and not a comment' line "+parser.getLocation().getLineNumber()+" : $str"
+					}
+				}
+				if (str.contains("(") || str.contains("[") || str.contains(")") || str.contains("]")) {
+					ret = false;
+				}
+		  }
+		}
+		return ret;
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/TextTranscription2TRS.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/TextTranscription2TRS.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/TextTranscription2TRS.groovy	(revision 728)
@@ -0,0 +1,285 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+package org.txm.macro.transcription
+
+import org.kohsuke.args4j.*
+
+import groovy.transform.Field
+
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.importer.DomUtils;
+import org.w3c.tidy.Tidy
+import org.txm.doc.*;
+
+import javax.xml.stream.*;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.txm.importer.*;
+import org.xml.sax.Attributes;
+import org.txm.importer.filters.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+
+import java.net.URL;
+
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+import java.text.DecimalFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+class TextTranscription2TRS {
+	boolean debug = false;
+	boolean isDirectory = false;
+	File outDir;
+	ConvertDocument converter;
+	def monitor
+
+	TextTranscription2TRS(File outDir, boolean debug, def monitor) {
+		this.outDir = outDir
+		this.monitor = monitor
+		this.debug = debug
+	}
+
+	boolean process(File file) {
+		try {
+			isDirectory = file.isDirectory();
+			if (isDirectory) {
+				return processDir(file)
+			} else {
+				return processFile(file, 100)
+			}
+		} catch(Exception e) {
+			println "Error while processing: "+e
+			if (debug) e.printStackTrace()
+		}
+	}
+
+	boolean processDir(File dir) {
+		boolean ret = true
+		try {
+			println "* Processing $dir directory"
+			converter = new ConvertDocument();
+			def files = dir.listFiles()
+			def okfiles = [];
+			if (files != null)
+				for (File file : files) {
+					String fname = file.getName().toLowerCase()
+					if ( file.isFile() &&
+					(fname.endsWith(".odt") || fname.endsWith(".doc") || fname.endsWith(".rtf") || fname.endsWith(".txt"))) {
+						okfiles << file
+					}
+
+				}
+
+			if (okfiles.size() == 0) {
+				println "No ODT/DOC/RTF file found in $dir"
+				return false
+			}
+
+			int delta = 100 / okfiles.size()
+			for (File file : okfiles) {
+				if (monitor != null) monitor.worked(0, "Processing file: $file")
+				if (!processFile(file, delta)) {
+					ret = false;
+					println "ERROR: Failed to process $file"
+				}
+
+				if (monitor != null && monitor.isCanceled()) {
+					break; // stop looping
+				}
+			}
+		} catch(Exception e) {
+			println "Error while processing directory: "+e;
+			if (debug) e.printStackTrace();
+		}
+		if (converter != null) converter.stop();
+		return ret;
+	}
+
+	boolean processFile(File docFile, int work) {
+		if (docFile == null) return false;
+		int delta = work / 5
+		println "** Processing $docFile file"
+		String filename = docFile.getName()
+		int idx = filename.lastIndexOf(".")
+		if (idx < 0) return false;
+		String ext = filename.substring(idx)
+		filename = filename.substring(0, idx)
+
+		//File docFile = new File(srcDir, "${filename}$ext")
+		//		File htmlFile = new File(outDir, "${filename}.html")
+		//		File htmlFile2 = new File(outDir, "${filename}_temp.html")
+		//		File xhtmlFile = new File(outDir, "${filename}.xhtml")
+		//		File xmlFile = new File(outDir, "${filename}.xml")
+		File txtFile = new File(outDir, "${filename}.txt")
+		File trsFile = new File(outDir, "${filename}-tmp.trs")
+		File finalTrsFile = new File(outDir, "${filename}.trs")
+		boolean ret = false;
+		
+		if (!docFile.getName().toLowerCase().endsWith("txt")) {
+			if (monitor != null) monitor.worked(0, "DOCtoTXT: "+docFile.getName())
+
+			ret = DOCtoTXT(docFile, txtFile)
+			if (monitor != null) monitor.worked(delta, "DOCtoTXT: "+docFile.getName())
+			if (monitor != null && monitor.isCanceled()) {
+				println "Process interrupted by user"
+				return false;
+			}
+			if (!ret) return ret;
+		} else { // the document is already a TXT file
+			org.txm.utils.FileCopy.copy(docFile, txtFile)
+			ret = true
+		}
+
+		ret = ret && TXTtoTRS(txtFile, trsFile)
+		if (monitor != null) monitor.worked(delta, "TXTtoTRS: "+docFile.getName())
+		if (monitor != null && monitor.isCanceled()) {
+			println "Process interrupted by user"
+			return false;
+		}
+		if (!ret) return ret;
+
+		ret = ret && TRStoFixedTRS(trsFile, finalTrsFile);
+		if (monitor != null) monitor.worked(delta, "Done: "+docFile.getName())
+		if (monitor != null && monitor.isCanceled()) {
+			println "Process interrupted by user"
+			return false;
+		}
+		if (!ret) return ret;
+
+		// cleaning
+		System.gc()
+		if (!debug) {
+			//htmlFile.delete();htmlFile2.delete();xhtmlFile.delete();xmlFile.delete();
+			txtFile.delete()
+			trsFile.delete()
+		}
+
+		return ret
+	}
+
+	boolean DOCtoTXT(File docFile, File txtFile) {
+		println "*** ODT -> TXT"
+		try {
+			if (!isDirectory) converter = new ConvertDocument();
+			converter.setDebug(debug)
+			converter.autoFile(docFile, txtFile, "txt")
+		} catch(Exception e) {
+			println "Error while converting $docFile : $e"
+			if (debug) e.printStackTrace()
+		} finally {
+			if (!isDirectory && converter != null) converter.stop()
+		}
+		return txtFile.exists() && txtFile.length() > 0
+	}
+
+//	boolean HTMLtoHTMLforTidy(File htmlFile, File htmlFile2) {
+//		println "*** HTML -> HTML for tidy"
+//		try {
+//			println "replace TABS with 4 spaces"
+//			String text2 = htmlFile.getText("UTF-8")
+//			text2 = text2.replaceAll("&nbsp;", " ")
+//			text2 = text2.replaceAll("â€™", "'")
+//			text2 = text2.replaceAll("&rsquo;", "'")
+//			text2 = text2.replaceAll("\t", "&nbsp;&nbsp;&nbsp;&nbsp;")
+//			text2 = text2.replaceAll("\n", '&nbsp;')
+//			text2 = text2.replaceAll("\r\n", '&nbsp;')
+//			htmlFile2.withWriter("UTF-8") { writer ->
+//				writer.write(text2);
+//			}
+//		} catch(Exception e) {
+//			println "Error while preparing HTML of $htmlFile : $e"
+//			if (debug) e.printStackTrace()
+//		}
+//		return htmlFile2.exists() && htmlFile2.length() > 0
+//	}
+//
+//	boolean HTMLtoXHTML(File htmlFile2, File xhtmlFile) {
+//		println "*** HTML for tidy -> XHTML"
+//		try {
+//			Tidy tidy = new Tidy(); // obtain a new Tidy instance
+//			tidy.setXHTML(true); // set desired config options using tidy setters
+//			tidy.setInputEncoding("UTF-8")
+//			tidy.setOutputEncoding("UTF-8")
+//			tidy.setShowErrors(100)
+//			tidy.setShowWarnings(debug)
+//			tidy.setTabsize(10)
+//			tidy.setWraplen(9999)
+//			tidy.setForceOutput(true) // Tidy won't stop if error are found
+//			xhtmlFile.withWriter("UTF-8") { out ->
+//				def input = new InputStreamReader(htmlFile2.toURI().toURL().newInputStream(), "UTF-8")
+//				tidy.parse(input, out); // run tidy, providing an input and output stream
+//			}
+//			if (xhtmlFile.exists()) {
+//				// JTidy produced a "0x0" char. removing them
+//				// fix separated < and / ???
+//				def c = Character.toChars(0)[0]
+//				String txttmp = xhtmlFile.getText("UTF-8");
+//				xhtmlFile.withWriter("UTF-8") { out ->
+//					out.write(txttmp.replace("<\n/", "</").replace("<\r\n/", "</"))
+//				}
+//			}
+//		} catch(Exception e) {
+//			println "Error while applying JTidy: "+e
+//			if (debug) e.printStackTrace()
+//		}
+//		return xhtmlFile.exists() && xhtmlFile.length() > 0
+//	}
+
+	boolean TXTtoTRS(File txtFile, File trsFile) {
+		println "*** TXT -> TRS"
+		try {
+			TXT2TRS ht = new TXT2TRS();
+			ht.process(txtFile, trsFile);
+		} catch(Exception e) {
+			println "Error while creating TRS file: "+e
+			if (debug) e.printStackTrace()
+		}
+		return trsFile.exists() && trsFile.length() > 0
+	}
+
+	boolean TRStoFixedTRS(File trsFile, File finalTrsFile) {
+		println "*** TRS -> FIXED TRS"
+		try {
+			def timingfixer = new SetTRSTurnTimingsAndSpeakers(trsFile, finalTrsFile);
+			if (!timingfixer.process()) {
+				println "Error while fixing timing"
+			}
+		} catch(Exception e) {
+			println "Error while fixing TRS file: "+e
+			if (debug) e.printStackTrace()
+		}
+		return finalTrsFile.exists() && finalTrsFile.length() > 0
+	}
+}
+
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/TextTranscription2TRSMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/TextTranscription2TRSMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/TextTranscription2TRSMacro.groovy	(revision 728)
@@ -0,0 +1,54 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+package org.txm.macro.transcription
+
+import org.kohsuke.args4j.*
+
+import groovy.transform.Field
+
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+
+@Field @Option(name="odtDir", usage="Dossier qui contient les fichiers ODT", widget="Folder", required=true, def="")
+File odtDir;
+
+@Field @Option(name="debug", usage="Don't clean files, 'y' to enable debug", widget="String", required=false, def="n")
+def debug = "n";
+
+if (!ParametersDialog.open(this)) return;
+
+File outDir = new File(odtDir, "out") // write result in "out" folder
+
+outDir.deleteDir()
+outDir.mkdir()
+
+println "out: $outDir"
+println "odtDir: $odtDir"
+
+println "DEBUG: "+("y" == debug || "yes" == debug)
+
+if (!odtDir.exists()) {
+	println "$odtDir does not exists. Aborting"
+}
+def monitor = null
+TextTranscription2TRS trs = new TextTranscription2TRS(outDir, "y" == debug, monitor)
+trs.process(odtDir)
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/Transana2TRS.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/Transana2TRS.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/transcription/Transana2TRS.groovy	(revision 728)
@@ -0,0 +1,296 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+package org.txm.macro.transcription
+
+import org.kohsuke.args4j.*
+
+import groovy.transform.Field
+
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.importer.DomUtils;
+import org.w3c.tidy.Tidy
+import org.txm.doc.*;
+
+import javax.xml.stream.*;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.txm.importer.*;
+import org.xml.sax.Attributes;
+import org.txm.importer.filters.*;
+import org.txm.macro.transcription.FixTransanaTimings;
+import org.txm.macro.transcription.HTML2TRS;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+
+import java.net.URL;
+
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+import java.text.DecimalFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+class Transana2TRS {
+	boolean debug = false;
+	boolean isDirectory = false;
+	File outDir;
+	File dtd;
+	ConvertDocument converter;
+	def monitor
+
+	Transana2TRS(File outDir, File dtd, boolean debug, def monitor) {
+		this.dtd = dtd;
+		this.outDir = outDir
+		this.monitor = monitor
+		this.debug = debug
+	}
+
+	boolean process(File file) {
+		try {
+			isDirectory = file.isDirectory();
+			if (isDirectory) {
+				return processDir(file)
+			} else {
+				return processFile(file, 100)
+			}
+		} catch(Exception e) {
+			println "Error while processing: "+e
+			if (debug) e.printStackTrace()
+		}
+	}
+
+	boolean processDir(File dir) {
+		boolean ret = true
+		try {
+			println "* Processing $dir directory"
+			converter = new ConvertDocument();
+			def files = dir.listFiles()
+			def okfiles = [];
+			if (files != null)
+				for (File file : files) {
+					String fname = file.getName().toLowerCase()
+					if ( file.isFile() &&
+					(fname.endsWith(".odt") || fname.endsWith(".doc") || fname.endsWith(".rtf"))) {
+						okfiles << file
+					}
+
+				}
+
+			if (okfiles.size() == 0) {
+				println "No ODT/DOC/RTF file found in $dir"
+				return false
+			}
+
+			int delta = 100 / okfiles.size()
+			for (File file : okfiles) {
+				monitor.worked(0, "Processing file: $file")
+				if (!processFile(file, delta)) {
+					ret = false;
+					println "ERROR: Failed to process $file"
+				}
+
+				if (monitor.isCanceled()) {
+					break; // stop looping
+				}
+			}
+		} catch(Exception e) {
+			println "Error while processing directory: "+e;
+			if (debug) e.printStackTrace();
+		}
+		if (converter != null) converter.stop();
+		return ret;
+	}
+
+	boolean processFile(File docFile, int work) {
+		if (docFile == null) return false;
+		int delta = work / 5
+		println "** Processing $docFile file"
+		String filename = docFile.getName()
+		int idx = filename.lastIndexOf(".")
+		if (idx < 0) return false;
+		String ext = filename.substring(idx)
+		filename = filename.substring(0, idx)
+
+		//File docFile = new File(srcDir, "${filename}$ext")
+		File htmlFile = new File(outDir, "${filename}.html")
+		File htmlFile2 = new File(outDir, "${filename}_temp.html")
+		File xhtmlFile = new File(outDir, "${filename}.xhtml")
+		File xmlFile = new File(outDir, "${filename}.xml")
+		File trsFile = new File(outDir, "${filename}-tmp.trs")
+		File finalTrsFile = new File(outDir, "${filename}.trs")
+
+		monitor.worked(0, "DOCtoHTML: "+docFile.getName())
+
+		boolean ret = DOCtoHTML(docFile, htmlFile)
+		monitor.worked(delta, "HTMLtoHTMLforTidy: "+docFile.getName())
+		if (monitor.isCanceled()) {
+			println "Process interrupted by user"
+			return false;
+		}
+		if (!ret) return ret;
+
+		ret = ret && HTMLtoHTMLforTidy(htmlFile, htmlFile2)
+		monitor.worked(delta, "HTMLtoXHTML: "+docFile.getName())
+		if (monitor.isCanceled()) {
+			println "Process interrupted by user"
+			return false;
+		}
+		if (!ret) return ret;
+
+		ret = ret && HTMLtoXHTML(htmlFile2, xhtmlFile)
+		monitor.worked(delta, "XHTMLtoTRS: "+docFile.getName())
+		if (monitor.isCanceled()) {
+			println "Process interrupted by user"
+			return false;
+		}
+		if (!ret) return ret;
+
+		ret = ret && XHTMLtoTRS(xhtmlFile, trsFile)
+		monitor.worked(delta, "TRStoFixedTRS: "+docFile.getName())
+		if (monitor.isCanceled()) {
+			println "Process interrupted by user"
+			return false;
+		}
+		if (!ret) return ret;
+
+		ret = ret && TRStoFixedTRS(trsFile, finalTrsFile);
+		monitor.worked(delta, "Done: "+docFile.getName())
+		if (monitor.isCanceled()) {
+			println "Process interrupted by user"
+			return false;
+		}
+		if (!ret) return ret;
+
+		// cleaning
+		System.gc()
+		if (!debug) {
+			htmlFile.delete();htmlFile2.delete();xhtmlFile.delete();xmlFile.delete();trsFile.delete()
+		}
+
+		return ret
+	}
+
+	boolean DOCtoHTML(File docFile, File htmlFile) {
+		println "*** ODT -> HTML"
+		try {
+			if (!isDirectory) converter = new ConvertDocument();
+			converter.setDebug(debug)
+			converter.autoFile(docFile, htmlFile, "html")
+		} catch(Exception e) {
+			println "Error while converting $docFile : $e"
+			if (debug) e.printStackTrace()
+		} finally {
+			if (!isDirectory && converter != null) converter.stop()
+		}
+		return htmlFile.exists() && htmlFile.length() > 0
+	}
+
+	boolean HTMLtoHTMLforTidy(File htmlFile, File htmlFile2) {
+		println "*** HTML -> HTML for tidy"
+		try {
+			println "replace TABS with 4 spaces"
+			String text2 = htmlFile.getText("UTF-8")
+			text2 = text2.replaceAll("&nbsp;", " ")
+			text2 = text2.replaceAll("â€™", "'")
+			text2 = text2.replaceAll("&rsquo;", "'")
+			text2 = text2.replaceAll("\t", "&nbsp;&nbsp;&nbsp;&nbsp;")
+			text2 = text2.replaceAll("\n", '&nbsp;')
+			text2 = text2.replaceAll("\r\n", '&nbsp;')
+			htmlFile2.withWriter("UTF-8") { writer ->
+				writer.write(text2);
+			}
+		} catch(Exception e) {
+			println "Error while preparing HTML of $htmlFile : $e"
+			if (debug) e.printStackTrace()
+		}
+		return htmlFile2.exists() && htmlFile2.length() > 0
+	}
+
+	boolean HTMLtoXHTML(File htmlFile2, File xhtmlFile) {
+		println "*** HTML for tidy -> XHTML"
+		try {
+			Tidy tidy = new Tidy(); // obtain a new Tidy instance
+			tidy.setXHTML(true); // set desired config options using tidy setters
+			tidy.setInputEncoding("UTF-8")
+			tidy.setOutputEncoding("UTF-8")
+			tidy.setShowErrors(100)
+			tidy.setShowWarnings(debug)
+			tidy.setTabsize(10)
+			tidy.setWraplen(9999)
+			tidy.setForceOutput(true) // Tidy won't stop if error are found
+			xhtmlFile.withWriter("UTF-8") { out ->
+				def input = new InputStreamReader(htmlFile2.toURI().toURL().newInputStream(), "UTF-8")
+				tidy.parse(input, out); // run tidy, providing an input and output stream
+			}
+			if (xhtmlFile.exists()) {
+				// JTidy produced a "0x0" char. removing them
+				// fix separated < and / ???
+				def c = Character.toChars(0)[0]
+				String txttmp = xhtmlFile.getText("UTF-8");
+				xhtmlFile.withWriter("UTF-8") { out ->
+					out.write(txttmp.replace("<\n/", "</").replace("<\r\n/", "</"))
+				}
+			}
+		} catch(Exception e) {
+			println "Error while applying JTidy: "+e
+			if (debug) e.printStackTrace()
+		}
+		return xhtmlFile.exists() && xhtmlFile.length() > 0
+	}
+
+	boolean XHTMLtoTRS(File xhtmlFile, File trsFile) {
+		println "*** XHTML -> TRS"
+		try {
+			HTML2TRS ht = new HTML2TRS();
+			ht.process(xhtmlFile, trsFile);
+		} catch(Exception e) {
+			println "Error while creating TRS file: "+e
+			if (debug) e.printStackTrace()
+		}
+		return trsFile.exists() && trsFile.length() > 0
+	}
+
+	boolean TRStoFixedTRS(File trsFile, File finalTrsFile) {
+		println "*** TRS -> FIXED TRS"
+		try {
+			def timingfixer = new FixTransanaTimings(trsFile, finalTrsFile);
+			if (!timingfixer.process()) {
+				println "Error while fixing timing"
+			}
+		} catch(Exception e) {
+			println "Error while fixing TRS file: "+e
+			if (debug) e.printStackTrace()
+		}
+		return finalTrsFile.exists() && finalTrsFile.length() > 0
+	}
+}
+
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/xml/ExecXSLMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/xml/ExecXSLMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/xml/ExecXSLMacro.groovy	(revision 728)
@@ -0,0 +1,68 @@
+package org.txm.macro.xml;
+// STANDARD DECLARATIONS
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.importer.ApplyXsl2;
+
+// BEGINNING OF PARAMETERS
+@Field @Option(name="XSLFile", usage="an example file", widget="File", required=true, def="file.xsl")
+def XSLFile = new File(System.getProperty("user.home"),"TXM/xsl/identity.xsl")
+
+@Field @Option(name="intputDirectory", usage="an example folder", widget="Folder", required=true, def="in")
+def intputDirectory = new File(System.getProperty("user.home"),"xml/TESTS2/xml")
+
+@Field @Option(name="outputDirectory", usage="an example folder", widget="Folder", required=true, def="out")
+def outputDirectory = new File("/tmp/xsltest")
+
+//@Field @Option(name="parameters", usage="an example folder", widget="Text", required=false, def="")
+def parameters = ""
+
+@Field @Option(name="debug", usage="Show debug messages, value = true|false", widget="String", required=true, def="false")
+def debug
+
+if (!ParametersDialog.open(this)) return;
+// END OF PARAMETERS
+
+debug = "true" == debug
+
+outputDirectory.mkdir()
+
+parameters = parameters.trim()
+if (parameters.length() == 0) {
+	parameters = null
+} else {
+	def split = parameters.split("\n")
+	parameters = []
+	for (def str : split) {
+		def split2 = str.split("=", 2)
+		if (split2.size() == 2) {
+			parameters << split2
+		}
+	}
+}
+
+println "Use XSL $XSLFile with parameters $parameters"
+println "Processed directory: $intputDirectory"
+
+def files = [] 
+ApplyXsl2 a = new ApplyXsl2(XSLFile.getAbsolutePath());
+intputDirectory.eachFileMatch(~/.+\.(xml|XML)/) { XMLFile ->
+	String name = XMLFile.getName()
+	try {
+		
+		def outFile = new File(outputDirectory, name)
+		if (parameters != null) {
+			for(def param : parameters) {
+				a.setParam(param[0], param[1])
+			}
+		}
+		a.process(XMLFile, outFile);
+		a.resetParams()
+		files << XMLFile
+	} catch (Exception e) {
+		println "Warning: XSL transformation of '$name' failed with error=$e with "
+		if (debug) e.printStackTrace(); 
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/xml/XMLStatisticsMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/xml/XMLStatisticsMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/xml/XMLStatisticsMacro.groovy	(revision 728)
@@ -0,0 +1,30 @@
+package org.txm.macro.xml
+
+import org.txm.scripts.*
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+@Field @Option(name="inputDirectory", usage="Dossier qui contient les fichiers Ã  parser", widget="Folder", required=true, def="src")
+File inputDirectory;
+
+@Field @Option(name="tsvFile", usage="FichierTSV rÃ©sultat", widget="File", required=true, def="file.tsv")
+File tsvFile;
+
+@Field @Option(name="usePaths", usage="FichierTSV rÃ©sultat", widget="Boolean", required=true, def="false")
+def usePaths = true
+@Field @Option(name="useAttributes", usage="FichierTSV rÃ©sultat", widget="Boolean", required=true, def="false")
+def useAttributes = true
+@Field @Option(name="useAttributeValues", usage="FichierTSV rÃ©sultat", widget="Boolean", required=true, def="false")
+def useAttributeValues = true
+
+if (!ParametersDialog.open(this)) return;
+
+tsvFile = tsvFile.getAbsoluteFile()
+println "Input directory: "+inputDirectory
+println "TSV file: "+tsvFile
+println "use paths $usePaths"
+println "use attributes $useAttributes"
+println "use attributes values $useAttributeValues"
+
+XMLStatistics.processDirectory(inputDirectory, tsvFile, ".xml", usePaths, useAttributes, useAttributeValues);
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/xml/GetXPathMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/xml/GetXPathMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/xml/GetXPathMacro.groovy	(revision 728)
@@ -0,0 +1,396 @@
+// Copyright Â© 2016 ENS de Lyon, CNRS, University of Franche-ComtÃ©
+// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
+// @author sheiden
+// $LastChangedDate: 2013-05-02 11:28:42 +0200 (jeu., 02 mai 2013) $
+// $LastChangedRevision: 2378 $
+// $LastChangedBy: sheiden $
+
+// lists all the XML elements matching a given XPath:
+// XPath is given by the XPath parameter
+// elements are searched in a file (srcFile parameter) or in the files of a directory (srcDirectory).
+// files in the directory can be filtered (filterByFileExtension parameter) by a specific file extension (fileExtension parameter)
+// results can be localized in the source files by line and column number (lineNumber parameter)
+// results can be wrapped to 100 characters max per line (wrapLines parameter)
+
+package org.txm.macro.xml
+
+// STANDARD DECLARATIONS
+
+import javax.xml.bind.helpers.DefaultValidationEventHandler
+import javax.xml.xpath.XPathConstants
+import javax.xml.namespace.NamespaceContext
+import javax.xml.XMLConstants
+
+import net.sf.saxon.dom.DocumentBuilderFactoryImpl
+import net.sf.saxon.xpath.XPathFactoryImpl
+import net.sf.saxon.s9api.Processor
+import net.sf.saxon.s9api.Serializer
+import net.sf.saxon.s9api.XdmNode
+
+import org.kohsuke.args4j.Option
+import groovy.transform.Field
+
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.importer.XPathResult
+
+import org.apache.commons.lang3.text.*
+
+// BEGINNING OF PARAMETERS
+
+// Declare each parameter here
+// (available widget types: Query, File, Folder, String, Text, Boolean, Integer, Float and Date)
+
+@Field @Option(name="srcFile", usage="XML source file", widget="File", required=false, def="")
+def srcFile
+
+@Field @Option(name="srcDirectory", usage="XML source directory", widget="Folder", required=false, def="")
+def srcDirectory
+
+@Field @Option(name="filterByFileExtension", usage="filter by file extension", widget="Boolean", required=false, def="true")
+def filterByFileExtension
+
+@Field @Option(name="fileExtension", usage="file extension to filter (eg .xml)", widget="String", required=false, def=".xml")
+def fileExtension
+
+@Field @Option(name="XPath", usage="XPath expression", widget="String", required=true, def="//tei:title/text()")
+def XPath
+
+@Field @Option(name="lineNumber", usage="print line number", widget="Boolean", required=false, def="true")
+def lineNumber
+
+@Field @Option(name="wrapLines", usage="wrap output lines longer than 100 characters", widget="Boolean", required=false, def="true")
+def wrapLines
+
+//@Field @Option(name="interactive", usage="open parameters dialog box", widget="Boolean", required=true, def="true")
+//def interactive
+
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) {
+	println "** Abandon de la macro."
+	return false
+}
+
+// END OF PARAMETERS
+
+lineNumberLen = 0
+columnNumberLen = 0
+
+def newDocBuilder = { ->
+
+		DocumentBuilderFactoryImpl factory = new DocumentBuilderFactoryImpl()
+		factory.setNamespaceAware(true)
+		return factory.newDocumentBuilder()
+		
+		/*
+		use catalog
+		use local DTD
+		use entity resolver
+		
+		import org.apache.xml.resolver.tools.CatalogResolver;
+import java.util.Properties;
+import java.io.*;
+import javax.xml.transform.*;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+tFactory = TransformerFactory.newInstance()
+resolver = new CatalogResolver()
+tFactory.setURIResolver(resolver)
+
+                transformer.setURIResolver(resolver);
+                transformer.transform(new StreamSource(xmlFile), new 
+StreamResult(new FileOutputStream(outFile)));
+
+To set an EntityResolver from a Java application, you need to create a
+SAXSource rather than a stream source, to instantiate your own XMLReader
+(the SAX parser), set the EntityResolver on the XMLReader, and then do
+saxSource.setXMLReader().
+
+
+catalog.xml
+
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+  <public publicId="-//W3C//DTD HTML 4.01 Transitional//EN" uri="dummy.dtd"/>
+  <system systemId="http://www.w3.org/TR/html4/loose.dtd" uri="dummy.dtd"/>
+</catalog>
+
+dummy.dtd
+<!ELEMENT html ANY>srcFile
+		
+		
+		*/
+}
+
+def newDoc = { builder, file ->
+
+		return builder.parse(file)
+}
+
+def newXpath = { config ->
+
+		def xfactory = new XPathFactoryImpl()
+		xfactory.setConfiguration(config)
+		def xpath = xfactory.newXPath()
+		
+		xpath.setNamespaceContext(new NamespaceContext() {
+			String TEINS = "http://www.tei-c.org/ns/1.0"
+			String MENS = "http://www.menota.org/ns/1.0"
+			String BFMNS = "http://bfm.ens-lsh.fr/ns/1.0"
+			String TXMNS = "http://textometrie.org/1.0"
+			String XINS = "http://www.w3.org/2001/XInclude"
+			String XHTMLNS = "http://www.w3.org/1999/xhtml"
+			String FNNS = "http://www.w3.org/2005/xpath-functions"
+
+			String TEINSNAME = "tei"
+			String MENSNAME = "me"
+			String BFMNSNAME = "bfm"
+			String TXMNSNAME = "txm"
+			String XINSNAME = "xi"
+			String XHTMLNSNAME = "xhtml"
+			String FNNSNAME = "fn"
+
+			public String getNamespaceURI(String prefix) {
+				if (prefix == null) throw new NullPointerException("Null prefix")
+				else if (TEINSNAME.equals(prefix)) return TEINS
+				else if (MENSNAME.equals(prefix)) return MENS
+				else if (BFMNSNAME.equals(prefix)) return BFMNS
+				else if (TXMNSNAME.equals(prefix)) return TXMNS
+				else if (XINSNAME.equals(prefix)) return XINS
+				else if (XHTMLNSNAME.equals(prefix)) return XHTMLNS
+				else if (FNNSNAME.equals(prefix)) return FNNS
+				else if (XMLConstants.XML_NS_PREFIX.equals(prefix)) return XMLConstants.XML_NS_URI
+				return XMLConstants.NULL_NS_URI
+			}
+
+			public String getPrefix(String uri) {
+				if (uri == null) throw new NullPointerException("Null prefix")
+				else if (TEINS.equals(uri)) return TEINSNAME
+				else if (MENS.equals(uri)) return MENSNAME
+				else if (BFMNS.equals(uri)) return BFMNSNAME
+				else if (TXMNS.equals(uri)) return TXMNSNAME
+				else if (XINS.equals(uri)) return XINSNAME
+				else if (XHTMLNS.equals(uri)) return XHTMLNSNAME
+				else if (FNNS.equals(uri)) return FNNSNAME
+				else if("http://www.w3.org/XML/1998/namespace") return XMLConstants.XML_NS_PREFIX
+				else if (XMLConstants.XML_NS_URI.equals(uri)) return XMLConstants.XML_NS_PREFIX
+				else XMLConstants.NULL_NS_URI
+			}
+	
+			public Iterator getPrefixes(String uri) {throw new UnsupportedOperationException()	}
+		})
+		
+		xpath.setNamespaceContext(new NamespaceContext() {
+			String TEINS = "http://www.tei-c.org/ns/1.0"
+			String MENS = "http://www.menota.org/ns/1.0"
+			String BFMNS = "http://bfm.ens-lsh.fr/ns/1.0"
+			String TXMNS = "http://textometrie.org/1.0"
+			String XINS = "http://www.w3.org/2001/XInclude"
+			String XHTMLNS = "http://www.w3.org/1999/xhtml"
+			String FNNS = "http://www.w3.org/2005/xpath-functions"
+
+			String TEINSNAME = "tei"
+			String MENSNAME = "me"
+			String BFMNSNAME = "bfm"
+			String TXMNSNAME = "txm"
+			String XINSNAME = "xi"
+			String XHTMLNSNAME = "xhtml"
+			String FNNSNAME = "fn"
+
+			public String getNamespaceURI(String prefix) {
+				if (prefix == null) throw new NullPointerException("Null prefix")
+				else if (TEINSNAME.equals(prefix)) return TEINS
+				else if (MENSNAME.equals(prefix)) return MENS
+				else if (BFMNSNAME.equals(prefix)) return BFMNS
+				else if (TXMNSNAME.equals(prefix)) return TXMNS
+				else if (XINSNAME.equals(prefix)) return XINS
+				else if (XHTMLNSNAME.equals(prefix)) return XHTMLNS
+				else if (FNNSNAME.equals(prefix)) return FNNS
+				else if (XMLConstants.XML_NS_PREFIX.equals(prefix)) return XMLConstants.XML_NS_URI
+				return XMLConstants.NULL_NS_URI
+			}
+
+			public String getPrefix(String uri) {
+				if (uri == null) throw new NullPointerException("Null prefix")
+				else if (TEINS.equals(uri)) return TEINSNAME
+				else if (MENS.equals(uri)) return MENSNAME
+				else if (BFMNS.equals(uri)) return BFMNSNAME
+				else if (TXMNS.equals(uri)) return TXMNSNAME
+				else if (XINS.equals(uri)) return XINSNAME
+				else if (XHTMLNS.equals(uri)) return XHTMLNSNAME
+				else if (FNNS.equals(uri)) return FNNSNAME
+				else if("http://www.w3.org/XML/1998/namespace") return XMLConstants.XML_NS_PREFIX
+				else if (XMLConstants.XML_NS_URI.equals(uri)) return XMLConstants.XML_NS_PREFIX
+				else XMLConstants.NULL_NS_URI
+			}
+	
+			public Iterator getPrefixes(String uri) {throw new UnsupportedOperationException()	}
+		})
+		
+	return xpath
+}
+
+def getXPath = { xpath, doc ->
+
+	return xpathProc.evaluate(xpath, doc, XPathConstants.NODESET)
+}
+
+builder = newDocBuilder()
+config = builder.getConfiguration()
+if (lineNumber) {
+	config.setLineNumbering(true)
+}
+xpathProc = newXpath(config)
+
+def serializeNode(node) {
+	processor = new Processor(false)
+	serializer = processor.newSerializer()
+	// Other properties found here: http://www.saxonica.com/html/documentation/javadoc/net/sf/saxon/s9api/Serializer.Property.html
+	serializer.setOutputProperty(Serializer.Property.OMIT_XML_DECLARATION, "yes")
+	serializer.setOutputProperty(Serializer.Property.INDENT, "yes")
+	xdmNode = new XdmNode(node.getUnderlyingNodeInfo())
+	return(serializer.serializeNodeToString(xdmNode))
+}
+
+def printValue(node) {
+
+//	println "beginning of printValue"
+	//println "result type is of type "+node.getClass()
+		switch (node.getNodeType()) {
+
+            		case 1: // element
+            			//println "case 1 : "+node.getClass()
+//            			println "beginning of case 1"
+            			if (lineNumber) {
+            				print sprintf("%${lineNumberLen}d, %${columnNumberLen}d: ", node.getUnderlyingNodeInfo().getLineNumber(), node.getUnderlyingNodeInfo().getColumnNumber())
+            			}
+            			if (wrapLines) {
+            				println WordUtils.wrap(serializeNode(node).replaceAll(/\r\n+/, " ").replaceAll(/\r+/, " ").replaceAll(/\n+/, " ").replaceAll(/ +/, " "), 100)
+            			} else {
+            				println serializeNode(node)
+            			}
+            			break
+
+            		case 2: // attribute
+            			//println "case 2 : "+node.getClass()
+//            			println "beginning of case 2"
+            			if (lineNumber) {
+            				print sprintf("%${lineNumberLen}d, %${columnNumberLen}d: ", node.getUnderlyingNodeInfo().getLineNumber(), node.getUnderlyingNodeInfo().getColumnNumber())
+            			}
+            			if (wrapLines) {
+            				println WordUtils.wrap(serializeNode(node).replaceAll(/\r\n+/, " ").replaceAll(/\r+/, " ").replaceAll(/\n+/, " ").replaceAll(/ +/, " "), 100)
+            			} else {
+            				println serializeNode(node)
+            			}
+                     	break
+
+            		default:
+            			//println "other case : "+node.getClass()
+//            			println "beginning of case 3"
+            			if (lineNumber) {
+            				print sprintf("%${lineNumberLen}d, %${columnNumberLen}d: ", node.getUnderlyingNodeInfo().getLineNumber(), node.getUnderlyingNodeInfo().getColumnNumber())
+            			}
+            			if (wrapLines) {
+            				println WordUtils.wrap(serializeNode(node).replaceAll(/\r\n+/, " ").replaceAll(/\r+/, " ").replaceAll(/\n+/, " ").replaceAll(/ +/, " "), 100)
+            			} else {
+            				println serializeNode(node)
+            			}
+                     	break
+        		}
+//		println "end of printValue"
+}
+
+// from http://stackoverflow.com/questions/453018/number-of-lines-in-a-file-in-java
+def countLines(File file) throws IOException {
+    InputStream is = new BufferedInputStream(new FileInputStream(file));
+    try {
+        byte[] c = new byte[1024];
+        int lineCount = 0;
+        int maxColumn = 0
+        int columnCount = 0;
+        int readChars = 0;
+        boolean endsWithoutNewLine = false;
+        while ((readChars = is.read(c)) != -1) {
+            for (int i = 0; i < readChars; ++i) {
+            	columnCount++
+                if (c[i] == '\n') {
+                    ++lineCount
+                    if (columnCount > maxColumn) { maxColumn = columnCount }
+                    columnCount=0
+                }
+            }
+            endsWithoutNewLine = (c[readChars - 1] != '\n');
+        }
+        if(endsWithoutNewLine) {
+            ++lineCount;
+        }
+        //println "maxColumn = "+maxColumn
+        return [lineCount, maxColumn]
+    } finally {
+        is.close();
+    }
+}
+
+if ((srcDirectory==null || srcDirectory.size() == 0) && (srcFile==null || srcFile.size() == 0)) { println "** GetXPathMacro: at least a source file or a source directory must be specified."; return}
+
+if (srcDirectory!=null && srcDirectory.size() > 0 && srcDirectory.exists()) {
+
+	def files = srcDirectory.listFiles()
+	if (files == null || files.size() == 0) {
+		println "** GetXPathMacro: No files in $srcDirectory"
+		return
+	}
+	files.sort()
+
+	def noFileSearched = true
+	
+	println "GetXPath: input directory = '$srcDirectory', XPath = $XPath"
+
+	for (def xmlFile : files) {
+	
+		String name = xmlFile.getName()
+		
+		if (filterByFileExtension && !name.endsWith(fileExtension)) { continue }
+	
+		println "\n-- $name"
+			
+		noFileSearched = false
+		
+		if (lineNumber) {
+			(maxLine, maxColumn) = countLines(xmlFile)
+			lineNumberLen = Math.log10(maxLine)+1 as int
+			columnNumberLen = Math.log10(maxColumn)+1 as int
+		}
+
+		doc = newDoc(builder, xmlFile)
+		res = getXPath(XPath, doc)
+
+//		println "res = "+res
+
+				if (res.getLength() == 0) {
+			println "No result."
+		} else res.each { printValue(it) }
+	}
+
+	if (noFileSearched) { println "** GetXPath: no file searched." }
+
+} else if (srcFile!=null && srcFile.exists()) {
+			def xmlFile = srcFile
+			String name = xmlFile.getName()
+
+			println "GetXPath: file = '$xmlFile', XPath = $XPath"
+			
+			if (lineNumber) {
+				(maxLine, maxColumn) = countLines(xmlFile)
+				lineNumberLen = Math.log10(maxLine)+1 as int
+				columnNumberLen = Math.log10(maxColumn)+1 as int
+			}
+			
+			doc = newDoc(builder, srcFile)
+			res = getXPath(XPath, doc)
+
+//			println "res = "+res
+			
+			if (res.getLength() == 0) {
+				println "No result."
+			} else res.each { printValue(it) }
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/commands/CrossedPartitionBuilderMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/commands/CrossedPartitionBuilderMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/commands/CrossedPartitionBuilderMacro.groovy	(revision 728)
@@ -0,0 +1,338 @@
+package org.txm.macro.commands
+
+import org.kohsuke.args4j.*
+
+import groovy.transform.Field
+
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.searchengine.cqp.corpus.*
+import org.txm.utils.logger.Log;
+import org.txm.rcpapplication.views.*
+
+//BEGINNING OF PARAMETERS
+def corpus = corpusViewSelection
+if (!(corpus instanceof Corpus)) {
+	println "Error: this macro should be run with a Corpus selected"
+	return
+}
+
+@Field @Option(name="structuralUnit", usage="the structural Unit to use", widget="String", required=true, def="text")
+String structuralUnit = "text"
+
+@Field @Option(name="structuralUnitPropertiesList", usage="the structural Unit properties list separated with commas", widget="String", required=true, def="p1,p2")
+def structuralUnitPropertiesList = "loc, type";
+		
+//@Field @Option(name="expandTarget", usage="Expand structure", widget="String", required=false, def="")
+def expandTarget = "";
+
+//@Field @Option(name="structuralUnitToIgnore", usage="the structural Unit properties list to ignore separated with commas", widget="String", required=false, def="")
+def structuralUnitToIgnore = "";
+
+//@Field @Option(name="partitionName", usage="The partition name to use", widget="String", required=false, def="")
+def partitionName = ""
+
+//@Field @Option(name="partNamePrefix", usage="the part prefix to use", widget="String", required=true, def="")
+def partNamePrefix = ""
+
+@Field @Option(name="debug", usage="If debug, then show only queries", widget="Boolean", required=false, def="false")
+def debug = true;
+
+//Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return;
+
+//END OF PARAMETERS
+
+/**
+ * Create partition with advanced CQL queries and autoname the parts.
+ * Can create partitions by defining a multi-level structural units hierarchy or by defining several properties values for one structural unit.
+ * Can define some structural units to remove from the resulting parts subcorpus.
+ * 
+ */
+
+// TODO: add this variables to the macro parameters
+
+def structuralUnits = []
+def structuralUnitProperties = []
+structuralUnit = structuralUnit.trim()
+structuralUnitPropertiesList = structuralUnitPropertiesList.trim()
+
+// Build lists
+def split = structuralUnit.split(",")
+def split2 = structuralUnitPropertiesList.split(",")
+if (split.size() == 1) {
+	for (String p : split2) {
+		p = p.trim();
+		structuralUnits << structuralUnit
+		structuralUnitProperties << p
+	}
+} else {
+	if (split.size() == split2.size()) {
+		for (int i = 0 ; i < split.size() ; i++) {
+			def su = split[i]
+			def p = split2[i];
+			structuralUnits << su
+			structuralUnitProperties << p
+		}
+	} else {
+		println "Error: structuralUnitList size is different from structuralUnitPropertiesList"
+		println "structuralUnitList=structuralUnitList=$structuralUnit structuralUnitPropertiesList=$structuralUnitPropertiesList"
+		return false
+	}
+}
+
+// check properties existance
+try {
+	boolean ok = true;
+	for (int i = 0 ; i < structuralUnits.size() ; i++) {
+		def suName = structuralUnits[i]
+		def pName = structuralUnitProperties[i]
+		
+		if (corpus.getStructuralUnit(suName) == null) {
+			println "Error: no '$suName' structure in the '$corpus' corpus"
+			ok = false;
+		} else {
+			def su = corpus.getStructuralUnit(suName)
+			for (String p : structuralUnitProperties) {
+				if (su.getProperty(pName) == null) {
+					println "Error: no '$pName' structure property in the '$corpus' corpus"
+					ok = false;
+				}
+			}
+		}
+	}
+	if (!ok) return;
+} catch(Exception e) {
+	println "Error: $e"
+	Log.printStackTrace(e)
+	return
+}
+
+
+
+//Running
+PartitionQueriesGenerator pqg = new PartitionQueriesGenerator();
+try {
+	def partition = pqg.createPartition(corpus, debug,
+			partitionName, partNamePrefix,
+			structuralUnits, structuralUnitProperties,
+			structuralUnitToIgnore, expandTarget);
+
+	if (partition != null)	{
+		monitor.syncExec(new Runnable() {
+					public void run() {
+						CorporaView.refresh();
+						CorporaView.expand(partition.getParent());
+					}
+				});
+	}
+} catch(Exception e) {
+	println "Exception $e"
+	Log.printStackTrace(e);
+	return;
+}
+
+/**
+ * Create a list of queries and part names regarding the structural units, structural units properties, structural units to ignore user defined lists and expand target value specified.
+ * @author s
+ *
+ */
+public class PartitionQueriesGenerator	{
+
+	public boolean DEBUG = false;					// si DEBUG, alors les requÃªtes sont affichÃ©es mais la partition n'est pas crÃ©Ã©e
+
+	public String PARTITION_NAME = "";				// Nom de la partition (optionnel)
+	public def STRUCTURAL_UNITS = [];				// Liste des unitÃ©s structurelles sur lesquelles effectuer la partition, ex: ['text', 'div1']
+	public def STRUCTURAL_UNITS_PROPERTIES = [];	// PropriÃ©tÃ©s des unitÃ©s structurelles sur lesquelles effectuer la partition, ex : ['id', 'name']
+	public def STRUCTURAL_UNITS_TO_IGNORE = [];	// Structure Ã  ignorer, ex. CQL : !speaker (optionnel)
+	public String PART_NAMES_PREFIX = '';			// Prefix pour les noms de partie (optionnel)
+	public String EXPAND_TARGET = null;			// Expand to target, englobe les empans jusqu'Ã  la balise parente spÃ©cifiÃ©e.
+	// NOTE : Le expand entre en conflit avec les sections Ã  ignorer.
+	// Si la target est Ã  un niveau supÃ©rieur aux balises Ã  ignorer, il les remet dans liste de rÃ©sultats CWB et elles ne sont donc pas ignorÃ©es
+
+	public def queries = [];
+	public def partNames = [];
+
+	/**
+	 * Init the generator and process.
+	 * @param corpusName
+	 */
+	public Partition createPartition(Corpus corpus, boolean debug,
+			String partitionName, String partNamePrefix,
+			def structuralUnits, def structuralUnitProperties,
+			def structuralUnitToIgnore, String expandTarget) 	{
+
+		PARTITION_NAME = partitionName
+		STRUCTURAL_UNITS = structuralUnits
+		STRUCTURAL_UNITS_PROPERTIES = structuralUnitProperties
+		STRUCTURAL_UNITS_TO_IGNORE = structuralUnitToIgnore
+		PART_NAMES_PREFIX = partNamePrefix
+		EXPAND_TARGET = expandTarget
+		DEBUG = debug;
+
+		if (DEBUG) {
+			println "Arguments: "
+			println "PARTITION_NAME = $PARTITION_NAME"
+			println "STRUCTURAL_UNITS = $STRUCTURAL_UNITS"
+			println "STRUCTURAL_UNITS_PROPERTIES = $STRUCTURAL_UNITS_PROPERTIES"
+			println "STRUCTURAL_UNITS_TO_IGNORE = $STRUCTURAL_UNITS_TO_IGNORE"
+			println "PART_NAMES_PREFIX = $PART_NAMES_PREFIX"
+			println "EXPAND_TARGET = $EXPAND_TARGET"
+			println "DEBUG = $DEBUG"
+		}
+
+		if (STRUCTURAL_UNITS.size() > 0 && STRUCTURAL_UNITS.size() == STRUCTURAL_UNITS_PROPERTIES.size())	{
+
+			if (DEBUG) println 'Creating the queries on corpus "' + corpus + "'" ;
+			if (DEBUG) println 'PARTITION_NAME: ' + PARTITION_NAME;
+
+			//Corpus corpus = CorpusManager.getCorpusManager().getCorpus(corpusName);
+
+			// Recursing through the corpus and subcorpus
+			process(corpus, 0, '', '');
+
+			// Displaying the queries
+			if (DEBUG) {
+				println "Queries processed: "
+				for (int i = 0 ; i < queries.size() ; i++) {
+					println partNames[i] + " = " + queries[i]
+				}
+			}
+
+			// Finalizing the queries
+			finalizeQueries();
+
+			// Displaying the queries
+			if (DEBUG) {
+				println "Queries finalized: "
+				for (int i = 0 ; i < queries.size() ; i++) {
+					println partNames[i] + " = " + queries[i]
+				}
+			}
+
+			if (DEBUG) println 'Queries created.';
+
+			// Creating the partition
+			if (!DEBUG  && queries.size() == partNames.size()) {
+				return corpus.createPartition(PARTITION_NAME, queries, partNames);
+			}
+		} else {
+			println "Error: Structural units count or structural units properties count error.";
+			return null
+		}
+	}
+
+	/**
+	 * Recurse through structural units and structural units properties of corpus and create the queries and the part names. 
+	 * @param corpus the corpus or subcorpus
+	 * @param index the index for recursion
+	 * @param tmpQuery the temporary query for creating subcorpus part
+	 * @param tmpPartName the temporary part name of the subcorpus part
+	 */
+	protected void process(Corpus corpus, int index, String tmpQuery, String tmpPartName)	{
+		// End of array
+		if (index >= STRUCTURAL_UNITS.size()) {
+
+			queries.add(tmpQuery);
+			partNames.add(PART_NAMES_PREFIX + tmpPartName);
+
+			return;
+		}
+
+		StructuralUnit su = corpus.getStructuralUnit(STRUCTURAL_UNITS[index]);
+		StructuralUnitProperty sup = su.getProperty(STRUCTURAL_UNITS_PROPERTIES[index]);
+
+		if (DEBUG) {
+			if (index == 0)	{
+				println 'Pocessing Structural Unit Property "' + sup.getFullName() + '" on mother corpus "' + corpus.getName() + '"';
+			} else {
+				println 'Pocessing Structural Unit Property "' + sup.getFullName() + '" on subcorpus part "' + tmpPartName + '"';
+			}
+		}
+
+
+		// Creating the queries parts for each structural units properties values
+		// for (supValue in sup.getOrderedValues()) { // TODO : signaler bug Matthieu, on ne devrait pas Ãªtre obligÃ© de repasser le sous-corpus Ã  la mÃ©thode car sup a dÃ©jÃ  Ã©tÃ© crÃ©Ã©e depuis le sous-corpus ? getValues() bugge aussi
+		for (supValue in sup.getOrderedValues(corpus)) {
+
+			// TODO : Log
+			if (DEBUG) println 'Value "' + supValue + '"';
+
+			// Getting the subcorpus linked to the structural unit property value
+			Subcorpus tmpSubcorpus = corpus.createSubcorpusWithQueryString(su, sup, supValue, "tmp" + UUID.randomUUID());
+
+			// Partition conditions and part name separators
+			String and = '';
+			String underscore = '';
+			if (tmpQuery != '')	{
+				underscore = ' âˆ© ';
+				and = ' & ';
+			}
+
+			process(tmpSubcorpus, index + 1, (tmpQuery + and + '_.' + sup.getFullName() + '="' + supValue + '"'), tmpPartName + underscore + supValue);
+
+			// Deleting the temporary subcorpus
+			// TODO : bug : cette mÃ©thode ne supprime pas le corpus sans doute car il faut que le sous-corpus ne contienne pas d'autres sous-corpus ? le delete() en revanche fonctionne.
+			//			corpus.dropSubcorpus(tmpSubcorpus);
+			tmpSubcorpus.delete();
+		}
+	}
+
+
+	/**
+	 * 	Autoname the partition.
+	 * @param partitionName
+	 */
+	protected void autoNamePartition(String partitionName) {
+
+		// Structural units names and properties
+		for (int i = 0; i < STRUCTURAL_UNITS.size(); i++) {
+			partitionName +=  STRUCTURAL_UNITS[i] + '_' + STRUCTURAL_UNITS_PROPERTIES[i] + ' x ';
+		}
+
+		// Structural units to ignore
+		for (int i = 0; i < STRUCTURAL_UNITS_TO_IGNORE.size(); i++) {
+			partitionName +=  'NOT_' + STRUCTURAL_UNITS_TO_IGNORE[i] + '.';
+		}
+
+		// Removing last 'x' in partition name
+		PARTITION_NAME = partitionName.substring(0, partitionName.length() - 3);
+	}
+
+	/**
+	 * Finalize the queries.
+	 */
+	protected void finalizeQueries() {
+
+		String expandTo = '';
+		// Expanding to user defined target
+		if (EXPAND_TARGET != null && EXPAND_TARGET.length() > 0) {
+			expandTo = ' expand to ' + EXPAND_TARGET;
+		}
+		// Expanding to last child structural unit in user defined hierarchy
+		else if(STRUCTURAL_UNITS_TO_IGNORE.size() == 0)	 {
+			expandTo = ' expand to ' + STRUCTURAL_UNITS[STRUCTURAL_UNITS.size() - 1];
+		}
+
+		// Autonaming the partition
+		if (PARTITION_NAME != null && PARTITION_NAME.length() == 0) {
+			autoNamePartition(PARTITION_NAME);
+			// Finalizing partition name
+			if (EXPAND_TARGET != null && EXPAND_TARGET.length() > 0)
+				PARTITION_NAME += expandTo.replace(' expand to', '.EXPAND TO').replace(' ', '_');
+		}
+
+		// Finalizing queries
+		for (int j = 0; j < queries.size(); j++) {
+
+			String queryEnd = '';
+
+			// Removing some sections
+			for (sectionToIgnore in STRUCTURAL_UNITS_TO_IGNORE) {
+				queryEnd += ' & !' + sectionToIgnore;
+			}
+
+			queryEnd += ']' + expandTo;
+			queries.set(j, '[' +  queries.get(j) + queryEnd);
+		}
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/r/ExecRMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/r/ExecRMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/r/ExecRMacro.groovy	(revision 728)
@@ -0,0 +1,48 @@
+package org.txm.macro.r;
+// STANDARD DECLARATIONS
+
+import org.kohsuke.args4j.*
+
+import groovy.transform.Field
+
+import org.txm.functions.index.Index;
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.rcpapplication.commands.*
+import org.txm.Toolbox
+import org.txm.searchengine.cqp.corpus.Lexicon
+import org.txm.stat.engine.r.RWorkspace
+
+
+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()
+}
+
+if (symbol == null) {
+	println "Selection is not an Index. Aborting."
+	return
+}
+
+def r = RWorkspace.getRWorkspaceInstance()
+def file = File.createTempFile("IndexHist", ".svg", new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "results"))
+
+/// BEGIN SCRIPTS
+def script ="""
+par(las=2)
+barplot($symbol, xlab="$prop", ylab="f")
+"""
+/// END SCRIPTS
+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(), "Distribution") }
+});
Index: tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/r/PlotSpecifMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/r/PlotSpecifMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/macro/org/txm/macro/r/PlotSpecifMacro.groovy	(revision 728)
@@ -0,0 +1,99 @@
+package org.txm.macro.r;
+// Copyright Â© 2013-2016 ENS de Lyon, University of Franche-ComtÃ©.
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.rcpapplication.commands.*
+import org.txm.Toolbox
+import org.txm.stat.engine.r.RWorkspace
+
+/**
+ * 
+ * @authors Matthieu Decorde, Serge Heiden, Achille Falaise.
+ * 
+ * Sample default values from:
+ *  Lafon, P. â€œSur la variabilitÃ© de la frÃ©quence des formes dans un corpus.â€� Mots, no. 1 (1980):
+ *  Robespierre 'peuple' word in D9 part example (see Figure 1), pp 140-141.
+ *  <http://www.persee.fr/web/revues/home/prescript/article/mots_0243-6450_1980_num_1_1_1008>.
+ *  
+**/
+
+@Field @Option(name="f", usage="La frÃ©quence de la forme dans la partie", widget="Integer", required=true, def="11")
+def f;
+
+@Field @Option(name="F", usage="La frÃ©quence totale de la forme dans le corpus", widget="Integer", required=true, def="296")
+def F;
+
+@Field @Option(name="t", usage="Le nombre d'occurrences de la partie", widget="Integer", required=true, def="1084")
+def t;
+
+@Field @Option(name="T", usage="Le nombre total d'occurrences du corpus", widget="Integer", required=true, def="61449")
+def T;
+
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return;
+
+// END OF PARAMETERS
+
+def r = RWorkspace.getRWorkspaceInstance()
+def file = File.createTempFile("txm", ".svg", new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "results"))
+
+/// BEGIN SCRIPTS
+def script ="""
+library(textometry)
+res <- specificities.distribution.plot($f, $F, $t, $T)
+"""
+/// END SCRIPTS
+r.plot(file, script)
+
+def px = r.eval('res$px').asDouble()
+def mode = r.eval('res$mode').asInteger()
+def pfsum = r.eval('res$pfsum'+"[$f+1]").asDouble()
+def isPositiveSpecificity = (f > mode.abs())  // True if S+
+def proba = pfsum.abs()  // Compute actual probability (should be a positive number, even for negative specificities, where pfsum = -probability)
+def specifSign = (isPositiveSpecificity ? "+" : "-")
+def specif = Math.log10(proba).abs()  // Compute actual specificity
+def operatorForDisplay = isPositiveSpecificity ? '>=' : '<='
+
+println """
+P(f'=f) et P(f' $operatorForDisplay f)
+f	F	t	T
+$f	$F	$t $T
+P(f' = $f) = $px
+mode = $mode
+P(f' $operatorForDisplay $f) = $proba
+Specificity S$specifSign = $specif
+"""
+println "Result saved in: "+file.getAbsolutePath()
+
+//display the graphic
+monitor.syncExec(new Runnable() {
+	@Override
+	public void run() {	OpenSVGGraph.OpenSVGFile(file.getAbsolutePath(), "Specificity distribution") }
+});
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/R/HelloWorld.R
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/R/HelloWorld.R	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/R/HelloWorld.R	(revision 728)
@@ -0,0 +1 @@
+print("Hello World!")
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/R/TXTCSV2Alceste.R
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/R/TXTCSV2Alceste.R	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/R/TXTCSV2Alceste.R	(revision 728)
@@ -0,0 +1,18 @@
+# Script R Ã©crit par Lise Vaudor (UMR 5600 EVS) en mars 2012
+
+setwd(choose.dir())  # choix du rÃ©pertoire de travail
+metadata=read.table("metadata.csv",sep=",",header=T)
+write.table("texte_tot.txt")
+
+for (i in 1:nrow(metadata)){   # on parcourt un Ã  un les lignes du fichier de mÃ©tadonnÃ©es
+   namefile=paste(metadata$id[i],".txt",sep="") # on considÃ¨re le fichier dont le nom est donnÃ©e Ã  la iÃ¨me ligne
+   descripteur_i=c("****")
+   for (j in 1:ncol(metadata)){
+         descripteur_i=paste(descripteur_i," *",colnames(metadata)[j],"_",metadata[i,j],sep="")  # on parcourt l'ensemble des colonnes de metadata pour crÃ©er le descripteur
+   }
+   cat(descripteur_i, file="texte_tot.txt",append=T)  # on concatÃ¨ne au fichier texte_tot le decripteur...
+   cat("\n", file="texte_tot.txt",append=T)                # des sauts de ligne...
+   cat(scan(namefile, what="character"), file="texte_tot.txt",append=T) # le texte qui nous intÃ©resse...
+   cat("\n", file="texte_tot.txt",append=T)                # re-des sauts de ligne
+   cat("\n", file="texte_tot.txt",append=T)
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/R/plot100.R
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/R/plot100.R	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/R/plot100.R	(revision 728)
@@ -0,0 +1,3 @@
+x <- rnorm(100)
+y <- rnorm(100)
+plot(x, y)
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/R/sample.R
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/R/sample.R	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/R/sample.R	(revision 728)
@@ -0,0 +1,2 @@
+x <- rnorm(100)
+show(x)
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Diversity.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Diversity.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Diversity.groovy	(revision 728)
@@ -0,0 +1,60 @@
+package org.txm.functions.mesures;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+
+import org.txm.Toolbox;
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.Property;
+import org.txm.searchengine.cqp.corpus.QueryResult;
+import org.txm.searchengine.cqp.corpus.query.Query;
+import org.txm.searchengine.cqp.serverException.CqiServerError;
+
+public class Diversity extends Mesure {
+
+	private static final long serialVersionUID = -375293299211271669L;
+	
+	public static List<Synthese> SUPORTED = Arrays.asList(Synthese.SUM);
+	private String query;
+	private String property;
+
+	public Diversity(String domaine, String query, String property) {
+		this.domaine = domaine;
+		this.query = query;
+		this.property = property;
+	}
+
+	@Override
+	public boolean compute(ArrayList<Corpus> corpora) {
+		this.corpora = corpora;
+		Integer[] rez = new Integer[corpora.size()];
+		for (int icorpus = 0 ; icorpus < corpora.size() ; icorpus++) {
+			try {
+				Corpus corpus = corpora.get(icorpus);
+				rez[icorpus] = computeForCorpus(corpus);
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+				return false;
+			}	
+		}
+		this.add(new MesureResult(this, rez, "Diversite: "+query+" "+property));
+		return true;
+	}
+	
+	private Integer computeForCorpus(Corpus corpus) throws CqiClientException, IOException, CqiServerError {
+		if (domaine != null) corpus = corpus.createSubcorpus(new Query(domaine), "DOMAINE");
+		
+		Property p = corpus.getProperty(property);
+		QueryResult result = corpus.query(new Query(query), "TMP", false);
+		int[] starts = result.getStarts();
+		int[] ids = Toolbox.getCqiClient().cpos2Id(p.getQualifiedName(), starts);
+		HashSet<Integer> set = new HashSet<Integer>();
+		for (int i : ids) set.add(i); // no double
+		return set.size();
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Synthese.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Synthese.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Synthese.groovy	(revision 728)
@@ -0,0 +1,17 @@
+package org.txm.functions.mesures;
+
+public enum Synthese {
+	
+	NONE,
+	COUNTMATCHES,
+	SUM,
+	MEAN,
+	MIN,
+	QUARTILE1,
+	MEDIAN,
+	QUARTILE3,
+	MAX,
+	FIRST,
+	LAST,
+	MIDDLE,
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Mesures.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Mesures.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Mesures.groovy	(revision 728)
@@ -0,0 +1,171 @@
+package org.txm.functions.mesures;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.Partition;
+
+/**
+ * Container of mesures
+ * 
+ * @author mdecorde
+ *
+ */
+public class Mesures extends ArrayList<Mesure>{
+
+	private static final long serialVersionUID = 324346022230541761L;
+
+	ArrayList<Corpus> data = new ArrayList<Corpus>();
+
+	public Mesures(Corpus corpus) {
+		data = new ArrayList<Corpus>();
+		data.add(corpus);
+	}
+
+	public Mesures(ArrayList<Corpus> corpora) {
+		data = corpora;
+		println "hello TXM"
+	}
+
+	public Mesures(Partition partition) {
+		data.addAll(partition.getParts());
+	}
+
+	public boolean add(Mesure mesure) {
+		if (!mesure.compute(data)) {
+			return false;
+		}
+
+		return super.add(mesure);
+	}
+
+	public boolean export(Writer writer, String encoding, String colseparator, String txtseparator) throws IOException {
+		String line = "Mesures";
+		for (Corpus c : data) {
+			line += colseparator+txtseparator+c.getName().replaceAll(txtseparator,txtseparator+txtseparator)+txtseparator;
+		}
+		writer.write(line+"\n");
+
+		for (Mesure m : this) {
+			for (MesureResult r : m) {
+				line = r.name;
+				for (int i = 0 ; i < r.data.length ; i++)
+					line += colseparator+r.data[i];
+				writer.write(line+"\n");
+			}
+		}
+
+		return true;
+	}
+
+	public boolean export(File outfile, String encoding, String colseparator, String txtseparator) throws IOException {
+		Writer writer = new OutputStreamWriter(
+				new FileOutputStream(outfile), encoding); //$NON-NLS-1$
+		boolean rez = export(writer, encoding, colseparator, txtseparator);
+		writer.close();
+		return rez;
+	}
+
+	DecimalFormat floatFormatter = new DecimalFormat("###,###.##");
+	DecimalFormat intFormatter = new DecimalFormat("###,###,###");
+	public void prettyPrint() {	
+		ArrayList<String[]> lines = new ArrayList<String[]>();
+		int[] maxx = new int[data.size()+1];
+		int[] maxxDecimales = new int[data.size()+1];
+
+
+		String[] line = new String[data.size() + 1];
+		line[0] = "Mesures";
+		maxx[0] = line[0].length();
+		for (int i = 1 ; i <= data.size() ; i++) {
+			line[i] = data.get(i-1).getName();
+			maxx[i] = line[i].length();
+		}
+		lines.add(line);
+
+		// fill lines
+		for (Mesure m : this) {
+			for(MesureResult r : m) {
+				line = new String[data.size()+1];
+				line[0] = r.name;
+				if (maxx[0] < r.name.length())
+					maxx[0] = r.name.length();
+
+				int i = 1;
+				for (Object o : r.data) {
+					String str = ""+o;
+					if (o instanceof Integer) str = intFormatter.format(o);
+					else if (o instanceof Float) str = floatFormatter.format(o);
+
+					line[i] = str;
+
+//					if (maxx[i] < str.length())
+//						maxx[i] = str.length();
+
+					int idxDecimal = str.indexOf(",");
+					if (idxDecimal > 0) {
+						idxDecimal = str.length() - idxDecimal;
+						if (maxxDecimales[i] < idxDecimal)
+							maxxDecimales[i] = idxDecimal;
+					}
+					i++;
+				}
+				lines.add(line);
+			}
+		}
+
+//		System.out.println("maxx: "+Arrays.toString(maxx));
+//		System.out.println("maxxDecimales: "+Arrays.toString(maxxDecimales));
+
+		// fix cells right lengths (decimals)
+		boolean notfirst = false;
+		for (String[] l : lines) {
+			for (int i = 1 ; i < data.size() +1; i++) {
+				String str = l[i];
+				int nbDecimalToAdd = 0;
+
+				if (str.indexOf(",") < 0) {
+					nbDecimalToAdd = maxxDecimales[i];
+				} else {
+					nbDecimalToAdd = maxxDecimales[i] - (str.length() - str.indexOf(","));
+				}
+
+				if (notfirst)
+				for (int j = 0 ; j < nbDecimalToAdd ; j++)
+					str += " ";
+
+				if (maxx[i] < str.length())
+					maxx[i] = str.length();
+				
+				l[i] = str;
+			}
+			notfirst = true;
+		}
+		
+		// fix cells left lengths (alignment)
+		for (String[] l : lines) {
+			for (int i = 0 ; i < data.size() +1; i++) {
+				while (l[i].length() < maxx[i]) {
+					if (i == 0)	l[i] = ""+l[i]+" ";
+					else l[i] = " "+l[i];
+				}
+			}
+		}
+
+		// print cells
+		for (String[] l : lines) {
+			for (int i = 0 ; i < data.size() +1; i++) {
+				if (i == 0) System.out.print(l[i]);
+				else  System.out.print(" "+l[i]);
+			}
+			System.out.println("");
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/SyntheseBuilder.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/SyntheseBuilder.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/SyntheseBuilder.groovy	(revision 728)
@@ -0,0 +1,157 @@
+package org.txm.functions.mesures;
+
+import java.util.Arrays;
+
+import org.apache.tools.ant.types.resources.selectors.InstanceOf;
+
+public class SyntheseBuilder {
+	private Integer[] isrc;
+	private Integer[] isorted;
+	private Float[] fsrc;
+	private Float[] fsorted;
+
+	public SyntheseBuilder(Integer[] rez) {
+		assert(rez.length > 0);
+		isrc = rez;
+		isorted = new Integer[rez.length];
+		System.arraycopy(rez, 0, isorted, 0, rez.length);
+		Arrays.sort(isorted);
+	}
+
+	public SyntheseBuilder(Float[] rez) {
+		assert(rez.length > 0);
+		fsrc = rez;
+		fsorted = new Float[rez.length];
+		System.arraycopy(rez, 0, fsorted, 0, rez.length);
+		Arrays.sort(fsorted);
+	}
+
+	public Number doSynthese(Synthese synt) {
+		if (isorted != null) {
+			return doSynthese(synt, isrc);
+		} else {
+			return doSynthese(synt, fsrc);
+		}
+	}
+
+	private Integer[] getSorted(Integer[] rez) {
+		return isorted;
+	}
+
+	private Float[] getSorted(Float[] rez) {
+		return fsorted;
+	}
+
+	private Number[] getSorted(Number[] rez) {
+		if (isorted != null) return isorted;
+		return fsorted;
+	}
+
+	public Number doSynthese(Synthese synt, Number[] rez) {
+		if (rez instanceof Integer[])
+			return doISynthese(synt, rez);
+		else if  (rez instanceof Float[])
+			return doFSynthese(synt, rez);
+
+		println "Error: doSynthese unsuported array type: "+rez.getClass();
+		return -1;
+	}
+
+	public Number doISynthese(Synthese synt, Integer[] rez) {
+		switch (synt) {
+			case Synthese.MIN: return min(rez);
+			case Synthese.MAX: return max(rez);
+			case Synthese.MEAN: return mean(rez);
+			case Synthese.QUARTILE1: return quartile1(rez);
+			case Synthese.MEDIAN: return median(rez);
+			case Synthese.QUARTILE3: return quartile3(rez);
+			case Synthese.SUM: return sum(rez);
+			case Synthese.COUNTMATCHES: return rez.length;
+			case Synthese.FIRST:
+				if (rez.length > 0) return rez[0];
+				else return -1;
+			case Synthese.LAST:
+				if (rez.length > 0) return rez[(int)rez.length -1];
+				else return -1;
+			case Synthese.MIDDLE:
+				if (rez.length > 0) return rez[(int)rez.length/2];
+				else return -1;
+		}
+		return null;
+	}
+
+	public Number doFSynthese(Synthese synt, Float[] rez) {
+		switch (synt) {
+			case Synthese.MIN: return min(rez);
+			case Synthese.MAX: return max(rez);
+			case Synthese.MEAN: return mean(rez);
+			case Synthese.QUARTILE1: return quartile1(rez);
+			case Synthese.MEDIAN: return median(rez);
+			case Synthese.QUARTILE3: return quartile3(rez);
+			case Synthese.SUM: return sum(rez);
+			case Synthese.COUNTMATCHES: return rez.length;
+			case Synthese.FIRST:
+				if (rez.length > 0) return rez[0];
+				else return -1;
+			case Synthese.LAST:
+				if (rez.length > 0) return rez[(int)rez.length -1];
+				else return -1;
+			case Synthese.MIDDLE:
+				if (rez.length > 0) return rez[(int)rez.length/2];
+				else return -1;
+		}
+		return null;
+	}
+
+	public Number min(Number[] obj) {
+		obj = getSorted(obj);
+		return obj[0];
+	}
+
+	public Number max(Number[] obj) {
+		obj = getSorted(obj);
+		return obj[obj.length - 1];
+	}
+
+	public Number sum(Float[] obj) {
+		Float sum = 0.0f;
+		for (int i = 0 ; i < obj.length ; i++)
+			sum += obj[i];
+		return sum;
+	}
+
+	public Number sum(Integer[] obj) {
+		Integer sum = 0;
+		for (int i = 0 ; i < obj.length ; i++)
+			sum += obj[i];
+		return sum;
+	}
+
+	public Number mean(Integer[] obj) {
+		Integer i = (Integer) sum(obj);
+		return (float) i / (float)obj.length;
+	}
+
+	public Number mean(Float[] obj) {
+		Float f = (Float) sum(obj);
+		return (float) f / obj.length;
+	}
+
+	public Number quartile1(Number[] obj) {
+		obj = getSorted(obj);
+		int len = obj.length;
+		return obj[(int)len/4];
+	}
+
+	public Number quartile3(Number[] obj) {
+		obj = getSorted(obj);
+		int len = obj.length;
+		return obj[(int)len/4 + len/2];
+	}
+
+	public Number median(Number[] obj) {
+		obj = getSorted(obj);
+		int len = obj.length;
+		return obj[(int)len/2];
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Prototype scripts of the "Mesures" functionnality</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Proportion.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Proportion.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Proportion.groovy	(revision 728)
@@ -0,0 +1,200 @@
+package org.txm.functions.mesures;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.QueryResult;
+import org.txm.searchengine.cqp.corpus.query.Match;
+import org.txm.searchengine.cqp.corpus.query.Query;
+
+public class Proportion extends Mesure {
+
+	private static final long serialVersionUID = -3160461437451974147L;
+
+	public static List<Synthese> SUPORTED = Arrays.asList(Synthese.COUNTMATCHES, 
+			Synthese.SUM);
+
+	protected String all;
+	protected List<String> cas;
+
+	public Proportion(String domaine, String unit, def syntheses, String all, List<String> cas) {
+		this.domaine = domaine;
+		this.unit= unit;
+		this.syntheses = syntheses;
+
+		this.all = all;
+		this.cas = cas;
+	}
+
+	@Override
+	public boolean compute(ArrayList<Corpus> arg0) {
+		this.corpora = arg0;
+		//		switch (synthese) {
+		//		case COUNTMATCHES:
+		//			return computeMatches();
+		//		case SUM:
+		//			return computeSum();
+		//		default:
+		//			System.out.println("UNSUPPORTED SYNTHESIS: "+synthese);
+		//			return false;
+		//		}
+		return computeSynthese();
+	}
+
+	HashMap<Synthese, ArrayList<Object[]>> rezsPerSynt = new HashMap<Synthese, ArrayList<Object[]>>();
+	private boolean computeSynthese() {
+
+		// initialize list of results 
+		for (Synthese synt : syntheses) {
+			ArrayList<Object[]> rezs = new ArrayList<Object[]>();
+			for (String c : cas) {
+				rezs.add(new Number[corpora.size()]);
+			}
+			rezsPerSynt.put(synt, rezs);
+		}
+
+		for (int icorpus = 0 ; icorpus < corpora.size() ; icorpus++) {
+			computeForCorpus(icorpus, corpora.get(icorpus)); // one cell per cas
+			//			Object[] r = compute(icorpus, corpora.get(icorpus)); // one cell per cas
+			//			for( int i = 0 ; i < cas.size() ; i++)
+			//				rezs.get(i)[icorpus] = r[i];
+		}
+
+		// register results
+		for (Synthese synt : syntheses) {
+			ArrayList<Object[]> rezs = rezsPerSynt.get(synt);
+			for (int i = 0 ; i < cas.size() ; i++) {
+				Object[] rez = rezs.get(i);
+				this.add(new MesureResult(this, rez, "Proportion synt="+synt+" domaine="+domaine+" cas="+cas.get(i)+" all="+all+")"));
+			}
+		}
+		return true;
+	}
+
+	private Integer[] countMatchesInMatches(List<Match> domaine, List<Match> cas) {
+		//		System.out.println("count dom.size "+domaine.size()+" cas.size "+cas.size());
+		//		System.out.println(domaine);
+		//		System.out.println(cas);
+
+		Integer[] rez = new Integer[domaine.size()];
+		int iCas = 0;
+		int iDom = 0;
+		rez[0] = 0;
+
+		int firsterror = 0;
+		while(iCas < cas.size() & iDom < domaine.size()) {
+			Match mDom = domaine.get(iDom);
+			Match mCas = cas.get(iCas);
+
+			if (mDom.getStart() <= mCas.getStart() & mCas.getEnd() <= mDom.getEnd()) {
+				rez[iDom] = rez[iDom] + 1; 
+				iCas++;
+			} else if ( mCas.getStart() < mDom.getStart()) {
+				iCas++;
+			} else if ( mDom.getEnd() < mCas.getEnd()) {
+				iDom++;
+				rez[iDom] = 0;
+			} else {
+				if (firsterror++ == 0)
+					System.out.println("ERROR MATCH COUNT: dom="+domaine+" cas="+cas);
+				System.out.println("ERROR idom="+iDom+" icas="+iCas);
+			}
+		}
+		//		for(int i = 0 ; i < rez.length ; i++) {
+		//			Match m = domaine.get(i);
+		//			while (currentMatchCas != null) {
+		//				if (m.contains(currentMatchCas)) {
+		//					rez[i] = rez[i]+1;
+		//				} else {
+		//					break; // next domaine match
+		//				}
+		//				// next cas match
+		//				if (iCas == cas.size()) break;
+		//				else currentMatchCas = cas.get(iCas++);
+		//			}
+		//		}
+
+		// complete counts
+		for (int i = 0 ; i < rez.length ; i++)
+			if (rez[i] == null) rez[i] = 0;
+
+		return rez;
+	}
+
+	private void computeForCorpus(int icorpus, Corpus corpus) {
+		HashMap<Synthese, Number> allSyntheses = new HashMap<Synthese, Number>();
+		HashMap<Synthese, Number[]> casSyntheses = new HashMap<Synthese, Number[]>();
+		for (Synthese synt : syntheses) {
+			casSyntheses.put(synt, new Number[cas.size()]);
+		}
+		//Object[] rez = new Object[cas.size()];
+		try {
+			Corpus domaineSub = corpus;
+			if (domaine != null && domaine.length() > 0)
+				domaineSub = corpus.createSubcorpus(new Query(domaine), "domaine");
+			else 
+				domaine = corpus.getName();
+			//System.out.println("domaineSub.name "+ domaineSub.getName());
+			//System.out.println("domaine "+ domaine);
+			List<Match> domaineMatches = domaineSub.getMatches();
+			//System.out.println("domaineMatches.size"+ domaineMatches.size());
+			// first process the all case
+
+			QueryResult allSub = domaineSub.query(new Query(all), "all", false);
+			Integer[] allCounts = countMatchesInMatches(domaineMatches, allSub.getMatches());
+			//System.out.println("allCounts.length "+allCounts.length+" count : "+Arrays.toString(allCounts));
+			builder = new SyntheseBuilder(allCounts);
+			for( Synthese synt : syntheses) {
+				Synthese s = synt;
+				if (s.equals(Synthese.NONE)) s = Synthese.SUM;
+				allSyntheses.put(synt, builder.doSynthese(s));
+			}
+
+			// then process each cas
+			for (int iCas = 0 ; iCas < cas.size() ; iCas++) {
+				String c = cas.get(iCas);
+				QueryResult result = domaineSub.query(new Query(c), "TMP", false);
+				Integer[] counts = countMatchesInMatches(domaineMatches, result.getMatches());
+
+				Float[] rapports = new Float[counts.length];
+				for (int i = 0 ; i < rapports.length ; i++) {
+					if (allCounts[i] == 0) rapports[i] = 0.0f;
+					else rapports[i] = (float)counts[i] / (float)allCounts[i];
+				}
+				
+				for (Synthese synt : syntheses) {
+					
+					if (synt.equals(Synthese.NONE)) {
+						int allTotal = 0;
+						for( int i : allCounts) allTotal += i;
+						int casTotal = 0;
+						for( int i : counts) casTotal += i;
+								
+						ArrayList<Object[]> rez = rezsPerSynt.get(synt);
+						rez.get(iCas)[icorpus] = (float)casTotal / (float)allTotal;
+					} else {
+						
+						builder = new SyntheseBuilder(rapports);
+
+						Synthese s = synt;
+						if (s.equals(Synthese.NONE)) s = Synthese.SUM;
+
+						ArrayList<Object[]> rez = rezsPerSynt.get(synt);
+						rez.get(iCas)[icorpus] = builder.doSynthese(s);
+					}
+				}
+			}
+
+			if (!domaineSub.equals(corpus)) { // cleaning
+				domaineSub.delete();
+			}
+		} catch (CqiClientException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Magnitude.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Magnitude.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Magnitude.groovy	(revision 728)
@@ -0,0 +1,127 @@
+package org.txm.functions.mesures;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.QueryResult;
+import org.txm.searchengine.cqp.corpus.query.Match;
+import org.txm.searchengine.cqp.corpus.query.Query;
+
+/**
+ * 
+ * Magnitude synonymes
+extent	Magnitude, importance, extension, superficie, longueur
+magnitude	Magnitude, grandeur, magnitude
+amplitude	amplitude, Magnitude, largeur
+fullness	plÃ©nitude, Magnitude, abondance
+width	largeur, Magnitude
+fulness	plÃ©nitude, Magnitude, abondance
+richness	richesse, abondance, Magnitude, luxe, fertilitÃ©
+ampleness	Magnitude
+thoroughness	minutie, Magnitude
+roundness	rondeur, circularitÃ©, Magnitude, franchise
+
+ * @author mdecorde
+ *
+ */
+public class Magnitude extends Mesure {
+
+	private static final long serialVersionUID = 3317066047569716511L;
+
+	private static String TMP = "TMP";
+	
+	public Magnitude(String domaine, String unit, Synthese[] syntheses) {
+		this.domaine = domaine;
+		this.unit= unit;
+		this.syntheses = syntheses;
+
+		//if (synthese.equals(Synthese.NONE)) this.synthese = Synthese.SUM; // NO synthese will sum the matches size
+	}
+
+	@Override
+	public boolean compute(ArrayList<Corpus> corpora) {
+		this.corpora = corpora;
+
+		//		switch (synthese) {
+		//		case COUNTMATCHES:
+		//			return computeCounts();
+		//		case MAX:
+		//		case MIN:
+		//		case MEAN:
+		//		case QUARTILE1:
+		//		case QUARTILE3:
+		//		case MEDIAN:
+		//		case NONE:
+		//		case SUM:
+		return computeSynthese();
+		//		default:
+		//			System.out.println("UNSUPPORTED SYNTHESIS: "+synthese);
+		//			return false;
+		//		}
+	}
+
+	//	private boolean computeCounts() {
+	//		Integer[] rez = new Integer[corpora.size()];
+	//		for (int i = 0 ; i < corpora.size() ; i++) {
+	//			Corpus corpus = corpora.get(i);
+	//			try {
+	//				rez[i] = computeCount(corpus);
+	//			} catch (CqiClientException e) {
+	//				e.printStackTrace();
+	//				return false;
+	//			}
+	//		}
+	//		this.add(new MesureResult(this, rez, "Magnitude synt="+synthese+" unit="+unit+" dom="+domaine));
+	//		return true;
+	//	}
+
+	//	private int computeCount(Corpus corpus) throws CqiClientException {
+	//		QueryResult result = corpus.query(new Query(domaine), TMP);
+	//		return result.getNMatch();
+	//	}
+	HashMap<Synthese, Object[]> rezPerSynthese = new HashMap<Synthese, Object[]>();
+	private boolean computeSynthese() {
+
+		for (Synthese synt : syntheses) {
+			rezPerSynthese.put(synt, new Object[corpora.size()]);
+		}
+
+		for (int i = 0 ; i < corpora.size() ; i++) {
+			Corpus corpus = corpora.get(i);
+			try {
+				computeSynthese(i, corpus);
+			} catch (CqiClientException e) {
+				e.printStackTrace();
+				return false;
+			}
+		}
+		for ( Synthese synt : syntheses) {
+			this.add(new MesureResult(this, rezPerSynthese.get(synt), "Magnitude synt="+synt+" unit="+unit+" dom="+domaine));
+		}
+		return true;
+	}
+
+	private void computeSynthese(int icorpus, Corpus corpus) throws CqiClientException {
+        QueryResult result = corpus.query(new Query(domaine), TMP, false);		
+		List<Match> matches = result.getMatches();
+		Integer[] sizes = new Integer[matches.size()];
+		for (int i = 0 ; i < matches.size() ; i++) {
+			Match m  = matches.get(i);
+			sizes[i] = m.getEnd() - m.getStart() + 1;
+		}
+		
+		builder = new SyntheseBuilder(sizes);
+		for (Synthese synt : syntheses) {
+			Object[] rez = rezPerSynthese.get(synt);
+			if (synt.equals(Synthese.NONE)) {
+				rez[icorpus] = builder.doSynthese(Synthese.SUM);
+			} else {
+				rez[icorpus] = builder.doSynthese(synt);
+			}
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/MesureResult.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/MesureResult.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/MesureResult.groovy	(revision 728)
@@ -0,0 +1,13 @@
+package org.txm.functions.mesures;
+
+public class MesureResult {
+	public Mesure from;
+	public Object[] data;
+	public String name;
+	
+	public MesureResult(Mesure from, Object[] data, String name) {
+		this.from = from;
+		this.data = data;
+		this.name = name;
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Mesure.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Mesure.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/Mesure.groovy	(revision 728)
@@ -0,0 +1,19 @@
+package org.txm.functions.mesures;
+
+import java.util.ArrayList;
+
+import org.txm.searchengine.cqp.corpus.Corpus;
+
+public abstract class Mesure extends ArrayList<MesureResult> {
+	
+	private static final long serialVersionUID = 4804073482551008502L;
+	
+	protected String domaine;
+	protected String unit;
+	protected Synthese[] syntheses;
+	protected SyntheseBuilder builder;
+
+	protected ArrayList<Corpus> corpora;
+	
+	public abstract boolean compute(ArrayList<Corpus> subcorpora);
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/PresenceRate.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/PresenceRate.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/functions/mesures/PresenceRate.groovy	(revision 728)
@@ -0,0 +1,10 @@
+package org.txm.functions.mesures;
+import java.util.Arrays;
+
+public class PresenceRate extends Proportion {
+	public PresenceRate(String unit, def syntheses, String all, String cas) {
+		super(all, unit, syntheses, all, Arrays.asList(cas));
+//remplace momentanÃ©ment la ligne suivante, pour pouvoir tourner sur une liste de corpus
+//		super(null, unit, syntheses, all, Arrays.asList(cas));
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/SplitFileRegExp.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/SplitFileRegExp.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/SplitFileRegExp.groovy	(revision 728)
@@ -0,0 +1,58 @@
+package org.txm.sw
+
+// PARAMETERS //
+
+infile = new File("/home/mdecorde/xml/test/grep")			// the file to process
+outdir = new File("/home/mdecorde/xml/test/result")			// the directory which received result files
+regex = /(<\?(.+))/           						// matching line test
+prefix = "prefix"							// result files prefix
+replace = '$2'								// use the matching line to build the filename
+ext = ".xml"                                     			// result files extension
+includeSeparatorLine = true						// should include matching line in result files
+writeAtStartup = false							// should create files only if a matching line is found
+encoding = "UTF-8"
+// CALL //
+splitByRegExp(infile, outdir, 
+//	regex, prefix, replace, ext,
+	regex, prefix, null, ext, 
+	includeSeparatorLine, writeAtStartup)
+
+
+// PUBLIC METHODS //
+def splitByRegExp(def infile, def outdir, def regex, def prefix, def replace, def ext, def includeSeparatorLine, def writeAtStartup) {
+	int count = 1;
+	outdir.deleteDir()
+	outdir.mkdirs()
+	if (!outdir.exists()) return false
+	if (!infile.isFile()) return false
+
+	File outfile = null;
+	def writer = null
+
+	if (writeAtStartup) {
+		if (replace == null) {
+			outfile = new File(outdir, prefix+(count++)+ext)
+		}
+		writer = outfile.newWriter(encoding)
+	}
+	infile.eachLine(encoding) { line ->
+		if (line ==~ regex) { // new file
+			if (replace == null) {
+				outfile = new File(outdir, prefix+(count++)+ext)
+			} else {
+				String name = prefix+line.replaceAll(regex, replace)+ext
+				outfile = new File(outdir, name)
+			}
+			if (writer != null)	writer.close() // close previous writer
+			writer = outfile.newWriter(encoding)
+			println "new file $outfile"
+			if (includeSeparatorLine) {
+				writer.println line
+			}
+		} else {
+			if (writer != null)
+				writer.println line
+		}
+	}
+	if (writer != null)	writer.close()
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/RemoveTag.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/RemoveTag.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/RemoveTag.groovy	(revision 728)
@@ -0,0 +1,109 @@
+package org.txm.sw
+
+import java.io.File;
+
+import org.txm.importer.DomUtils;
+import org.w3c.dom.Element;
+import java.io.File;
+
+import org.w3c.dom.Document;
+
+import javax.xml.parsers.*;
+import javax.xml.xpath.*;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import org.txm.importer.graal.PersonalNamespaceContext;
+
+class RemoveTag {
+
+	public static boolean xpath(File xmlfile, String xpath)
+	{
+		if (!xmlfile.exists()) {
+			println "Error: $xmlfile does not exists"
+		}
+
+		if (!(xmlfile.canRead() && xmlfile.canWrite())) {
+			println "Error: $xmlfile is not readable or writable"
+		}
+
+		DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+		domFactory.setNamespaceAware(true); // never forget this!
+		domFactory.setXIncludeAware(true);
+		DocumentBuilder builder = domFactory.newDocumentBuilder();
+		Document doc = builder.parse(xmlfile);
+
+		XPathFactory xpathfactory = XPathFactory.newInstance();
+		def _xpath = xpathfactory.newXPath();
+		_xpath.setNamespaceContext(new PersonalNamespaceContext());
+		def expr = _xpath.compile(xpath);
+		def nodes = expr.evaluate(doc, XPathConstants.NODESET);
+
+		for(Element node : nodes) {
+			def parent = node.getParentNode();
+			if (parent != null)
+				parent.removeChild(node)
+		}
+		return DomUtils.save(doc, xmlfile)
+	}
+
+	public static boolean xpath(File xmlfile, def xpaths)
+	{
+		if (!xmlfile.exists()) {
+			println "Error: $xmlfile does not exists"
+		}
+
+		if (!(xmlfile.canRead() && xmlfile.canWrite())) {
+			println "Error: $xmlfile is not readable or writable"
+		}
+
+		DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+		domFactory.setNamespaceAware(true); // never forget this!
+		domFactory.setXIncludeAware(true);
+		DocumentBuilder builder = domFactory.newDocumentBuilder();
+		Document doc = builder.parse(xmlfile);
+		XPathFactory xpathfactory = XPathFactory.newInstance();
+
+		for (String xpath : xpaths) {
+			def _xpath = xpathfactory.newXPath();
+			_xpath.setNamespaceContext(new PersonalNamespaceContext());
+			def expr = _xpath.compile(xpath);
+			def nodes = expr.evaluate(doc, XPathConstants.NODESET);
+
+			for (Element node : nodes) {
+				def parent = node.getParentNode();
+				if (parent != null)
+					parent.removeChild(node)
+			}
+		}
+		return DomUtils.save(doc, xmlfile)
+
+	}
+	public static void main(String[] args) {
+		File dir = new File("/home/mdecorde/Bureau/matrice/tÃ©moignages")
+		File infile = new File(dir, "tei2.xml")
+		File outfile = new File(dir, "tei2-out.xml")
+
+		def doc = DomUtils.load(infile);
+		def addList = doc.getDocumentElement().getElementsByTagName("add")
+		println "nb <add> to delete: "+addList.getLength()
+		for(int i = 0 ; i < addList.getLength() ; i++) {
+			Element node = addList.item(i);
+			String text = node.getTextContent().trim();
+			Element parent = node.getParentNode();
+			parent.insertBefore(doc.createTextNode(text), node)
+			parent.removeChild(node);
+			i--
+		}
+
+		def delList = doc.getDocumentElement().getElementsByTagName("del")
+		println "nb <del> to delete: "+delList.getLength()
+		for(int i = 0 ; i < delList.getLength() ; i++) {
+			Element node = delList.item(i);
+			node.getParentNode().removeChild(node);
+			i--
+		}
+
+		DomUtils.save(doc, outfile);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/RenameFilesInDirectoryByXpathElementContentTrace.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/RenameFilesInDirectoryByXpathElementContentTrace.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/RenameFilesInDirectoryByXpathElementContentTrace.groovy	(revision 728)
@@ -0,0 +1,38 @@
+package org.txm.sw
+// Copyright Â© - ENS de Lyon - http://textometrie.ens-lyon.fr
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+// $LastChangedDate: 2013-05-02 10:05:14 +0200 (jeu., 02 mai 2013) $
+// $LastChangedRevision: 2377 $
+// $LastChangedBy: sheiden $
+//
+
+import org.txm.importer.*
+
+// parameters
+													// **change this parameter**
+dir = new File(System.getProperty("user.home"), "TXM/sources/Factiva")
+													// **change this parameter**
+xpath = "/article/@date"
+
+print "Renaming"
+// main body
+dir.eachFileMatch(~/.*.xml/){ file ->               // for each file
+	file.renameTo(new File(file.getParent(), XPathResult.getXpathResponse(file, xpath)+"_"+file.name));
+	print "."
+}
+println "Done."
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Contains Groovy scripts that will be included in the Source Workbench</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/RenameFilesInDirectoryByXpathElementContent.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/RenameFilesInDirectoryByXpathElementContent.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/RenameFilesInDirectoryByXpathElementContent.groovy	(revision 728)
@@ -0,0 +1,36 @@
+package org.txm.sw
+// Copyright Â© - ENS de Lyon - http://textometrie.ens-lyon.fr
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+// $LastChangedDate: 2013-05-02 10:05:14 +0200 (jeu., 02 mai 2013) $
+// $LastChangedRevision: 2377 $
+// $LastChangedBy: sheiden $
+//
+import org.txm.importer.*
+
+// parameters
+
+// **change this parameter**
+dir = new File(System.getProperty("user.home"), "TXM/sources/Factiva")
+
+// **change this parameter**
+xpath = "/article/@date"
+
+// main body
+dir.eachFileMatch(~/.*.xml/){ file -> // for each file
+	file.renameTo(new File(file.getParent(), XPathResult.getXpathResponse(file, xpath)+"_"+file.name));
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/ChangeEncoding.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/ChangeEncoding.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/ChangeEncoding.groovy	(revision 728)
@@ -0,0 +1,47 @@
+package org.txm.sw
+// Copyright Â© - ENS de Lyon - http://textometrie.ens-lyon.fr
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+// $LastChangedDate: 2012-02-01 17:58:45 +0100 (mer., 01 fÃ©vr. 2012) $
+// $LastChangedRevision: 2122 $
+// $LastChangedBy: mdecorde $
+//
+
+// PARAMETERS
+
+File dir = new File("/home/mdecorde/TEMP/atelier") // the directory containing the files
+String fromEncoding = "UTF-8" // the sources encoding
+String toEncoding = "windows-1252" // the final encoding
+
+// END OF PARAMETERS
+
+def processDirectory(File dir, String fromEncoding, String toEncoding) {
+	dir.eachFileMatch(~/.*.txt/){ file -> // for each file with the "txt" extension
+		processFile(file, fromEncoding, toEncoding)
+	}
+}
+
+def processFile(File file, String fromEncoding, String toEncoding) {
+	println "Convert file: $file"
+	String text = file.getText(fromEncoding);
+	file.withWriter(toEncoding) {writer -> // read with the "fromEncoding"
+		writer.write(text) // write with the "toEncoding"
+	}
+}
+
+processDirectory(dir, fromEncoding, toEncoding)
+println "Done"
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/RenameFilesInDirectoryByRegExp.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/RenameFilesInDirectoryByRegExp.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/RenameFilesInDirectoryByRegExp.groovy	(revision 728)
@@ -0,0 +1,39 @@
+package org.txm.sw
+// Copyright Â© - ENS de Lyon - http://textometrie.ens-lyon.fr
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+// $LastChangedDate: 2012-02-01 17:58:45 +0100 (mer., 01 fÃ©vr. 2012) $
+// $LastChangedRevision: 2122 $
+// $LastChangedBy: mdecorde $
+//
+import org.txm.importer.*
+
+// PARAMETERS
+
+File dir = new File("/home/mdecorde/TEMP/atelier")
+String searchRegexp = "(.+).txt"
+String replaceRegexp = 't$1.txt' // WARNING: Use simple quotes only
+
+// END OF PARAMETERS
+
+// main body
+dir.eachFileMatch(~/.*.txt/){ file -> // for each file with extension "txt"
+	String filename = file.getName()
+	filename = filename.replaceAll(searchRegexp, replaceRegexp)
+	println "Rename file '$file' to '$filename'"
+	file.renameTo(new File(file.getParent(), filename))
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/SearchReplaceInDirectoryTrace.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/SearchReplaceInDirectoryTrace.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/SearchReplaceInDirectoryTrace.groovy	(revision 728)
@@ -0,0 +1,56 @@
+package org.txm.sw
+// Copyright Â© - ENS de Lyon - http://textometrie.ens-lyon.fr
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
+//
+
+// parameters
+
+dir = new File("/home/sheiden/TXM/sources/Factiva") // **change this parameter**
+ext = "\\.xml"                                      // **change this parameter**
+find = /date="([0-9]+)-([0-9]+-[0-9]+)"/            // **change this parameter**
+replaceWith = 'date="$1-$2" year="$1"'              // **change this parameter**
+encoding = "cp1252"
+test = false // XML Validation
+
+// main body
+println "SearchReplaceInDirectory: processing directory '$dir'..."
+dir.eachFileMatch(~/.*$ext/) { file ->               // for each file matching extension
+    println "SearchReplaceInDirectory: processing file '$file'..."
+    println "XML syntax initial check"
+    if (org.txm.importer.ValidateXml.test(file)) {
+        println "Search&Replace"
+        def tmp = File.createTempFile("SearchReplaceInDirectoryTemp", ".xml", dir) // create temporary file
+        tmp.withWriter(encoding) { writer ->
+            file.eachLine(encoding) { line ->                  // for each line
+                writer.println line.replaceAll(find, replaceWith) // find&replace and print
+            }
+        }
+        file.delete()
+        tmp.renameTo(file)                           // save results
+        
+        println "XML syntax final check"
+        if (test && !org.txm.importer.ValidateXml.test(file)) {
+            println "** Warning: bad XML syntax for result file '$file'"
+        }
+    } else {
+        println "Skipping file '$file'"
+    }
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/SearchReplaceInDirectory.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/SearchReplaceInDirectory.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/SearchReplaceInDirectory.groovy	(revision 728)
@@ -0,0 +1,73 @@
+package org.txm.sw
+// Copyright Â© - ENS de Lyon - http://textometrie.ens-lyon.fr
+// @author sheiden
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+// $LastChangedDate: 2013-05-02 11:28:42 +0200 (jeu., 02 mai 2013) $
+// $LastChangedRevision: 2378 $
+// $LastChangedBy: sheiden $
+//
+
+// parameters
+
+// **change this parameter**
+dir = new File(System.getProperty("user.home"), "Bureau/voeux")
+
+// **change this parameter**
+ext = "\\.txt"
+
+// **change this parameter**
+find = "â€™"
+
+// **change this parameter**
+replaceWith = "'"
+
+// **change this parameter**
+encoding = "utf-8"
+
+// **change this parameter**
+// 'true' = only display matching lines, 'false' = replace in matching files
+showMatchingFilesOnly = false
+
+
+//find = /date="([0-9]+)-([0-9]+-[0-9]+)"/
+		      // **change this parameter**
+//replaceWith = 'date="$1-$2" year="$1"'
+		      // **change this parameter** (warning: '$1', '$2'... can be interpreted by Groovy in "..." strings)
+
+// main body
+println "in $dir ... "+/.*$ext/
+dir.eachFileMatch(~/.*$ext/) { file ->               // for each file matching extension
+	println file.getName()
+	
+if (showMatchingFilesOnly) {
+	
+       file.eachLine(encoding) { line ->                  // for each line
+           if (line.matches(".*$find.*")) { println " *match* : "+line }
+	   }
+} else {
+       def tmp = File.createTempFile("SearchReplaceInDirectoryTemp", ".tmp", dir) // create temporary file
+       tmp.write('')                                // create empty file
+       tmp.withWriter(encoding) { writer ->
+           file.eachLine(encoding) { line ->                  // for each line
+           	writer.println line.replaceAll(find, replaceWith) // find&replace and print
+           }
+       }
+       file.delete()
+       tmp.renameTo(file)                           // save results
+ }
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/SearchReplaceXMLInDirectoryTrace.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/SearchReplaceXMLInDirectoryTrace.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/SearchReplaceXMLInDirectoryTrace.groovy	(revision 728)
@@ -0,0 +1,53 @@
+package org.txm.sw
+// Copyright Â© - ENS de Lyon - http://textometrie.ens-lyon.fr
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+// $LastChangedDate: 2013-05-02 10:05:14 +0200 (jeu., 02 mai 2013) $
+// $LastChangedRevision: 2377 $
+// $LastChangedBy: sheiden $
+//
+
+// parameters
+
+dir = new File("/home/sheiden/TXM/sources/Factiva") // **change this parameter**
+ext = "\\.xml"                                      // **change this parameter**
+find = /date="([0-9]+)-([0-9]+-[0-9]+)"/            // **change this parameter**
+replaceWith = 'date="$1-$2" year="$1"'              // **change this parameter**
+
+// main body
+println "SearchReplaceInDirectory: processing directory '$dir'..."
+dir.eachFileMatch(~/.*$ext/){ file ->               // for each file matching extension
+    println "SearchReplaceInDirectory: processing file '$file'..."
+    println "XML syntax initial check"
+    if (org.txm.importer.ValidateXml.test(file)) {
+        println "Search&Replace"
+        def tmp = File.createTempFile("SearchReplaceInDirectoryTemp", ".xml", dir) // create temporary file
+        tmp.write('')                                // create empty file
+        tmp.withWriter { writer ->
+            file.eachLine { line ->                  // for each line
+                writer.println line.replaceAll(find, replaceWith) // find&replace and print
+            }
+        }
+        tmp.renameTo(file)                           // save results
+        println "XML syntax final check"
+        if (!org.txm.importer.ValidateXml.test(file)) {
+            println "** Warning: bad XML syntax for result file '$file'"
+        }
+    } else {
+        println "Skipping file '$file'"
+    }
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/AddHeadTailInDirectory.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/AddHeadTailInDirectory.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/AddHeadTailInDirectory.groovy	(revision 728)
@@ -0,0 +1,68 @@
+package org.txm.sw
+// Copyright Â© - ENS de Lyon - http://textometrie.ens-lyon.fr
+// @author sheiden
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+// $LastChangedDate: 2012-02-01 17:58:45 +0100 (mer., 01 fÃ©vr. 2012) $
+// $LastChangedRevision: 2122 $
+// $LastChangedBy: mdecorde $
+//
+
+import static groovy.io.FileType.*
+
+// PARAMETERS
+
+// dir
+def dir = new File("/home/mdecorde/TEMP/atelier")
+
+// inputEncoding
+def inputEncoding = "UTF-8"
+
+// outputEncoding
+def outputEncoding = "UTF-8"
+
+// head
+def head = "<?xml version=\"1.0\" encoding=\"${outputEncoding}\"?>\n<discours>\n" // can be empty
+
+// tail
+def tail = "</discours>\n"; // can be empty
+
+// fileExtension
+def fileExtension = "txt"
+
+//END OF PARAMETERS
+
+// filePattern
+def filePattern = ".*\\.$fileExtension\$"
+
+// main body
+dir.eachFileMatch(~/$filePattern/) { inputFile ->				// for each file matching extension
+    def outputTmp = File.createTempFile("AddHeadInDirectoryTemp", '.tmp', dir) // create temporary file
+    outputTmp.withWriter(outputEncoding) { writer ->
+    if (head != null && head.length() > 0)
+    	writer.print(head)
+	inputFile.withReader(inputEncoding) { reader ->
+			reader.eachLine { inputLine ->               		// for each line
+				writer.println inputLine
+			}
+		}
+	if (tail != null && tail.length() > 0)
+		writer.print(tail)
+	writer.close()
+    }
+	assert outputTmp.renameTo(inputFile)						// save results
+}		
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/SearchReplaceFromList.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/SearchReplaceFromList.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/SearchReplaceFromList.groovy	(revision 728)
@@ -0,0 +1,57 @@
+package org.txm.sw
+// Copyright Â© - ENS de Lyon - http://textometrie.ens-lyon.fr
+// @author mdecorde
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+// $LastChangedDate: 2012-10-01 08:24:58 +0200 (lun., 01 oct. 2012) $
+// $LastChangedRevision: 2269 $
+// $LastChangedBy: sheiden $
+//
+
+// parameters
+
+file = new File("/home/mdecorde/xml/apollinaire/apollinaire.xml")
+out = new File("/home/mdecorde/xml/apollinaire/apo/apollinaire.xml")
+def changesFind = [ "</recueil>",	"<paragraphe>", "</paragraphe>", "<racine>",	"</racine>", "<interp",	"</interp>", "<TEI xmlns=\"http://www.tei-c.org/ns/1.0\" xmlns:txm=\"http://textometrie.org/1.0\">"	]
+def changesReplace = [ "</recueil><pb/>", "<p>", "</p><lb/>", '<text id ="apollinaire">', '</text',	'<txm:ana',	'</txm:ana>', """<TEI xmlns="http://www.tei-c.org/ns/1.0" xmlns:txm="http://textometrie.org/1.0">
+<teiHeader type="text">
+<fileDesc>
+<titleStmt>
+<title>null</title>
+<respStmt>
+<resp id="cordial">initial tagging</resp></respStmt>
+</titleStmt>
+</fileDesc>
+<encodingDesc>
+<classDecl>
+<taxonomy id="pos"><bibl type="tagset"/></taxonomy>
+<taxonomy id="func"><bibl type="tagset"/></taxonomy>
+<taxonomy id="lemma"><bibl type="tagset"/></taxonomy>
+</classDecl>
+</encodingDesc>
+</teiHeader>""" ]
+
+// main body
+out.write('')                                // create empty file
+out.withWriter { writer ->
+	String text = file.getText("UTF-8");
+	for (int i = 0 ; i < changesFind.size() ; i++) {
+		println "loop $i: "+changesFind[i] +" >> "+ changesReplace[i]
+		text = text.replaceAll(changesFind[i], changesReplace[i])
+	}
+	out.write(text)
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/ReplaceXmlDomNode.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/ReplaceXmlDomNode.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/sw/ReplaceXmlDomNode.groovy	(revision 728)
@@ -0,0 +1,163 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.sw;
+
+import java.io.File;
+
+import javax.xml.namespace.NamespaceContext;
+import org.w3c.dom.*;
+import javax.xml.parsers.*;
+import org.xml.sax.SAXException;
+import javax.xml.stream.*;
+import javax.xml.xpath.*;
+
+import org.txm.sw.ReplaceXmlDomNode;
+import org.txm.importer.graal.PersonalNamespaceContext;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ReplaceXmlDomNode.
+ */
+class ReplaceXmlDomNode
+{
+	
+	/** The ns context. */
+	NamespaceContext nsContext = new PersonalNamespaceContext();
+	
+	/**
+	 * Instantiates a new replace xml dom node.
+	 *
+	 * @param src the src
+	 * @param target the target
+	 * @param xpathsrc the xpathsrc
+	 * @param xpathtarget the xpathtarget
+	 */
+	public ReplaceXmlDomNode(File src, File target, String xpathsrc, String xpathtarget)
+	{
+		def factory = DocumentBuilderFactory.newInstance();
+		factory.setXIncludeAware(true)
+		def builder = factory.newDocumentBuilder()
+		
+		def docsrc = builder.parse(src);
+		def doctarget = builder.parse(target);
+		
+		Node srcnode = null;
+		Node targetnode = null;
+		
+		factory = XPathFactory.newInstance();
+		XPath XpathObj = factory.newXPath();
+		XpathObj.setNamespaceContext(nsContext);
+		
+		XPathExpression expr = XpathObj.compile(xpathsrc);
+		for(Node node : (NodeList) expr.evaluate(docsrc, XPathConstants.NODESET))
+		{
+			srcnode = node;
+			break;
+		}
+		
+		XPathExpression expr2 = XpathObj.compile(xpathtarget);
+		for(Node node : (NodeList) expr2.evaluate(doctarget, XPathConstants.NODESET))
+		{
+			targetnode = node;
+			break;
+		}
+		
+		//println "replace : "+targetnode
+		//println "by : "+srcnode
+		if(targetnode != null && srcnode != null)
+		{
+			Node parent = targetnode.getParentNode();
+			parent.removeChild(targetnode);
+			parent.appendChild(doctarget.importNode(srcnode, true));
+			
+			save(doctarget, target);
+		}
+		else
+		{
+			println "Error: "
+			println "target node = "+targetnode
+			println "src node = "+srcnode
+		}
+		
+	}
+	
+	/**
+	 * Save.
+	 *
+	 * @param doc the doc
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean save(def doc, File outfile)
+	{
+		try {
+			// CrÃ©ation de la source DOM
+				Source source = new DOMSource(doc);
+			
+			// CrÃ©ation du fichier de sortie
+				Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8")); 
+			Result resultat = new StreamResult(writer);
+			
+			// Configuration du transformer
+			TransformerFactory fabrique = new net.sf.saxon.TransformerFactoryImpl();
+			Transformer transformer = fabrique.newTransformer();
+			transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+			transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+			
+			// Transformation
+			transformer.transform(source, resultat);
+			writer.close();
+			doc = null;
+			return true;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		String home = System.getProperty("user.home")
+		File src = new File(home, "xml/subberoul/subcorpus0000.xml")
+		File target = new File(home, "xml/subberoul/master.xml")
+		String xpathsrc = "//subcorpus"
+		String xpathtarget = "//subcorpus[@name=\"subcorpus0000\"]"
+		
+		new ReplaceXmlDomNode(src, target, xpathsrc, xpathtarget)
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/SlashFile2TTRez.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/SlashFile2TTRez.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/SlashFile2TTRez.groovy	(revision 728)
@@ -0,0 +1,45 @@
+package org.txm.tal
+
+class SlashFile2TTRez {
+	public static boolean debug = true;
+
+	public SlashFile2TTRez(File inputFile, File outputFile, String encoding) {
+		outputFile.withWriter("UTF-8") { writer ->
+			int nline = 1;
+			inputFile.eachLine(encoding) { line ->
+				def rez = processString(line)
+				for (def l : rez) {
+					//if (debug) println "result: $l"
+					writer.println(l[0] + "\t" + l[1])
+				}
+				nline++;
+			}
+		}
+	}
+
+	def static empty = [null,null]
+	public static def processString(String line) {
+		def rez = [];
+		if (debug) println "process line $line"
+		if (line.length() == 0) {
+			return []
+		} else {
+			for (String str : line.tokenize()) {
+				if (debug) println " process str $str"
+				int idx = str.lastIndexOf("/")
+				if (idx > 0) {
+					rez << [str.substring(0, idx), str.substring(idx+1)]
+				} else {
+					if (debug) println "ERROR line $line"
+				}
+			}
+		}
+		return rez
+	}
+
+	public static void main(def args) {
+		File inputFile = new File("/home/mdecorde/Taggers/melt-2.0b2/txtbrut-o.txt");
+		File outputFile = new File("/home/mdecorde/Taggers/melt-2.0b2/txtbrut-tt.txt");
+		new SlashFile2TTRez(inputFile, outputFile, "UTF-8")
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/Tagger.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/Tagger.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/Tagger.groovy	(revision 728)
@@ -0,0 +1,13 @@
+package org.txm.tal
+
+class Tagger {
+	File executablePath
+	File modelPath
+	String lang
+	
+	public Tagger(File executablePath, File modelPath, String lang) {
+		this.executablePath = executablePath
+		this.modelPath = modelPath
+		this.lang = lang
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/XMLDomTokenizerAdapter.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/XMLDomTokenizerAdapter.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/XMLDomTokenizerAdapter.groovy	(revision 728)
@@ -0,0 +1,38 @@
+package org.txm.tal
+
+import org.txm.importer.StaxIdentityParser;
+import org.txm.importer.XPathResult;
+import org.w3c.dom.*;
+
+class XMLDomTokenizerAdapter {
+	String xpath;
+	boolean debug = true;
+	def nodes = []
+	
+	File infile, outfile;
+	public XMLDomTokenizerAdapter(File infile, def xpath) {
+		this.infile = infile
+		this.xpath = xpath
+	}
+	
+	public boolean process(File outfile) {
+		this.outfile = outfile
+		
+		XPathResult rez = new XPathResult(infile)
+		def nodes = rez.getNodes(xpath)
+		println nodes.size()
+//		for (Node node : rez.getNodes(xpath)) {
+//			println "Found $node"
+//			//nodes << [node, ""]
+//		}
+	}
+	
+	
+	public static void main(String[] args) {
+		File inputXMLFile = new File("/home/mdecorde/xml/comere/cmrclavardage/cmr-getalp_org-actu-tei-v1.xml");
+		File outputXMLFile = new File("/home/mdecorde/xml/comere/cmrclavardage/tmp.xml");
+		def processor = new XMLDomTokenizerAdapter(inputXMLFile, "/tei:TEI/tei:text/tei:body/tei:div/tei:post") //tei:div/tei:post/tei:p
+		processor.process(outputXMLFile)
+		//println processor.getNodes()
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/XMLStaxTokenizerAdapter.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/XMLStaxTokenizerAdapter.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/XMLStaxTokenizerAdapter.groovy	(revision 728)
@@ -0,0 +1,87 @@
+package org.txm.tal
+
+import org.txm.importer.StaxIdentityParser;
+
+/**
+ * Experiment of Tokenizer that targets XPath results text
+ * 
+ * @author mdecorde
+ *
+ */
+class XMLStaxTokenizerAdapter extends StaxIdentityParser {
+	def xpaths;
+	boolean debug = false;
+	boolean doTokenize = false
+	String str; // string to tokenize
+	def tokenizeResults = []
+	def nsegments = 0
+	
+	public XMLStaxTokenizerAdapter(File infile, def xpaths, def tokenizeResults) {
+		super(infile.toURI().toURL());
+		this.xpaths = xpaths
+		this.tokenizeResults = tokenizeResults
+	}
+	
+	protected void processStartElement() {
+		String localname = parser.getLocalName();
+		if (debug) println "start element $currentXPath"
+		if (doTokenize) {
+			if (debug) println "Found text element $currentXPath"
+			tokenizeCurrentText();
+		} else {
+			if (xpaths.contains(currentXPath.toString())) {
+				doTokenize = true;
+				str = "";
+			}
+		}
+		super.processStartElement()
+	}
+	
+	protected void processEndElement() {
+		if (xpaths.contains(currentXPath.toString())) {
+			tokenizeCurrentText()
+			doTokenize = false;
+			if (debug) println "Found text element: stop tokenizing"
+		}
+		
+		super.processEndElement();
+	}
+	
+	protected void processCharacters() {
+		if (doTokenize) {
+			str += parser.getText();
+		} else {
+			super.processCharacters();
+		}
+	}
+	
+	protected tokenizeCurrentText() {
+		if (str.length() == 0) return;
+		def tokens = tokenizeResults[nsegments]
+		for (def token : tokens) {
+			writer.writeStartElement("w");
+			writer.writeCharacters(token);
+			writer.writeEndElement();
+			writer.writeCharacters(" ");
+		}
+
+		nsegments++;
+	}
+		
+	/**
+	 * Best tokenizer ever.
+	 * Extends this function
+	 * 
+	 * @param str
+	 * @return
+	 */
+	protected List<CharSequence> tokenize(String str) {
+		return str.tokenize();
+	}
+	
+	public static void main(String[] args) {
+		File inputXMLFile = new File("/home/mdecorde/xml/comere/cmrclavardage/cmr-getalp_org-actu-tei-v1.xml");
+		File outputXMLFile = new File("/home/mdecorde/xml/comere/cmrclavardage/tmp.xml");
+		new XMLStaxTokenizerAdapter(inputXMLFile, ["/TEI/text/body/div/post/p/"]).process(outputXMLFile)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/stanford/StanfordSegmenterMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/stanford/StanfordSegmenterMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/stanford/StanfordSegmenterMacro.groovy	(revision 728)
@@ -0,0 +1,120 @@
+// STANDARD DECLARATIONS
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+import edu.stanford.nlp.international.arabic.process.*
+import edu.stanford.nlp.international.arabic.*
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.io.Serializable;
+import java.io.StringReader;
+import java.io.UnsupportedEncodingException;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import edu.stanford.nlp.ie.crf.*;
+import edu.stanford.nlp.io.*;
+import edu.stanford.nlp.ling.*;
+import edu.stanford.nlp.objectbank.*;
+import edu.stanford.nlp.process.*;
+import edu.stanford.nlp.sequences.*;
+import edu.stanford.nlp.stats.*;
+import edu.stanford.nlp.trees.*;
+import edu.stanford.nlp.util.*;
+import edu.stanford.nlp.util.concurrent.*;
+
+@Field @Option(name="inputDir", usage="input directory", widget="Folder", required=true, def="/home/mdecorde/xml/testarabe")
+File inputDir
+@Field @Option(name="outputDir", usage="output directory", widget="Folder", required=true, def="/home/mdecorde/xml/testarabe/out-s")
+File outputDir
+
+@Field @Option(name="model", usage="'.tagger' model file", widget="File", required=false, def="data/arabic-segmenter-atbtrain.ser.gz")
+File model
+@Field @Option(name="extension", usage="Regexp de l'extension des fichiers Ã  modifier", widget="String", required=true, def='\\.txt')
+String extension = "\\.txt"
+
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return;
+
+outputDir.mkdir()
+if (!outputDir.exists()) {
+	println("Could not create $outputDir")
+	return;
+}
+
+// END OF PARAMETERS
+//File inputFile = new File("/home/mdecorde/xml/testarabe/test.txt")
+inputDir.eachFileMatch(~/.*$extension/) { inputFile ->
+println "Processing file: $inputFile"
+File outputFile = new File(outputDir, inputFile.getName())
+//File model = new File("/home/mdecorde/LIBRAIRIES/stanford-segmenter-2014-01-04/data/arabic-segmenter-atbtrain.ser.gz")
+Properties options = new Properties();
+//options.put("prefixMarker", "#")
+//options.put("suffixMarker", "#")
+options.put("loadClassifier", model.getAbsolutePath())
+//TODO: uncommend me
+//ArabicSegmenter segmenter = new ArabicSegmenter(options);
+segmenter.flags.inputEncoding = "UTF-8";
+segmenter.loadSegmenter(segmenter.flags.loadClassifier, options);
+
+def br = inputFile.newReader("UTF-8")
+OutputStreamWriter out = new OutputStreamWriter( new FileOutputStream(outputFile), "UTF-8");
+PrintWriter pw = new PrintWriter(out, true);
+double charsPerSec = decode(segmenter, br, pw, 5);
+IOUtils.closeIgnoringExceptions(br);
+System.err.printf("Done! Processed input text at %.2f input characters/second%n", charsPerSec);
+
+}
+
+/**
+   * Segment input and write to output stream.
+   *
+   * @param segmenter
+   * @param br
+   * @param pwOut
+   * @param nThreads
+   * @return input characters processed per second
+   */
+def decode(def segmenter, BufferedReader br,
+                               PrintWriter pwOut, int nThreads) {
+    assert nThreads > 0;
+    long nChars = 0;
+    final long startTime = System.nanoTime();
+    if (nThreads > 1) {
+		//TODO: uncommend me
+		//      MulticoreWrapper<String,String> wrapper = new MulticoreWrapper<String,String>(nThreads, segmenter);
+      try {
+        for (String line; (line = br.readLine()) != null;) {
+          nChars += line.length();
+          wrapper.put(line);
+          while (wrapper.peek()) {
+            pwOut.println(wrapper.poll());
+          }
+        }
+
+        wrapper.join();
+        while (wrapper.peek()) {
+          pwOut.println(wrapper.poll());
+        }
+
+      } catch (IOException e) {
+        e.printStackTrace();
+      }
+
+    } else {
+      nChars = segmenter.segment(br, pwOut);
+    }
+    long duration = System.nanoTime() - startTime;
+    double charsPerSec = (double) nChars / (duration / 1000000000.0);
+    return charsPerSec;
+  }
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/stanford/StanfordTaggerMacro.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/stanford/StanfordTaggerMacro.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/stanford/StanfordTaggerMacro.groovy	(revision 728)
@@ -0,0 +1,64 @@
+import edu.stanford.nlp.ling.*
+import edu.stanford.nlp.process.*
+import edu.stanford.nlp.tagger.maxent.*;
+
+// STANDARD DECLARATIONS
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcpapplication.swt.widget.parameters.*
+
+@Field @Option(name="inputDir", usage="input directory", widget="Folder", required=true, def="/home/mdecorde/xml/testarabe/out-s")
+File inputDir
+@Field @Option(name="outputDir", usage="output directory", widget="Folder", required=true, def="/home/mdecorde/xml/testarabe/out-t")
+File outputDir
+
+@Field @Option(name="model", usage="'.tagger' model file", widget="File", required=false, def="taggers/arabic-train.tagger")
+File model
+@Field @Option(name="extension", usage="Regexp de l'extension des fichiers Ã  modifier", widget="String", required=true, def='\\.txt')
+String extension = "\\.txt"
+
+// Open the parameters input dialog box
+if (!ParametersDialog.open(this)) return;
+def modelPath = model.getAbsolutePath()
+
+outputDir.mkdir()
+if (!outputDir.exists()) {
+	println("Could not create $outputDir")
+	return;
+}
+
+inputDir.eachFileMatch(~/.*$extension/) { inputFile ->
+	String name = inputFile.getName()
+	int idx = name.lastIndexOf(".")
+	if (idx > 0) name = name.substring(0, idx)
+	
+	new File(outputDir, name+".xml").withWriter("UTF-8") { writer ->
+		
+		writer.println('<?xml version="1.0" encoding="UTF-8"?>')
+		writer.println('<text>')
+		//TODO: uncomment me
+	//	def tagger = new MaxentTagger(modelPath);
+	//	def ptbTokenizerFactory = PTBTokenizer.factory(new CoreLabelTokenFactory(),	"untokenizable=noneKeep");
+	
+			//TODO: uncomment me
+//		def documentPreprocessor = new DocumentPreprocessor(inputFile.newReader());
+		documentPreprocessor.setTokenizerFactory(ptbTokenizerFactory);
+		int n = 0
+		
+		for (def sentence : documentPreprocessor) {
+			writer.println("<s n=\"$n\">")
+			n++;
+			def tSentence = tagger.tagSentence(sentence);
+			//println(Sentence.listToString(tSentence, false));
+			for (def taggedWord : tSentence)
+			{
+				def form = w.word();
+				def pos = w.tag();
+				writer.println("<w pos=\"$pos\">$form</w>")
+			}
+			writer.println('</s>')
+		}
+		writer.println('</text>')
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/melt/MElt.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/melt/MElt.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/melt/MElt.groovy	(revision 728)
@@ -0,0 +1,105 @@
+
+package org.txm.tal.melt
+
+import java.io.File;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import org.txm.tal.Tagger
+import org.txm.tal.SlashFile2TTRez
+import org.txm.utils.StreamHog;
+
+class MElt extends Tagger {
+	
+	Process process = null;
+	InputStream meltis
+	OutputStream meltos
+	boolean debug = false
+	
+	BufferedReader reader
+	StringBuffer buffer = new StringBuffer();
+	
+	public MElt(File executablePath, File modelPath, String lang) {
+		super(executablePath, modelPath, lang);
+	}
+	
+	public boolean start() {
+		// Call Melt
+		def args = [];
+		args << "MElt"
+		//args << "-L"
+		ProcessBuilder pb = new ProcessBuilder(args);
+		try {
+			process = pb.start();
+		} catch (IOException e) {
+			System.err.println(e);
+			return false
+		}
+		meltis = process.getInputStream();
+		meltos = process.getOutputStream();
+		
+		new StreamHog(process.getErrorStream(), debug) // read Error Stream
+		//new StreamHog(process.getInputStream(), true) // read Error Stream
+		reader = new BufferedReader(new InputStreamReader(meltis));
+		return true;
+	}
+	
+	public boolean processText(String text) {
+		if (debug) println "Send text: $text"
+		process << text
+		process << "\n"
+		meltos.flush()
+		return true;
+	}
+	
+	public def readStream() {
+		if (debug) println "reading lines..."
+		
+		try {
+			String line = null;
+			while ((line = reader.readLine()) != null) {
+				buffer << line
+				buffer << "\n"
+			}
+		} catch (IOException e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+		}
+		
+		return "end"
+	}
+	
+	public boolean stop() {
+		meltos.close()
+		readStream()
+		
+		int e = 0;
+		try {
+			e = process.waitFor();
+		} catch (Exception err) {	}
+
+		if (e != 0) {
+			System.err .println("Process exited abnormally with code " + e )
+		}
+	}
+	
+	public def getResult() {
+		return SlashFile2TTRez.processString(buffer.toString())
+	}
+	
+	
+	public static void main(String[] args) {
+		MElt melt = new MElt(new File(""), new File(""), "fr")
+		melt.start()
+		melt.processText("""Il va.
+Un autre bout, de texte""")
+		melt.stop()
+
+		println "\nMELT DONE\n"
+		for (def r : melt.getResult()) {
+			for (def rr : r)
+				print rr+"\t"
+			println ""
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/melt/SxPipe.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/melt/SxPipe.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/melt/SxPipe.groovy	(revision 728)
@@ -0,0 +1,164 @@
+
+package org.txm.tal.melt
+
+import java.io.File;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import org.txm.tal.Tagger
+import org.txm.tal.SlashFile2TTRez
+import org.txm.utils.StreamHog;
+
+class SxPipe {
+
+	Process process = null;
+	InputStream meltis
+	OutputStream meltos
+	boolean debug = false
+
+	BufferedReader reader
+	StringBuffer buffer = new StringBuffer();
+
+	public SxPipe() {
+	}
+
+	public boolean start() {
+		// Call Melt
+		def args = [];
+		args << "MElt"
+		args << "-t"
+		args << "-C"
+		ProcessBuilder pb = new ProcessBuilder(args);
+		try {
+			process = pb.start();
+		} catch (IOException e) {
+			System.err.println(e);
+			return false
+		}
+		meltis = process.getInputStream();
+		meltos = process.getOutputStream();
+
+		new StreamHog(process.getErrorStream(), debug) // read Error Stream
+		//new StreamHog(process.getInputStream(), true) // read Error Stream
+		reader = new BufferedReader(new InputStreamReader(meltis));
+		return true;
+	}
+
+	public boolean processText(String text) {
+		if (debug) println "Send text: $text"
+		process << text
+		process << "\n"
+		meltos.flush()
+		return true;
+	}
+
+	public def readStream() {
+		if (debug) println "reading lines..."
+
+		try {
+			String line = null;
+			while ((line = reader.readLine()) != null) {
+				buffer << line
+				buffer << "\n"
+			}
+		} catch (IOException e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+		}
+
+		return "end"
+	}
+
+	public boolean stop() {
+		meltos.close()
+		readStream()
+
+		int e = 0;
+		try {
+			e = process.waitFor();
+		} catch (Exception err) {	}
+
+		if (e != 0) {
+			System.err .println("Process exited abnormally with code " + e )
+		}
+	}
+
+	public def getResult() {
+		return buffer.toString()
+		//return SlashFile2TTRez.processString(buffer.toString())
+	}
+
+	public void printResult() {
+		def segs = getResult().split("\n")// \\{\\\$\\\$\\\$\\\$\\} \\\$\\\$\\\$\\\$
+
+		int i = 0;
+		for (def seg : segs) {
+			def tokens = []
+			for(def str :  seg.replaceAll("\\{", "\n{").tokenize("\n")) {
+				if (str.startsWith("{"))
+					println str.substring(1, str.indexOf("}")).replace("_ACC_O", "{").replace("_ACC_F", "}")
+			}
+		}
+	}
+
+	public def getResultTokens() {
+		def segs = getResult().split("\n")
+		def tokens = []
+
+		int i = 0, idx = -1;
+		for (def seg : segs) {
+			for(def str :  seg.replaceAll("\\{", "\n{").tokenize("\n")) {
+				if (str.startsWith("{")) {
+					idx = str.indexOf("}")
+					try{
+						tokens << [str.substring(1, idx).replace("_ACC_O", "{").replace("_ACC_F", "}"),
+							str.substring(idx+1)]
+					} catch(Exception e) {e.printStackTrace();println "STRING IS : '$str'"}
+				}
+			}
+
+		}
+		return tokens
+	}
+
+	public def getResultSegments() {
+		def segs = getResult().split("\n")
+		def segsFinal = []
+
+		int i = 0, idx = -1;
+		for (def seg : segs) {
+			def tokens = []
+			for(def str :  seg.replaceAll("\\{", "\n{").tokenize("\n")) {
+				if (str.startsWith("{")) {
+					idx = str.indexOf("}")
+					try{
+						tokens << [str.substring(1, idx).replace("_ACC_O", "{").replace("_ACC_F", "}"),
+							str.substring(idx+1)]
+					} catch(Exception e) {e.printStackTrace();println "STRING IS : '$str'"}
+				}
+			}
+			segsFinal << tokens
+		}
+		return segsFinal
+	}
+
+
+	public static void main(String[] args) {
+		SxPipe melt = new SxPipe()
+		melt.start()
+		melt.processText("""Il y a {du} pain \$\$\$\$ c'Ã©tait bon. Y a-t-il assez ?
+Un autre bout, de texte : fin.""")
+		melt.stop()
+
+		melt.printResult()
+
+
+
+		//		println "\nMELT DONE\n"
+		//		for (def r : melt.getResult()) {
+		//			for (def rr : r)
+		//				print rr+"\t"
+		//			println ""
+		//		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/melt/MEltAnnotate.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/melt/MEltAnnotate.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/melt/MEltAnnotate.groovy	(revision 728)
@@ -0,0 +1,163 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2013-11-08 13:38:06 +0100 (Fri, 08 Nov 2013) $
+// $LastChangedRevision: 2569 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.tal.melt
+
+import java.io.BufferedReader;
+import java.io.File
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.text.DateFormat
+import java.util.ArrayList;
+import java.util.Date
+import java.util.Locale;
+
+import org.txm.Toolbox
+import org.txm.importer.*
+import org.txm.importer.cwb.*
+import org.txm.objects.*
+import org.txm.scripts.teitxm.Annotate;
+import org.txm.tal.SlashFile2TTRez;
+import org.txm.utils.LangDetector;
+import org.txm.utils.treetagger.TreeTagger
+
+// TODO: Auto-generated Javadoc
+/**
+ * Annotate and replace the TEI-TXM files of the folder $rootDirFile/txm with TreeTagger.
+ * creates $rootDirFile/interp and $rootDirFile/treetagger
+ *
+ */
+class MEltAnnotate extends Annotate {
+
+	public void initTTOutfileInfos(File rootDirFile, File modelfile)
+	{
+		reportFile = new File(rootDirFile,"NLPToolsParameters.xml");
+
+		respPerson = System.getProperty("user.name");
+		respId = "txm";
+		respDesc = "NLP annotation tool";
+		respDate = DateFormat.getDateInstance(DateFormat.SHORT, Locale.UK).format(new Date());
+		respWhen = DateFormat.getDateInstance(DateFormat.FULL, Locale.UK).format(new Date());
+
+		appIdent = "MElt";
+		appVersion = "2.0";
+
+		distributor = "";
+		publiStmt = """""";
+		sourceStmt = """""";
+
+		types = ["frpos"];
+		typesTITLE = ["frpos"];
+
+		typesDesc = ["pos tagset built from MElt"]
+		typesTAGSET = ["",""]
+		typesWEB = ["",""]
+
+		idform ="w";
+	}
+
+	/**
+	 * Apply tt.
+	 *
+	 * @param ttsrcfile the ttsrcfile
+	 * @param ttoutfile the ttoutfile
+	 * @param modelfile the modelfile
+	 * @return true, if successful
+	 */
+	public boolean applyTT(File ttsrcfile, File ttoutfile, File modelfile) {
+		return applyMElt(ttsrcfile, ttoutfile)
+	}
+
+	public boolean applyMElt(File ttsrcfile, File ttoutfile) {
+		// Call Melt
+		def args = [];
+		args << "MElt"
+		args
+		ProcessBuilder pb = new ProcessBuilder(args);
+		Process process = null;
+		try {
+			process = pb.start();
+		} catch (IOException e) {
+			System.err.println(e);
+		}
+		InputStream is = process.getInputStream();
+		OutputStream os = process.getOutputStream();
+		InputStreamReader isr = new InputStreamReader(is);
+		BufferedReader br = new BufferedReader(isr);
+		ttsrcfile.eachLine ("UTF-8") { line ->
+			println "> $line"
+			os.println line
+		}
+		
+		ttoutfile.withWriter("UTF-8") { writer ->
+			String line;
+			println "getting result"
+			while ((line = br.readLine()) != null) {
+				println "< $line"
+				writer.println(line);
+			}
+			println "end of result"
+			int e = 0;
+			try {
+				e = process.waitFor();
+			} catch (Exception err) {	}
+
+			if (e != 0) {
+				System.err .println("Process exited abnormally with code " + e + " at " + DateFormat.getDateInstance(DateFormat.FULL, Locale.UK).format(new Date())); //$NON-NLS-1$ //$NON-NLS-2$
+
+				for (int c = 0; c < args.size(); c++)
+					System.out.print("" + args.get(c) + " "); //$NON-NLS-1$ //$NON-NLS-2$
+				System.out.println();
+			}
+		}
+
+		// Reformat MElt output
+		File tmpFile = new File(ttoutfile.getParentFile(),ttoutfile.getName()+".tmp")
+		new SlashFile2TTRez(ttoutfile, tmpFile, "UTF-8")
+	}
+	
+	public boolean run(File binDir, File txmDir) {
+		return run(binDir, txmDir, "fr.par")
+	}
+
+	public static void main(def args) {
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:/Program Files/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH, new File("/home/mdecorde/treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH, new File("/home/mdecorde/treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File("/home/mdecorde/TXM"));
+		
+		println "-- ANNOTATE - Running MElt tool"
+
+		File binDir = new File("/home/mdecorde/xml/melt-out")
+		File txmDir = new File("/home/mdecorde/xml/melt-in")
+		new MEltAnnotate().run(binDir, txmDir);
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/melt/MEltTokenizer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/melt/MEltTokenizer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/melt/MEltTokenizer.groovy	(revision 728)
@@ -0,0 +1,22 @@
+package org.txm.tal.melt
+
+import org.txm.tal.XMLStaxTokenizerAdapter;
+
+class MEltTokenizer extends XMLStaxTokenizerAdapter {
+	
+	public MEltTokenizer(File infile, def xpaths) {
+		super(infile, xpaths);
+	}
+	
+	protected List<CharSequence> tokenize(String str) {
+		def ret = str.tokenize()
+		return ret;
+	}
+	
+	public static void main(String[] args) {
+		File inputXMLFile = new File("/home/mdecorde/xml/xmltest/txt1.xml");
+		File outputXMLFile = new File("/home/mdecorde/xml/xmltest/txt1-o.xml");
+		
+		new MEltTokenizer(inputXMLFile, ["/root/subtruc/submachin/"]).process(outputXMLFile)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/XMLStaxTokenizerAdapter2.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/XMLStaxTokenizerAdapter2.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/tal/XMLStaxTokenizerAdapter2.groovy	(revision 728)
@@ -0,0 +1,160 @@
+package org.txm.tal
+
+import java.net.URL;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.txm.importer.StaxIdentityParser;
+import org.txm.importer.graal.PersonalNamespaceContext;
+import org.txm.tal.melt.SxPipe
+
+
+/**
+ * Test of tokenizer that tokenize parts of a XML file using XPath resolved with the Stax parser
+ * 
+ * @author mdecorde
+ *
+ */
+class XMLStaxTokenizerAdapter2 {
+	def xpaths;
+	boolean debug = false;
+	boolean doTokenize = false
+	def segments = []
+	String str;
+
+	protected URL inputurl;
+	protected def inputData;
+	protected XMLInputFactory factory;
+	protected XMLStreamReader parser;
+
+	public static String TXMNS = "http://textometrie.org/1.0";
+	public static String TEINS = "http://www.tei-c.org/ns/1.0";
+	protected static PersonalNamespaceContext Nscontext = new PersonalNamespaceContext();
+
+	String currentXPath = "/"
+	String localname;
+
+	public XMLStaxTokenizerAdapter2(File infile, def xpaths) {
+		this.inputurl = infile.toURI().toURL();
+		inputData = inputurl.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		this.xpaths = xpaths
+	}
+
+	public boolean process() {
+		try {
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+				switch (event) {
+					case XMLStreamConstants.START_ELEMENT:
+						localname = parser.getLocalName();
+						currentXPath += localname+"/"
+						processStartElement();
+						break;
+					case XMLStreamConstants.CHARACTERS:
+						processCharacters();
+						break;
+					case XMLStreamConstants.END_ELEMENT:
+						localname = parser.getLocalName();
+						processEndElement();
+						currentXPath = currentXPath.substring(0, currentXPath.length() - localname.length() -1)
+						break;
+
+				}
+			}
+		} catch(Exception e) {
+			println("Error while parsing file "+inputurl);
+			println("Location "+parser.getLocation());
+			org.txm.utils.logger.Log.printStackTrace(e);
+			parser.close();
+			return false;
+		}
+
+		if (parser !=null) parser.close();
+		return true;
+	}
+
+	protected void processStartElement() {
+		String localname = parser.getLocalName();
+		if (debug) println "start element $currentXPath"
+		if (doTokenize) {
+			if (debug) println "Found text element $currentXPath"
+			tokenizeCurrentText();
+		} else {
+			if (xpaths.contains(currentXPath)) {
+				doTokenize = true;
+				str = "";
+			}
+		}
+	}
+
+	protected void processEndElement() {
+		if (xpaths.contains(currentXPath)) {
+			tokenizeCurrentText()
+			doTokenize = false;
+			if (debug) println "Found text element: stop tokenizing"
+		}
+	}
+
+	protected void processCharacters() {
+		if (doTokenize) {
+			str += parser.getText();
+		}
+	}
+
+	int nsegments = 0;
+	protected tokenizeCurrentText() {
+		if (str.length() == 0) return;
+
+		segments << str
+		nsegments++;
+		str = "" // continue tokenizing
+	}
+
+	/**
+	 * Best tokenizer ever.
+	 * Extends this function
+	 * 
+	 * @param str
+	 * @return
+	 */
+	protected List<CharSequence> tokenize(String str) {
+		return str.tokenize();
+	}
+
+	public static void main(String[] args) {
+		File inputXMLFile = new File("/home/mdecorde/xml/comere/cmrclavardage/cmr-getalp_org-actu-tei-v1.xml");
+		def firstPass = new XMLStaxTokenizerAdapter2(inputXMLFile, ["/TEI/text/body/div/post/p/"]);
+
+		println "FIRST PASS"
+		firstPass.process()
+		println firstPass.getSegments().size()
+
+		println "TOKENIZING..."
+		StringBuffer buffer = new StringBuffer();
+		for(def segment : firstPass.getSegments()) {
+			buffer << segment.replaceAll("\n", " ") + "\n"
+		}
+		new File("/home/mdecorde/Bureau/test1.txt").withWriter {writer -> writer.println(buffer)}
+
+		SxPipe sxpipe = new SxPipe()
+		sxpipe.start()
+		sxpipe.processText(buffer.toString())
+		sxpipe.stop()
+
+		new File("/home/mdecorde/Bureau/test.txt").withWriter {writer -> writer.println(sxpipe.getResult())}
+		def tokenizedSegments = sxpipe.getResultSegments()
+		println "tokenizedSegments size "+tokenizedSegments.size()
+		//		for(def segment : firstPass.getSegments()) {
+		//			tokenizedSegments << segment.tokenize()
+		//		}
+
+		//		println "SECOND PASS"
+		//		def secondPass = new XMLStaxTokenizerAdapter(inputXMLFile, ["/TEI/text/body/div/post/p/"], tokenizedSegments);
+		//		secondPass.process(new File("/home/mdecorde/xml/comere/cmrclavardage/tmp.xml"))
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ConcordancesExport.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ConcordancesExport.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ConcordancesExport.groovy	(revision 728)
@@ -0,0 +1,156 @@
+/**
+ * Main.
+ *
+ * @param args the args
+ */
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2017-12-13 14:23:35 +0100 (mer., 13 dÃ©c. 2017) $
+// $LastChangedRevision: 3485 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.export
+
+// import the packages containing the functions we are going to use
+import org.txm.Toolbox
+import org.txm.searchengine.cqp.corpus.*
+import org.txm.searchengine.cqp.corpus.query.*
+import org.txm.functions.concordances.*
+import org.txm.functions.concordances.comparators.*
+import org.txm.functions.ReferencePattern
+
+// TODO: Auto-generated Javadoc
+/* (non-Javadoc)
+ * @see groovy.lang.Script#run()
+ */
+def manualInit = false
+if (!org.txm.Toolbox.isInitialized())
+{
+	manualInit = true
+	org.txm.Toolbox.initialize(new File("~/TXM/install.prefs"))
+}
+
+// get the BFM corpus
+def discours = CorpusManager.getCorpusManager().getCorpus("VOEUX")
+
+// get some properties
+def pos = discours.getProperty("frpos")
+println "pos: "+pos
+def id = discours.getProperty("id")
+println "id: "+id
+def word = discours.getProperty("word")
+println "word: "+word
+def text = discours.getStructuralUnit("text")
+println "text: "+text
+def text_id = text.getProperty("id")
+println "text_id: "+text_id
+
+// create a query. Edit the query here
+def querys = javax.swing.JOptionPane.showInputDialog(null, "query ")
+if (querys == null)
+	return
+def query = new Query(Query.fixQuery(querys))
+
+println "Compute concordance "
+def start = System.currentTimeMillis()
+
+// define the references pattern for each concordance line
+def referencePattern = new ReferencePattern()
+referencePattern.addProperty(text_id)
+referencePattern.addProperty(pos)
+referencePattern.addProperty(id)
+
+def sortReferencePattern = new ReferencePattern()
+sortReferencePattern.addProperty(text_id)
+sortReferencePattern.addProperty(pos)
+sortReferencePattern.addProperty(id)
+
+// compute the concordance with contexts of 15 words on each side of the keyword
+def concordance = new Concordance(discours, query, word, [word, pos], referencePattern, sortReferencePattern, 10, 10)
+concordance.computeConcordance()
+// get a builtin sort function
+def comparator = new LexicographicKeywordComparator()
+comparator.initialize(discours)
+
+// sort the concordance
+//concordance.sort(comparator)
+
+println "done "+(System.currentTimeMillis()-start)
+
+def writer = new FileWriter("ExportConcordanceBFM3TT.csv")
+
+println "write lines"
+start = System.currentTimeMillis()
+
+// define which occurrence properties will be displayed
+concordance.setViewProperties([word])
+
+for (int i = 0 ; i < concordance.getNLines() ; i += 1000)
+{
+	List<Line> lines
+	if (i+1000 > concordance.getNLines())
+		lines = concordance.getLines(i, concordance.getNLines()-1)
+	else
+		lines = concordance.getLines(i, i+1000)
+		
+	// println "lines: from "+i
+	for (Line l : lines)
+	{
+		/*
+		 A : rÃ©fÃ©rence (nom de texte + page)
+		 B : contexte gauche (10 mots)
+		 C : pivot (cf. la remarque sur "ce que")
+		 D : pos du pivot
+		 E : colonne vide pour les commentaires
+		 F : contexte droit (10 mots)
+		 G : identifiant de l'occurrence (pour injecter les corrections aprÃ¨s)
+		 */
+		
+		String ntext = l.getViewRef().getValue(text_id)
+		String lcontext = l.leftContextToString()
+		String pivot = l.keywordToString()
+		String rien = ""
+		String rcontext = l.rightContextToString()
+		String ids = l.getViewRef().getValue(id)
+		
+		String poss = ""
+		for(String s : l.getKeywordsViewProperties().get(pos))
+		{
+			poss += s+" "
+		}
+		
+		//println l.getKeywordsViewProperties().get(pos)
+		writer.write(ntext+"\t"+lcontext+"\t"+pivot+"\t"+poss+"\t"+rien+"\t"+rcontext+"\t"+ids+"\n")
+	}
+	writer.flush()
+}
+writer.close()
+
+println "done "+(System.currentTimeMillis()-start)+" results"
+
+println("Concordance "+query.getQueryString()+" saved in file "+new File("ExportConcordanceBFM3TT.csv").getAbsolutePath())
+
+if(manualInit)
+	org.txm.Toolbox.shutdown()
+
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/CooccurrencesFilter.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/CooccurrencesFilter.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/CooccurrencesFilter.groovy	(revision 728)
@@ -0,0 +1,56 @@
+package org.txm.export
+
+// we import the packages containing the functions we are going to use
+import org.txm.Toolbox
+import org.txm.searchengine.cqp.corpus.*
+import org.txm.searchengine.cqp.corpus.query.*
+import org.txm.functions.cooccurrences.*
+
+//////////// PARAMETERS ////////////
+def corpus = CorpusManager.getCorpusManager().getCorpus("VOEUX")
+
+def word = corpus.getProperty("word")
+def pos = corpus.getProperty("frpos")
+def viewprops = [word, pos]
+
+def query = new Query(Query.fixQuery("je"))
+def PROPSVALUETOKEEP = "V.+"
+def PROPNUMBER = 1;
+
+def limit = corpus.getStructuralUnit("s") // contexts by <s>
+def includeXpivot = false; // used only if limit != null
+//def limit = null // contexts by word 
+def minleft = 1 // min = 1
+def maxleft = 20 // min = 1
+def minright = 1 // min = 1
+def maxright = 20 // min = 1
+
+def minf = 0
+def mincof = 0
+def minscore = 0
+
+def buildLTWithOnlyCooccurrents = false
+
+//////////// END OF PARAMETERS ////////////
+
+println "computing cooc lines..."
+long time = System.currentTimeMillis()
+def cooccurrence = new Cooccurrence(corpus, query, viewprops, limit, maxleft, minleft, minleft, maxright, minf,mincof, minscore, includeXpivot, buildLTWithOnlyCooccurrents)
+cooccurrence.process();
+println("Compute time : "+(System.currentTimeMillis()-time)+" ms")
+
+println "filtering lines..."
+def lines = cooccurrence.getLines()
+for(int i = 0 ; i < lines.size(); i++)
+{
+	def line = lines.get(i)
+	if( !line.props.get(PROPNUMBER).matches(PROPSVALUETOKEEP))
+	{
+		lines.remove(i--)
+	}	
+}
+
+println "writing result..."
+def file = new File("cooc.txt")
+cooccurrence.toTxt(file, "UTF-8")
+println "printed cooccurrents in "+file.getAbsolutePath()
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/exportCA.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/exportCA.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/exportCA.groovy	(revision 728)
@@ -0,0 +1,29 @@
+package org.txm.export
+import org.txm.Toolbox
+import org.txm.searchengine.cqp.corpus.*
+import org.txm.searchengine.cqp.corpus.query.*
+import org.txm.stat.data.LexicalTable;
+import org.txm.functions.ca.*
+
+String moncorpus = "VOEUX"
+String mapartition = "texts"
+
+
+def corpus = CorpusManager.getCorpusManager().getCorpus(moncorpus) // mettre le nom du corpus en Majuscules ici
+def partition = corpus.getPartition(mapartition);
+
+for(Object o : partition.getResults())
+{
+	if(o instanceof CA)
+	{
+		CA ca = ((CA)o);
+		File colinfosfile = new File(ca.getName()+"_colinfosfile.txt");
+		File rowinfosfile = new File(ca.getName()+"_rowinfosfile.txt");
+	
+		
+		ca.exportColInfos(colinfosfile, "UTF-8", "\t", "")
+		ca.exportRowInfos(rowinfosfile, "UTF-8", "\t", "")
+		
+		println CA.getName()+" exported in : "+rowinfosfile.getAbsolutePath()+" and "+colinfosfile.getAbsolutePath()
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ParaConc.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ParaConc.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ParaConc.groovy	(revision 728)
@@ -0,0 +1,135 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2011-09-27 16:44:37 +0200 (mar., 27 sept. 2011) $
+// $LastChangedRevision: 2008 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.export
+
+import org.txm.Toolbox
+import org.txm.searchengine.cqp.corpus.*
+import org.txm.searchengine.cqp.corpus.query.*
+import org.txm.functions.concordances.*
+import org.txm.functions.concordances.comparators.*
+import org.txm.functions.ReferencePattern
+
+////// PARAMETERS //////
+
+def output = "nomfichier"
+
+def tgtCorpusName = "BLLATLAT"
+def srcCorpusName = "BLLATFRO"
+
+def tgtWords = "sum|ego" // use to highlight lat words
+def srcWords = "je|j'" // use to highlight fro words
+
+def tgtQuery = "<seg> []* \""+tgtWords+"\" []* </seg> :"+srcCorpusName+" \""+srcWords+"\"" // default lat query
+def srcQuery = "<seg> []* \""+srcWords+"\" []* </seg> :"+tgtCorpusName+" \""+tgtWords+"\"" // default fro query
+
+println tgtCorpusName+": "+tgtQuery
+println srcCorpusName+": "+srcQuery
+
+new File(output).withWriter("UTF-8"){writer->
+//// LAT CONCORDANCE ////
+def tgtCorpus = CorpusManager.getCorpusManager().getCorpus(tgtCorpusName)
+def text_id = tgtCorpus.getStructuralUnit("text").getProperty("id")
+def seg_id = tgtCorpus.getStructuralUnit("seg").getProperty("id")
+def word = tgtCorpus.getProperty("word")
+def referencePattern = new ReferencePattern()
+//referencePattern.addProperty(text_id)
+referencePattern.addProperty(seg_id)
+def tgtConcordance = new Concordance(tgtCorpus, new Query(tgtQuery), word, [word], referencePattern, referencePattern, 0, 0)
+tgtConcordance.computeConcordance()
+
+//// LAT CONCORDANCE ////
+def srcCorpus = CorpusManager.getCorpusManager().getCorpus(srcCorpusName)
+text_id = srcCorpus.getStructuralUnit("text").getProperty("id")
+seg_id = srcCorpus.getStructuralUnit("seg").getProperty("id")
+word = srcCorpus.getProperty("word")
+referencePattern = new ReferencePattern()
+//referencePattern.addProperty(text_id)
+referencePattern.addProperty(seg_id)
+def srcConcordance = new Concordance(srcCorpus, new Query(srcQuery), word, [word], referencePattern, referencePattern, 0, 0)
+srcConcordance.computeConcordance()
+//// MERGE CONCORDANCE RESULT ////
+HashSet<String> allKeys = new HashSet<String>()
+HashMap<String, Line> srcLines = [:]
+HashMap<String, Line> tgtLines = [:]
+
+println "nb tgt result: "+tgtConcordance.getNLines()
+for(Line line : tgtConcordance.getLines(0, tgtConcordance.getNLines()))
+{
+	allKeys.add(line.getViewRef().toString())
+	tgtLines.put(line.getViewRef().toString(), line)
+}
+
+println "nb src result: "+srcConcordance.getNLines()
+for(Line line : srcConcordance.getLines(0, srcConcordance.getNLines()))
+{
+	allKeys.add(line.getViewRef().toString())
+	srcLines.put(line.getViewRef().toString(), line)
+}
+println "src seg: "+srcLines.keySet()
+println "tgt seg: "+tgtLines.keySet()
+println "nb segments: "+allKeys.size()
+
+writer.println "segment\tsource\ttarget"
+for(Line line : srcConcordance.getLines(0, srcConcordance.getNLines()))
+{
+	String key = line.getViewRef().toString();
+	def tgtLine = tgtLines.get(key)
+	String srcString = line.keywordToString();
+	String tgtString = "";
+	if(tgtLine != null)	{
+		tgtString = tgtLine.keywordToString();
+		tgtLines.remove(key)
+		}else
+	{
+		key = key+"*"
+	}
+	srcString = srcString.replaceAll("("+srcWords+")", "*\$1*");
+	tgtString = tgtString.replaceAll("("+tgtWords+")", "*\$1*");
+	writer.println key+"\t"+srcString+"\t"+tgtString
+}
+
+println "\n"
+for(String key : tgtLines.keySet()) // process remaining tgt lines
+{
+	def srcline = srcLines.get(key)
+	def tgtline = tgtLines.get(key)
+	String srcString = "";
+	String tgtString = tgtLines.keywordToString();
+	if(srcline == null){
+		srcString = srcline.keywordToString();
+	}else
+	{
+		key = key+"*"
+	}
+	srcString = srcString.replaceAll("("+srcWords+")", "*\$1*");
+	tgtString = tgtString.replaceAll("("+tgtWords+")", "*\$1*");
+	writer.println key+"\t"+srcString+"\t"+tgtString
+}
+}
+
+println "Done : written in "+new File(output).getAbsolutePath();
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>export scripts from TXM's format to xxxx's format</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ExportCAH.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ExportCAH.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ExportCAH.groovy	(revision 728)
@@ -0,0 +1,34 @@
+package org.txm.export
+
+import org.txm.rcpapplication.views.*
+import org.txm.functions.classification.CAH
+import org.txm.stat.engine.r.*
+// uncomment this
+import org.eclipse.jface.viewers.*
+
+// Select the CAH result in the CorporaView and run this script
+
+// PARAMETER: the output file
+def outfile = new File("/home/mdecorde/Bureau/CAH.txt")
+
+// get selected object from Corpora view
+def obj = null;
+monitor.syncExec(new Runnable() {
+	@Override
+	public void run() {
+		def corporaview = CorporaView.getInstance()
+		def tree = corporaview.getTreeViewer()
+		// uncomment these 2 lines
+		def sel = tree.getSelection()
+		obj = sel.getFirstElement()
+		}
+	});
+println("Selected object: "+obj)
+
+if (obj != null && obj instanceof CAH) {
+	def rw = RWorkspace.getRWorkspaceInstance()
+	rw.eval("sink(file=\"" + outfile.getAbsolutePath().replace("\\", "\\\\")+"\")")
+	rw.eval("print("+((CAH)obj).getSymbol()+")")
+	rw.eval("sink()")
+	println("CAH saved in file: "+outfile)
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/MultipleConcordances.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/MultipleConcordances.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/MultipleConcordances.groovy	(revision 728)
@@ -0,0 +1,105 @@
+/**
+ * Main.
+ *
+ * @param args the args
+ */
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+// 
+// 
+// 
+// $LastChangedDate: 2011-05-09 14:58:28 +0200 (lun., 09 mai 2011) $
+// $LastChangedRevision: 1839 $
+// $LastChangedBy: mdecorde $ 
+//
+
+package org.txm.export
+
+// import the packages containing the functions we are going to use
+import org.txm.Toolbox
+import org.txm.searchengine.cqp.corpus.*
+import org.txm.searchengine.cqp.corpus.query.*
+import org.txm.functions.concordances.*
+import org.txm.functions.concordances.comparators.*
+import org.txm.functions.ReferencePattern
+
+//PARAMETRES
+def corpusname = "VOEUX"
+def requetes = ["je", "tu", "vous"]
+// get the DISCOURS corpus
+// TODO: Auto-generated Javadoc
+
+/* (non-Javadoc)
+ * @see groovy.lang.Script#run()
+ */
+def discours = CorpusManager.getCorpusManager().getCorpus(corpusname)
+
+// get some properties
+def pos = discours.getProperty("pos")
+def word = discours.getProperty("word")
+def text = discours.getStructuralUnit("text")
+
+//get structure text
+def text_id = text.getProperty("id")
+// and define the references pattern for each concordance line
+def referencePattern = new ReferencePattern().addProperty(text_id)
+
+// get a builtin sort function
+def comparator = new LexicographicLeftContextComparator()
+comparator.initialize(discours)
+
+def noconc = 0
+for(String querystring : requetes)
+{
+	println "Computing concordance of $querystring ..."
+	// create a query. Here the concordance keyword will be the French word "Je" (the "I" pronoun in English)
+	def query = new Query(Query.fixQuery(querystring))
+	
+	// compute the concordance with contexts of 15 words on each side of the keyword
+	def concordance = new Concordance(discours, query, word, [word, pos], referencePattern, 15, 15)
+	concordance.computeConcordance()
+	// sort the concordance
+	//concordance.sort(comparator)
+	
+	// define which occurrence properties will be displayed
+	concordance.setViewProperties([word])
+	
+	// write all the concordance in a text file
+	def file = new File("conc"+(noconc++)+".txt")
+	concordance.toTxt(file, "UTF-8")
+	println("Concordance $querystring written in file: "+file.getAbsolutePath())
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/conll2009/ToCoNLL2009.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/conll2009/ToCoNLL2009.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/conll2009/ToCoNLL2009.groovy	(revision 728)
@@ -0,0 +1,115 @@
+package org.txm.export.conll2009
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.Arrays;
+import java.util.List;
+
+import org.txm.searchengine.cqp.CqpDataProxy;
+import org.txm.searchengine.cqp.corpus.Corpus
+import org.txm.searchengine.cqp.corpus.*
+import org.txm.searchengine.cqp.corpus.query.Query
+
+class ToCoNLL2009 {
+
+	boolean debug = true
+	/**
+	 * To CoNLL2009.
+	 *
+	 * @param outfile the outfile, where is result is saved
+	 * @param corpus the corpus or sub-corpus to export
+	 * @param sentenceUnit the StructuralUnitProperty that identify a sentence
+	 * @param word the word property
+	 * @param lemme the lemme property
+	 * @param pos the pos property
+	 * @param encoding the encoding of the outfile
+	 * @return true, if successful
+	 */
+	public boolean process(File outfile, Corpus corpus, StructuralUnitProperty sentenceUnit, Property word, Property lemme, Property pos, String encoding)
+	{
+		def matches = corpus.query(new Query("<s> []+ </s>"), "TMPEXPORTCONNL", false).getMatches()
+		if (debug) println matches.size()
+		int npositions = 0;
+		for (def match : matches) npositions += match.length +1
+		if (debug) println "npositions= $npositions"
+
+		int[] positions = new int[npositions+1]
+		int i = 0;
+		for (def match : matches) {
+			for (int p : match.getRange())
+				positions[i++] = p
+		}
+
+		List<String> words = CorpusManager.getCorpusManager().getCqiClient().cpos2Str(word.getQualifiedName(), positions);
+
+		List<String> lemmes = null;
+		if (lemme != null) {
+			lemmes = CorpusManager.getCorpusManager().getCqiClient().cpos2Str(lemme.getQualifiedName(), positions);
+		}
+
+		List<String> poss = null;
+		if (pos != null) {
+			poss =  CorpusManager.getCorpusManager().getCqiClient().cpos2Str(pos.getQualifiedName(), positions);
+		}
+
+		Writer writer = new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8"); //$NON-NLS-1$;
+
+		String lemmestr;
+		String posstr;
+		int id = 0;
+		int iposition = 0;
+		for (def match : matches) {
+			id = 0 // first position in sentence
+			for (i = match.start ; i < match.end ; i++) { // loop n times, n = mathc length
+
+				if (lemme != null)
+					lemmestr = lemmes.get(iposition);
+				else
+					lemmestr = "_";
+
+				if (pos != null)
+					posstr = poss.get(iposition);
+				else
+					posstr = "_";
+
+				//print(""+id+"\t"+words.get(iposition)+"\t"+lemmestr+"\t_\t"+posstr+"\t_\t_\t_\t_\t_\t_\t_\t_\t_\t_\n");
+				writer.write(""+id+"\t"+words.get(iposition)+"\t"+lemmestr+"\t_\t"+posstr+"\t_\t_\t_\t_\t_\t_\t_\t_\t_\t_\n");
+
+				id++; // next word
+				iposition++ // nextposition
+			}
+		}
+		writer.flush();
+		writer.close();
+
+		return true;
+	}
+
+	public static void main(String[] args) {
+		Corpus corpus = null
+		File outfile = new File("/home/mdecorde/Bureau/conn_export.tsv")
+		String encoding = "UTF-8"
+
+		String sentenceProperty = "s_id"
+		String posProperty = "frpos"
+		String lemmaProperty = "frlemma"
+
+
+		def split = sentenceProperty.split("_", 2)
+		StructuralUnitProperty s = null;//corpus.getStructuralUnit(split[0]).getProperty(split[1])
+		Property word = null;//corpus.getProperty("word")
+		Property lemma = null;//corpus.getProperty(lemmaProperty)
+		Property pos = null;//corpus.getProperty(posProperty)
+
+		//		if (s == null) { println "Error sentence property: $sentenceProperty"; return}
+		//		if (word == null) { println "Error no word property"; return}
+		//		if (pos == null) { println "Error pos property: $posProperty"; return}
+		//		if (lemma == null) { println "Error lemma property: $lemmaProperty"; return}
+
+
+		ToCoNLL2009 processor = new ToCoNLL2009()
+		processor.process(outfile, corpus, s, word, lemma, pos, encoding)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ExportLT.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ExportLT.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ExportLT.groovy	(revision 728)
@@ -0,0 +1,44 @@
+package org.txm.export
+import org.txm.Toolbox
+import org.txm.searchengine.cqp.corpus.*
+import org.txm.searchengine.cqp.corpus.query.*
+import org.txm.stat.data.LexicalTable;
+import org.txm.functions.cooccurrences.*
+
+
+def corpus = CorpusManager.getCorpusManager().getCorpus("VOEUX") // mettre le nom du corpus en Majuscules ici
+def partition = corpus.getPartition("VOEUX_text_id");
+
+int NTable = 1;
+for (Object o : partition.getResults()) {
+	if (o instanceof LexicalTable) {
+		File outfile = new File("lt${NTable}.txt")
+		println "export LT of $partition in "+outfile.getAbsolutePath();
+		NTable++;
+		outfile.withWriter{writer->
+		def lt = (LexicalTable)o;
+		println "found lexical table: "+lt.getName()
+		println "n col: "+lt.getNColumns()
+		println "n line: "+lt.getNRows()
+		def cols = lt.getColNames().asStringsArray();
+		String strline = "unit\t";
+		for (int i = 0 ; i < cols.length ; i++) {
+			strline += cols[i]+"\t"
+			
+		}
+		writer.println(strline.substring(0, strline.length()-1));
+		
+		def rows = lt.getRowNames().asStringsArray();
+		for (int i = 0 ; i < rows.length ; i++) {
+			strline = "";
+			strline += rows[i]+"\t";
+			def line = lt.getRow(i).asIntArray();
+			for (int j = 0 ; j < line.length ; j++)
+				strline += line[j]+"\t";
+			writer.println(strline.substring(0, strline.length()-1));
+		}
+		
+		writer.close();
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ts/PunctInject.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ts/PunctInject.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ts/PunctInject.groovy	(revision 728)
@@ -0,0 +1,349 @@
+// Script to restore punctuation etc. to results of TS query.
+// Inputs:
+// --- Tiger-XML Document node
+// --- Java array:
+// --- --- String [index][type] where:
+// --- --- --- type == 0 gives the xml:id
+// --- --- --- type == 1 gives the word form
+// Process:
+// --- Injects punctuation.
+// Returns:
+// --- Tiger-XML Document node.
+package org.txm.export.ts;
+
+import javax.xml.parsers.DocumentBuilderFactory
+import org.txm.searchengine.cqp.CqpDataProxy;
+import org.txm.searchengine.cqp.corpus.Corpus
+import org.txm.searchengine.cqp.corpus.CorpusManager;
+import org.txm.searchengine.cqp.corpus.QueryResult;
+import org.txm.searchengine.cqp.corpus.query.Query
+
+public class PunctInject
+{
+	public process (def tigerXml, def txmIdWordTable) {
+
+		def allTs = toList(tigerXml.getElementsByTagName('t'))
+
+		def tAttrs = getTAttrNames(allTs[0])
+
+		def tNodeIdPrefix = allTs[0].getAttribute('id').tokenize('#').first()
+
+		def addedWordIds = []
+
+		int tIx = 0
+
+		while (txmIdWordTable) {
+
+			def word = txmIdWordTable.remove(0)
+
+			if (tIx == allTs.size()) {
+				// End of TS file, but still words left in the BFM file.
+				addTNode(word, allTs.last(), tAttrs, tNodeIdPrefix, 'append')
+			}
+
+			else {
+
+				def tNode = allTs[tIx]
+
+				def tId = getTNodeId(tNode)
+
+				if (tId == word[0] && tNode.getAttribute('word') == word[1]) {
+
+					// alles gut
+
+					tIx += 1
+
+				}
+
+				else if (tId == word[0]) {
+
+					println("Mismatched Ids! ($tId)")
+					tIx += 1
+				}
+
+				else if (['#', '*'].contains(tNode.getAttribute('word')) ) {
+
+					// SRCMF duplicata; try comparing word against the next tNode next time
+					// around.
+
+					txmIdWordTable.add(0, word)
+
+					tIx += 1
+
+				}
+				
+				// Check that the SRCMF corpus doesn't have a bug in it...
+
+				else if ( !(word[1] =~ /[\,\.\?\!\:\;\(\)\[\]\{\}]/)
+				&& (allTs[0..tIx - 1].find{
+					it.getAttribute('id') == "$tNodeIdPrefix#$tId"
+				})) {
+
+					println "Warning: word ${tNode.getAttribute('word')}, id $tId appears twice in corpus!"
+
+					txmIdWordTable.add(0, word)
+
+					tIx += 1
+
+				}
+				
+				// Check that there's not an extra word in the SRCMF corpus (rare, usu. a tokenisation change)
+				
+				else if ( !(word[1] =~ /[\,\.\?\!\:\;\(\)\[\]\{\}]/)
+				&& (allTs[tIx..-1].find{
+					it.getAttribute('id') == "$tNodeIdPrefix#${word[0]}"
+				})) {
+			
+					println "Warning: word ${tNode.getAttribute('word')}, id $tId does not appear in BFM!"
+
+					txmIdWordTable.add(0, word)
+					
+					tIx += 1
+				}
+
+				else if (addedWordIds.contains(tId)) {
+
+					println "Warning: word ${tNode.getAttribute('word')}, id ${tId} out of sequence in SRCMF corpus!"
+
+					txmIdWordTable.add(0, word)
+
+					tIx += 1
+
+				}
+
+				else {
+
+					// Insert word.  In the first instance, it will have the same parent as
+					// the tNode before which it's being inserted.
+
+					addTNode(word, allTs[tIx], tAttrs, tNodeIdPrefix, 'before')
+
+					addedWordIds.add(word[0])
+
+				}
+
+			}
+
+		}
+
+		// Second phase: move punctuation into previous sentence,
+		// dependent on sequence.
+
+		def allTerminalses = toList(tigerXml.getElementsByTagName('terminals'))
+
+		for (def i = 1 ; i < allTerminalses.size() ; i++) {
+
+			def ts = toList(allTerminalses[i].getElementsByTagName('t'))
+
+			def startPunc = true
+
+			def puncStack = []
+
+			while (ts && startPunc) {
+
+				if ((ts[0].getAttribute('word') =~ /[A-zÃ€-Ã¿0-9]/).size() == 0) {
+
+					puncStack.add(ts.remove(0))
+
+				}
+
+				else {
+
+					startPunc = false
+
+				}
+
+			}
+
+			// Now, treat the punctuation stack at the beginning of the sentence
+
+			if ( puncStack ) {
+
+				int moveLeft = 0
+
+				// First, identify LAST instance of sentence-final punctuation.
+
+				def puncString = puncStack.collect{ it.getAttribute('word')[0] }.join('')
+
+				def matches = puncString =~ /[\.\,\;\:\!\?\)\]\}Â»â€�â€™]/
+
+				if (matches.size() > 0) {
+
+					moveLeft = puncString.lastIndexOf(matches[-1]) + 1
+
+				}
+
+				// Second, split pairs of straight quotes
+
+				matches = puncString =~ /(""|'')/ //"
+
+				if (matches.size() > 0) {
+
+					moveLeft = [moveLeft, puncString.lastIndexOf(matches[-1][0]) + 1].max()
+				}
+
+				// Now, move moveLeft punctuation nodes to the end of the prev. sentence
+
+				ts = toList(allTerminalses[i].getElementsByTagName('t'))
+
+				for (def j = 0 ; j < moveLeft ; j++ ) {
+
+					allTerminalses[i - 1].appendChild(ts[j])
+
+				}
+
+			}
+		}
+		return tigerXml
+
+	}
+
+	private addTNode(word, tNode, tAttrs, tNodeIdPrefix, where) {
+
+		def newTNode = tNode.getOwnerDocument().createElement('t')
+
+		for (def anAttr : tAttrs) {
+
+			if (anAttr == 'id') {
+
+				newTNode.setAttribute('id', "${tNodeIdPrefix}#${word[0]}")
+
+			}
+
+			else if (anAttr == 'word') {
+
+				newTNode.setAttribute('word', word[1])
+
+			}
+
+			else {
+
+				newTNode.setAttribute(anAttr, '--')
+
+			}
+
+		}
+
+		if (where == 'before') {
+
+			tNode.getParentNode().insertBefore(newTNode, tNode)
+
+		}
+
+		else if (where == 'append') {
+
+			tNode.getParentNode().appendChild(newTNode)
+
+		}
+
+		else {
+
+			throw new IllegalArgumentException('Bad before value')
+
+		}
+
+	}
+
+	public getTAttrNames(tNode) {
+
+		def nodeMap = tNode.attributes
+
+		def nameList = []
+
+		for ( def i = 0 ; i < nodeMap.getLength() ; i++ ) {
+			nameList.add( nodeMap.item(i).nodeName )
+		}
+
+		return nameList
+
+	}
+
+	public getTNodeId(tNode) {
+
+		return tNode.getAttribute('id').tokenize('#').last()
+
+	}
+
+	public def toList(def iterable) {
+		return iterable.findAll {true};
+	}
+
+	public static def getWords(String corpusname, String query)
+	{
+		CorpusManager cm = CorpusManager.getCorpusManager();
+		Corpus corpus = cm.getCorpus(corpusname);
+		def word_property = corpus.getProperty("word")
+		def id_property = corpus.getProperty("id")
+
+		def wordCache = cm.getCorpusProxies(corpus).get(word_property);
+		def idCache = cm.getCorpusProxies(corpus).get(id_property);
+
+		def positions = new int[corpus.getSize()];
+		for(int i = 0 ; i< corpus.getSize() ; i++)
+			positions[i] = i;
+		def word_values = wordCache.getData(positions)
+		def id_values = idCache.getData(positions)
+		ArrayList<String[]> words = new ArrayList<String[]>(corpus.getSize());
+		for(int p : positions)
+		{
+			if(id_values[p].startsWith("w"))
+			{
+				words.add(new String[2])
+				words[p][0] = id_values[p]
+				words[p][1] = word_values[p]
+			}
+		}
+
+		return words;
+	}
+
+	public static void main(String[] args)
+	{
+		def words = [
+			["w203_1", "Dominedeu"],
+			["w203_2", "devemps"],
+			["w203_3", "lauder"],
+			["w203_4", "et"],
+			["w203_5", "a"],
+			["w203_6", "sus"],
+			["w203_7", "sancz"],
+			["w203_8", "honor"],
+			["w203_9", "porter"],
+			["w203_10", "Â»"],
+			["w203_10.2", ")"],
+			["w203_10.3", '.'],
+			["w203_10.5", '"'],
+			["w203_10.7", '"'],
+			["w203_11", "in"],
+			["w203_12", "su'"],
+			["w203_13", "amor"],
+			["w203_14", "cantomps"],
+			["w203_15", "del"],
+			["w203_16", "Â·sanz"],
+			["w203_17", "quae"],
+			["w203_18", "por"],
+			["w203_19", "lui"],
+			["w203_20", "augrent"],
+			["w203_21", "granz"],
+			["w203_22", "aanz"],
+			["w203_23", "."],
+		];
+		File tigerXml = new File(args[0]);
+		def factory = DocumentBuilderFactory.newInstance()
+		factory.setXIncludeAware(true)
+		def builder = factory.newDocumentBuilder()
+		def THEDOM = builder.parse(tigerXml).documentElement
+
+		println THEDOM.getClass()
+
+		def NEWDOM = new PunctInject().process(THEDOM, words);
+
+		println NEWDOM
+
+		// File outfile = new File("outfile.xml")
+		// println outfile
+		//outfile.withWriter("iso-8859-1"){writer ->
+		//writer.write(NEWDOM.toString())
+		// }
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ts/MatchInject.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ts/MatchInject.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ts/MatchInject.groovy	(revision 728)
@@ -0,0 +1,86 @@
+#! /usr/bin/groovy
+package org.txm.export.ts;
+
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+import groovy.util.slurpersupport.NodeChild
+
+/*
+ * The script takes the <matches/> elements from file "Tiger_match.xml"
+ * and inserts them at the end of the <s/> element bearing the same ID.
+ * Inputs: three file names 
+ * - TsInputName --- the TS file WITHOUT matches
+ * - MatchInputName --- the TS file containing only matches.
+ * - OutputFileName ---required output file.
+ * To pass these arguments from within an application, call script() directly.
+ */
+
+// Filename variables
+// def TsInputName = '/home/tomr/Documents/Work/lyon12/srcmf/groovy/MatchInject/ts_input.xml'
+// def MatchInputName = '/home/tomr/Documents/Work/lyon12/srcmf/groovy/MatchInject/match_input.xml'
+// def OutputFileName = '/home/tomr/Documents/Work/lyon12/srcmf/groovy/MatchInject/test.xml'
+
+// Main code: checks for correct number of arguments if run from cmd line.
+if (args && args.size() == 3) {
+    script(args[0], args[1], args[2])
+} else {
+    println '''Incorrect number of arguments: three strings required.
+
+USAGE:
+******
+groovy MatchInject.groovy TsInput.xml MatchInput.xml OutputFile.xml'''}
+
+def script(String tsInputName, String matchInputName, String outputFileName) {
+	script(new File(tsInputName), new File(matchInputName, new File(outputFileName)));
+}
+
+// The script.
+def script(File tsInputFile, File matchInputFile, File outputFile) {
+	//println "loading TsInput..."
+    def TsInput = new XmlSlurper().parse(tsInputFile)
+	//println "loading matchInputFile..."
+	System.setProperty("org.xml.sax.driver", "com.sun.org.apache.xerces.internal.parsers.SAXParser");
+	def xmlReader = XMLReaderFactory.createXMLReader();
+	xmlReader.setFeature('http://xml.org/sax/features/namespaces', false)
+    XmlSlurper mslurper = new XmlSlurper(xmlReader);
+	def MatchInput = mslurper.parse(matchInputFile)
+	//println "building OutputFile... size="+matchInputFile.length()
+	
+	def inputSentences = TsInput.'**'.findAll {it.name() == 's'};
+	def matcheSentences = MatchInput.'**'.findAll { it.name() == 's' }
+//	println "MATCHES"
+//	for(NodeChild match : matcheSentences) {
+//		//println match.getClass()
+//		match.namespacePrefix = ""
+//		match.namespaceMap = [:]
+//		//println match
+//	}
+	int count = 0;
+	//println("nb of input sentences: "+inputSentences.size());
+	
+    def markup = {
+		mkp.xmlDeclaration()
+		//mkp.declareNamespace("svg":"xmlns=\"http://www.w3.org/2000/svg\"")
+		
+        corpus(id:'TSOut') {
+            body {
+                inputSentences.each { sPath ->
+					//if (count++%200 == 0) println((100*count/inputSentences.size()))
+                    s(id:"${sPath.'@id'}") { 
+                        mkp.yield(sPath.graph)
+                        def sMatches = matcheSentences.find {
+                            it.'@id'.toString() == sPath.'@id'.toString()
+                        }
+						
+                        if (sMatches) {
+                            mkp.yield(sMatches.matches)
+                        }
+						//matcheSentences.removeAll(sMatches)
+                    }
+                }
+            }
+        }
+    }
+    def processor = new groovy.xml.StreamingMarkupBuilder().bind(markup)
+    outputFile.withWriter { it << groovy.xml.XmlUtil.serialize(processor)}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ts/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ts/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ts/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Contains scripts to build the TIGERSearch concordances</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ts/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ts/ConcordanceBlocks.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ts/ConcordanceBlocks.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/export/ts/ConcordanceBlocks.groovy	(revision 728)
@@ -0,0 +1,476 @@
+package org.txm.export.ts;
+
+import javax.xml.parsers.DocumentBuilderFactory
+
+class ConcordanceBlocks {
+	def codec = 'UTF-8'
+
+	int cx = 30;
+	def ntTypes = [];
+	def tTypes = [];
+	File xmlfile, outfile;
+
+	public boolean process(File xmlfile, File outfile, int cx, def ntTypes, def tTypes) {
+		this.cx = cx;
+		this.xmlfile = xmlfile;
+		this.outfile = outfile;
+		this.ntTypes = ntTypes;
+		this.tTypes = tTypes;
+
+		Writer writer = outfile.newPrintWriter(codec)
+
+		println 'Reading XML File'
+		def factory = DocumentBuilderFactory.newInstance()
+		factory.setXIncludeAware(true)
+		def builder = factory.newDocumentBuilder()
+		def records = builder.parse(xmlfile).documentElement
+		println 'done.'
+
+		println 'done.  Pre-treating file to combine results with the same pivot...'
+		records = matchCombine(records)
+		println 'done.'
+
+		println 'Calculating max. number of blocks...'
+		def nBlock = 0
+
+		def allMatches = toList(records.getElementsByTagName('match'))
+
+		for (def match : allMatches) {
+			nBlock = [
+				nBlock,
+				toList(match.getElementsByTagName('variable')).findAll{
+					it.getAttribute('name').startsWith('#block')
+				}.size()
+			].max()
+		}
+
+		println "done ( $nBlock )"
+
+		// Table headers
+		println 'Writing concordance...'
+
+		def header = ['sId', 'LeftCxOutsideSnt', 'LeftCxInsideSnt']
+
+		for (int i = nBlock ; i > 0 ; i--) {
+
+			header.add("${i}BlockBeforePivot")
+
+			for (int j = 0 ; j < [ntTypes.size(), tTypes.size()].max() ; j++) {
+
+				header.add("${i}BlockBeforePivotType${j+1}")
+
+			}
+		}
+
+		header.add('Pivot')
+
+		for (int j = 0 ; j < [ntTypes.size(), tTypes.size()].max() ; j++) {
+
+			header.add("PivotType${j+1}")
+
+		}
+
+		for (int i = 1 ; i <= nBlock ; i++) {
+
+			header.add("${i}BlockAfterPivot")
+
+			for (int j = 0 ; j < [ntTypes.size(), tTypes.size()].max() ; j++) {
+
+				header.add("${i}BlockAfterPivotType${j+1}")
+
+			}
+		}
+
+		header.addAll(['RightCxInsideSnt', 'RightCxOutsideSnt', 'Warnings'])
+
+		writer.write(header.join("\t")+"\n");
+
+		def allTerminals = toList(records.getElementsByTagName('t'))
+		int tenPercentile = 0
+
+		int i = 0;
+		for (def aMatchNode : allMatches) {
+			if ((int)(((float)++i / allMatches.size()) * 10) > tenPercentile)
+				println ""+(++tenPercentile * 10)+ ' percent complete...'
+
+			def (rowDict, inSntCxLengthLeft, inSntCxLengthRight) = match2CSVrow(aMatchNode, header);
+			
+			// Add out-of-sentence context
+			def sNode = aMatchNode.parentNode.parentNode; // sentence
+			def terminals = toList(sNode.getElementsByTagName('t'));
+			def firstTInS = terminals[0] // get first node of the sentence
+			def lastTInS = terminals[-1] // get last node of the sentence
+			def firstTInSIx = allTerminals.indexOf(firstTInS) // get its position in the text
+			def lastTInSIx = allTerminals.indexOf(lastTInS) // get its position in the text
+
+			// Left context
+			def lexs = []
+			int start = Math.max(firstTInSIx - cx + inSntCxLengthLeft, 0);
+			int end = firstTInSIx;
+			if(start < end)
+			for (def tNode : allTerminals.subList(start, end)){
+				lexs.add(tNode.getAttribute('word'))
+				if (toList(tNode.parentNode.getElementsByTagName('t'))[-1] == tNode)
+					lexs.add('/')
+			}
+			rowDict['LeftCxOutsideSnt'] = lexs.join(" ")
+
+			// Right context
+			lexs = []
+
+			start = lastTInSIx + 1;
+			end = Math.min(allTerminals.size(), lastTInSIx + cx - inSntCxLengthRight)
+
+			if(start < end) {
+				for (def tNode : allTerminals.subList(start, end)){
+					lexs.add(tNode.getAttribute('word'))
+					if (toList(tNode.parentNode.getElementsByTagName('t'))[-1] == tNode)
+						lexs.add('/')
+				}}
+			rowDict["RightCxOutsideSnt"] = lexs.join(" ")
+
+			// Right rowDict to CSV
+
+			//			CSVWriter.writerow(dict(zip([k for k in rowDict.iterkeys()], \
+			//        [ v.encode('utf-8') for v in rowDict.itervalues() ] )))
+
+			String line = "";
+			for (int ii = 0 ; ii < header.size() ; ii++){
+				String h = header.get(ii)
+				String val = rowDict.getAt(h);
+				if (val == null)
+					line += "--"
+				else
+					line += val
+				if (ii < header.size() -1)
+					line +="\t"
+			}
+			writer.write(line+"\n")
+			writer.flush()
+
+		}
+		writer.close();
+		return true;
+	}
+
+	private def match2CSVrow(def aMatchNode, def header) {
+		// Step 1: Build a LIST of DICTIONARIES to describe the variables:
+		// dict(name='varname_minus_the_hash'
+		//      parent='nt_nodes'
+		//      terminals='t_nodes in a list')
+		
+		def sNode = aMatchNode.parentNode.parentNode // get the sentence node
+
+		def tNodesInSentence = toList(sNode.getElementsByTagName('t')) // get all terminal nodes of the sentence
+
+		def varDetails = []
+
+		for ( def aVariable : aMatchNode.getElementsByTagName('variable')){
+			if ( aVariable.getAttribute('name') == '#pivot' ||
+			aVariable.getAttribute('name').startsWith('#block')) {
+				def varParent = idKey(sNode, aVariable.getAttribute('idref'))
+
+				varDetails.add([
+							'name' : aVariable.getAttribute('name').substring(1),
+							'parent': varParent,
+							'terminals': toList(getTNodes(varParent)),
+							'lexform': writeLexForm(varParent),
+						])
+
+				// Add types
+
+				for (int j = 0 ; j < [ntTypes.size(), tTypes.size()].max() ; j++) {
+
+					def a = ''
+
+					if (j < ntTypes.size() && varParent.getAttribute(ntTypes[0])
+					) {
+						a = varParent.getAttribute(ntTypes[j])
+					} else if (j < tTypes.size() && varParent.getAttribute(tTypes[0])
+					) {
+						a = varParent.getAttribute(tTypes[j])
+					}
+
+					varDetails[-1]["type${j+1}"] = a
+
+				}
+
+				// write min idx in sentence of terminal nodes used
+				varDetails[-1]['terminalsIx'] = varDetails[-1]['terminals'].collect{tNodesInSentence.indexOf(it)}
+			}
+		}
+
+		// Sort varDetails by the start ID of the word
+
+		varDetails =  varDetails.sort{it['terminalsIx'].min()}
+
+		def pivotBlockPosition = 0;
+		pivotBlockPosition = varDetails.findIndexOf{it['name'] == 'pivot'}
+
+		// Write the table
+		def rowDict = [:]
+		rowDict['sId'] = sNode.getAttribute('id')
+
+		// write the pivot
+		rowDict['Pivot'] = varDetails[pivotBlockPosition]['lexform']
+
+		for (int j = 0 ; j < [ntTypes.size(), tTypes.size()].max() ; j++) {
+
+			rowDict["PivotType${j+1}"] = varDetails[pivotBlockPosition]["type${j+1}"]
+		}
+
+		def startNextId = (varDetails[pivotBlockPosition]['terminalsIx']).min()
+		def endPrevId = (varDetails[pivotBlockPosition]['terminalsIx']).max()
+
+		// Write the Pre-pivot blocks
+
+		def i = 0
+
+		//println "rowDict: $rowDict"
+		if ( pivotBlockPosition > 0)	{
+			for ( int j = pivotBlockPosition -1 ; j >= 0 ; j--) {
+				
+				i++;
+				def block = varDetails.get(j)
+				//println "process block: $block"
+
+				rowDict["${i}BlockBeforePivot"] = block['lexform']
+
+				for ( int k = 0 ; k < [ntTypes.size(), tTypes.size()].max() ; k++ ) {
+					rowDict["${i}BlockBeforePivotType${k+1}"] = block["type${k+1}"]
+				}
+
+				// Add any intervening words to the right edge.
+
+				def rightEdge = (block['terminalsIx'].findAll{ it < startNextId }).max();
+				//println ""+block['terminalsIx']+"   rightEdge: $rightEdge"
+
+				for (int ix = rightEdge + 1 ; ix < startNextId ; ix++) // add word to reach the pivot
+				{
+					rowDict["${i}"+"BlockBeforePivot"] += ' {' + tNodesInSentence[ix].getAttribute('word') + '}';
+				}
+
+				startNextId = (block['terminalsIx']).min()
+			}
+		}
+		
+		// Write the in-sentence left context
+
+		def lexs = tNodesInSentence.subList(0, startNextId).collect {it.getAttribute('word')}
+		rowDict['LeftCxInsideSnt'] = lexs.join(" ")
+
+		def inSntCxLengthLeft = startNextId
+
+		// Write the Post-pivot blocks
+
+		i = 0
+		for (def block in varDetails.subList(pivotBlockPosition + 1, varDetails.size())){
+			i++
+			rowDict["${i}BlockAfterPivot"] = block['lexform']
+
+			for (int j = 0 ; j < [ntTypes.size(), tTypes.size()].max() ; j++) {
+				rowDict["${i}BlockAfterPivotType${j+1}"] = block["type${j+1}"]
+			}
+
+			// Add any intervening words to the left edge.
+			// Note that this isn't always possible, in particular
+			// if the preceding element is discontinuous.
+
+			def leftEdgeList = block['terminalsIx'].findAll{it > endPrevId }
+
+			if ( leftEdgeList.size() > 0) {
+				def leftEdge = leftEdgeList.min()
+				for (int ix = leftEdge - 1 ; ix > endPrevId ; ix--) {
+					rowDict["${i}BlockAfterPivot"] = '{' + tNodesInSentence[ix].getAttribute('word') + '} ' + rowDict["${i}BlockAfterPivot"]
+				}
+			}
+			else {
+				rowDict["${i}BlockAfterPivot"] = '{?} ' + rowDict["${i}BlockAfterPivot"]
+			}
+			endPrevId = block['terminalsIx'].max()
+		}
+
+		// Write the in-sentence right-context
+
+		lexs = tNodesInSentence.subList(endPrevId + 1, tNodesInSentence.size()).collect {it.getAttribute('word')}
+		rowDict['RightCxInsideSnt'] = lexs.join(" ")
+
+		def inSntCxLengthRight = tNodesInSentence.size() - endPrevId
+
+		return [rowDict, inSntCxLengthLeft, inSntCxLengthRight]
+		return null;
+	}
+
+	public def toList(def iterable) {
+		return iterable.findAll {true};
+	}
+
+	/**
+	 * return the children of sNode with the id anId 
+	 */
+	public def idKey(def sNode, String anId) {
+		return sNode.getElementsByTagName("*").find{it.getAttribute("id") == anId}
+	}
+
+	/**
+	 * return a list of all terminal nodes of the node.
+	 * if the node is a non-terminal, iterate over children and so on
+	 */
+	def getTNodes(theNode) {
+		def terminals = []
+		def unprocessed = [theNode]
+
+		while( unprocessed.size() > 0) {
+			def aNode = unprocessed.pop()
+			def edges = toList(aNode.getElementsByTagName('edge'))
+			if (edges.size() == 0)
+				terminals.add(aNode)
+			else
+				for (def anEdge : edges)
+					unprocessed.add(idKey(theNode.parentNode.parentNode, anEdge.getAttribute('idref')))
+		}
+		return terminals;
+	}
+
+	/**
+	 * 
+	 * @param theNode
+	 * @return the join of the terminal nodes value in theNode a varaible node
+	 */
+	def writeLexForm(theNode) {
+		def sNode = theNode.parentNode.parentNode // get the sentence of the variable
+		def allTNodes = sNode.getElementsByTagName('t') // get all sentence children
+		def tNodesInTheNode = getTNodes(theNode) // get the terminal nodes pointed by idref
+		def begunNode = false
+		def lexs = []
+		def lexBuffer = []
+		for (def aTNode : allTNodes){
+			if ( aTNode in tNodesInTheNode) {
+				begunNode = true
+				lexs.addAll(lexBuffer)
+				lexs.add(aTNode.getAttribute('word'))
+				lexBuffer = []
+			}
+			if ( begunNode && !tNodesInTheNode.contains(aTNode))
+				lexBuffer.add('[' + aTNode.getAttribute('word') + ']')
+		}
+		return lexs.join(" ");
+	}
+
+	def matchCombine(theDOM) {
+
+		def matchesNodes = theDOM.getElementsByTagName('matches')
+
+		for (def aMatchesNode : matchesNodes){
+
+			def pivotNodes = toList(
+					aMatchesNode.getElementsByTagName('variable')
+					).findAll{it.getAttribute('name') == '#pivot'}
+
+			def checkedPivots = []
+
+			while (pivotNodes){
+
+				def aPivotNode = pivotNodes.remove(0)
+
+				def matchingPivotList = checkedPivots.findAll{
+					it.getAttribute('idref') == aPivotNode.getAttribute('idref')
+				}
+
+				if (matchingPivotList) {
+
+					// duplicate pivot; copy all variables
+
+
+					for (def node : toList(aPivotNode.getParentNode()
+					.getElementsByTagName('variable')
+					)) {
+
+						matchingPivotList[0].getParentNode().appendChild(node)
+
+					}
+
+					def variables = toList(
+							matchingPivotList[0].getParentNode()
+							.getElementsByTagName('variable')
+							)
+
+					// remove duplicates
+
+					def checkedVariables = []
+
+					while (variables) {
+
+						def aVariableNode = variables.remove(0)
+
+						def matchingVariableList = checkedVariables.findAll{
+							(
+									it.getAttribute('idref') == aVariableNode.getAttribute('idref')
+									&& (
+									it.getAttribute('name') == aVariableNode.getAttribute('name')
+									|| (
+									it.getAttribute('name').startsWith('#block')
+									&& aVariableNode.getAttribute('name').startsWith('#block')
+									)
+									)
+									)
+						}
+
+						if (matchingVariableList) {
+
+							// remove variable node
+
+							aVariableNode.getParentNode().removeChild(aVariableNode)
+
+						}
+
+						else {
+
+							checkedVariables.add(aVariableNode)
+
+						}
+					}
+				}
+				else {
+
+					// not the same pivot
+
+					checkedPivots.add(aPivotNode)
+				}
+			}
+			// Tidying up: remove empty <match /> nodes
+			def matchNodes = toList(aMatchesNode.getElementsByTagName('match'))
+
+			for (def matchNode : matchNodes) {
+
+				if ( !toList(matchNode.getElementsByTagName('variable'))) {
+
+					aMatchesNode.removeChild(matchNode)
+				}
+			}
+		}
+
+		return theDOM
+	}
+
+	public static void usage() {
+		println 'concordance_blocks [OPTIONS] inputfile.xml [outputfile.csv]'
+		println 'OPTIONS'
+		println '-h, --help           Displays this message.'
+		println '-c --context [length] Sets the number of words in context.'
+	}
+
+	static main(args) {
+		if(args.length == 0)
+			usage()
+		int cx = 30;
+		def ntTypes = ['cat'];
+		def tTypes = ['pos'];
+		File xmlfile = new File(args[0])
+		File outfile = new File(args[1])
+		ConcordanceBlocks p = new ConcordanceBlocks();
+		println "START"
+		p.process(xmlfile, outfile, cx, ntTypes, tTypes)
+		println "END"
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ImportXmlTag.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ImportXmlTag.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ImportXmlTag.groovy	(revision 728)
@@ -0,0 +1,216 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.txm.importer.filters.*;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+// TODO: Auto-generated Javadoc
+
+/**
+ * The Class ImportXmlTag.
+ *
+ * @author mdecorde
+ */
+public class ImportXmlTag {
+	
+	/** The url. */
+	private def url;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The output. */
+	private def output;
+	
+	/**
+	 * Instantiates a new import xml tag.
+	 *
+	 * @param url the url
+	 */
+	public ImportXmlTag(URL url){
+		try {
+			this.url = url;
+			inputData = url.openStream();
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+			
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile){
+		try {
+			File f = outfile;
+			output = new OutputStreamWriter(new FileOutputStream(f) , "UTF-8");
+			
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+	
+	/** The maxprof. */
+	int maxprof = 0;
+	
+	/**
+	 * Process.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	public boolean process(File outfile){
+		LinkedList<Integer> writechilds = new LinkedList<Integer>();
+		writechilds.add(0);
+		String prof = "";
+		int wordid =0
+		
+		def children = 0;
+		if(createOutput(outfile)){
+			
+			String localname = "";
+			try {
+				for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+					
+					String prefix = parser.getPrefix();
+					if(prefix == null || prefix == "")
+						prefix = "none";
+					
+					switch (event) {
+					
+						case XMLStreamConstants.START_ELEMENT:
+							localname = parser.getLocalName();
+							if (writechilds.getLast() == 0) {
+								children++;
+								output.write(prof+"<children n="+children+">\n");
+							}
+							
+							int cpt = writechilds.pop();
+							cpt++;
+							writechilds.add(cpt);
+
+							prof+=" ";
+							maxprof = Math.max(maxprof,prof.length());
+							output.write(prof+localname+"\t"+(wordid++)+"\t"+prefix+"\t"+prof.length()+"\t"+parser.getAttributeCount()+"\n");
+
+							writechilds.add(0);
+							break;	
+						
+						case XMLStreamConstants.END_ELEMENT:
+							localname = parser.getLocalName();
+							if (writechilds.getLast() > 0) {
+								output.write(prof+"</children>\n");
+							}
+							writechilds.removeLast();
+							prof = prof.subSequence(0, prof.length() -1);
+
+							break;
+						
+						case XMLStreamConstants.CHARACTERS:		
+							break;
+					}
+				}
+				output.write(prof+"</children>\n");
+				output.close();
+				parser.close();
+			}
+			catch (XMLStreamException ex) {
+				System.out.println(ex);
+			}
+			catch (IOException ex) {
+				System.out.println("IOException while parsing " + inputData);
+			}
+		}
+	}
+	
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+		
+		String rootDir = "~/xml/rgaqcj/";
+		new File(rootDir+"/wtc/").mkdir();
+		new File(rootDir,"/registry/").mkdir();
+		
+		File srcfile = new File(rootDir+"/src/","roland.xml");
+		File resultfile = new File(rootDir+"/wtc/","roland-xmltag.wtc");
+		println("importXmlTag : "+srcfile+" to : "+resultfile );
+		
+		def builder = new ImportXmlTag(srcfile.toURL());
+		builder.process(resultfile);
+		
+		def cwbLoc ="~/Bureau/textometrie/CWB/cwb-3.0/utils/";//chemin vers executable cqp
+		
+		def inDir = rootDir;
+		def outDir =rootDir+"wtc/";
+		def outDirTxm = rootDir;
+		CwbEncode cwbEn = new CwbEncode();
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		
+		String[] pAttributes = ["id","prefix","prof","nbattr"];
+		String[] sAttributes = ["children:"+builder.maxprof+"+n"];
+		
+		try {
+			if (System.getProperty("os.name").contains("Windows")) {
+				cwbEn.run(cwbLoc + "cwb-encode.exe", outDirTxm + "data/"+"ROLANDXML", outDir +"roland-xmltag.wtc", outDirTxm + "registry/"+"rolandxml",pAttributes, sAttributes);
+				cwbMa.run(cwbLoc + "cwb-makeall.exe", "ROLANDXML", outDirTxm + "registry");
+			} else {
+				cwbEn.run(cwbLoc + "cwb-encode", outDirTxm + "data/"+"ROLANDXML", outDir +"roland-xmltag.wtc", outDirTxm + "registry/"+"rolandxml",pAttributes, sAttributes);
+				cwbMa.run(cwbLoc + "cwb-makeall", "ROLANDXML", outDirTxm + "registry");
+			}
+		} catch (Exception ex) {System.out.println(ex);}
+		
+		return;
+	}
+}
+
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/SetNewXmlDocumentRoot.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/SetNewXmlDocumentRoot.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/SetNewXmlDocumentRoot.groovy	(revision 728)
@@ -0,0 +1,51 @@
+package org.txm.importer
+
+import java.io.File;
+
+import org.w3c.dom.Document;
+import java.io.File;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import javax.xml.parsers.*;
+import javax.xml.xpath.*;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import org.txm.importer.graal.PersonalNamespaceContext;
+
+class SetNewXmlDocumentRoot {
+	public static boolean process(File xmlfile, String xpath) {
+		DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+		domFactory.setNamespaceAware(true); // never forget this!
+		domFactory.setXIncludeAware(true);
+		DocumentBuilder builder = domFactory.newDocumentBuilder();
+		
+		Document doc = builder.parse(xmlfile);
+		Element root = doc.getDocumentElement();
+		
+		XPathFactory xpathfactory = XPathFactory.newInstance();
+		def _xpath = xpathfactory.newXPath();
+		_xpath.setNamespaceContext(new PersonalNamespaceContext());
+		def expr = _xpath.compile(xpath);
+		def nodes = expr.evaluate(doc, XPathConstants.NODESET);
+
+		for(Node node : nodes) {
+
+			Document document = builder.newDocument();
+			document.setXmlVersion("1.0");
+			document.setXmlStandalone(true);
+			Node adopted = document.adoptNode(node)
+			document.appendChild(adopted)
+			return DomUtils.save(document, xmlfile);
+		}
+		return false;
+	}
+	
+	//		File xmlfile = new File("/home/mdecorde/xml/txmrefman/TEI/refman.xml")
+	//		File outfile = new File("/home/mdecorde/xml/txmrefman/TEI/refman-o.xml")
+	//		String xpath = "//body"
+	
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ReadImportParameters.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ReadImportParameters.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ReadImportParameters.groovy	(revision 728)
@@ -0,0 +1,277 @@
+package org.txm.importer
+
+import javax.xml.stream.*;
+import java.net.URL;
+/**
+ * Read the import.xml file
+ * @author mdecorde
+ */
+class ReadImportParameters {
+	HashMap<String, ArrayList<String>> links = new HashMap<String, ArrayList<String>>();;
+	HashMap<String, String> structs = new HashMap<String, String>();
+	HashMap<String, Integer> levels = new HashMap<String, Integer>();
+	
+	HashMap<String, HashMap<String, String>> metadatas = [:];
+	HashMap<String, HashMap<String, String>> pattributes = [:];
+	HashMap<String, HashMap<String, String>> sattributes = [:];
+	
+	HashMap<String, String> biblios = [:];
+	
+	HashMap<String, String> uis = [:];
+	
+	HashMap<String, ArrayList<HashMap<String, String>>> editions = [:];
+	
+	String basename;
+	String encoding;
+	String language;
+	String rootDir;
+	String script;
+	String xslt;
+	String author;
+	String description;
+	
+	boolean debug;
+
+	public ReadImportParameters()
+	{
+
+	}
+
+	public boolean read(File infile)
+	{
+		try {
+			def url = infile.toURI().toURL();
+			def inputData = url.openStream();
+			def factory = XMLInputFactory.newInstance();
+			def parser = factory.createXMLStreamReader(inputData);
+			return read(parser);
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+
+	public boolean read(def parser)
+	{
+		boolean startAlignInfos = false;
+		boolean startEditions = false;
+		boolean startMetadatas = false;
+		boolean startPAttributes = false;
+		boolean startSAttributes = false;
+		boolean startTokenizer = false;
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+		{
+			switch (event) {
+
+				case XMLStreamConstants.END_ELEMENT:
+					String localname = parser.getLocalName();
+					if(localname == "linkGrp")
+					{
+						startAlignInfos = false;
+					}
+					else if(localname == "metadatas")
+					{
+						startMetadatas = false;
+					}
+					else if(localname == "editions")
+					{
+						startEditions = false;
+					}
+					else if(localname == "pattributes")
+					{
+						startPAttributes = false;
+					}
+					else if(localname == "sattributes")
+					{
+						startSAttributes = false;
+					}
+					else if(localname == "tokenizer")
+					{
+						startSAttributes = false;
+					}
+					break;
+
+				case XMLStreamConstants.START_ELEMENT:
+					String localname = parser.getLocalName();
+					if (localname == "import")
+					{
+						basename = parser.getAttributeValue(null, "name");
+						encoding = parser.getAttributeValue(null, "encoding");
+						language = parser.getAttributeValue(null, "lang");
+						rootDir = parser.getAttributeValue(null, "rootDir");
+						script = parser.getAttributeValue(null, "script");
+						xslt = parser.getAttributeValue(null, "xslt");
+						author = parser.getAttributeValue(null, "author")
+						description = parser.getAttributeValue(null, "desc");
+						
+						boolean debug;
+					}
+					else if(localname == "editions")
+					{
+						startEditions = true;
+					}
+					else if(localname == "edition")
+					{
+						String corpus = parser.getAttributeValue(null, "corpus")
+						if(!editions.containsKey(corpus))
+							editions.put(corpus, []);
+						def list = editions.get(corpus);
+						def map = [:]
+						list.add(map)
+						
+						map.put("name", parser.getAttributeValue(null, "name"))
+						map.put("mode", parser.getAttributeValue(null, "mode"))
+						map.put("script", parser.getAttributeValue(null, "script"))
+					}
+					else if (localname == "metadatas") {
+						startMetadatas = true;
+					}
+					else if (localname == "metadata" && startMetadatas) {
+						metadatas.put(parser.getAttributeValue(null, "id"), 
+							["id":parser.getAttributeValue(null, "id"),
+							"shortname":parser.getAttributeValue(null, "shortname"),
+							"longname":parser.getAttributeValue(null, "longname"),
+							"type":parser.getAttributeValue(null, "type"),
+							"selection":parser.getAttributeValue(null, "selection"),
+							"partition":parser.getAttributeValue(null, "partition"),
+							"display":parser.getAttributeValue(null, "display"),])
+					}
+					else if (localname == "pattributes") {
+						startPAttributes = true;
+					} else if(localname == "pattribute" && startPAttributes) {
+						pattributes.put(parser.getAttributeValue(null, "id"), 
+							["id":parser.getAttributeValue(null, "id"),
+							"shortname":parser.getAttributeValue(null, "shortname"),
+							"longname":parser.getAttributeValue(null, "longname"),
+							"type":parser.getAttributeValue(null, "type"),
+							"renderer":parser.getAttributeValue(null, "renderer"),
+							"tooltip":parser.getAttributeValue(null, "tooltip"),
+							"display":parser.getAttributeValue(null, "display"),
+							"min":parser.getAttributeValue(null, "min"),
+							"max":parser.getAttributeValue(null, "max"),
+							"inputFormat":parser.getAttributeValue(null, "inputFormat"),
+							"outputFormat":parser.getAttributeValue(null, "outputFormat"),
+							"position":parser.getAttributeValue(null, "position"),
+							"sortBy":parser.getAttributeValue(null, "sortBy")])
+					}
+					else if (localname == "sattributes") {
+						startSAttributes = true;
+					}
+					else if (localname == "sattribute" && startSAttributes) {
+						sattributes.put(parser.getAttributeValue(null, "id"), 
+							["id":parser.getAttributeValue(null, "id"),
+							"shortname":parser.getAttributeValue(null, "shortname"),
+							"longname":parser.getAttributeValue(null, "longname"),
+							"type":parser.getAttributeValue(null, "type"),
+							"renderer":parser.getAttributeValue(null, "renderer"),
+							"tooltip":parser.getAttributeValue(null, "tooltip"),
+							"pattern":parser.getAttributeValue(null, "renderer"),
+							"import":parser.getAttributeValue(null, "import"),
+							"min":parser.getAttributeValue(null, "min"),
+							"max":parser.getAttributeValue(null, "max"),
+							"mandatory":parser.getAttributeValue(null, "mandatory"),
+							"order":parser.getAttributeValue(null, "order"),
+							"inputFormat":parser.getAttributeValue(null, "inputFormat"),
+							"outputFormat":parser.getAttributeValue(null, "outputFormat"),])
+					} else if (localname == "link" && startAlignInfos) {
+						String target = parser.getAttributeValue(null, "target");
+						String struct = parser.getAttributeValue(null, "alignElement");
+						String level = parser.getAttributeValue(null, "alignLevel")
+						ArrayList<String> corpora = target.split("#");
+						for (int i = 0 ; i < corpora.size() ; i++) {
+							corpora[i] = corpora[i].trim()
+							if (corpora[i].length() == 0) {
+								corpora.remove(i)
+								i--
+							}
+						}
+
+						if (level == null)
+							level = "1";
+
+						if (corpora.size() == 0) {
+							println "no corpus aligned: "+parser.getLocation()
+							return false;
+						}
+						if (struct == null) {
+							println "a sturcture is missing: "+parser.getLocation()
+							return false;
+						}
+						links.put(target, corpora)
+						structs.put(target, struct)
+						levels.put(target, level.toInteger())
+					} else if(localname == "linkGrp" && parser.getAttributeValue(null, "type") == "align") {
+						startAlignInfos = true;
+					} else if(localname == "tokenizer") {
+						startSAttributes = true;
+					}
+			}
+		}
+	}
+
+	public Set<String> getAlignements()
+	{
+		return links.keySet();
+	}
+
+	public ArrayList<String> getTargets(String alignement)
+	{
+		return links.get(alignement);
+	}
+
+	public String getStructure(String alignement)
+	{
+		return structs.get(alignement);
+	}
+
+	public int getLevel(String alignement)
+	{
+		return levels.get(alignement);
+	}
+
+	public void dump()
+	{
+		println "LINKS"
+		for(String link : links.keySet())
+		{
+			println link
+			println " corpus: "+links.get(link)
+			println " struct: "+structs.get(link)
+			println " level: "+levels.get(link)
+		}
+		
+		println "PROPERTIES"
+		println "metadatas $metadatas"
+		println " pattributes $pattributes"
+		println " sattributes $sattributes"
+		
+		println " biblios $biblios"
+		
+		println "uis $uis"
+		
+		println " editions $editions"
+		
+		println "HEADER"
+		println " basename $basename"
+		println " encoding $encoding"
+		println " language $language"
+		println " rootDir $rootDir"
+		println " script $script"
+		println " xslt $xslt"
+		println " author $author"
+		println " description $description"
+		println "DEBUG: $debug"
+	}
+
+	public static void main(String[] args)
+	{
+		String userhome = System.getProperty("user.home");
+		File alignfile = new File(userhome, "xml/xmltxmpara/align.xml")
+		ReadImportParameters parameters = new ReadImportParameters();
+		parameters.read(alignfile);
+		parameters.dump();
+	}
+}
+
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RenameTag.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RenameTag.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RenameTag.groovy	(revision 728)
@@ -0,0 +1,154 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.importer
+
+import java.io.File;
+
+import org.w3c.dom.Document;
+import java.io.File;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javax.xml.parsers.*;
+import javax.xml.xpath.*;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import org.txm.importer.graal.PersonalNamespaceContext;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class RenameTag : using Stax or DOM depending on the file size
+ */
+class RenameTag extends StaxIdentityParser{
+
+	public static int DOMMAXSIZE = 1000000;
+	String newname, oldname;
+	File xmlfile;
+
+	public RenameTag(File xmlfile, String oldname, String newname)
+	{
+		super(xmlfile.toURI().toURL());
+		this.oldname = oldname;
+		this.newname = newname;
+		this.xmlfile = xmlfile;
+	}
+	/**
+	 * Rename an element - DOM method
+	 *
+	 * @param xmlfile the xmlfile
+	 * @param oldname the oldname
+	 * @param newname the newname
+	 * @return true, if successful
+	 */
+	public static boolean rename(File xmlfile, String oldname, String newname)
+	{
+		if (!xmlfile.exists()) {
+			println "Error: $xmlfile does not exists"
+		}
+
+		if (!(xmlfile.canRead() && xmlfile.canWrite())) {
+			println "Error: $xmlfile is not readable or writable"
+		}
+
+		if (xmlfile.length() <= DOMMAXSIZE) {
+			String xpath = "//"+oldname;
+			DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+			domFactory.setXIncludeAware(true);
+			domFactory.setNamespaceAware(true); // never forget this!
+			DocumentBuilder builder = domFactory.newDocumentBuilder();
+			Document doc = builder.parse(xmlfile);
+
+			XPathFactory xpathfactory = XPathFactory.newInstance();
+			def _xpath = xpathfactory.newXPath();
+			_xpath.setNamespaceContext(new PersonalNamespaceContext());
+			def expr = _xpath.compile(xpath);
+			def nodes = expr.evaluate(doc, XPathConstants.NODESET);
+
+			for(def node : nodes) {
+				doc.renameNode(node, null, newname)
+			}
+			return DomUtils.save(doc, xmlfile)
+		}
+		else {
+			RenameTag builder = new RenameTag(xmlfile, oldname, newname);
+			File temp = File.createTempFile("temp", ".xml", xmlfile.getParentFile());
+			if(builder.process(temp)) {
+				if (!(xmlfile.delete() && temp.renameTo(xmlfile))) println "Warning can't rename file "+temp+" to "+xmlfile
+				return true;
+			}
+			else
+				return false;
+		}
+	}
+
+	/**
+	 * Rewrite processStartElement to update the localname if localname == oldname
+	 */
+	public void processStartElement()
+	{
+		String prefix = parser.getPrefix();
+		if (INCLUDE == localname && XI == prefix) {
+			processingXInclude();
+			return;
+		}
+
+		if (localname == oldname) {
+			localname = newname;
+
+			if(prefix.length() > 0)
+				writer.writeStartElement(Nscontext.getNamespaceURI(prefix), localname)
+			else
+				writer.writeStartElement(localname);
+
+			for(int i = 0 ; i < parser.getNamespaceCount() ; i++)
+			{
+				writer.writeNamespace(parser.getNamespacePrefix(i), parser.getNamespaceURI(i));
+			}
+
+			for(int i = 0 ; i < parser.getAttributeCount() ; i++)
+				writer.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+		} else {
+			super.processStartElement();
+		}
+	}
+
+	public static void main(String[] args)
+	{
+		File xmlfile = new File("/home/mdecorde/xml/xmlÃ§Ã Ã©/essai.xml");
+		File temp = new File("/home/mdecorde/xml/xmlÃ§Ã Ã©/renamed.xml");
+		String oldname = "machin"
+		String newname = "titre"
+		long time = System.currentTimeMillis();
+		RenameTag.rename(xmlfile, oldname, newname);
+		//		RenameTag builder = new RenameTag(xmlfile, oldname, newname);
+		//		builder.process(temp);
+		println "elapsed: "+(System.currentTimeMillis()-time);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/AddAttributeValuesInXML.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/AddAttributeValuesInXML.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/AddAttributeValuesInXML.groovy	(revision 728)
@@ -0,0 +1,99 @@
+package org.txm.importer
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.txm.metadatas.Entry
+import org.txm.utils.Pair;
+
+/**
+ * Add a attribute value map in a XML file
+ * Warning: if an attribute already exists its value won't be changed
+ */
+class AddAttributeValuesInXML extends StaxIdentityParser {
+	File xmlFile;
+	String tag, attribute;
+	List<String> values;
+	HashMap<String, String> attributesMap;
+	boolean result;
+
+	public AddAttributeValuesInXML(File xmlFile, String tag, String attribute, List<String> values)
+	{
+		super(xmlFile.toURI().toURL());
+		this.xmlFile = xmlFile;
+		this.tag = tag;
+		this.attribute = attribute;
+		this.values = values;
+	}
+
+	public boolean process(File outfile) {
+		this.result = false;
+		boolean ret = super.process(outfile)
+		return this.result & ret;
+	}
+
+	/**
+	 * Rewrite the processStartElement() to update/add attributes
+	 */
+	int n = 0;
+	public void processStartElement()
+	{
+		if (localname != tag) {
+			super.processStartElement()
+		} else {
+			String prefix = parser.getPrefix();
+			if (INCLUDE == localname && XI == prefix) {
+				processingXInclude();
+				return;
+			}
+
+			if (prefix.length() > 0)
+				writer.writeStartElement(Nscontext.getNamespaceURI(prefix), localname)
+			else
+				writer.writeStartElement(localname);
+
+			for (int i = 0 ; i < parser.getNamespaceCount() ; i++) {
+				writer.writeNamespace(parser.getNamespacePrefix(i), parser.getNamespaceURI(i));
+			}
+
+			// get attributes
+			HashMap<String, String> attributes = new HashMap<String, String>();
+			for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+				attributes[parser.getAttributeLocalName(i)] = parser.getAttributeValue(i);
+			}
+			// add/update the value
+			if (n < values.size()) {
+				attributes[attribute] = values[n]; 
+			} else {
+				println "ERROR: not enough values to insert for file $xmlFile, at XML parser location: l="+parser.getLocation().getLineNumber()+",c="+parser.getLocation().getColumnNumber()+")."
+			}
+			n++
+			
+			// write attributes
+			for (def k : attributes.keySet()) {
+				writer.writeAttribute(k, attributes[k])
+			}
+		}
+	}
+	
+	@Override
+	public void after() {
+		super.after();
+		
+		if (n != values.size()) {
+			println "ERROR: number of $tag ("+n+") missmatch the number of values to insert: "+values.size()
+		}
+	}
+
+	public static void main(String[] args)
+	{
+		File xmlfile = new File("/home/mdecorde/xml/macroaddfacsattribute/src/test1.xml")
+		File temp = File.createTempFile("temp", ".xml", xmlfile.getParentFile());
+
+		AddAttributeValuesInXML builder = new AddAttributeValuesInXML(xmlfile, "pb", "facs", ["V1","V1.2", "V2", "V3"]);
+		builder.process(temp);
+		
+		println "Done"
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/DisplayXmlTags.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/DisplayXmlTags.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/DisplayXmlTags.groovy	(revision 728)
@@ -0,0 +1,183 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.io.File;
+import javax.xml.stream.*;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/** count and display the tags of an xml file. @author mdecorde */
+class DisplayXmlTags {
+	ArrayList<String> paths = new ArrayList<String>(); // contains the xpath of
+	// the tags
+	
+	/** The counts. */
+	HashMap<String, Integer> counts = new HashMap<String, Integer>(); // contains the counts per tag
+	
+	/** The chars. */
+	HashMap<String, Integer> chars = new HashMap<String, Integer>(); // contains the char counts per tag
+
+	/** The currentpath. */
+	String currentpath = "";
+	
+	/** The sum. */
+	public int sum = 0;
+
+	/**
+	 * Instantiates a new display xml tags.
+	 *
+	 * @param infile : the file to parse
+	 */
+	public DisplayXmlTags(File infile) {
+		if (infile.isDirectory()) {
+			for (File f : infile.listFiles()) {
+				processxmlFile(f);
+			}
+		} else
+			processxmlFile(infile);
+	}
+
+	/**
+	 * run the script.
+	 *
+	 * @param xmlfile the xmlfile
+	 * @return true, if successful
+	 */
+	private boolean processxmlFile(File xmlfile)
+	{
+		try
+		{
+			URL url = xmlfile.toURI().toURL();
+			def inputData = url.openStream();
+			def factory = XMLInputFactory.newInstance();
+			XMLStreamReader parser = factory.createXMLStreamReader(inputData);
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+			{
+				switch (event) 
+				{
+					case XMLStreamConstants.START_ELEMENT:
+					
+						currentpath += "/"+parser.getLocalName();// append the current tag to the current path
+						if(!paths.contains(currentpath))
+						{
+							paths.add(currentpath);
+							counts.put(currentpath, 0);
+							chars.put(currentpath, 0);
+						}
+						counts.put(currentpath, counts.get(currentpath)+1); // increment path count
+					
+						break;
+					case XMLStreamConstants.END_ELEMENT:
+						currentpath = currentpath.substring(0,currentpath.length() -1 - parser.getLocalName().length()) // remove tag from the path
+						break;
+					case XMLStreamConstants.CHARACTERS:
+						
+						chars.put(currentpath, chars.get(currentpath)+parser.getText().trim().length());
+						sum += parser.getText().trim().length();
+				}
+			}
+			
+		}
+		catch(Exception e){println("File "+xmlfile+"\n"+e); return false;}
+		return true;
+	}
+
+	/**
+	 * Gets the tag hierarchy.
+	 *
+	 * @return the hierarchy of the tags
+	 */
+	public ArrayList<String> getTagHierarchy() {
+		return paths;
+	}
+
+	/**
+	 * return the counts of a tag.
+	 *
+	 * @param path : the tag path (ex : /TEI/text/p")
+	 * @return the count
+	 */
+	public int getCount(String path) {
+		return counts.get(path);
+	}
+
+	/**
+	 * Gets the counts.
+	 *
+	 * @return all the tags counts
+	 */
+	public int getCounts() {
+		return counts;
+	}
+	
+	/**
+	 * return the counts of chars of  a tag.
+	 *
+	 * @param path : the tag path (ex : /TEI/text/p")
+	 * @return the char
+	 */
+	public int getChar(String path) {
+		return chars.get(path);
+	}
+
+	/**
+	 * Gets the chars.
+	 *
+	 * @return all the tags counts
+	 */
+	public int getChars() {
+		return chars;
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		String userhome = System.getProperty("user.home"); 
+		DisplayXmlTags diag = new DisplayXmlTags(new File(userhome, "xml/manuelTXM/Manuel_TEI_FR_0_5.xml"));
+		ArrayList<String> paths = diag.getPaths();
+		Collections.sort(paths);
+		if(paths != null)
+			for(String s : paths)
+			{
+				print s+" : "+diag.getCount(s);
+				if(diag.getChar(s) > 0)
+					print " (chars "+diag.getChar(s)+")";
+					
+				println ""
+			}
+		
+		println "total chars : "+diag.sum;
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/StaxIdentityParser.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/StaxIdentityParser.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/StaxIdentityParser.groovy	(revision 728)
@@ -0,0 +1,379 @@
+package org.txm.importer
+
+import groovy.transform.CompileStatic
+import java.io.File;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+import java.io.File;
+import java.net.URL;
+import javax.xml.stream.*;
+import org.txm.importer.filters.*;
+import org.txm.importer.graal.PersonalNamespaceContext;
+
+@CompileStatic
+class StaxIdentityParser {
+	/** The input */
+	protected URL inputurl;
+	protected InputStream inputData;
+	protected XMLInputFactory factory;
+	protected XMLStreamReader parser;
+	
+	/** The output. */
+	protected XMLOutputFactory outfactory = XMLOutputFactory.newInstance();
+	protected BufferedOutputStream output;
+	protected XMLStreamWriter writer;
+	
+	public static String TXMNS = "http://textometrie.org/1.0";
+	public static String TXM = "txm"
+	public static String TEINS = "http://www.tei-c.org/ns/1.0";
+	public static String TEI = "tei"
+	protected static PersonalNamespaceContext Nscontext = new PersonalNamespaceContext();
+	
+	//protected StringBuilder currentXPath = new StringBuilder("/")
+	protected String localname;
+	int processingXInclude = 0;
+	
+	public StaxIdentityParser(File infile) {
+		this(infile.toURI().toURL());
+	}
+	
+	public StaxIdentityParser(URL inputurl) {
+		this.inputurl = inputurl;
+		this.inputData = inputurl.openStream();
+		this.factory = XMLInputFactory.newInstance();
+		this.parser = factory.createXMLStreamReader(inputData);
+	}
+	
+	protected void before() {
+		
+	}
+	
+	protected void after() {
+		factory = null;
+		if (parser !=null) parser.close();
+		writer.flush();
+		if (writer != null) writer.close();
+		if (inputData != null) inputData.close();
+		writer = null;
+		parser = null;
+	}
+	
+	protected void closeForError() {
+		parser.close();
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File f) {
+		try {
+			if (writer != null) // process from a file
+				writer.close();
+			if (output != null) // process from a file
+				output.close();
+
+			output = new BufferedOutputStream(new FileOutputStream(f), 16*1024)
+			
+			writer = outfactory.createXMLStreamWriter(output, "UTF-8");//create a new file
+			writer.setNamespaceContext(Nscontext);
+			return true;
+		} catch (Exception e) {
+			System.out.println("Error: create output of "+f+": "+e);
+			return false;
+		}
+	}
+	
+	public boolean process(File outfile)
+	{
+		if (!createOutput(outfile))
+			return false;
+			
+		writer.writeStartDocument("UTF-8", "1.0");
+		writer.writeCharacters("\n");
+		boolean ret = process(writer);
+		if (writer != null) { // process from a file
+			writer.close();
+		}
+		if (output != null) { // process from a file
+		//	output.flush()
+			output.close();
+		}
+		
+		if (parser != null) {
+			try {parser.close()} catch(Exception e){println "parser exep: "+e; return false;}
+		}
+		return ret;
+	}
+	
+	public final static String SLASH = "/"
+	public boolean process(XMLStreamWriter awriter)
+	{
+		this.writer = awriter;
+		//if (processingXInclude == 0) {
+			before(); // if you need to do something before reading the xml
+		//}
+		try {
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+				switch (event) {
+					case XMLStreamConstants.NAMESPACE:
+						processNamespace();
+						break;
+					case XMLStreamConstants.START_ELEMENT:
+						localname = parser.getLocalName();
+						//currentXPath.append(SLASH)
+						processStartElement();
+						break;		
+					case XMLStreamConstants.CHARACTERS:
+						processCharacters();
+						break;
+					case XMLStreamConstants.END_ELEMENT:
+						localname = parser.getLocalName();
+						processEndElement();
+						//currentXPath.substring(0, currentXPath.length() - localname.length() -1)
+						break;
+					case XMLStreamConstants.PROCESSING_INSTRUCTION:
+						processProcessingInstruction();
+						break;
+					case XMLStreamConstants.DTD:
+						processDTD();
+						break;
+					case XMLStreamConstants.CDATA:
+						processCDATA();
+						break;
+					case XMLStreamConstants.COMMENT:
+						processComment();
+						break;
+					case XMLStreamConstants.END_DOCUMENT:
+						processEndDocument();
+						break;
+					case XMLStreamConstants.ENTITY_REFERENCE:
+						processEntityReference();
+						break;
+				}
+			}
+		} catch(Exception e) {
+			println("Unexpected error while parsing file "+inputurl+" : "+e);
+			println("Location line: "+parser.getLocation().getLineNumber()+" character: "+parser.getLocation().getColumnNumber());
+			org.txm.utils.logger.Log.printStackTrace(e);
+			//e.printStackTrace();
+			if (writer != null) writer.close();
+			if (output != null) output.close();
+			parser.close();
+			return false;
+		}
+		//if (processingXInclude == 0) {
+		after(); // if you need to do something before closing the parser();
+		//}
+		return true;
+	}
+	
+	/**
+	 * The start element has already been written
+	 * @param tagname
+	 */
+	public void goToEnd(String tagname) {
+		//println "start gotoend $tagname"
+		def elements = 1;
+		try {
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+				//println "event "+event
+				switch (event) {
+					case XMLStreamConstants.NAMESPACE:
+						processNamespace();
+						break;
+					case XMLStreamConstants.START_ELEMENT:
+						elements++;
+						localname = parser.getLocalName();
+						//currentXPath.append(SLASH)
+						_processStartElement();
+						break;
+					case XMLStreamConstants.CHARACTERS:
+						processCharacters();
+						break;
+					case XMLStreamConstants.PROCESSING_INSTRUCTION:
+						processProcessingInstruction();
+						break;
+					case XMLStreamConstants.DTD:
+						processDTD();
+						break;
+					case XMLStreamConstants.CDATA:
+						processCDATA();
+						break;
+					case XMLStreamConstants.COMMENT:
+						processComment();
+						break;
+					case XMLStreamConstants.END_ELEMENT:
+						elements--;
+						localname = parser.getLocalName();
+						//currentXPath.substring(0, currentXPath.length() - localname.length() -1)
+						writer.writeEndElement();
+						if (elements == 0 && localname == tagname)
+							return;
+						break;
+					case XMLStreamConstants.END_DOCUMENT:
+						processEndDocument();
+						break;
+					case XMLStreamConstants.ENTITY_REFERENCE:
+						processEntityReference();
+						break;
+				}
+			}
+		} catch(Exception e) {
+			println("Error while parsing file "+inputurl);
+			println("Location "+parser.getLocation());
+			org.txm.utils.logger.Log.printStackTrace(e);
+			output.close();
+			parser.close();
+			return;
+		}
+	}
+	
+	public def getLocation() {
+		if (parser != null)
+			return "Line: "+parser.getLocation().getLineNumber()+" Col: "+parser.getLocation().	getColumnNumber()
+		return null;
+	}
+	
+	protected void processNamespace() {
+		writer.writeNamespace(parser.getPrefix(), parser.getNamespaceURI());
+	}
+	
+	public static final String INCLUDE = "include"
+	public static final String XI = "xi"
+	
+	protected void processStartElement()
+	{
+		String prefix = parser.getPrefix();
+//		if (INCLUDE == localname && XI == prefix) {
+//			processXInclude();
+//		} else {
+			if (prefix != null && prefix.length() > 0)
+				writer.writeStartElement(Nscontext.getNamespaceURI(prefix), localname)
+			else
+				writer.writeStartElement(localname);
+			
+			for (int i = 0 ; i < parser.getNamespaceCount() ; i++) {
+				writer.writeNamespace(parser.getNamespacePrefix(i), parser.getNamespaceURI(i));
+			}
+			
+			writeAttributes();
+//		}
+	}
+	
+	private void _processStartElement()
+	{
+		String prefix = parser.getPrefix();
+//		if (INCLUDE == localname && XI == prefix) {
+//			processXInclude();
+//		} else {
+			if (prefix != null && prefix.length() > 0)
+				writer.writeStartElement(Nscontext.getNamespaceURI(prefix), localname)
+			else
+				writer.writeStartElement(localname);
+			
+			for (int i = 0 ; i < parser.getNamespaceCount() ; i++) {
+				writer.writeNamespace(parser.getNamespacePrefix(i), parser.getNamespaceURI(i));
+			}
+			
+			writeAttributes();
+//		}
+	}
+	
+	protected void writeAttributes() {
+		for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+			writeAttribute(parser.getAttributePrefix(i), parser.getAttributeLocalName(i), parser.getAttributeValue(i))
+		}
+	}
+	
+	protected void writeAttribute(String prefix, String name, String value) {
+		if (prefix != null && prefix.length() > 0)
+			writer.writeAttribute(prefix+":"+name, value);
+		else
+			writer.writeAttribute(name, value);
+	}
+	
+	protected void processCharacters()
+	{
+		writer.writeCharacters(parser.getText());
+	}
+	
+	protected void processProcessingInstruction()
+	{
+		writer.writeProcessingInstruction(parser.getPITarget(), parser.getPIData());
+	}
+	
+	protected void processDTD()
+	{
+		writer.writeDTD(parser.getText());
+	}
+	
+	protected void processCDATA()
+	{
+		writer.writeCData(parser.getText())	
+	}
+	
+	protected void processComment()
+	{
+		writer.writeComment(parser.getText());
+	}
+	
+	protected void processEndElement()
+	{
+//		if (localname == INCLUDE && parser.getPrefix() == XI) {
+//			// nothing !!
+//		} else {
+			writer.writeEndElement();
+//		}
+	}
+	
+	protected void processEndDocument() {
+		writer.writeEndDocument();
+	}
+	
+	protected void processEntityReference() {
+		writer.writeEntityRef(parser.getLocalName());
+	}
+	/**
+	 * Process the XInclude elements
+	 */
+	protected void processXInclude() {
+		String url = parser.getAttributeValue(null, "href"); // relative only
+		File driver = new File(inputurl.getFile());
+		File ref = new File(driver.getParent(), url);
+		if (ref.exists()) {
+			URL includeurl = ref.toURI().toURL();
+			// save variables before killing them
+			println "process xi include: "+ref
+			def parserSave = this.parser // back up current parser
+			def xiIncludeInputData = includeurl.openStream();
+			def xiIncludeParser = factory.createXMLStreamReader(xiIncludeInputData);
+			parser = xiIncludeParser;
+			processingXInclude++ // to avoid recalling before & after methods
+			this.process(writer);
+			processingXInclude-- // end of XInclude processing
+			this.parser = parserSave // restore parser
+		} else {
+			println "Warning referenced file: $ref does not exists"
+		}
+	}
+	
+	public static void main(String[] args)
+	{
+		File input = new File("/home/mdecorde/xml/xiinclude/master.xml")
+		File output = new File("/home/mdecorde/xml/xiinclude/merged.xml")
+		if (!(input.exists() && input.canRead())) {
+			println "cannot found $input";
+			return;
+		}
+		def builder = new StaxIdentityParser(input.toURI().toURL());
+		if (builder.process(output)) {
+			println "success ? "+ValidateXml.test(output);
+		} else {
+			println "failure !"
+		}
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/Doc2Transcription.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/Doc2Transcription.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/Doc2Transcription.groovy	(revision 728)
@@ -0,0 +1,122 @@
+package org.txm.importer
+
+import javax.xml.stream.*
+import java.net.URL
+
+class Doc2Transcription {
+
+	String encoding
+	File txtfile
+	File outfile
+	Reader reader
+	XMLOutputFactory factory
+	FileOutputStream output
+	XMLStreamWriter writer
+
+	int noline = 1
+	boolean question = false
+	int idquestion = 1
+	int idresponse = 1
+	boolean opened = false
+
+	public Doc2Transcription(File txtfile, File outfile, String encoding)
+	{
+		this.txtfile = txtfile
+		this.outfile = outfile
+		this.encoding = encoding
+
+		reader = new InputStreamReader(new FileInputStream(txtfile) , encoding)
+		factory = XMLOutputFactory.newInstance()
+		output = new FileOutputStream(outfile)
+		writer = factory.createXMLStreamWriter(output, "UTF-8")//create a new file
+	}
+
+	public boolean process()
+	{
+		if(reader == null || writer == null)
+		{
+			println "I/O error"
+			return false
+		}
+		
+		// build text id
+		String filename = txtfile.getName()
+		int idx = filename.lastIndexOf(".")
+		if(idx > 0)
+			filename = filename.substring(0, idx)
+
+		//write Start doc
+		writer.writeStartDocument("UTF-8", "1.0")
+		writer.writeStartElement("text") // we create a tag <text>
+		writer.writeAttribute("id",filename)// and set its id
+
+		//write first block
+		writeStartQuestionResponse()
+		
+		String line = reader.readLine()
+		while(line != null)
+		{
+			if(line.length() == 0) // saut de ligne
+			{
+				question = !question
+				writer.writeEmptyElement("br")
+				writeStartQuestionResponse()
+			}
+			else
+			{
+				writer.writeCharacters(line+" \n")
+				writer.writeEmptyElement("br")
+			}
+
+			noline++
+			line = reader.readLine()
+		}
+
+		//close xml doc and question/response if needed
+		if(opened)
+			writer.writeEndElement()// question/response
+		writer.writeEndElement()// text
+
+		reader.close()
+		writer.close()
+		output.close()
+		return true
+	}
+
+	public void writeStartQuestionResponse()
+	{
+		if(opened)
+		{
+			writer.writeEndElement()
+			opened = false
+		}
+		opened = true
+		if(question)
+		{
+			writer.writeStartElement("question") // we create a tag <text>
+			writer.writeAttribute("id","q"+idquestion++)// and set its id
+		}
+		else
+		{
+			writer.writeStartElement("response") // we create a tag <text>
+			writer.writeAttribute("id","r"+idresponse++)// and set its id
+		}
+	}
+
+	public void setInitialeState(boolean state)
+	{
+		question = state
+	}
+
+	static main(args) {
+		File infile = new File("/home/matt/xml/txttranscription/test.txt")
+		File outfile = new File("/home/matt/xml/txttranscription/test.xml")
+		String encoding = "UTF-8"
+
+		def builder = new Doc2Transcription(infile, outfile, encoding)
+		if(builder.process())
+			println "ok"
+		else
+			println "fail"
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ResolveXInclude.java
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ResolveXInclude.java	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ResolveXInclude.java	(revision 728)
@@ -0,0 +1,106 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.importer;
+
+import java.io.File;
+import java.io.FileOutputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Document;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ResolveXInclude.
+ */
+class ResolveXInclude {
+	
+	/**
+	 * Resolve.
+	 *
+	 * @param xmlfile the xmlfile
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 * @throws Exception the exception
+	 */
+	public static boolean resolve(File xmlfile, File outfile) throws Exception
+	{
+		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+		//factory.setXIncludeAware(true);
+		factory.setNamespaceAware(true);
+		DocumentBuilder docBuilder = factory.newDocumentBuilder();
+//		if (!docBuilder.isXIncludeAware()) {
+//			throw new IllegalStateException();
+//		}
+		/*docBuilder.setEntityResolver(new EntityResolver() {
+					@Override
+					public InputSource resolveEntity(String publicId, String systemId)
+					throws SAXException, IOException {
+						if (systemId.endsWith("include.txt")) {
+							return new InputSource(includeStream);
+						}
+						return null;
+					}
+				});*/
+		Document doc = docBuilder.parse(xmlfile);
+		// print result
+		Source source = new DOMSource(doc);
+		Result result = new StreamResult(new FileOutputStream(outfile));
+		TransformerFactory transformerFactory = new net.sf.saxon.TransformerFactoryImpl();
+		Transformer transformer;
+
+		transformer = transformerFactory.newTransformer();
+		transformer.transform(source, result);		
+		return true;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		String userdir= System.getProperty("user.home");
+		File xmlfile = new File(userdir, "xml/queen/queen/Texts/driver.xml");
+		File outfile = new File(userdir, "xml/queen/queen.xml");
+		try {
+			ResolveXInclude.resolve(xmlfile, outfile);
+		} catch (Exception e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			System.out.println("Fail to resolve xinclude");
+		}
+	}
+}

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ResolveXInclude.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/annotate.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/annotate.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/annotate.groovy	(revision 728)
@@ -0,0 +1,146 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-11-08 13:38:06 +0100 (Fri, 08 Nov 2013) $
+// $LastChangedRevision: 2569 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.corptef;
+
+import org.txm.importer.cwb.*
+import org.txm.scripts.teitxm.*;
+import org.txm.importer.*;
+import org.txm.utils.treetagger.TreeTagger;
+import org.txm.Toolbox;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class annotate.
+ */
+class annotate {
+	
+	/**
+	 * Run.
+	 *
+	 * @param dir the dir
+	 */
+	public void run(File dir)
+	{
+		String rootDir = dir.getAbsolutePath()+"/";//"~/xml/discours/src";
+		String txmDir = dir.getAbsolutePath()+"/txm/"
+
+		//cleaning
+		new File(rootDir,"annotations").deleteDir();
+		new File(rootDir,"annotations").mkdir();
+		new File(rootDir,"treetagger").deleteDir();
+		new File(rootDir,"treetagger").mkdir();
+		println txmDir
+		List<File> listfiles = new File(txmDir).listFiles();
+		for(File teifile : listfiles)
+		{
+			println("annotate "+teifile)
+			File modelfile = new File(Toolbox.getParam(Toolbox.TREETAGGER_MODELS_PATH),"/rgaqcj.par");
+			if(!modelfile.exists())
+			{
+				println "Skipping ANNOTATE: Incorrect modelfile path: "+modelfile;
+				return;
+			}
+			File annotfile = new File(rootDir+"annotations",teifile.getName()+"-STDOFF.xml");
+			File ttsrcfile = new File(rootDir+"treetagger",teifile.getName()+"-src.tt");
+			File ttrezfile = new File(rootDir+"treetagger",teifile.getName()+"-out.tt");
+			
+			//prepare file to be tagged
+			def builder = new BuildTTSrc(teifile.toURL());
+			builder.process(ttsrcfile);
+			
+			//Apply TT
+			if(!new File(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists() || Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH).length() == 0 )
+			{
+				println("Path to TreeTagger is wrong: "+Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
+				return;
+			}
+			TreeTagger tt = new TreeTagger(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/");
+			tt.settoken();
+			tt.setlemma();
+			tt.setquiet();
+			tt.setnounknown();
+			tt.setsgml();
+			tt.seteostag("<s>");
+			tt.treetagger( modelfile.getAbsolutePath(), ttsrcfile.getAbsolutePath(), ttrezfile.getAbsolutePath())
+			
+			//create stand-off annotation file
+			//targeted file for annotations
+			String target = teifile.getName()
+			
+			
+			//contains txm:application/txm:commandLine
+			File reportFile = new File(rootDir,"NLPToolsParameters.xml");
+			
+			String respPerson = System.getProperty("user.name");
+			String respId = "txm";
+			String respDesc = "NLP annotation tool";
+			String respDate = "Tue Mar  11 1:02:55 Paris, Madrid 2010";
+			String respWhen = ""
+			
+			String appIdent = "TreeTagger";
+			String appVersion = "3.2";
+			
+			String distributor = "";
+			String publiStmt = """""";
+			String sourceStmt = """""";
+			
+			def types = ["ttpos","ttlemma"];
+			def typesTITLE = ["ttpos","ttlemma"];
+			def typesDesc = ["fr pos","fr lemma"]
+			def typesTAGSET = ["",""]
+			def typesWEB = ["",""]
+			String idform ="w_";
+			String encoding ="UTF-8";
+			
+			def transfo = new CSV2W_ANA();
+			transfo.setAnnotationTypes( types, typesDesc, typesTAGSET, typesWEB, idform);
+			transfo.setResp(respId, respDesc,respDate, respPerson, respWhen);
+			transfo.setApp(appIdent, appVersion);
+			transfo.setTarget(target, reportFile);
+			transfo.setInfos(distributor,  publiStmt, sourceStmt);
+			transfo.process( ttrezfile, annotfile, encoding );
+			
+			//merge into the tei file
+			builder = new AnnotationInjection(teifile.toURL(), annotfile.toURL(), new ArrayList<String>());
+			builder.transfomFile(rootDir,"temp");
+			
+			if (!(teifile.delete() && new File(rootDir,"temp").renameTo(teifile))) println "Warning can't rename file "+new File(rootDir,"temp")+" to "+teifile
+		}
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("C:/Documents and Settings/alavrent/TXM/corpora/corptef/")
+		new annotate().run(dir);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/corptefLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/corptefLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/corptefLoader.groovy	(revision 728)
@@ -0,0 +1,134 @@
+/**
+ * Main.
+ *
+ * @param args the args
+ */
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.corptef;
+
+import org.txm.importer.corptef.importer;
+import org.txm.importer.corptef.compiler;
+import org.txm.importer.corptef.annotate;
+import org.txm.importer.corptef.pager;
+import org.txm.objects.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+
+// TODO: Auto-generated Javadoc
+/* (non-Javadoc)
+ * @see groovy.lang.Script#run()
+ */
+String userDir = System.getProperty("user.home");
+String rootDir;
+String lang;
+String encoding;
+String model;
+try{rootDir = rootDirBinding;lang=langBinding;encoding=encodingBinding;model=modelBinding;}
+catch(Exception)
+{	println "DEV MODE";//exception means we debug
+	if(!org.txm.Toolbox.isInitialized())
+	{
+		//rootDir = "C:\\Documents and Settings\\alavrent\\TXM\\sources\\corptef\\src";
+		rootDir = userDir+"/xml/corptef"
+		lang="fr";
+		encoding= "UTF-8";
+		model="rgaqcj";
+		Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File(userDir,"txminstall"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"txminstall/treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"txminstall/treetagger/models"));
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"),"TXM"));
+	}
+}
+
+File dir = new File(rootDir);
+
+println "-- IMPORTER - Reading source files"
+new importer().run(dir);
+
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/corptef");
+rootDir = binDir.getAbsolutePath();
+dir = new File(rootDir);
+
+println "-- ANNOTATE - Running NLP tools"
+new Annotate().run(dir,model+".par");
+
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+c.setDebug();
+//c.setCwbPath("C:/Program Files/TXM/cwb/bin");
+c.setLang(lang);
+c.run(dir);
+
+
+//move registry file to cwb registry dir
+File registryfile = new File(rootDir+"/registry","corptef");
+if(registryfile.exists())
+	org.txm.utils.FileCopy.copy(registryfile,new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"registry/corptef"))
+
+Workspace w = org.txm.Toolbox.workspace;
+Project p = w.getProject("default")
+p.removeBase("corptef")
+Base b = p.addBase("corptef");
+b.addDirectory(new File(rootDir,"txm"));
+b.setAttribute("lang", lang)
+b.propagateAttribute("lang")
+
+println "-- EDITION"
+new File(rootDir+"/HTML/").deleteDir()
+new File(rootDir+"/HTML/").mkdir();
+new File(rootDir+"/HTML/default/").mkdir();
+files = new File(rootDir,"txm").listFiles();
+
+for(String textname : b.getTextsID())
+{
+	Text text = b .getText(textname);
+	File srcfile = text.getSource();
+	File resultfile = new File(rootDir+"/HTML",srcfile.getName().substring(0,srcfile.getName().length()-4)+".html");
+	List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+	List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+	println("Building edition  : "+srcfile+" to : "+resultfile );
+	
+	def ed = new pager(srcfile,resultfile, NoSpaceBefore, NoSpaceAfter,600);
+	ed.writecorrespondancesFile(new File(rootDir,"edition_correspondances.txt"))
+	Edition editionweb = text.addEdition("default","html",resultfile);
+
+	for(int i = 0 ; i < ed.getPageFiles().size();i++)
+	{
+		File f = ed.getPageFiles().get(i);
+		String idx = ed.getIdx().get(i);
+		editionweb.addPage(f,idx);
+	}
+	
+//	Edition editionbp = text.addEdition("onepage","html",resultfile);
+//	editionbp.addPage(resultfile,ed.getIdx().get(0));
+}
+
+w.save();
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/compiler.groovy	(revision 728)
@@ -0,0 +1,617 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.corptef
+
+
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+
+import javax.xml.stream.*;
+import java.net.URL;
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class compiler.
+ */
+class compiler
+{
+
+	/** The debug. */
+	private boolean debug= false;
+
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The dir. */
+	private def dir;
+
+	/** The output. */
+	private def output;
+
+	/** The url. */
+	private def url;
+
+	/** The anahash. */
+	private HashMap<String,String> anahash =new HashMap<String,String>() ;
+
+	/** The text. */
+	String text="";
+
+	/** The base. */
+	String base="";
+
+	/** The project. */
+	String project="";
+
+	/** The cwb loc. */
+	String cwbLoc;
+
+	/** The lang. */
+	private String lang ="fr";
+
+	/**
+	 * initialize.
+	 *
+	 */
+	public compiler(){}
+
+	/**
+	 * Instantiates a new compiler.
+	 *
+	 * @param url the url
+	 * @param text the text
+	 * @param base the base
+	 * @param project the project
+	 */
+	public compiler(URL url,String text,String base, String project)
+	{
+		this.text = text
+		this.base = base;
+		this.project = project;
+		try {
+			this.url = url;
+			inputData = url.openStream();
+
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+
+	/**
+	 * set the language of the corpus.
+	 *
+	 * @param lang the lang
+	 * @return the java.lang. object
+	 */
+	public setLang(String lang)
+	{
+		this.lang = lang;
+	}
+
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the new cwb path
+	 */
+	public void setCwbPath(String path)
+	{
+		if(!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path;
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(String dirPathName, String fileName){
+		try {
+			File f = new File(dirPathName, fileName)
+			output = new OutputStreamWriter(new FileOutputStream(f,f.exists()) , "UTF-8");
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Go to text.
+	 */
+	private void GoToText()
+	{
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+		{
+			if(event == XMLStreamConstants.END_ELEMENT)
+				if(parser.getLocalName().equals("teiHeader"))
+					return;
+		}
+	}
+
+	/**
+	 * Transfom file wtc.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	public boolean transfomFileWtc(String dirPathName, String fileName)
+	{
+		createOutput(dirPathName, fileName);
+
+		String headvalue=""
+		String vAna = "";
+		String vForm = "";
+		String wordid= "";
+		String vHead = "";
+
+		int p_id = 0;
+		int q_id = 0;
+		int body_id = 0;
+		int front_id = 0;
+		int back_id = 0;
+		String lb_id = 0;
+		int lb_count = 0;
+		String pb_id = 0;
+		int pb_count = 0;
+		String ab_id = 0;
+
+		boolean captureword = false;
+
+		String vExpan = "";
+		String vCorr = "";
+		String vReg = "";
+		String vOrig = "";
+		String vSic = "";
+		String vAbbr = "";
+
+		boolean flaglg = false;
+		boolean flaghead = false;
+		boolean flagAuthor = false;
+		boolean flagDate = false;
+		boolean flagWord = false;
+		boolean flagForm = false;
+		boolean flagAna = false;
+
+		boolean flagchoice = false;
+		boolean flagcorr = false;
+		boolean flagsic = false;
+		boolean flagreg = false;
+		boolean flagexpan = false;
+		boolean flagorig = false;
+		boolean flagabbr = false;
+		boolean flagfw = false;
+
+		File xpathfile = new File(url.getFile());
+		String titreId = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='reference']/text()");
+		String auteur = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:author/text()");
+		String datecompo = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo']/@when");
+		String ssiecle = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo_sous_siecle']/@n");
+		String domaine = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:textDesc/tei:domain/@type");
+		String genre = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:textDesc/@n");
+		String forme = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:textClass/tei:catRef/@target[contains(.,'forme')]").substring(1);
+		String dialecte = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:region[@type='dialecte_auteur']/text()");
+
+		this.GoToText()
+		output.write("<txmcorpus lang=\""+lang+"\">\n");
+		try
+		{
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+			{
+				switch (event)
+				{
+					case XMLStreamConstants.START_ELEMENT:
+						switch (parser.getLocalName())
+						{
+							case "text":
+							output.write("<text id=\""+text+"\"" +
+							" titre=\""+titreId+"\"" +
+							" auteur=\""+auteur+"\"" +
+							" datecompo=\""+datecompo+"\"" +
+							" ssiecle=\""+ssiecle+"\"" +
+							" domaine=\""+domaine+"\"" +
+							" genre=\""+genre+"\"" +
+							" forme=\""+forme+"\"" +
+							" dialecte=\""+dialecte+"\"" +
+							" base=\""+base+"\"" +
+							" project=\""+project+"\">\n");
+							captureword=true;
+							break;
+
+							case "div":
+							//output.write("<div type=\""+parser.getAttributeValue(null,"type")+"\">\n");
+							break;
+
+							case "p":
+							output.write("<p n=\""+(p_id++)+"\">\n");
+							break;
+							case "ab":
+							output.write("<ab n=\""+ab_id+++"\" rend=\""+parser.getAttributeValue(null,"rend")+"\">\n");
+							break;
+							case "q":
+							output.write("<q n=\""+(q_id++)+"\">\n");
+							break;
+							case "front":
+							output.write("<front n=\""+(front_id++)+"\">\n");
+							break;
+							case "body":
+							output.write("<body n=\""+(body_id++)+"\">\n");
+							break;
+							case "back":
+							output.write("<back n=\""+(back_id++)+"\">\n");
+							break;
+							case "lb":
+							String n = parser.getAttributeValue(null,"n")
+							if(n != null)
+								lb_id = n;
+							else
+								lb_id =""+lb_count++;
+							break;
+							case "pb":
+							String n = parser.getAttributeValue(null,"n");
+							if(n != null)
+								pb_id = n;
+							else
+								pb_id = ""+(pb_count++);
+
+							break;
+
+							case "choice":
+							flagchoice = true;
+							break;
+							case "corr":
+							flagcorr = true;
+							vCorr= "";
+							break;
+							case "reg":
+							flagreg = true;
+							vReg= "";
+							break;
+							case "expan":
+							flagexpan = true;
+							vExpan= "";
+							break;
+							case "orig":
+							flagreg = true;
+							vOrig= "";
+							break;
+							case "sic":
+							flagsic = true;
+							vSic= "";
+							break;
+							case "abbr":
+							flagreg = true;
+							vAbbr= "";
+							break;
+
+							case "w":
+							for(int i = 0 ; i < parser.getAttributeCount(); i++)
+								if(parser.getAttributeLocalName(i).equals("id"))
+							{
+								wordid = parser.getAttributeValue(i);
+							}
+							vAna = "";
+							vForm = "";
+							flagWord = true;
+							break;
+							case "form":
+							flagForm = true;
+							vForm = "";
+							vAna ="";
+							break;
+
+							case "ana":
+							flagAna = true;
+							break;
+						}
+						break;
+
+					case XMLStreamConstants.END_ELEMENT:
+						switch (parser.getLocalName())
+						{
+							case "div":
+							break;
+
+							case "text":
+							output.write("</text>\n");
+							captureword=false;
+							break;
+							case "p":
+							output.write("</p>\n");
+							break;
+							case "ab":
+							output.write("</ab>\n");
+							break;
+							case "q":
+							output.write("</q>\n");
+							break;
+							case "front":
+							output.write("</front>\n");
+							break;
+							case "body":
+							output.write("</body>\n");
+							break;
+							case "back":
+							output.write("</back>\n");
+							break;
+
+							case "fw":
+							flagfw = false;
+							break;
+							case "choice":
+
+							if(vCorr != "")
+							{
+								//System.out.println(vCorr+" >> write corr "+vForm +"\t"+vAna+wordid+"\t"+pb_id+"\t"+lb_id+"\t"+vOrig+"\t"+vSic+"\t"+vAbbr)
+								output.write( vCorr +"\t"+vAna+wordid+"\t"+pb_id+"\t"+lb_id+"\t"+vOrig+"\t"+vSic+"\t"+vAbbr+"\n");
+							}
+							else if(vReg != "")
+							{
+								//System.out.println("write reg "+vForm)
+								output.write( vReg +"\t"+vAna+wordid+"\t"+pb_id+"\t"+lb_id+"\t"+vOrig+"\t"+vSic+"\t"+vAbbr+"\n");
+							}
+							else if(vExpan != "")
+							{
+								//System.out.println("write expan "+vForm)
+								output.write( vExpan +"\t"+vAna+wordid+"\t"+pb_id+"\t"+lb_id+"\t"+vOrig+"\t"+vSic+"\t"+vAbbr+"\n");
+							}
+							flagchoice = false;
+							vCorr= "";
+							vSic= "";
+							break;
+							case "corr":
+							flagcorr = false;
+
+							break;
+							case "reg":
+							flagreg = false;
+							vReg = "";
+							break;
+							case "expan":
+							flagexpan = false;
+							vExpan= "";
+							break;
+							case "orig":
+							flagreg = false;
+							vOrig= "";
+							break;
+							case "sic":
+							flagsic = false;
+
+							break;
+							case "abbr":
+							flagreg = false;
+							vAbbr= "";
+							break;
+
+							case "w":
+							if(vAna != null)
+								if(captureword)
+							{
+								if(flagchoice)
+								{
+
+								}
+								else if(flagfw)
+								{
+
+								}
+								else
+								{
+									output.write( vForm +"\t"+vAna+wordid+"\t"+pb_id+"\t"+lb_id+"\t"+vOrig+"\t"+vSic+"\t"+vAbbr+"\n");
+								}
+
+							}
+
+							flagWord = false;
+							break;
+
+							case "form":
+							flagForm = false;
+							break;
+
+							case "ana":
+							vAna += "\t";
+							flagAna = false;
+							break;
+						}
+						break;
+
+					case XMLStreamConstants.CHARACTERS:
+						if(flagAna)
+						{
+							vAna += parser.getText().trim();
+						}
+
+						if(flagForm)
+						{
+							vForm += parser.getText().trim();
+							if(flagchoice)
+							{
+								if(flagsic)
+								{
+									vSic += parser.getText().trim();
+								}
+								if(flagorig)
+								{
+									vOrig += parser.getText().trim();
+								}
+								if(flagabbr)
+								{
+									vAbbr += parser.getText().trim();
+								}
+								if(flagcorr)
+								{
+									vCorr += parser.getText().trim();
+								}
+							}
+						}
+				}
+			}
+			output.write("</txmcorpus>");
+			output.close();
+			parser.close();
+			inputData.close();
+		}
+		catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}
+		catch (IOException ex) {
+			System.out.println("IOException while parsing " + inputData);
+		}
+
+		return true;
+	}
+
+
+
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @return true, if successful
+	 */
+	public boolean run(File rootDirFile)
+	{
+		String rootDir =rootDirFile.getAbsolutePath();
+
+		if(cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+
+		if(!new File(cwbLoc).exists())
+		{
+			println ("CWB path error: "+cwbLoc)
+			return false;
+		}
+		if(!new File(rootDir).exists())
+		{
+			println ("binary directory does not exists: "+rootDir)
+			return false;
+		}
+		new File(rootDir+"/wtc/","corptef.wtc").delete();//cleaning&preparing
+		new File(rootDir,"/wtc/").deleteDir();
+		new File(rootDir,"/wtc/").mkdir();
+		new File(rootDir,"/data/").deleteDir();
+		new File(rootDir,"/data/").mkdir();
+		new File(rootDir,"registry/").mkdir();
+
+		String textid="";
+		int counttext =0;
+		List<File> files = new File(rootDirFile,"txm").listFiles();
+		Collections.sort(files);
+		//1- Transform into WTC file
+		for(File f : files)
+		{
+			counttext++;
+			if(!f.exists())
+			{
+				println("file "+f+ " does not exists")
+			}
+			else
+			{
+				println("process file "+f)
+				String txtname = f.getName().substring(0,f.getName().length()-4);
+				def builder = new compiler(f.toURL(),txtname, "corptef", "default");
+				builder.setLang lang
+				builder.transfomFileWtc(rootDir+"/wtc","corptef.wtc");
+			}
+		}
+
+		//2- Import into CWB
+		def outDir = rootDir;
+		CwbEncode cwbEn = new CwbEncode();
+		cwbEn.setDebug(debug);
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		cwbMa.setDebug(debug);
+		String[] pAttributes = ["ttpos","ttlemme","id","pb","lb","orig","sic","abbr"];
+		String[] sAttributes = ["txmcorpus:0+lang", "text:0+id+titre+auteur+datecompo+ssiecle+domaine+genre+forme+dialecte+base+project","front:0+n","body:0+n","ab:0+n+rend","div:0+id+type","p:0+n","back:0+n"];
+		try {
+
+			String regPath = new File(outDir , "registry/corptef").getAbsolutePath();
+			cwbEn.run(new File(cwbLoc,"cwb-encode").getAbsolutePath(),
+					new File(outDir, "/data").getAbsolutePath(),
+					new File(outDir, "wtc/"+"corptef.wtc").getAbsolutePath(),
+					regPath,
+					pAttributes, sAttributes);
+			if (!new File(regPath).exists()) {
+				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			cwbMa.run(new File(cwbLoc,"cwb-makeall").getAbsolutePath(),
+					"CORPTEF",
+					new File(outDir, "registry").getAbsolutePath());
+		} catch (Exception ex) {System.out.println(ex); return false;}
+		// "C:\Documents and Settings\alavrent\TXM\cwb\bin\cwb-encode" -d "C:\Documents and Settings\alavrent\TXM\corpora\corptef\data" -f "C:\Documents and Settings\alavrent\TXM\corpora\corptef\wtc\corpte.wtc" -R "C:\Documents and Settings\alavrent\TXM\corpora\corptef\registry\corptef" -c utf8 -xsB -xsB -P ttpos -P ttlemme -P id -P pb -P lb -P orig -P sic -P abbr -S text:0+id+titre+auteur+datecompo+ssiecle+domaine+genre+forme+dialecte+base+project -S front:0+n -S body:0+n -S ab:0+n+rend -S div:0+id+type -S p:0+n -S back:0+n
+		System.out.println("Done.")
+
+		return true;
+	}
+
+	/**
+	 * Sets the debug.
+	 */
+	public void setDebug()
+	{
+		this.debug = true;
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("C:/TXM/corpora/corptef/");
+		def c = new compiler();
+		c.setDebug();
+		c.setCwbPath("C:/Program Files/TXM/cwb/bin");
+		c.run(dir);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Corptef import module</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/pager.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/pager.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/pager.groovy	(revision 728)
@@ -0,0 +1,558 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.corptef;
+
+import org.txm.importer.*;
+import org.xml.sax.Attributes;
+import org.txm.importer.filters.*;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+// TODO: Auto-generated Javadoc
+/** Build BFM corpus simple edition from a xml-tei. @author mdecorde */
+class pager {
+	List<String> NoSpaceBefore;
+	
+	/** The No space after. */
+	List<String> NoSpaceAfter;
+
+	/** The wordcount. */
+	int wordcount = 0;
+	
+	/** The pagecount. */
+	int pagecount = 0;
+	
+	/** The wordmax. */
+	int wordmax = 0;
+
+	/** The wordid. */
+	String wordid;
+	
+	/** The first word. */
+	boolean firstWord = true;
+	
+	/** The wordvalue. */
+	String wordvalue;
+	
+	/** The interpvalue. */
+	String interpvalue;
+	
+	/** The lastword. */
+	String lastword = " ";
+	
+	/** The wordtype. */
+	String wordtype;
+	
+	/** The flagform. */
+	boolean flagform = false;
+	
+	/** The flaginterp. */
+	boolean flaginterp = false;
+	
+	/** The url. */
+	private def url;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The writer. */
+	OutputStreamWriter writer;
+	
+	/** The multiwriter. */
+	OutputStreamWriter multiwriter = null;
+	
+	/** The infile. */
+	File infile;
+	
+	/** The outfile. */
+	File outfile;
+	
+	/** The pages. */
+	ArrayList<File> pages = new ArrayList<File>();
+	
+	/** The idxstart. */
+	ArrayList<String> idxstart = new ArrayList<String>();
+	
+	/** The titre id. */
+	String titreId;
+
+	/**
+	 * Instantiates a new pager.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param NoSpaceBefore the no space before
+	 * @param NoSpaceAfter the no space after
+	 * @param max the max
+	 */
+	pager(File infile, File outfile, List<String> NoSpaceBefore,
+			List<String> NoSpaceAfter, int max) {
+		this.wordmax = max;
+		this.NoSpaceBefore = NoSpaceBefore;
+		this.NoSpaceAfter = NoSpaceAfter;
+		this.url = infile.toURI().toURL();
+		this.infile = infile;
+
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		createOutput(outfile);
+		process();
+	}
+
+	/**
+	 * Creates the next output.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean createNextOutput()
+	{
+		try {
+			if(multiwriter != null)
+			{
+				multiwriter.write("</body>");
+				multiwriter.write("</html>");
+				multiwriter.close();
+			}
+			pagecount++;
+			File f = new File(outfile.getParent()+"/multi/",outfile.getName().substring(0,outfile.getName().length()-5)+"_"+pagecount+".html");
+			pages.add(f);
+			idxstart.add(wordid)
+			multiwriter = new OutputStreamWriter(new FileOutputStream(f) , "UTF-8");
+			
+			multiwriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+			multiwriter.write("<html>");
+			multiwriter.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+			multiwriter.write("<head>");
+			multiwriter.write("<title>BFM - "+titreId+" - "+pagecount+"</title>");
+			multiwriter.write("</head>");
+			multiwriter.write("<body>");
+			if(wordid != null)
+			{
+				String[] splited = wordid.split("_");
+				int no = Integer.parseInt(splited[1]);
+				multiwriter.write("<span id=\""+splited[0]+"_"+(no++)+"\"/>");
+			}
+						
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile) {
+		try {
+			this.outfile = outfile;
+
+			writer = new OutputStreamWriter(new FileOutputStream(outfile),
+					"UTF-8");
+
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Gets the page files.
+	 *
+	 * @return the page files
+	 */
+	public ArrayList<File> getPageFiles() {
+		return pages;
+	}
+
+	/**
+	 * Gets the idx.
+	 *
+	 * @return the idx
+	 */
+	public ArrayList<String> getIdx() {
+		return idxstart;
+	}
+
+	/**
+	 * Process.
+	 */
+	void process()
+	{
+		String localname = "";
+		
+		boolean closeTitre = false;
+		boolean closeAmen = false;
+		
+		boolean flagchoice = false;
+		boolean flagcorr = false;
+		boolean flagsic = false;
+		boolean flagreg = false;
+		boolean flagexpan = false;
+		boolean flagorig = false;
+		boolean flagabbr = false;
+		boolean flagforeign = false;
+				
+		File xpathfile = infile;
+		titreId = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='normal']/text()");
+		String auteur = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:author");
+		String datecompo = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo']/@when");
+		String ssiecle = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo_sous_siecle']/@n");
+		String domaine = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:textDesc/tei:domain/@type");
+		String genre = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:textDesc/@n");
+		String forme = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:textClass/tei:catRef/@target[contains(.,'forme')]");
+		String dialecte = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:region[@type='dialecte_auteur']");
+		if(titreId == null)
+			System.err.println("titreId regexp error");
+		if(auteur == null)
+			System.err.println("auteur regexp error");
+		if(datecompo == null)
+			System.err.println("datecompo regexp error");
+		if(ssiecle == null)
+			System.err.println("ssiecle regexp error");
+		if(domaine == null)
+			System.err.println("domaine regexp error");
+		if(genre == null)
+			System.err.println("genre regexp error");
+		if(forme == null)
+			System.err.println("forme regexp error");
+		
+		if(dialecte == null)
+			System.err.println("dialecte regexp error");
+		if(titreId == null || auteur == null || datecompo == null || ssiecle == null || domaine == null || genre == null || forme == null || dialecte == null)
+			return;
+		forme = forme.substring(1);
+		createNextOutput();
+		
+		writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+		writer.write("<html>");
+		writer.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+		writer.write("<head>");
+		writer.write("<title>BFM - "+titreId+"</title>");
+		writer.write("</head>");
+		writer.write("<body>");
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			
+			
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{
+					case "text":
+						
+						writer.write("<h1 align=\"center\" style=\"color:darkviolet;font-family:Times;font-weight:bold;font-style:italic;font-size=200%\" class=\"text\">"+titreId+"</h1>")
+						writer.write("<p align=\"center\">")
+						writer.write("_____________________________________________________<br/>\n")
+						writer.write("auteur : "+auteur+"<br/>");
+						writer.write("date de composition : "+datecompo+"<br/>");
+						writer.write("sous-siÃ¨cle : "+ssiecle+"<br/>");
+						writer.write("domaine : "+domaine+"<br/>");
+						writer.write("genre : "+genre+"<br/>");
+						writer.write("forme : "+forme+"<br/>");
+						writer.write("dialecte : "+dialecte+"<br/>");
+						writer.write("_____________________________________________________<br/>\n")
+						writer.write("</p>")
+						
+						
+						multiwriter.write("<h1 align=\"center\" style=\"color:darkviolet;font-family:Times;font-weight:bold;font-style:italic;font-size=200%\" class=\"text\">"+titreId+"</h1>")
+						multiwriter.write("<p align=\"center\">")
+						multiwriter.write("_____________________________________________________<br/>\n")
+						multiwriter.write("auteur : "+auteur+"<br/>");
+						multiwriter.write("date de composition : "+datecompo+"<br/>");
+						multiwriter.write("sous-siÃ¨cle : "+ssiecle+"<br/>");
+						multiwriter.write("domaine : "+domaine+"<br/>");
+						multiwriter.write("genre : "+genre+"<br/>");
+						multiwriter.write("forme : "+forme+"<br/>");
+						multiwriter.write("dialecte : "+dialecte+"<br/>");
+						multiwriter.write("_____________________________________________________<br/>\n")
+						multiwriter.write("</p>")
+						
+						break;
+						break;
+						case "head":
+							writer.write("<h2>\n")
+							multiwriter.write("<h2>\n")
+							break;
+						
+						case "lg":
+							writer.write("<p>\n")
+							multiwriter.write("<p>\n")
+							break;
+						
+						case "pb":
+							if(wordcount > 0)
+								createNextOutput();
+							if(parser.getAttributeValue(null,"n") != null)
+							{
+								writer.write("<p style=\"color:red\" align=\"center\">- "+parser.getAttributeValue(null,"n")+" -</p>\n")
+								multiwriter.write("<p style=\"color:red\" align=\"center\">- "+parser.getAttributeValue(null,"n")+" -</p>\n")
+							}
+							break;
+						
+						case "ab":
+							if(parser.getAttributeValue(null,"n") != null)
+							{
+								writer.write("<p align=\"center\">"+parser.getAttributeValue(null,"n")+"</p>\n")
+								multiwriter.write("<p align=\"center\">"+parser.getAttributeValue(null,"n")+"</p>\n")
+							}
+							break;
+						case "l":
+							writer.write("<br/>\n")
+							multiwriter.write("<br/>\n")
+							break;
+						
+						case "p":
+						case "q":
+							writer.write("<p>\n")
+							multiwriter.write("<p>\n")
+							break;
+						
+						case "div":
+							if(parser.getAttributeValue(null,"type") == "titre")
+							{
+								writer.write("<h3>\n")
+								multiwriter.write("<h3>\n")
+								closeTitre = true;
+							}
+							else if(parser.getAttributeValue(null,"type") == "amen")
+							{
+								writer.write("<h3>\n")
+								multiwriter.write("<h3>\n")
+								closeAmen = true;
+							}
+							break;
+													
+						case "w":
+							wordid = parser.getAttributeValue(null,"id");
+							if(firstWord)
+							{
+								firstWord=false;
+								this.idxstart.set(0,wordid);
+							}
+							wordcount++;
+							if(wordcount >= wordmax)
+							{
+								
+								wordcount=0;
+							}
+							break;
+						
+						case "choice":
+							flagchoice = true;
+							break;
+						case "corr":
+							flagcorr = true;
+							break;
+						case "sic":
+							flagsic = true;
+							break;
+						case "reg":
+							flagreg = true;
+							break;
+						case "orig":
+							flagorig = true;
+							break;
+						case "foreign":
+							flagforeign = true;
+							break;
+						
+						case "ana":
+							flaginterp=true;
+							interpvalue+=" "+parser.getAttributeValue(null,"type").substring(1)+":"
+							break;
+						
+						case "form":
+							wordvalue="";
+							interpvalue ="";
+							flagform=true;
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{
+						case "head":
+							writer.write("</h2>\n")
+							multiwriter.write("</h2>\n")
+							break;
+						
+						case "div":
+							if(closeTitre)
+							{
+								writer.write("</h3>\n")
+								multiwriter.write("</h3>\n")
+								closeTitre = false;
+							}
+							else if(closeAmen)
+							{
+								writer.write("</h3>\n")
+								multiwriter.write("</h3>\n")
+								closeTitre = false;
+							}
+							break;
+						
+						case "lg":
+							writer.write("</p>\n")
+							multiwriter.write("</p>\n")
+							break;
+						
+						case "lb":
+							writer.write("<br/>\n")
+							multiwriter.write("<br/>\n")
+							break;
+						
+						case "p":
+						case "q":
+							writer.write("</p>\n")
+							multiwriter.write("</p>\n")
+							break;
+						
+						case "choice":
+							flagchoice = false;
+							break;
+						case "corr":
+							flagcorr = false;
+							break;
+						case "sic":
+							flagsic = false;
+							break;
+						case "reg":
+							flagreg = false;
+							break;
+						case "orig":
+							flagorig = false;
+							break;
+						case "foreign":
+							flagforeign = false;
+							break;
+						
+						case "form":
+							flagform = false
+							break;
+						
+						case "ana":
+							flaginterp = false
+							break;
+						
+						case "w":
+							int l = lastword.length();
+							String color = "";
+							if(flagcorr)
+								color = "style=\"color: green;\"";
+							else if(flagreg)
+								color = "style=\"color: blue;\"";
+							else if(flagforeign)
+								color = "style=\"color: blue;\"";
+							if(!flagchoice || flagcorr || flagreg)
+							{
+								String endOfLastWord = "";
+								if(l > 0)
+									endOfLastWord = lastword.subSequence(l-1, l);
+								
+								if(interpvalue != null)
+									interpvalue = interpvalue.replace("\"","&quot;");
+								
+								if(NoSpaceBefore.contains(wordvalue) || 
+										NoSpaceAfter.contains(lastword) || 
+										wordvalue.startsWith("-") || 
+										NoSpaceAfter.contains(endOfLastWord))
+								{
+									writer.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\" "+color+">");
+									multiwriter.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\" "+color+">");
+								}
+								else
+								{
+									writer.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\" "+color+">");
+									multiwriter.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\" "+color+">");
+								}
+								writer.write(wordvalue.replace("<", "&lt;")+"</span>");
+								multiwriter.write(wordvalue.replace("<", "&lt;")+"</span>");
+								lastword=wordvalue;
+							}
+						
+						
+							break;
+					}
+					break;
+				
+				case XMLStreamConstants.CHARACTERS:
+					if(flagform)
+						if(parser.getText().length() > 0)
+							wordvalue+=(parser.getText());
+					if(flaginterp)
+						if(parser.getText().length() > 0)
+							interpvalue+=(parser.getText());
+					break;
+			}
+		}	
+		writer.write("</body>");
+		writer.write("</html>");
+		writer.close();
+		multiwriter.write("</body>");
+		multiwriter.write("</html>");
+		multiwriter.close();
+		inputData.close();
+	}
+
+	/**
+	 * Writecorrespondances file.
+	 *
+	 * @param file the file
+	 * @return the java.lang. object
+	 */
+	public writecorrespondancesFile(File file)
+	{
+		Writer w = new OutputStreamWriter(new FileOutputStream(file,file.exists()) , "UTF-8");
+		for(int i = 0 ; i < pages.size(); i ++)
+		{
+			w.write(pages.get(i).getName()+"\t"+idxstart.get(i)+"\n")
+		}
+		w.close();
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/importer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/importer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/corptef/importer.groovy	(revision 728)
@@ -0,0 +1,166 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.corptef;
+
+import org.txm.importer.*;
+import org.txm.importer.filters.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+import javax.xml.stream.*;
+import java.net.URL;
+
+import org.txm.Toolbox;
+
+import filters.CutHeader.*;
+import filters.ReunitBrokenWords.*;
+import filters.Tokeniser.*;
+import filters.TagSentences.*;
+import filters.FusionHeader.*;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class importer.
+ */
+class importer {
+	
+	/**
+	 * Run.
+	 *
+	 * @param dir the dir
+	 */
+	public void run(File dir)
+	{
+		//prepare
+		String rootDir = dir.getAbsolutePath()+"/";
+
+		//clean directories
+		File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/corptef");
+		binDir.deleteDir();
+		binDir.mkdir();
+		new File(binDir,"ptokenized").deleteDir();
+		new File(binDir,"ptokenized").mkdir();
+		new File(binDir,"tokenized").deleteDir();
+		new File(binDir,"tokenized").mkdir();
+		new File(binDir,"headers").deleteDir();
+		new File(binDir,"headers").mkdir();
+		new File(binDir,"txm").deleteDir();
+		new File(binDir,"txm").mkdir();
+
+		ArrayList<String> milestones = new ArrayList<String>();
+
+		List<File> files = new File(rootDir,"").listFiles();//scan directory split
+
+		//PREPARE EACH FILE TO BE TOKENIZED
+		for(File f : files)
+		{
+			File srcfile = f;
+			File resultfile = new File(binDir,"ptokenized/"+f.getName());
+			println("prepare tokenizer file : "+srcfile+" to : "+resultfile );
+
+			def builder2 = new OneTagPerLine(srcfile.toURL(), milestones);
+			builder2.process(resultfile);
+		}
+
+		rootDir = binDir.getAbsolutePath();
+
+		//TOKENIZE FILES
+		//Manager<Filter> filterManager = new FilterManager(ActionHome);	
+		files = new File(rootDir,"ptokenized").listFiles();//scan directory split
+		for(File infile : files)
+		{
+			Sequence S = new Sequence();
+			Filter F1 = new CutHeader();
+			Filter F2 = new ReunitBrokenWords();
+			Filter F6 = new Tokeniser(infile);
+			Filter F7 = new TagSentences();
+			Filter F11 = new FusionHeader();
+			S.add(F1);
+			S.add(F2);
+			S.add(F6);
+			//S.add(F7);
+			S.add(F11);
+
+			File xmlfile = new File(rootDir,"tokenized/"+infile.getName());
+			println("Tokenizing "+xmlfile)
+			S.SetInFileAndOutFile(infile.getAbsolutePath(), xmlfile.getAbsolutePath());
+			S.setEncodages("UTF-8","UTF-8");
+
+			Object[] arguments1 = [rootDir+"/headers/"+infile.getName()+"header.xml"];
+			F1.SetUsedParam(arguments1);
+			Object[] arguments2 = [rootDir+"/headers/"+infile.getName()+"header.xml",F1];
+			F11.SetUsedParam(arguments2);
+
+			S.proceed();
+			S.clean();
+		}
+
+		files = new File(rootDir,"tokenized").listFiles()
+		//TRANSFORM INTO XML-TEI-TXM
+		for(File f : files)
+		{
+			//ArrayList<String> milestones = new ArrayList<String>();
+			println("Building xml-tei-txm "+f+ " >> "+f.getName())
+			File file = f; 
+			String txmfile = f.getName();
+
+			def correspType = new HashMap<String,String>()
+			def correspRef = new HashMap<String,String>()
+
+			//il faut lister les id de tous les respStmt
+			def respId = [];
+			//fait la correspondance entre le respId et le rapport d'execution de l'outil
+			def applications = new HashMap<String,HashMap<String,String>>();	
+			//fait la correspondance entre le respId et les attributs type de la propriÃ©tÃ© ana du w txm
+			//pour construire les ref vers les taxonomies
+			def taxonomiesUtilisees = new HashMap<String,String[]>();
+			//associe un id d'item avec sa description et son URI
+			def itemsURI = new HashMap<String,HashMap<String,String>>();
+			//informations de respStmt
+			//resps (respId <voir ci-dessus>, [description, person, date])
+			def resps = new HashMap<String,String[]>();
+
+			//lance le traitement
+			def builder3 = new Xml2Ana(file);
+			builder3.setCorrespondances(correspRef, correspType);
+			builder3.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)
+			builder3.transformFile(rootDir,"txm/"+txmfile);
+		}
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("C:/TXM/corpora/corptef/")
+		new importer().run(dir);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/WriteIdAndNAttributes.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/WriteIdAndNAttributes.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/WriteIdAndNAttributes.groovy	(revision 728)
@@ -0,0 +1,231 @@
+package org.txm.importer
+
+class WriteIdAndNAttributes extends StaxIdentityParser {
+
+	String textname
+
+	int nMileStone = 1, nPb = 1, nCb = 1, nLb = 1, nW = 1, nSeg = 1, nRejet = 1;
+	String previousMileStone, previousPb, previousCb, previousW;
+
+
+	String PB = "pb", CB = "cb", LB = "lb", ID = "id", TYPE = "type",
+	N = "n", CORRESP = "corresp", FACS="facs", W="w", PC="pc", SEG="seg",
+	UNIT="unit", XML="xml", WP="wp", SURFACE="surface", POINT = ".", REJET ="rejet";
+
+	public WriteIdAndNAttributes(File xmlFile, String textname) {
+		super(xmlFile);
+
+		this.textname = textname
+	}
+
+	protected void writeAttributes() {
+		// do nothing
+	}
+
+	protected void processStartElement() {
+		String id = null
+		String n = null
+		String type = null
+		String corresp = null
+		String facs = null
+
+		for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+			if (parser.getAttributeLocalName(i) == ID) {
+				id = parser.getAttributeValue(i)
+			} else if (parser.getAttributeLocalName(i) == N) {
+				n = parser.getAttributeValue(i)
+			} else if (parser.getAttributeLocalName(i) == TYPE) {
+				type = parser.getAttributeValue(i)
+			} else if (parser.getAttributeLocalName(i) == CORRESP) {
+				corresp = parser.getAttributeValue(i)
+			} else if (parser.getAttributeLocalName(i) == FACS) {
+				facs = parser.getAttributeValue(i)
+			}
+		}
+
+		super.processStartElement(); // attributes are not written because super.writeAttributes() is not called
+
+		if (localname == "milestone" && parser.getAttributeValue(null, UNIT) == SURFACE) {
+			if (n == null) {
+				n = nMileStone
+			} else {
+				int tmp = Integer.parseInt(n)
+				if (nMileStone < tmp) {
+					nMileStone = tmp
+					n = tmp
+				} else {
+					n = nMileStone;
+				}
+			}
+
+			if (id == null) { // don't rewrite "id"
+				if (facs == null) {
+					println "Error: found milestone@type=\"surface\" with no @facs at "+parser.getLocation()
+					throw new Exception("no facs attribute")
+				}
+				if (facs.lastIndexOf(POINT) > 0) facs = facs.substring(0, facs.lastIndexOf(POINT))
+				previousMileStone = "surf_$textname"+"_"+facs
+				id = previousMileStone
+			} else {
+				previousMileStone = id
+			}
+
+			nMileStone++
+		} else if (localname == PB) {
+			if (n == null) {
+				n = nPb
+			} else {
+				try {
+					int tmp = Integer.parseInt(n)
+					if (nPb < tmp) {
+						nPb = tmp
+					} else {
+						n = nPb;
+					}
+				} catch(Exception e) { }
+			}
+
+			if (id == null) { // don't rewrite "id"
+				id = "page_${textname}_"+nPb
+				previousPb = "${textname}_"+nPb
+			} else {
+				previousPb = id
+			}
+
+			nRejet = nLb = nCb = 1
+			nPb++
+		} else if (localname == CB) {
+			if (n == null) {
+				n = nCb
+			} else {
+				try {
+					int tmp = Integer.parseInt(n)
+					if (nCb < tmp) {
+						nCb = tmp
+					} else {
+						n = nCb;
+					}
+				} catch(Exception e) { }
+			}
+
+			if (id == null) { // don't rewrite "id"
+				previousCb = "${previousPb}_"+nCb
+				id = "col_${previousPb}_"+nCb
+			} else {
+				previousCb = id
+			}
+
+			nLb = nRejet = 1
+			nCb++
+		} else if (localname == LB) {
+			if (n == null) {
+				if (REJET == type) {
+					println "Warning: no 'n' attribute provided for 'rejet' line break at "+parser.getLocation()
+				}
+				
+				n = nLb
+			} else {
+				if (REJET != type) {
+					try { // if n is numeric update nLgRelative
+						int tmp = Integer.parseInt(n)
+						nLb = tmp;
+					} catch(Exception e) {
+						// n is not numeric use it
+					}
+				}
+			}
+
+			if (id == null) { // don't rewrite "id"
+				if (REJET == type) {
+					id = "line_${previousCb}_"+n+"_r"+nRejet
+				} else {
+					id = "line_${previousCb}_"+n
+				}
+			}
+
+			if (corresp == null && REJET == type) {
+				//println "Warning: no 'corresp' attribute provided for 'rejet' line break at "+parser.getLocation()
+				corresp = "#line_${previousCb}_"+n; // next word id in the same column
+			}
+
+			if (REJET != type) {
+				nLb++;
+			} else {
+				nRejet++;
+			}
+
+		} else if (localname == W || localname == PC) {
+			if (n == null) {
+				n = nW
+			} else {
+				try {
+					int tmp = Integer.parseInt(n)
+					if (nW < tmp) {
+						nW = tmp
+					} else {
+						n = nW;
+					}
+				} catch(Exception e) { }
+			}
+
+			if (id == null) { // don't rewrite "id"
+				//previousW = "${previousPb}_"+nW
+				id = localname+"_${textname}_"+nW
+			} 
+			previousW = id
+			nSeg = 1
+			nW++
+		} else if (localname == SEG && WP == type) {
+			if (n == null) {
+				n = nSeg
+			} else {
+				try {
+					int tmp = Integer.parseInt(n)
+					if (nSeg < tmp) {
+						nSeg = tmp
+					} else {
+						n = nSeg;
+					}
+				} catch(Exception e) { }
+			}
+
+			if (id == null) { // don't rewrite "id"
+				id = "w_p_"+previousW+"_"+nSeg
+			}
+			nSeg++
+		}
+
+		// write attributes except ID, N and CORRESP
+		for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+			if (parser.getAttributeLocalName(i) == ID) {
+
+			} else if (parser.getAttributeLocalName(i) == N) {
+
+			}  else if (parser.getAttributeLocalName(i) == CORRESP) {
+
+			} else {
+				writeAttribute(parser.getAttributePrefix(i), parser.getAttributeLocalName(i), parser.getAttributeValue(i))
+			}
+		}
+		//if (localname == "lb") println "write id: "+["xml", "id", id]
+		if (id != null)
+			writeAttribute(XML, ID, id)
+		if (n != null)
+			writeAttribute(null, N, n)
+		if (corresp != null)
+			writeAttribute(null, CORRESP, corresp)
+	}
+
+	public static void main(String[] args) {
+		File xmlFile = new File("/home/mdecorde/xml/bugrejet/Psautier5-or28.xml")
+		File outFile = new File("/home/mdecorde/xml/bugrejet/Psautier5-or28-o.xml")
+
+		WriteIdAndNAttributes wiana = new WriteIdAndNAttributes(xmlFile, "qgraal_cm")
+		println wiana.process(outFile)
+
+		String text = xmlFile.getText().replaceAll(">", ">\n");
+		new File("/home/mdecorde/xml/bugrejet/Psautier5-or28-p.xml").write(text);
+		text = outFile.getText().replaceAll(">", ">\n");
+		new File("/home/mdecorde/xml/bugrejet/Psautier5-or28-o-p.xml").write(text);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/Hyperbase2Xml.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/Hyperbase2Xml.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/Hyperbase2Xml.groovy	(revision 728)
@@ -0,0 +1,184 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-06-26 16:53:47 +0200 (lun., 26 juin 2017) $
+// $LastChangedRevision: 3451 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer
+
+import org.txm.utils.CharsetDetector
+import org.txm.utils.i18n.DetectBOM;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+
+import javax.xml.stream.*;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Create a xml file per text declared in a Hyperbase file (old format).
+ *
+ * @author mdecorde
+ */
+class Hyperbase2Xml {
+	
+	/**
+	 * Run.
+	 *
+	 * @param infile the hyperbase file (old format)
+	 * @param outdir where the xml files are created
+	 * @param encoding the encoding of the hyperbase file
+	 * @return true, if successful
+	 */
+	public boolean run(File infile, File outdir, String encoding)
+	{
+		if (encoding == "??") {
+			encoding = new CharsetDetector(infile).getEncoding();
+			println "Guessing encoding of $infile : $encoding"
+		}
+		outdir.mkdir();
+		
+		String textname = null
+		String partname = null;
+		int textcount = 1;
+		def input = new FileInputStream(infile)
+		Reader reader = new InputStreamReader(input , encoding);
+		DetectBOM bomdetector = new DetectBOM(infile);
+		for (int ibom = 0 ; ibom < bomdetector.getBOMSize() ; ibom++) input.read()
+		
+		XMLOutputFactory factory = X	MLOutputFactory.newInstance();
+		BufferedOutputStream output = null;
+		XMLStreamWriter writer = null;
+		
+		boolean firsttext=true;
+		
+		String line = reader.readLine();
+		while(line != null) {
+			line = CleanFile.clean(line);
+			if ((line.startsWith("&&&"))) // text declaration &&& longtitle, title, shorttitle &&&
+			{
+				if (partname != null) // close previous part
+				{
+					//println("close last part")
+					writer.writeEndElement();
+					partname= null;
+				}
+				if (textname != null) // close previous text
+				{
+					//println("close text "+textname)
+					writer.writeEndElement();
+					writer.close();
+					output.close();
+				}
+				textname = line.substring(3, line.length()-3);
+				if (textname.contains(","))
+				{
+					String[] textnames = textname.split(",");
+					if(textnames.length > 1)
+						textname = textnames[1].trim();
+					
+				}
+				// create a new text
+				output = new BufferedOutputStream(new FileOutputStream(new File(outdir,textname+".xml")))
+				writer = factory.createXMLStreamWriter(output, "UTF-8");
+				writer.writeStartElement("text");
+				writer.writeAttribute("id",textname);
+				println "text : "+new File(outdir,textname+".xml");
+			}
+			else if((line.startsWith("%%%%"))) // an other type of text declaration
+			{
+				if(partname != null)
+				{
+					//println("close last part")
+					writer.writeEndElement();
+					partname= null;
+				}
+				if(textname != null)
+				{
+					//println("close text "+textname)
+					writer.writeEndElement();
+					writer.close();
+					output.close();
+				}
+				textname = infile.getName().substring(0, infile.getName().length()-4)+(textcount++);
+				output =  new BufferedOutputStream(new FileOutputStream(new File(outdir,textname+".xml")))
+				writer = factory.createXMLStreamWriter(output, "UTF-8");
+				writer.writeStartElement("text");
+				writer.writeAttribute("id",textname);
+				println "text : "+new File(outdir,textname+".xml");
+			}
+			else if((line.startsWith("\$"))) // paragraph declaration
+			{
+				if(partname != null)
+				{
+					//println("close part "+partname)
+					writer.writeEndElement();
+				}
+				partname = line.substring(1);
+				
+				writer.writeStartElement("p");
+				writer.writeAttribute("id",partname);
+			}
+			else // brut text > write chars
+			{
+				if(writer != null)
+					writer.writeCharacters(line+"\n");
+			}
+			line = reader.readLine();
+		}
+		
+		if(partname != null)
+		{
+			//println("close last part")
+			writer.writeEndElement();
+		}
+		if(writer != null)
+			writer.writeEndElement();
+		
+		reader.close();
+		if(output != null)
+			output.close();
+		
+		return true;
+	}
+	
+	/**
+	 * Main.
+	 *
+	 * @param args the args
+	 */
+	static main(args) 
+	{
+		File infile = new File(System.getProperty("user.home")+"/xml/presdiscfra/src/PresDiscFranc");
+		File outfile = new File(System.getProperty("user.home")+"/xml/presdiscfra/split/");
+		new Hyperbase2Xml().run(infile, outfile,"ISO-8859-1");
+		println "done"
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/SplitBy.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/SplitBy.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/SplitBy.groovy	(revision 728)
@@ -0,0 +1,204 @@
+package org.txm.importer
+
+import java.io.Writer;
+import java.io.File;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.txm.importer.filters.*;
+
+class SplitBy 
+{
+	
+	XMLOutputFactory factory = XMLOutputFactory.newInstance();
+	FileOutputStream output;
+	XMLStreamWriter writer;
+	def parser;
+	ArrayList<String> newfiles = [];
+	
+	public SplitBy(File xmlfile)
+	{
+		try {
+			def inputData = xmlfile.toURI().toURL().openStream();
+			def inputFactory = XMLInputFactory.newInstance();
+			parser = inputFactory.createXMLStreamReader(inputData);
+			
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+	boolean inby = false;
+	public boolean process(File outdir, String by, String idAttribute)
+	{
+		outdir.mkdirs();
+		try
+		{
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+				
+				switch(event)
+				{
+					case XMLStreamConstants.START_ELEMENT:
+						if(parser.getLocalName() == by)
+						{
+							
+							inby = true;
+							if(writer != null)
+							{
+								writer.close();
+								output.close();
+							}
+							
+							String filename = "";
+							for(int i = 0 ; i < parser.getAttributeCount(); i++)
+								if(parser.getAttributeLocalName(i) == idAttribute)
+								{
+									filename = parser.getAttributeValue(i);
+									break;
+								}
+							File newfile = new File(outdir,filename+".xml")
+							if(files.contains(newfile))
+							{
+								println "Item declared twice "+filename+" at location "+parser.getLocation();
+								return false;
+							}
+							files.add(newfile);
+							output = new FileOutputStream(newfile)
+							writer = factory.createXMLStreamWriter(output, "UTF-8");//create a new file
+							
+						}
+						if(writer != null)
+						{
+							writeEvent(event);
+							if(parser.getLocalName() == "TEI")
+							{ // write namespaces
+								writer.writeNamespace("tei", "http://www.tei-c.org/ns/1.0")
+								writer.writeNamespace("txm", "http://textometrie.org/1.0")
+							}
+						}
+						break;
+					case XMLStreamConstants.END_ELEMENT:
+						if(inby)
+						{
+							if(writer != null)
+							{
+								writer.writeEndElement();
+							}
+						}
+						if(parser.getLocalName() == by)
+						{
+							inby = false; // write the end element $by before
+						}
+						break;
+					case XMLStreamConstants.CHARACTERS:
+						if(writer != null)
+						{
+							writer.writeCharacters(parser.getText());
+						}
+						break;
+				}
+				
+			}
+			if(writer != null)
+				writer.close();
+			if(output != null)
+				output.close();
+			return true;
+		}
+		catch(Exception e){
+			println "XML Error at location: "+parser.getLocation()
+			e.printStackTrace()
+			if(writer != null)
+				writer.close()
+				output.close()
+				return false
+			}
+	}
+	
+	/**
+	 * write the current event.
+	 *
+	 * @param event the stax event
+	 */
+	private void writeEvent(int event)
+	{
+		def prefix = parser.getPrefix();
+		if (event == XMLStreamConstants.START_ELEMENT ) 
+		{
+			def localname = parser.getLocalName(); // write element
+			if (prefix != null && prefix.length() > 0)
+				writer.writeStartElement(prefix+":"+localname);
+			else
+				writer.writeStartElement(localname);
+			
+			for(int i = 0 ; i < parser.getNamespaceCount() ; i++) //write namespaces
+			{
+				writer.writeNamespace(parser.getNamespacePrefix(i), parser.getNamespaceURI(i));
+			}
+			
+			String attrprefix; // write attributes
+			for (int i = 0 ; i < parser.getAttributeCount() ; i++)
+			{
+				attrprefix = parser.getAttributePrefix(i);
+				if (attrprefix != null & attrprefix.length() > 0)
+					writer.writeAttribute(attrprefix+":"+parser.getAttributeLocalName(i), parser.getAttributeValue(i))
+				else
+					writer.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i))
+			}
+			//writer.writeCharacters("\n");
+		}
+		else if (event == XMLStreamConstants.END_ELEMENT)
+		{
+			writer.writeEndElement();
+			//writer.writeCharacters("\n");
+		}
+		else if (event == XMLStreamConstants.CHARACTERS)
+		{
+			writer.writeCharacters(parser.getText());
+		}
+		else if (event == XMLStreamConstants.COMMENT)
+		{
+			writer.writeComment(parser.getText());
+		}
+	}
+	
+	public ArrayList<File> getFiles()
+	{
+		return newfiles;
+	}
+	
+	public static void main(String[] args)
+	{
+		File xmlfile = new File("C:\\Documents and Settings\\mdecorde\\Bureau\\MISAT2011\\corpus\\tiempo\\ELTIEMPO.2002-2010.MIN.xml");
+		File okfile = new File("C:\\Documents and Settings\\mdecorde\\Bureau\\MISAT2011\\corpus\\tiempo\\");
+		File outdir = new File("C:\\Documents and Settings\\mdecorde\\Bureau\\MISAT2011\\corpus\\tiempo\\tiempo");
+		outdir.deleteDir();
+		outdir.mkdir();
+		
+		//		Reader reader = new InputStreamReader(new FileInputStream(xmlfile) , "ISO-8859-1");
+		//		Writer writer = new OutputStreamWriter(new FileOutputStream(okfile) , "UTF-8");
+		//		String line = reader.readLine();
+		//		while(line != null)
+		//		{
+		//			line = line.replaceAll(' ([a-zA-Z0-9]+)="(.*)""', ' $1="$2"')
+		//			writer.write(line+"\n");
+		//			line = reader.readLine();
+		//		}
+		//		reader.close();
+		//		writer.close();
+		//		
+		//		
+		////		if(!ValidateXml.test(okfile))
+		////		{
+		////			println "XML not valid";
+		////			return;
+		////		}
+		
+		def splitter = new SplitBy(xmlfile);
+		if(splitter.process(outdir, "texte", "id"))
+			println "success";
+		else
+			println "failed !"
+		
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/INARecords.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/INARecords.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/INARecords.groovy	(revision 728)
@@ -0,0 +1,39 @@
+package org.txm.importer
+
+import org.txm.utils.CsvReader;
+import java.nio.charset.Charset;
+
+File csvFile = new File("/home/mdecorde/xml/notices/MARTICE_20130304_TF1_IMAGO_1994-12-31.csv")
+CsvReader reader = new CsvReader(csvFile.getAbsolutePath(), ";".charAt(0), Charset.forName("UTF-8"))
+
+reader.readHeaders()
+def headers = reader.getHeaders()
+int nheader = headers.size()
+int nlines = 0;
+def counts = new int[nheader]
+def values = [:]
+for (String key : headers) values[key] = new HashSet()
+
+while (reader.readRecord()) {
+	nlines++;
+	for (int i = 0 ; i < nheader ; i++) {
+		String key = headers[i]
+		String str = " "+reader.get(key);
+		//print str
+		if (str.trim().length() > 0) {
+			counts[i] = counts[i] + 1
+			values[key] << str.trim()
+		}
+	}
+	//println ""
+}
+
+println "N lines: "+nlines
+println "Empty cols: N <= 20"
+for (int i = 0 ; i < nheader ; i++) {
+	
+	if (counts[i] < 30) {
+		println ( headers[i]+ " : "+counts[i])
+		println values[headers[i]]
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/TRSTestWorkflow.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/TRSTestWorkflow.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/TRSTestWorkflow.groovy	(revision 728)
@@ -0,0 +1,57 @@
+package org.txm.importer.transcriber
+
+import org.txm.utils.FileCopy;
+
+/**
+ * Test and Fix workflow for the STDDAD master corpus
+ * @author mdecorde
+ *
+ */
+
+File rootDir = new File("/home/mdecorde/xml/leman/")
+if (!rootDir.exists()) println "Error rootDir: "+rootDir;
+
+File dtdFile = new File(rootDir, "trans-14.dtd")
+File renamedTRSDir = new File(rootDir, "final 2012-03-26")
+File corrTRSDir = new File(rootDir, "corr")
+File okTRSDir = new File(rootDir, "ready")
+
+corrTRSDir.delete();
+corrTRSDir.mkdir();
+FileCopy.copy(dtdFile, new File(corrTRSDir, dtdFile.getName()));
+//okTRSDir.delete();
+okTRSDir.mkdir();
+FileCopy.copy(dtdFile, new File(okTRSDir, dtdFile.getName()));
+
+println "1- FixTimming"
+def files = renamedTRSDir.listFiles();
+files.sort()
+for (File trsFile : files) {
+	if (!trsFile.getName().endsWith(".trs")) continue;
+	println "FIX: "+trsFile
+	File newTRSFile = new File(corrTRSDir, trsFile.getName())
+	new FixTiming().fixTRS(trsFile, newTRSFile);
+}
+
+println "2- Validate"
+files = corrTRSDir.listFiles();
+files.sort()
+for(File trsFile : files) {
+	if(!trsFile.getName().endsWith(".trs")) continue;
+	File newTRSFile = new File(okTRSDir, trsFile.getName())
+	println "VALIDATE: "+trsFile
+	if(ValidateTRS.checkTRS(trsFile))
+		FileCopy.copy(trsFile, newTRSFile);
+}
+/*
+println "3- FINALLY"
+if (renamedTRSDir.listFiles().size() != corrTRSDir.listFiles().size) {
+	println "Missing corr transcriptions"
+	return;
+}
+
+if (corrTRSDir.listFiles().size() != okTRSDir.listFiles().size) {
+	println "Missing ok transcriptions"
+	return;
+}
+*/
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/transcriberLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/transcriberLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/transcriberLoader.groovy	(revision 728)
@@ -0,0 +1,309 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.importer.transcriber;
+
+import java.io.File;
+import org.txm.scripts.teitxm.*;
+import org.txm.*;
+import org.txm.objects.*;
+import org.txm.utils.i18n.*;
+import org.txm.utils.*;
+import org.txm.importer.*;
+import org.txm.metadatas.*;
+import org.txm.utils.FileCopy;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+//PARAMETERS
+boolean removeInterviewer = false;//if true the transcription of speakers (en1 and enq2) defined in metadatas file will be ignored
+boolean includeComments = false;
+boolean ignoreTranscriberMetadata = false;
+int csvHeaderNumber = 1;
+int maxlines = 200;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/anapovoas/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, "\t");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+String page_element = params.getPageElement("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+//get metadata values from CSV
+Metadatas metadatas; // text metadata
+File allmetadatasfile = new File(srcDir, "metadata.csv");
+println "Trying to read metadatas values from: "+allmetadatasfile
+if (allmetadatasfile.exists()) {
+	File copy = new File(binDir, "metadata.csv")
+	if (!FileCopy.copy(allmetadatasfile, copy)) {
+		println "Error: could not create a copy of metadata file "+allmetadatasfile.getAbsoluteFile();
+		return;
+	}
+	metadatas = new Metadatas(copy, Toolbox.getParam(Toolbox.METADATA_ENCODING), Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR), Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
+}
+else
+	println "no metadata file: "+allmetadatasfile
+
+File propertyFile = new File(srcDir, "import.properties")//default
+Properties props = new Properties();
+String[] metadatasToKeep;
+if (propertyFile.exists() && propertyFile.canRead()) {
+	FileInputStream input = new FileInputStream(propertyFile);
+	props.load(input);
+	input.close();
+
+	if (props.getProperty("removeInterviewer") != null)
+		removeInterviewer = Boolean.parseBoolean(props.get("removeInterviewer").toString());
+	if (props.getProperty("ignoreTranscriberMetadata") != null)
+		ignoreTranscriberMetadata = Boolean.parseBoolean(props.get("ignoreTranscriberMetadata").toString());
+	if (props.getProperty("metadataList") != null)
+		metadatasToKeep = props.get("metadataList").toString().split("|");
+	if (props.getProperty("csvHeaderNumber") != null)
+		csvHeaderNumber = props.get("csvHeaderNumber").toString().split("|");
+	//if (props.getProperty("includeComments") != null)
+	//	includeComments = props.get("includeComments").toString();
+
+	println "import properties: "
+	println " removeInterviewer: "+removeInterviewer
+	println " ignoreTranscriberMetadata: "+ignoreTranscriberMetadata
+	println " metadataToKeep: "+metadatasToKeep
+	println " ignored csvHeaderSize: "+csvHeaderNumber
+	//println " includeComments: "+includeComments
+}
+
+// Apply XSL
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(1, "XSL")
+if (xsl != null && xsl.trim().length() > 0) {
+	if (ApplyXsl2.processImportSources(new File(xsl), srcDir, new File(binDir, "src")))
+		srcDir = new File(binDir, "src");
+	println ""
+}
+
+try {
+	// select only trs files
+	String ext = "trs";
+	ArrayList<File> trsfiles = srcDir.listFiles(); //find all trs files
+	if (trsfiles  == null) {
+		println ("No files in "+srcDir.getAbsolutePath())
+		return false;
+	}
+	for (int i = 0 ; i < trsfiles.size() ; i++) {
+		File f = trsfiles.get(i);
+		if (!f.getName().endsWith(ext) || !f.canRead() || f.isHidden()) {
+			trsfiles.remove(i)
+			i--;
+		}
+	}
+
+	if (trsfiles.size() == 0) {
+		println ("No transcription file (*.trs) found in "+srcDir.getAbsolutePath()+". Aborting.")
+		return false;
+	}
+
+	if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	println "-- IMPORTER"
+	def imp = new importer(trsfiles, binDir, txmDir, metadatas, lang) //put result in the txm folder of binDir
+	if (!imp.run()) {
+		println "Failed to prepare files - Aborting";
+		return;
+	}
+	if (MONITOR != null) MONITOR.worked(20)
+
+	println "-- Xml Validation"
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	for (File infile : txmDir.listFiles()) {
+		if (!ValidateXml.test(infile)) {
+			println "$infile : Validation failed";
+			infile.delete();
+		}
+	}
+
+	if (MONITOR != null) MONITOR.worked(5)
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	println "-- Remove interviewer: "+removeInterviewer
+	if (removeInterviewer) 	{
+		if (metadatas == null) {
+			println "Can't remove interviewer without a metadata.csv file defining who are the interviewers."
+		} else {
+			println "Removing some speakers in "+txmDir.listFiles().length+" file(s)"
+			for (File infile : txmDir.listFiles()) {
+				String filename = infile.getName();
+				int idx = filename.indexOf(".xml");
+				if (idx > 0)
+					filename = filename.substring(0, idx);
+
+				ArrayList<Pair<String, String>> metas = metadatas.get(filename)
+				//println "filename=$filename metas= $metas"
+				for (Pair p : metas) {
+					if (p.getFirst().startsWith("enq")) {
+						new RemoveSpeaker(infile, infile, p.getFirst())
+					}
+				}
+			}
+		}
+	}
+
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+	println "-- ANNOTATE - Running NLP tools"
+	boolean annotationSuccess = false;
+	if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
+		annotationSuccess = true;
+	}
+
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+	println "--COMPILING - Building Search Engine indexes"
+	trsfiles = txmDir.listFiles();
+
+	def comp = new compiler()
+	if(debug) comp.setDebug();
+	comp.removeInterviewers(removeInterviewer);
+	comp.setIgnoreTranscriberMetadata(ignoreTranscriberMetadata);
+	comp.setAnnotationSucces(annotationSuccess)
+	if (!comp.run(trsfiles, corpusname, "default", binDir)) {
+		println "Failed to compile files";
+		return;
+	}
+	
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	
+	File htmlDir = new File(binDir,"HTML/$corpusname");
+	htmlDir.deleteDir()
+	htmlDir.mkdirs();
+	if (build_edition) {
+		
+		if (MONITOR != null) MONITOR.worked(20, "EDITION")
+		println "-- EDITION - Building editions"
+		
+		List<File> filelist = txmDir.listFiles();
+		Collections.sort(filelist);
+		def second = 0
+
+		println "Paginating texts: "
+		for (File txmFile : filelist) {
+			print "."
+			String txtname = txmFile.getName();
+			int i = txtname.lastIndexOf(".");
+			if(i > 0) txtname = txtname.substring(0, i);
+
+			List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+			List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+			Element text = params.addText(corpusElem, txtname, txmFile);
+
+			def ed = new pager(txmFile, htmlDir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, page_element, metadatas);
+			Element edition = params.addEdition(text, "default", htmlDir.getAbsolutePath(), "html");
+
+			for (i = 0 ; i < ed.getPageFiles().size();) {
+				File f = ed.getPageFiles().get(i);
+				String wordid = ed.getIdx().get(i);
+				params.addPage(edition, ""+(++i), wordid);
+			}
+
+			if (ed.getPageFiles().size() > 0) {
+				Element editionBD = params.addEdition(text, "onepage", htmlDir.getAbsolutePath(), "html");
+				params.addPage(editionBD, "1", ed.getIndexes().get(0));
+			}
+		}
+
+		//copy transcriber.css
+		File cssfile = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "css/transcriber.css")
+		if (cssfile.exists() && htmlDir.exists()) {
+			FileCopy.copy(cssfile, new File(htmlDir, "transcriber.css"));
+			FileCopy.copy(cssfile, new File(htmlDir, "onepage/transcriber.css"));
+			FileCopy.copy(cssfile, new File(htmlDir, "default/transcriber.css"));
+		}
+	}
+}
+catch (Exception e){org.txm.utils.logger.Log.printStackTrace(e);}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/RemoveSpeaker.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/RemoveSpeaker.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/RemoveSpeaker.groovy	(revision 728)
@@ -0,0 +1,131 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.importer.transcriber;
+
+
+import org.txm.importer.*;
+import org.txm.importer.graal.PersonalNamespaceContext
+import org.txm.utils.*;
+import org.txm.metadatas.*;
+
+import java.io.File;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javax.xml.parsers.*;
+import javax.xml.xpath.*;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+
+
+// TODO: Auto-generated Javadoc
+/**
+ * Removes "u" tags of TRS file given an "u@name" value. 
+ * @author mdecorde
+ *
+ */
+public class RemoveSpeaker {
+	File outfile;
+	
+	/** The doc. */
+	Document doc;
+	
+	/**
+	 * Instantiates a new removes the speaker.
+	 *
+	 * @param transcriptionfile the transcriptionfile
+	 * @param outfile the outfile
+	 * @param id the id
+	 */
+	public RemoveSpeaker(File transcriptionfile, File outfile, String id)
+	{
+		System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl");
+				
+		this.outfile = outfile;
+		String xpathString = "//tei:u[@spk='"+id+"']";
+		//println "removing $xpathString in $transcriptionfile"
+		DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+		//println "domFactory: $domFactory"
+		domFactory.setNamespaceAware(true); // never forget this!
+		domFactory.setXIncludeAware(true);
+		DocumentBuilder builder = domFactory.newDocumentBuilder();
+		//println "builder $builder"
+		doc = builder.parse(transcriptionfile);
+		//println "doc $doc"
+		
+		def xpath = XPathFactory.newInstance().newXPath()
+		xpath.setNamespaceContext(new PersonalNamespaceContext());
+		def expr = xpath.compile(xpathString);
+		def nodes = expr.evaluate(doc, XPathConstants.NODESET);
+		
+		for (def node : nodes) {
+			//println "remove node "+node
+			Element elem = (Element)node;
+			elem.getParentNode().removeChild(node);
+		}
+		save()
+	}
+	
+	/**
+	 * Save.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean save()
+	{
+		try {
+			// CrÃ©ation de la source DOM
+			Source source = new DOMSource(doc);
+			
+			// CrÃ©ation du fichier de sortie
+			Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8")); 
+			Result resultat = new StreamResult(writer);
+			
+			// Configuration du transformer
+			//TransformerFactory fabrique = new net.sf.saxon.TransformerFactoryImpl();
+			TransformerFactory fabrique = new net.sf.saxon.TransformerFactoryImpl();
+			//println "fabrique $fabrique"
+			Transformer transformer = fabrique.newTransformer();
+			//println "transformer $transformer"
+			transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+			transformer.setOutputProperty(OutputKeys.INDENT, "yes"); 
+			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); 
+			
+			// Transformation
+			transformer.transform(source, resultat);
+			writer.close();
+			return true;
+		} catch (Exception e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return false;
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/TranscriberTokenizer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/TranscriberTokenizer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/TranscriberTokenizer.groovy	(revision 728)
@@ -0,0 +1,192 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.importer.transcriber
+
+import filters.Tokeniser.SimpleTokenizerXml;
+
+/**
+ * The Class TranscriberTokenizer : manages Transcriber notations
+ */
+class TranscriberTokenizer extends SimpleTokenizerXml{
+	
+	/** The troncature. */
+	boolean troncature = false;
+	
+	/** The audio. */
+	String audio ="F";
+	
+	/** The notation. */
+	String notation = "";
+	
+	/** paroles rapportees */
+	boolean rapp = false;
+	
+	/** The event. */
+	String event="";
+	String txtname;
+	
+	/**
+	 * Instantiates a new transcriber tokenizer.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 */
+	public TranscriberTokenizer(File infile, File outfile)
+	{
+		super(infile, outfile, null)
+		txtname = infile.getName();
+		int idx = txtname.lastIndexOf(".")
+		if (idx > 0) txtname = txtname.substring(0, idx);
+	}
+	
+	/**
+	 * Instantiates a new transcriber tokenizer.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 */
+	public TranscriberTokenizer(File infile, File outfile, String lang)
+	{
+		super(infile, outfile, lang)
+		txtname = infile.getName();
+		int idx = txtname.lastIndexOf(".")
+		if (idx > 0) txtname = txtname.substring(0, idx);
+	}
+	
+	/* (non-Javadoc)
+	 * @see filters.Tokeniser.SimpleTokenizerXml#processWord()
+	 */
+	protected void processWord()
+	{
+		//println " chars: "+parser.getText().trim();
+		String text = buffer.toString().trim().replace("\t", " ");
+		text = text.replaceAll("\\p{C}", "");
+		String previousChar = "";
+		for (String s : text.split("[\\p{Z}\\p{C}]+") )	
+		{
+			//init transcriber attributes
+			if (troncature)
+				audio = "absent";
+			else
+				audio = "present"
+			notation = s;
+			event = "";
+			
+			if (s.startsWith("\"")) {
+				rapp = true;
+				event += "#rapp1";
+			} else if(s.endsWith("\"")) {
+				rapp = false;
+				event += "#rapp2";
+			}
+
+			//test events
+			if (s.startsWith("^^")) {
+				event += "#orth";			
+				s = s.substring(2);
+			}
+			if (s.startsWith("*")) {
+				event += "#corr";
+				s = s.substring(1);
+			}
+			
+			if (event.length() > 0)
+				event = event.substring(1);//remove '|'
+			
+			// test audio
+			if (s.contains("(") || s.contains(")")) // contains ( or )
+			{
+				if (s.contains("(") ^ s.contains(")")) // ert(ert XOR ert)ert
+				{
+					audio = "partiel"
+					
+					if (s.contains("(")) // ert(ert
+					{
+						troncature = true;
+						if (s.startsWith("(")) // (ertert
+						{
+							audio = "absent";
+						}
+					} else // ert)ert
+					{
+						troncature = false;
+						if (s.endsWith(")")) // ertert)
+						{
+							audio = "absent";
+						}
+					}
+				}
+				else if (s.contains("(") && s.contains(")")) // ert(ert)ert OR ert)ert(ert
+				{
+					audio = "partiel";
+					if (s.startsWith("(") && s.endsWith(")")) // (ertert)
+					{
+						audio = "absent";
+						troncature = false;
+					} else if (s.indexOf("(") < s.indexOf(")")) // ert(ert)ert
+					{
+						troncature = false;
+					} else // ert)ert(ert
+					{
+						troncature = true;
+					}
+				}
+				s = s.replace("(","");
+				s = s.replace(")","");
+			}
+						
+			iterate(s);
+		}
+	}
+	
+	/**
+	 * Iterate.
+	 *
+	 * @param s the s
+	 * @return the java.lang. object
+	 */
+	protected iterate(String s)
+	{
+		while (s != null && s.length() > 0) {
+			if (DEBUG) {println "  > $s"}
+			s = standardChecks(s);
+			event = "";
+		}
+	}
+	
+	/* (non-Javadoc)
+	 * @see filters.Tokeniser.SimpleTokenizerXml#writeWordAttributes()
+	 */
+	protected writeWordAttributes()
+	{
+		writer.writeAttribute("id","w_"+txtname+"_"+wordcount);
+		writer.writeAttribute("audio", audio);
+		writer.writeAttribute("event", event);
+		writer.writeAttribute("notation", notation);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/compiler.groovy	(revision 728)
@@ -0,0 +1,678 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.importer.transcriber
+
+import java.io.File;
+
+import javax.xml.stream.*;
+
+import java.io.OutputStreamWriter;
+import java.util.LinkedHashMap;
+
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.cwb.CwbProcess;
+import org.txm.importer.cwb.PatchCwbRegistry;
+import org.txm.utils.Pair;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class compiler.
+ */
+class compiler {
+
+	boolean ADD_TEXTID_TO_REF = true
+	
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The output. */
+	OutputStreamWriter output;
+
+	/** The basename. */
+	String corpusname;
+
+	/** The projectname. */
+	String projectname
+
+	/** The outdir. */
+	String outdir;
+
+	/** The debug. */
+	boolean debug = false;
+
+	/** The annotation succes. */
+	boolean annotationSucces = false;
+
+	/** The removeinterviewers. */
+	boolean removeinterviewers = false;
+
+	/** The trans. */
+	HashMap<String, ArrayList<Pair<String, String>>> trans;
+
+	/** The speakers. */
+	HashMap<String, ArrayList<Pair<String, String>>> speakers;
+
+	/** The speakersname. */
+	HashMap<String, String> speakersname = new HashMap<String, String>();
+
+	/** The topics. */
+	HashMap<String, ArrayList<Pair<String, String>>> topics;
+
+
+	/** The interviewers. */
+	ArrayList<String> interviewers = [];
+	static HashSet<String> sectionAttrs;
+
+	/** The anatypes. */
+	private static anatypes = []
+	private static anavalues = [:]
+
+	/**
+	 * Removes the interviewers.
+	 *
+	 * @param value the value
+	 * @return the java.lang. object
+	 */
+	public removeInterviewers(boolean value) {
+		this.removeinterviewers = value;
+	}
+
+	/**
+	 * Run.
+	 *
+	 * @param xmlfiles the xmlfiles
+	 * @param basename the basename
+	 * @param projectname the projectname
+	 * @param outdir the outdir
+	 * @return true, if successful
+	 */
+	public boolean run(List<File> xmlfiles, String corpusname, String projectname, File binDir)
+	{
+		Collections.sort(xmlfiles);
+		//println "run compiler with $xmlfiles, $basename and $outdir"
+		this.outdir = binDir;
+		this.corpusname = corpusname;
+		this.projectname = projectname;
+
+		anatypes = ["event"] // reset
+		anavalues = [:] // reset
+
+		sectionAttrs = new HashSet<String>() // reset section attributs set
+
+		File wtcDir = new File(binDir, "wtc")
+		new File(binDir, "wtc").delete();
+		wtcDir.mkdir();
+		if (!new File(binDir, "wtc").exists()) {
+			println "Can't create wtc directory"
+			return false;
+		}
+
+		File wtcFile = new File(wtcDir, corpusname.toLowerCase()+".wtc")
+
+		// get all anatypes
+		for (File f : xmlfiles) {
+			getAnaTypes(f)
+		}
+		//println "ANATYPES: "+anatypes
+		if (!createOutput(wtcFile)) return false;
+		output.write("<txmcorpus lang=\"fr\">\n")
+		output.close();
+
+		println("Compiling "+xmlfiles.size()+" files")
+		for (File f :xmlfiles) {
+			if (f.exists())
+				if (!process(f)) {
+					println("Failed to compile "+f)
+				}
+		}
+
+		if (!createOutput(wtcFile)) return false;
+		output.write("</txmcorpus>\n")
+		output.close();
+
+		//2- Import into CWB
+		File registryFile = new File(binDir, "registry/"+corpusname.toLowerCase())
+		File dataDir = new File(binDir, "data/$corpusname")
+
+		new File(binDir, "registry").mkdir();
+		if (!new File(binDir, "registry").exists()) {
+			println "Can't create registry directory"
+			return false;
+		}
+
+		String cwbLoc = CwbProcess.getCWBLocation();
+		if (cwbLoc == null) return false;
+
+		CwbEncode cwbEn = new CwbEncode();
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		cwbEn.setDebug(debug);
+		cwbMa.setDebug(debug);
+
+		String uAttr = "u:0+spkid+spk+scope+accent+s+time+check+dialect+type";
+		String textAttr ="text:0+base+project"
+		if (trans != null) {
+			for (String key : trans.keySet()) {
+				for (Pair p : trans.get(key)) {
+					if (ignoreTranscriberMetadata) {
+						String meta =p.getFirst();
+						if (	meta != "scribe" && meta != "audio_filename" &&
+						meta != "version" && meta != "version_date")
+							textAttr+="+"+meta
+					} else {
+						textAttr+="+"+p.getFirst()
+					}
+				}
+				break;
+			}
+		}
+
+		String sectionAttr = "div:0" // "div:0+id+topic+endtime+starttime+type"
+		for (String attr : sectionAttrs) {
+			sectionAttr += "+"+attr
+		}
+
+		List<String> pargs = ["spk", "ref", "id", "entitytype", "entityid"]
+		for (String ana : anatypes) pargs.add(ana)
+
+		String[] pAttributes = pargs
+
+		String[] sAttributes = ["txmcorpus:0+lang", uAttr , textAttr, "event:0+id+desc+type+extent", sectionAttr, "sp:0+id+speaker+endtime+starttime+overlap+time"];
+
+		println "pAttributes: $pAttributes"
+		println "sAttributes: $sAttributes"
+		//return;
+		try {
+			cwbEn.run(cwbLoc + "cwb-encode", dataDir.getAbsolutePath(),
+					wtcFile.getAbsolutePath(),
+					registryFile.getAbsolutePath(), pAttributes, sAttributes);
+			if (!registryFile.exists()) {
+				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			cwbMa.run(cwbLoc + "cwb-makeall", corpusname, registryFile.getParent());
+			
+
+		} catch (Exception ex) {System.out.println(ex); return false;}
+
+
+		return true;
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File f){
+		try {
+			//File f = new File(dirPathName, fileName)
+			output = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(f,f.exists())) , "UTF-8");
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/** The text_id. */
+	String text_id
+
+	/** The u opened. */
+	boolean uOpened = false;
+
+	/** The idturn. */
+	int idturn = 1;
+
+	/** The idsection. */
+	int idsection = 1;
+
+	/** The idu. */
+	int idu = 1;
+
+	/** The idevent. */
+	int idevent = 1;
+
+	/** The events. */
+	List<String> events = [];
+	static int vEntityId = 0;
+	static int vEntityIdCount = 1;
+
+	/**
+	 * Process.
+	 *
+	 * @param xmlfile the xmlfile
+	 * @return true, if successful
+	 */
+	private boolean process(File xmlfile) {
+		text_id = xmlfile.getName();
+		text_id = text_id.substring(0, text_id.length() -4);
+
+		idturn = 1;
+		idsection = 1;
+		idu = 1;
+
+		boolean flagAna;
+		boolean flagForm;
+		boolean flagWord;
+		String vWord="";
+		String vForm="";
+		String vAna="";
+		String vEvents = "N/A";
+		String vEntityType = "N/A"
+		String wordid= "";
+		//def wordattributes = [:];
+		String anatype = "";
+		String anavalue = "";
+
+		String formatedTime;
+
+		LinkedHashMap<String, String> anahash = new LinkedHashMap<String, String>();
+		String currentType;
+
+		URL url = xmlfile.toURI().toURL();
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		String filename = xmlfile.getName()
+		String textid = filename.substring(0, filename.length() - 4);
+
+		createOutput(new File(outdir, "wtc/"+corpusname.toLowerCase()+".wtc"));
+		String localname;
+
+		//get all metadatas declared before Episode tag
+		speakers = new HashMap<String, ArrayList<Pair<String, String>>>();
+		trans = new HashMap<String, ArrayList<Pair<String, String>>>();
+		topics = new HashMap<String, ArrayList<Pair<String, String>>>();
+		//println "parse infos"
+		parseInfos();
+
+		//		println "Trans: $trans"
+		//		println "Topics: $topics"
+		//		println "Speakers: $speakers"
+		//		def transproperties = ""
+		//		for (String key : trans.keySet()) {
+		//			for (Pair p : trans.get(key))
+		//				transproperties+="\t"+p.getSecond();
+		//			break;
+		//		}
+		//		println "Trans properties: "+transproperties
+		List<String> localspeakers;
+
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			//print "event: "+event +" "
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+				//println localname
+					switch(localname) {
+						case "div":
+							output.write("<div");
+							for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
+								String name = parser.getAttributeLocalName(i).replace("_","").toLowerCase()
+								output.write(" "+name+"=\""+parser.getAttributeValue(i)+"\"");
+								sectionAttrs << name
+							}
+							output.write ">\n"
+							break;
+						case "sp":
+							output.write("<sp");
+							writeAttributes();
+							output.write ">\n"
+							break;
+						case "u":
+							output.write("<u");
+							for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
+								String name = parser.getAttributeLocalName(i).replace("_","").toLowerCase()
+								output.write(" "+name+"=\""+parser.getAttributeValue(i)+"\"");
+								if (name == "time") formatedTime = parser.getAttributeValue(i)
+								else if (name == "spk") u_name = parser.getAttributeValue(i)
+							}
+							output.write ">\n"
+							break;
+						case "event":
+							output.write("<event");
+							writeAttributes();
+							output.write ">\n"
+
+							if (parser.getAttributeValue(null, "type") == "entities") {
+								if (parser.getAttributeValue(null, "extent") == "begin") {
+									vEntityType = parser.getAttributeValue(null, "desc");
+									vEntityId = vEntityIdCount++;
+								} else {
+									vEntityType = "N/A";
+									vEntityId = 0;
+								}
+							} else if (parser.getAttributeValue(null, "type") == "pronounce") {
+								if (parser.getAttributeValue(null, "extent") == "begin")
+									events.add(parser.getAttributeValue(null, "desc"))
+								else if (parser.getAttributeValue(null, "extent") == "end")
+									events.remove(parser.getAttributeValue(null, "desc"))
+								vEvents = "";
+								for (String s : events)
+									vEvents += s+"#";
+								if (vEvents.length() > 0)
+									vEvents = vEvents.substring(0, vEvents.length()-1);
+								else
+									vEvents = ""
+							}
+							break;
+						case "w":
+							for (int i = 0 ; i < parser.getAttributeCount(); i++) {
+								if (parser.getAttributeLocalName(i).equals("id")) {
+									wordid = parser.getAttributeValue(i);
+									break;
+								}
+							}
+							anavalues = [:];
+							break;
+						case "form":
+							flagForm = true;
+							vForm = "";
+							vAna ="";
+							break;
+						case "ana":
+							flagAna = true;
+							anavalue = "";
+							for (int i = 0 ; i < parser.getAttributeCount(); i++)
+								if (parser.getAttributeLocalName(i).equals("type")) {
+									anatype = parser.getAttributeValue(i).substring(1);//remove the #
+									break;
+								}
+							break;
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+
+					switch (localname) {
+						case "text":
+							output.write("</text>\n")
+							break;
+						case "Topics":
+							break;
+						case "Topic":
+							break;
+						case "Speakers":
+							break;
+						case "Speaker":
+							break;
+						case "Episode":
+							break;
+						case "div":
+							output.write("</div>\n")
+							break;
+						case "sp":
+							output.write("</sp>\n")
+							break;
+						case "u":
+							output.write("</u>\n")
+							break;
+						case "event":
+							output.write("</event>\n")
+							break;
+						case "form":
+							flagForm = false;
+							break;
+						case "ana":
+							anavalues.put(anatype, anavalue)
+							flagAna = false;
+							break;
+						case "w":
+						// concat spk id and ref
+							String isEnq = (interviewers.contains(u_name))?"*":"";
+							String ref = (u_name+", "+formatedTime+""+isEnq)
+							if (ADD_TEXTID_TO_REF) ref = textid+", "+ref
+							vForm +="\t"+u_name+"\t"+ref
+
+						// concat entity and entity ID
+							vAna+= "\t"+vEntityType+"\t"+vEntityId;
+
+						//concat ana values
+							for (String type : anatypes) {
+								def v = anavalues.get(type);
+								if (v == null) v = "";
+
+								if ("event" == type) {
+									if (v.length() > 0)
+										vAna+="\t#"+v;
+									else
+										vAna+="\t";
+
+									//concat <Event> values
+									if (vEvents != null && vEvents.length() > 0 && vEvents != "N/A")
+										vAna += "#"+vEvents;
+								} else {
+									vAna+="\t"+v;
+								}
+							}
+
+
+							vForm = vForm.replaceAll("\n", "").replaceAll("&", "&amp;").replaceAll("<", "&lt;");
+
+							if (removeinterviewers) {
+								if (!interviewers.contains(u_name))
+									output.write(vForm+"\t"+wordid+vAna+"\n");
+							} else {
+								output.write(vForm+"\t"+wordid+vAna+"\n");
+							}
+
+							vAna = "";
+							vForm = "";
+							break;
+					}
+					break
+				case XMLStreamConstants.CHARACTERS:
+					if (flagForm)
+						vForm += parser.getText().trim();
+					if (flagAna) {
+						anavalue += parser.getText().trim();
+					}
+					break;
+			}
+		}
+
+		parser.close();
+		inputData.close();
+		output.close();
+		return true;
+	}
+
+	/** The u_name. */
+	String u_name;
+
+	/**
+	 * Write start tag.
+	 */
+	private void writeStartTag() {
+		output.write("<"+parser.getLocalName());
+		writeAttributes();
+		output.write ">\n"
+	}
+
+	/**
+	 * Write attributes.
+	 */
+	private void writeAttributes() {
+		for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
+			output.write(" "+parser.getAttributeLocalName(i).replace("_","").toLowerCase()+"=\""+parser.getAttributeValue(i)+"\"");
+		}
+	}
+
+	private void getAnaTypes(File xmlFile) {
+		inputData = xmlFile.toURI().toURL().openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		String ana = "ana"
+		HashSet<String> types = new HashSet<String>();
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) { // start elem
+				if (ana.equals(parser.getLocalName())) { // ana elem
+					for (int i = 0 ; i < parser.getAttributeCount(); i++) { // find @type
+						if ("type".equals(parser.getAttributeLocalName(i))) { // @type
+							types.add(parser.getAttributeValue(i).substring(1)); //remove the #
+							break;
+						}
+					}
+				}
+			}
+		}
+		parser.close()
+
+		for (String type : types)
+			if (!anatypes.contains(type))
+				anatypes << type
+	}
+
+	/**
+	 * Write start tag.
+	 *
+	 * @param id the id
+	 */
+	private void writeStartTag(int id) {
+		output.write("<"+parser.getLocalName().toLowerCase());
+		output.write(" id=\""+id+"\"");
+		writeAttributes();
+		output.write ">\n"
+	}
+
+	/**
+	 * Write end tag.
+	 */
+	private void writeEndTag() {
+		output.write("</"+parser.getLocalName().toLowerCase()+">\n");
+	}
+
+	/** The ignore transcriber metadata. */
+	boolean ignoreTranscriberMetadata = false;
+
+	/**
+	 * Sets the ignore transcriber metadata.
+	 *
+	 * @param state the new ignore transcriber metadata
+	 */
+	public void setIgnoreTranscriberMetadata(boolean state) {
+		this.ignoreTranscriberMetadata = state;
+	}
+
+	/**
+	 * Parses the infos.
+	 */
+	private void parseInfos() { //until tag Episode
+		String localname;
+		//assert(parser != null);
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				localname = parser.getLocalName();
+				switch (localname) {
+					case "text":
+						output.write("<text project=\""+projectname+"\" base=\""+corpusname+"\"")
+						for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
+							if (ignoreTranscriberMetadata) {
+								if (parser.getAttributeLocalName(i) != "scribe" &&
+								parser.getAttributeLocalName(i) != "audio_filename" &&
+								parser.getAttributeLocalName(i) != "version" &&
+								parser.getAttributeLocalName(i) != "version_date")
+									output.write(" "+parser.getAttributeLocalName(i).replace("_","").toLowerCase()+"=\""+parser.getAttributeValue(i)+"\"");
+							} else {
+								output.write(" "+parser.getAttributeLocalName(i).replace("_","").toLowerCase()+"=\""+parser.getAttributeValue(i)+"\"");
+							}
+						}
+
+						output.write ">\n"
+
+						ArrayList list = new ArrayList<Pair<String, String>>()
+						trans.put("trans", list);
+
+						for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
+							list.add(new Pair(parser.getAttributeLocalName(i).replace("_","").toLowerCase(), parser.getAttributeValue(i)));
+							if(parser.getAttributeLocalName(i).startsWith("enq"))
+								interviewers.add(parser.getAttributeValue(i));
+						}
+						return
+					case "Topic":
+						String id = parser.getAttributeValue(null, "id");
+						if (id != null) {
+							ArrayList list = new ArrayList<Pair<String, String>>()
+							topics.put(id, list);
+						} else {
+							println "found tag $localname with no id"
+						}
+						break;
+					case "Speaker":
+					//case "Trans":
+						String id = parser.getAttributeValue(null, "id");
+						String name = parser.getAttributeValue(null, "name");
+						if (id != null && name != null) {
+							speakersname.put(id, name);
+						} else {
+							println "found tag $localname with no id ($id)or name ($name)"
+							return;
+						}
+						if (id != null) {
+							ArrayList list = new ArrayList<Pair<String, String>>()
+							speakers.put(id, list);
+
+							for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
+								list.add(new Pair(parser.getAttributeLocalName(i), parser.getAttributeValue(i)));
+							}
+						} else {
+							println "found tag $localname with no id"
+							return;
+						}
+						break;
+				}
+			}
+		}
+	}
+
+	/**
+	 * Sets the debug.
+	 */
+	public void setDebug() {
+		debug = true;
+	}
+
+	/**
+	 * Sets the annotation success.
+	 *
+	 * @param val the new annotation success
+	 */
+	public void setAnnotationSuccess(boolean val) {
+		annotationSucces = val
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Transcriber import module.</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/TRSToTEI.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/TRSToTEI.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/TRSToTEI.groovy	(revision 728)
@@ -0,0 +1,341 @@
+package org.txm.importer.transcriber
+
+import java.io.File;
+
+import javax.xml.stream.*;
+
+import java.io.OutputStreamWriter;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+
+import org.txm.importer.StaxIdentityParser;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.cwb.CwbProcess;
+import org.txm.importer.cwb.PatchCwbRegistry;
+import org.txm.utils.Pair;
+
+class TRSToTEI extends StaxIdentityParser {
+	
+	// Transcription informations
+	def informations = [:]
+	def speakers = [:];
+	HashMap<String, String> speakersname = new HashMap<String, String>();
+	def topics = [:];
+
+	List<String> localspeakers; // speakers of the current Turn
+
+	// IDs
+	int idturn = 1;
+	int idsection = 1;
+	int idu = 1;
+	int idevent = 1;
+
+	boolean uOpened = false;
+
+	// values stored
+	List<String> events = [];
+	static int vEntityId = 0;
+	static int vEntityIdCount = 1;
+	String vSpeaker="";
+	String u_name;
+	boolean flagAna;
+	boolean flagForm;
+	boolean flagWord;
+	String vWord="";
+	String vForm="";
+	String vAna="";
+	String vEvents = "N/A";
+	String vEntityType = "N/A"
+	String wordid= "";
+	String anatype = "";
+	String anavalue = "";
+
+	String formatedTime;
+	String currentType;
+	String lastTime = ""
+	String textid;
+	public TRSToTEI(File infile) {
+		super(infile.toURI().toURL());
+		textid = infile.getName()
+		int idx = textid.indexOf(".trs")
+		if (idx > 0) textid = textid.substring(0, idx)
+	}
+
+	boolean beforeBody = true;
+	protected void processStartElement() {
+		if (beforeBody) {
+			parseInfos()
+		} else {
+			processEpisodeStartElement()
+		}
+	}
+
+	protected void processEndElement() {
+		if (beforeBody) {
+			parseInfosEndElements()
+		} else {
+			processEpisodeEndElement()
+		}
+	}
+
+	/**
+	 * Parses the infos.
+	 */
+	private void parseInfos() { //until tag Episode
+		//println "parse infos: $localname"
+		switch (localname) {
+			case "Trans":
+				for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
+					informations.put(parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+				}
+				writer.writeStartElement("TEI");
+				writer.writeStartElement("teiHeader");
+				writer.writeStartElement("fileDesc");
+				writer.writeEndElement();
+				writer.writeStartElement("encodingDesc");
+				writer.writeEndElement();
+				writer.writeStartElement("profileDesc");
+				writer.writeEndElement();
+				writer.writeStartElement("application");
+				break;
+			case "Topics":
+				super.processStartElement();
+				break;
+			case "Topic":
+				super.processStartElement();
+				for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
+					topics.put(parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+				}
+				break;
+			case "Speakers":
+				super.processStartElement();
+				break;
+			case "Speaker":
+				super.processStartElement();
+				String id = parser.getAttributeValue(null, "id");
+				String name = parser.getAttributeValue(null, "name");
+				if (id != null && name != null) {
+					speakersname.put(id, name);
+				} else {
+					println "found tag $localname with no id ($id) nor name ($name)"
+					return;
+				}
+
+				if (id != null) {
+					ArrayList list = new ArrayList<Pair<String, String>>()
+					speakers.put(id, list);
+
+					for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
+						list.add(new Pair(parser.getAttributeLocalName(i), parser.getAttributeValue(i)));
+					}
+				} else {
+					println "found tag $localname with no id"
+					return;
+				}
+				break;
+			case "Episode":
+				writer.writeEndElement() // application
+				writer.writeEndElement() // teiHeader
+				writer.writeStartElement("text")
+				writer.writeAttribute("id", textid)
+				for(def k : informations.keySet()) writer.writeAttribute(k, informations[k])
+				beforeBody = false; // end of info parsing
+				break;
+		}
+	}
+
+	private void parseInfosEndElements() { //until tag Episode
+		//println "parse infos: $localname"
+		switch (localname) {
+			case "Topics":
+				super.processEndElement();
+				break;
+			case "Topic":
+				super.processEndElement();
+				break;
+			case "Speakers":
+				super.processEndElement();
+				break;
+			case "Speaker":
+				super.processEndElement();
+				break;
+		}
+	}
+
+	
+	boolean ignoreFirstSync = false // need to skip fist Sync when multiple locutors in Turn
+	/**
+	 * Process.
+	 *
+	 * @param xmlfile the xmlfile
+	 * @return true, if successful
+	 */
+	private boolean processEpisodeStartElement() {
+		//println "parse start: $localname"
+		switch(localname) {
+			case "Section": // >> div
+				testCloseU();
+				writer.writeStartElement("div")
+				writer.writeAttribute("id", Integer.toString(idsection++))
+				writeAttributes();
+				break;
+			case "Turn": // >> sp
+				testCloseU();
+				vSpeaker = parser.getAttributeValue(null, "speaker");
+				if (vSpeaker == null) { vSpeaker="N/A"	// no spk
+				} else {
+					localspeakers = vSpeaker.split(" ")
+					if (localspeakers.size() == 0) { // only one speaker
+						//println "FOUND ONE SPEAKER"
+						if (speakersname.containsKey(vSpeaker)) {
+							vSpeaker = speakersname.get(vSpeaker);
+						}
+					}
+				}
+
+				writer.writeStartElement("sp")
+				writer.writeAttribute("id", Integer.toString(idturn++))
+				ignoreFirstSync = vSpeaker.contains(" ") // need to skip fist Sync when multiple locutors in Turn
+				writer.writeAttribute("overlap", ""+ignoreFirstSync)
+				
+				String time = parser.getAttributeValue(null, "startTime");
+				formatedTime = formatTime(time)
+				writer.writeAttribute("time", formatedTime)
+				writeAttributes();
+				break;
+			case "Sync": // >> u
+				lastTime = parser.getAttributeValue(null, "time")
+				testCloseU();
+				if (ignoreFirstSync) { // need to skip fist Sync when multiple locutors in Turn
+					ignoreFirstSync = false;
+				} else {
+					writeU()
+				}
+				break;
+			case "Who": // >> u
+				testCloseU();
+				int n = Integer.parseInt(parser.getAttributeValue(null, "nb")) -1;
+				if (localspeakers.size() <= n || n < 0) {
+					println "\nWarning: Mismatch speaker number declaration between <Who> and <Turn> tags at line "+parser.getLocation().getLineNumber()+" of the '"+inputurl.getFile()+"' transcription file.";
+					vSpeaker = "#"+(n+1)+"?";
+				} else {
+					vSpeaker = localspeakers.get(n);
+				}
+				writeU()
+				break;
+			case "Event": // >> event
+				writer.writeStartElement("event")
+				writer.writeAttribute("id", Integer.toString(idevent++))
+				writeAttributes();
+				break;
+			default:
+				super.processStartElement();
+		}
+	}
+
+	void processEpisodeEndElement() {
+		switch (localname) {
+			case "Section":
+				if (uOpened) {
+					super.processEndElement(); // u
+					uOpened = false;
+				}
+				super.processEndElement(); //div
+				break;
+			case "Turn":
+				if (uOpened) {
+					super.processEndElement(); // u
+					uOpened = false;
+				}
+				super.processEndElement(); // sp
+				break;
+			case "Sync":
+			case "Who":
+			case "Episode":
+				break
+			case "Trans":
+				writer.writeEndElement(); // text
+				writer.writeEndElement(); //TEI
+				break
+			default:
+				super.processEndElement();
+		}
+	}
+
+	/**
+	 * If a 'u' tag is opened, close it.
+	 */
+	private testCloseU() {
+		if (uOpened) {
+			super.processEndElement(); // u
+			uOpened = false;
+		}
+	}
+
+	/**
+	 * Write u.
+	 */
+	private void writeU() {
+		writer.writeStartElement("u")
+		writer.writeAttribute("s", lastTime);
+		writer.writeAttribute("time", formatTime(lastTime));
+//		println "write u for vSpeaker=$vSpeaker"
+//		println "getting spk name? ="+speakers.get(vSpeaker)
+//		println "speakers: $speakers"
+		def attributes = speakers.get(vSpeaker)
+		if (attributes == null) { // in case of Who@n wrong number
+			if (vSpeaker.startsWith("#") && vSpeaker.endsWith("?")) { // don't show "N/A" vSpeaker
+				writer.writeAttribute("spk", vSpeaker)
+				writer.writeAttribute("spkid", vSpeaker)
+			}
+		} else {
+			for (Pair p : attributes) {
+//				println " write attribute "+p.getFirst()+" "+p.getSecond()
+				String attrn = p.getFirst().toString();
+				if (attrn == "name") { // rename @name to @spk
+					attrn = "spk"
+					u_name = p.getSecond();
+				} else if (attrn == "id") { // rename @id to @spkid
+					attrn = "spkid"
+				}
+
+				writer.writeAttribute(attrn,p.getSecond())
+			}
+		}
+		uOpened = true;
+	}
+	private String formatTime(String time) {
+		try {
+			return formatTime(Float.parseFloat(time))
+		} catch(Exception e) {return formatTime(0.0f)}
+	}
+
+	private String formatTime(float time) {
+		String rez = " ";
+		float h = time / 3600;
+		time = time%3600;
+		float min = (time%3600) / 60;
+		int sec = (int)time%60
+		if (min < 10)
+			rez = ""+(int)h+":0"+(int)min;//+":"+time%60;
+		else
+			rez = ""+(int)h+":"+(int)min;//+":"+time%60;
+
+		if (sec >= 10)
+			rez += ":"+sec;
+		else
+			rez += ":0"+sec;
+
+		return rez;
+	}
+
+	public static void main(String[] args) {
+		File infile = new File("/home/mdecorde/xml/trs/int01.trs")
+		File outfile = new File("/home/mdecorde/xml/trs/test-tei.xml")
+
+		TRSToTEI p = new TRSToTEI(infile);
+		p.process(outfile)
+	}
+
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/BuildTemplates.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/BuildTemplates.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/BuildTemplates.groovy	(revision 728)
@@ -0,0 +1,89 @@
+package org.txm.importer.transcriber
+import java.nio.charset.Charset
+import org.txm.utils.CsvReader
+
+/// START PARAMETERS ///
+File dir = new File("C:/") // output and input directory
+File csvfile = new File(dir, "test.csv") // 3 cols: int enq ext
+String spkSeparator = "\\|" // regular expression
+char colSeparator = '\t' // csv column separator
+String csvencoding = "ISO-8859-1" // csv encoding
+
+//transcriptions header
+String date = "111128" // date of transcription edition
+String scribes= "studentN" // scribe name
+String encoding = "ISO-8859-1" // transcription encoding
+
+/// END PARAMETERS ///
+String canvas="""<?xml version="1.0" encoding="@ENCODING"?>
+<!DOCTYPE Trans SYSTEM "trans-14.dtd">
+<Trans scribe="@SCRIBE" audio_filename="@AUDIOFILE" version="1" version_date="@DATE">
+<Speakers>
+@SPEAKERS</Speakers>
+<Episode>
+<Section type="report" startTime="0" endTime="2.0">
+<Turn startTime="0" endTime="1.0" speaker="@FIRSTSPK">
+<Sync time="0"/>
+
+</Turn>
+</Section></Episode></Trans>
+""";
+String spkCanvas="<Speaker id=\"@ID\" name=\"@ID\" check=\"no\" dialect=\"native\" accent=\"\" scope=\"local\"/>"
+
+//load csv
+CsvReader csvreader = new CsvReader(csvfile.getAbsolutePath(), colSeparator, Charset.forName(csvencoding))
+
+//check header
+csvreader.readHeaders();
+def titles = [];
+for(String title : csvreader.getHeaders())
+	titles << title
+assert(titles.contains("int"))
+assert(titles.contains("enq"))
+assert(titles.contains("ext"))
+
+// one transcription per csv line
+while (csvreader.readRecord()){
+
+	String ints = csvreader.get("int")
+	String enqs = csvreader.get("enq")
+	String exts = csvreader.get("ext")
+	
+	def intsS = ints.split(spkSeparator)
+	def enqsS = enqs.split(spkSeparator)
+	def extsS = exts.split(spkSeparator)
+	assert(intsS.size() > 0)
+	assert(enqsS.size() > 0)
+	
+	// build speaker declarations
+	String speakers = ""
+	for(String s : intsS)
+		if(s.length() > 0)
+			speakers += spkCanvas.replace("@ID", s)+"\n"
+	for(String s : enqsS)
+		if(s.length() > 0)
+			speakers += spkCanvas.replace("@ID", s)+"\n"
+	for(String s : extsS)
+		if(s.length() > 0)
+			speakers += spkCanvas.replace("@ID", s)+"\n"
+
+	// some infos
+	String transfile = intsS[0]
+	String firstSpeaker = enqsS[0]
+			
+	// fill infos
+	String content = canvas
+	content = content.replace("@ENCODING", encoding)
+	content = content.replace("@SCRIBE", scribes)
+	content = content.replace("@AUDIOFILE", dir.getAbsolutePath()+transfile+".mp3")
+	content = content.replace("@DATE", date)
+	content = content.replace("@SPEAKERS", speakers)
+	content = content.replace("@FIRSTSPK", firstSpeaker)
+	
+	//write transcription
+	File outfile = new File(dir, transfile+".trs")
+	println "create: "+outfile
+	outfile.withWriter(encoding) { out ->
+      out.println content
+    }
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/CheckWhos.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/CheckWhos.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/CheckWhos.groovy	(revision 728)
@@ -0,0 +1,115 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.importer.transcriber
+
+import java.io.File;
+import javax.xml.stream.*;
+import java.io.OutputStreamWriter;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class CheckWhos.
+ */
+class CheckWhos {
+	
+	/**
+	 * Test.
+	 *
+	 * @param xmlfile the xmlfile
+	 * @return true, if successful
+	 */
+	public static boolean test(File xmlfile)
+	{
+		boolean ret = true;
+		URL url = xmlfile.toURI().toURL();
+		def inputData = url.openStream();
+		XMLInputFactory factory = XMLInputFactory.newInstance();
+		def parser = factory.createXMLStreamReader(inputData);
+		
+		String localname;
+		String vSpeaker;
+		
+		List<String> localspeakers;
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			switch (event) 
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{
+						case "Turn":
+						
+							vSpeaker = parser.getAttributeValue(null, "speaker");			
+							if(vSpeaker == null)
+							{
+								localspeakers = [];
+								vSpeaker = "N/A"
+							}
+							else
+								localspeakers = vSpeaker.split(" ")
+							break;
+						
+						case "Who":
+						
+							int n = Integer.parseInt(parser.getAttributeValue(null, "nb")) -1;
+							if(localspeakers.size() <= n)
+							{
+								println "$xmlfile: Who error : line "+parser.getLocation().lineNumber+" col "+parser.getLocation().columnNumber+" in file "+xmlfile;
+								vSpeaker = "N/A";
+								ret = false;
+							}
+						
+							break;
+							
+					}
+			}
+		}
+		return ret;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		String userdir = System.getProperty("user.home")
+		for(File trsfile : new File(userdir, "xml/cedre").listFiles())
+		{
+			if(trsfile.getName().endsWith(".trs"))
+			{
+				if(!CheckWhos.test(trsfile))
+					println trsfile.getName()+" not ok"
+			}
+		}
+	}
+	
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/ValidateTRS.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/ValidateTRS.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/ValidateTRS.groovy	(revision 728)
@@ -0,0 +1,510 @@
+package org.txm.importer.transcriber
+
+import java.text.DecimalFormat;
+
+import org.txm.importer.DomUtils;
+import org.txm.utils.ExecTimer;
+import org.w3c.dom.*;
+
+/**
+ * TRS file time validation for the STDDAD master corpus
+ * @author mdecorde
+ *
+ */
+class ValidateTRS {
+	def doc;
+	def root;
+	def episodeElem;
+	def topicsElem;
+	def speakersElem;
+
+	def declaredTopics = [];
+	def topics = [];
+
+	def mandatoryTopics = ["parcours", "ressources", "dÃ©bouchÃ©s", "acteurs", "mÃ©tier", "images", "autres"]
+	def declaredSpeakers = [];
+	def speakers = [];
+	def spkDict = [:];
+	def topicDict = [:];
+
+	def sections = [];
+	def turns = new LinkedHashMap();
+	def syncs = new LinkedHashMap();
+	def entities = [];
+
+	def messages = [];
+
+	float sectionsTime = 0;
+	int numberOfSection = 0;
+	HashMap<String, Float> sectionsTimesByTopic = new HashMap<String, Float>();
+	HashMap<String, Integer> numberOfSectionByTopic = new HashMap<String, Integer>();
+
+	float turnsTime = 0;
+	int numberOfTurn = 0;
+	HashMap<String, Float> turnsTimesBySpk = new HashMap<String, Float>();
+	HashMap<String, Integer> numberOfTurnsBySpk = new HashMap<String, Integer>();
+
+	int totalWords = 0;
+	HashMap<String, Integer> totalWordsByTopic = new HashMap<String, Integer>();
+	HashMap<String, Integer> totalWordsBySpk = new HashMap<String, Integer>();
+
+	def static okTopics = ["dÃ©bouchÃ©s", "parcours","ressources",
+		"mÃ©tier", "acteurs", "autres", "images"];
+
+	def static spkPattern = "((int|enq)[0-9][0-9])|(ext[0-9][0-9][0-9])"
+
+	public static boolean checkSpk(String spk)
+	{
+		return spk.matches("((int|enq)[0-9][0-9])|(ext[0-9][0-9][0-9])");
+	}
+
+	public ValidateTRS(File trsFile)
+	{
+		def slurper = new XmlParser();
+		root = slurper.parse(trsFile.toURI().toString())
+		episodeElem = root.Episode;
+		speakersElem = root.Speakers;
+		topicsElem = root.Topics
+		init();
+	}
+
+	public boolean test(){
+		//ckeckTimes();
+	}
+
+	public void init() {
+		initSpeakersDecl();
+		initTopicsDecl();
+
+		initSections();
+		initTurns();
+		initSyncs();
+
+		initSpeakers();
+		initTopics();
+		initEntities();
+	}
+
+	public void initEntities() {
+		for(def section : sections)
+			for(def turn : turns.get(section))
+				for(def entity : turn.Event)
+					if (entity.@type == "entities")
+						entities.add(entity.@desc)
+	}
+
+	public void initTopicsDecl(){
+		declaredTopics = topicsElem.Topic;
+		for (def topic:declaredTopics) {
+			topicDict[topic.@id]=topic.@desc
+		}
+	}
+
+	public void initSpeakersDecl(){
+		declaredSpeakers = speakersElem.Speaker;
+		for (def spk:declaredSpeakers) {
+			spkDict[spk.@id]=spk.@name
+		}
+	}
+
+	public void initSections() {
+		sections = episodeElem.Section;
+		numberOfSection = sections.size()
+	}
+
+	public void initTurns() {
+		for(def section : sections) {
+			turns[section] = section.Turn
+			numberOfTurn += turns[section].size()
+			//numberOfTurn
+		}
+	}
+
+	public void initSyncs() {
+		for(def section : sections)
+			for(def turn : turns.get(section))
+				syncs[turn] = turn.Sync
+	}
+
+	public void initTopics(){
+		for(def section : sections) {
+			String topic = section.@topic;
+			if (section.@type != "report")
+				topic = section.@type
+			if (topic == null) topic = "notopic"	
+			topics.add(topic);
+		}
+
+		topics.sort()
+	}
+
+	public void initSpeakers(){
+		for(def section : sections)
+			for(def turn : turns.get(section)) {
+				String spk = turn.@speaker;
+				if (spk == null) spk = "nospk"
+				speakers.add(spk);
+			}
+		speakers.sort();
+	}
+
+	public boolean topicsCheck() {
+		messages = []
+		boolean ret = false;
+		def topicsIds = declaredTopics.collect { topic -> topic.@id }
+		for(def topic : topics)
+			if( topic != null && !topicsIds.contains(topic) && topic != "nontrans" && topic != "notopic") {
+				messages << "missing topic declaration: "+topic
+				ret = true;
+			}
+		return ret;
+	}
+
+	public def speakersCheck() {
+		messages = []
+		boolean ret = false;
+		def spksIds = declaredSpeakers.collect { spk -> spk.@id }
+		for(def spk : speakers)  {
+			if (spk == null) continue; // ignore null spk
+			def split = spk.split(" ")
+			for(def sspk : split) {
+				if(!spksIds.contains(sspk) && sspk != "nospk") {
+					println "missing spk declaration: "+sspk
+					ret = true;
+				}
+			}
+		}
+		return ret;
+	}
+
+	String NULL = "null"
+	public void printSortedList(def list, def dict) {
+		def all = [:]
+		for(def value : list) {
+			if (value == null) {
+				if(!all.containsKey(NULL))
+					all[NULL] = 0
+				all[NULL] = all[NULL] + 1
+			} else {
+				def split = value.split(" ")
+				if (dict != null) {
+					for(def sspk : split) {
+						if (!(all.containsKey(sspk)))
+							all[sspk] = 0;
+						all[sspk] = all[sspk] + 1
+					}
+				} else {
+					if (!(all.containsKey(value)))
+						all[value] = 0;
+					all[value] = all[value] + 1
+				}
+			}
+		}
+
+		def toprint = [];
+		for(def speaker : all.keySet())
+			toprint.add([speaker, all[speaker]]);
+
+		toprint = toprint.sort{it -> it.get(1)}
+
+		for(def line : toprint)
+			if (dict != null) {
+				if (dict[line.get(0)] != null)
+					println line.get(0)+"\t"+dict[line.get(0)]+"\t"+line.get(1)
+				else
+				println line.get(0)+"\t"+line.get(0)+"\t"+line.get(1)
+			} else {
+				println line.get(0)+"\t"+line.get(1)
+			}
+	}
+
+	public def timeCheck() {
+		messages = [];
+		boolean warning = false;
+		boolean error = false
+		def previousSectionStart = -1.0f;
+		def previousSectionEnd = -1.0f;
+
+		def previousTurnStart = -1.0f;
+		def previousTurnEnd = -1.0f;
+
+		for(def section : sections) {
+			def sectionStart = Float.parseFloat(section.'@startTime')
+			def sectionEnd =  Float.parseFloat(section.'@endTime')
+			def topic = section.@topic;
+			if (section.@type != "report")
+				topic = section.@type;
+			if (topic == null) topic = "notopic"
+			
+			def time = sectionEnd - sectionStart;
+			if (!sectionsTimesByTopic.containsKey(topic)) {
+				sectionsTimesByTopic.put(topic, 0);
+				numberOfSectionByTopic.put(topic, 0);
+				totalWordsByTopic.put(topic, 0);
+			}
+			if (topic != null && topic != "null" && topic.length() > 0) {
+				sectionsTime += time;
+			}
+			sectionsTimesByTopic.put(topic, sectionsTimesByTopic.get(topic) + time);
+			numberOfSectionByTopic.put(topic, numberOfSectionByTopic.get(topic) + 1);
+
+			boolean sectionBug = false;
+
+			if ( sectionEnd <= sectionStart) { sectionBug = true;
+				messages << "sectionEnd <= sectionStart : $sectionEnd <= $sectionStart"
+			}
+
+			if ( sectionStart < previousSectionStart) { sectionBug = true;
+				messages << "sectionStart < previousSectionStart : $sectionStart < $previousSectionStart"
+			}
+			if ( sectionStart < previousSectionEnd) { sectionBug = true;
+				messages << "sectionStart < previousSectionEnd : $sectionStart < $previousSectionEnd"
+			}
+			if ( sectionEnd < previousSectionStart) { sectionBug = true;
+				messages << "sectionEnd < previousSectionStart : $sectionEnd < $previousSectionStart"
+			}
+			if ( sectionEnd < previousSectionEnd) { sectionBug = true;
+				messages << "sectionEnd < previousSectionEnd : $sectionEnd < $previousSectionEnd"
+			}
+
+			for(def turn : turns.get(section)) {
+				def turnStart = Float.parseFloat(turn.'@startTime')
+				def turnEnd =  Float.parseFloat(turn.'@endTime')
+				def spk = ""+turn.@speaker;
+				if (turn.@speaker == "null") spk = "nospk"
+				time = turnEnd - turnStart;
+				int nbwords = turn.text().split().length
+
+				for(String subspk : spk.split(" ")) {
+					String spkname = spkDict[subspk];
+					if (spkname == null) spkname = "nospk"
+					if (!totalWordsBySpk.containsKey(spkname)) {
+						totalWordsBySpk.put(spkname, 0);
+						turnsTimesBySpk.put(spkname, 0);
+						numberOfTurnsBySpk.put(spkname, 0);
+					}
+				}
+
+				if (spk != "null") turnsTime += time;
+				totalWords += nbwords
+				for(String subspk : spk.split(" ")) {
+					String spkname = spkDict[subspk];
+					if (spkname == null) spkname = "nospk"
+					totalWordsBySpk.put(spkname, totalWordsBySpk.get(spkname) + nbwords)
+					numberOfTurnsBySpk.put(spkname, numberOfTurnsBySpk.get(spkname) + 1);
+					turnsTimesBySpk.put(spkname, turnsTimesBySpk.get(spkname) + time);
+				}
+				totalWordsByTopic.put(topic,totalWordsByTopic.get(topic) +nbwords);
+
+				boolean bug = false;
+
+				if ( turnEnd <= turnStart) { bug = true;
+					messages << " turnEnd <= turnStart : $turnEnd <= $turnStart"
+				}
+
+				//				if ( turnStart < previousSectionStart) { bug = true;
+				//					println " turnStart < previousSectionStart : $turnStart < $previousSectionStart"
+				//				}
+				//				if ( turnStart < previousSectionEnd) { bug = true;
+				//					println " turnStart < previousSectionEnd : $turnStart < $previousSectionEnd"
+				//				}
+				//				if ( turnEnd < previousSectionStart) { bug = true;
+				//					println " turnEnd < previousSectionStart : $turnEnd < $previousSectionStart"
+				//				}
+				//				if ( turnEnd < previousSectionEnd) { bug = true;
+				//					println " turnEnd < previousSectionEnd : $turnEnd < $previousSectionEnd"
+				//				}
+
+				if ( turnStart < previousTurnStart) { bug = true;
+					messages << " turnStart < previousTurnStart : $turnStart < $previousTurnStart"
+				}
+				if ( turnStart < previousTurnEnd) { bug = true;
+					messages << " turnStart < previousTurnEnd : $turnStart < $previousTurnEnd"
+				}
+				if ( turnEnd < previousSectionStart) { bug = true;
+					messages << " turnEnd < previousTurnStart : $turnEnd < $previousTurnStart"
+				}
+				if ( turnEnd < previousTurnEnd) { bug = true;
+					messages << " turnEnd < previousTurnEnd : $turnEnd < $previousTurnEnd"
+				}
+				if (turnStart < sectionStart) { bug = true;
+					messages << " turnStart < sectionStart : $turnStart < $sectionStart"
+				}
+				if (turnStart > sectionEnd) { bug = true;
+					messages << " turnStart > sectionEnd : $turnStart > $sectionEnd"
+				}
+				if ( turnEnd < sectionStart) { bug = true;
+					messages << " turnEnd < sectionStart : $turnEnd < $sectionStart"
+				}
+				if (turnEnd > sectionEnd) { bug = true;
+					messages << " turnEnd > sectionEnd : $turnEnd > $sectionEnd"
+				}
+
+				for(def sync : syncs.get(turn)) {
+					boolean syncBug = false;
+					def syncTime = Float.parseFloat(sync.'@time')
+					if ( syncTime < turnStart) { syncBug = true;
+						messages << "  syncTime < turnStart : $syncTime < $turnStart"
+					}
+					if ( syncTime > turnEnd) { syncBug = true;
+						messages << "  syncTime > turnEnd : $syncTime > $turnEnd"
+					}
+
+					if (syncBug) {
+						warning = true;
+					}
+				}
+
+				previousTurnStart = turnStart;
+				previousTurnEnd = turnEnd;
+				if (bug) {
+					error = true;
+				}
+			}
+
+			previousSectionStart = sectionStart;
+			previousSectionEnd = sectionEnd;
+			if ( sectionBug) {
+				error = true;
+			}
+		}
+
+		return [error, warning];
+	}
+
+	public void printErrors()
+	{
+		for(String mess : messages)
+			println mess;
+	}
+
+	public void printAll()
+	{
+		println "Declared topics: $declaredTopics"
+		println "Topics: $topics"
+
+		println "Declared speakers: $declaredSpeakers"
+		println "Speakers: $speakers"
+
+		println "Sections: "+sections.size()
+		println "Turns: "+syncs.size()
+		println "Entities: $entities"
+	}
+
+	public static HashSet<String> allTopicDesc = new HashSet<String>();
+	public static HashSet<String> allSpkName = new HashSet<String>();
+	public static void checkDirectory(File dir) {
+		allTopicDesc = new HashSet<String>();
+		allSpkName = new HashSet<String>();
+		//println "trs dir: $dir"
+		for (File trsFile : dir.listFiles().sort()) {
+			if (!trsFile.getName().endsWith(".trs")) continue; // ignore
+			checkTRS(trsFile)
+
+		}
+
+		//println allTopicDesc;
+		//println allSpkName;
+
+	}
+
+	public static boolean checkTRS(File trsFile) {
+		boolean ret = true;
+		println "\n***** $trsFile.name *****"
+		def tester = new ValidateTRS(trsFile);
+		//tester.printAll();
+
+		def (error, warning) = tester.timeCheck();
+		if( error ) {
+			print "\nTIMES: "
+			//if( error || warning) {
+			println "errors: "+error+" warnings: "+warning;
+			tester.printErrors();
+			ret = false;
+		} //else println "all declared"
+
+		println "\nSPEAKERS: id, name, frequency"
+		if (tester.speakersCheck()) {
+			println "errors:"
+			tester.printErrors();
+			ret = false;
+		} //else println "all declared"
+		tester.printSortedList(tester.speakers, tester.spkDict);
+
+		println "\nSECTIONS: id, title, frequency"//+ tester.declaredTopics
+		if (tester.topicsCheck()) {
+			println "errors:"
+			tester.printErrors();
+			ret = false;
+		} //else println "all declared"
+		tester.printSortedList(tester.topics, tester.topicDict);
+
+		println "\nENTITIES: value, frequency"
+		tester.printSortedList(tester.entities, null);
+
+		println ""
+		for(def topic : tester.declaredTopics) {
+			allTopicDesc.add(topic.@desc)
+			if (!okTopics.contains(topic.@desc)) {
+				if(tester.topics.contains(topic.@id))
+					println "topic error: "+topic.@desc
+
+			}
+		}
+		//println ""
+		for(def spk : tester.declaredSpeakers) {
+			allSpkName.add(spk.@name)
+			if(!checkSpk(spk.@name)) {
+				if(tester.speakers.contains(spk.@id))
+					println "spk error: "+spk.@name
+			}
+		}
+		DecimalFormat formater = new DecimalFormat("0.00");
+
+		println "Statistics:"
+		println " Approx nb words: "+tester.totalWords;
+		println " Total time: "+ExecTimer.formatSecs(tester.turnsTime)
+		println " Approx word rate (word/sec): "+formater.format(tester.totalWords/tester.turnsTime)
+		println " Approx word rate (word/min): "+formater.format(60*(tester.totalWords/tester.turnsTime))
+		println ""
+
+		def meanSections = [:];
+		for(String key : tester.sectionsTimesByTopic.keySet())
+			meanSections.put(key, ExecTimer.formatSecs(tester.sectionsTimesByTopic.get(key) / tester.numberOfSectionByTopic.get(key)))
+		def meanTurns = [:];
+		for(String key : tester.turnsTimesBySpk.keySet())
+			meanTurns.put(key, ExecTimer.formatSecs(tester.turnsTimesBySpk.get(key) / tester.numberOfTurnsBySpk.get(key)))
+
+		for(String key : tester.sectionsTimesByTopic.keySet())
+			tester.sectionsTimesByTopic.put(key, ExecTimer.formatSecs(tester.sectionsTimesByTopic.get(key)))
+		for(String key : tester.turnsTimesBySpk.keySet())
+			tester.turnsTimesBySpk.put(key, ExecTimer.formatSecs(tester.turnsTimesBySpk.get(key)))
+
+		println " Number of sections: "+tester.numberOfSection
+		println " Sections time: "+ExecTimer.formatSecs(tester.sectionsTime);
+		println " Mean time of sections: "+ExecTimer.formatSecs(tester.sectionsTime/tester.numberOfSection)
+
+		println " Sections time by topic: "+tester.sectionsTimesByTopic
+		println " Number of sections by topic: "+tester.numberOfSectionByTopic
+		println " Mean time of sections by topic: "+meanSections
+		println ""
+
+		println " Number of turns: "+tester.numberOfTurn
+		println " Turns time: "+ExecTimer.formatSecs(tester.turnsTime);
+		println " Mean time of turns: "+ExecTimer.formatSecs(tester.turnsTime/tester.numberOfTurn)
+
+		println " Turns time by spk: "+tester.turnsTimesBySpk
+		println " Number of turns by spk: "+tester.numberOfTurnsBySpk
+		println " Mean time of turns by spk: "+meanTurns
+		println ""
+
+		return ret;
+	}
+
+	public static void main(String[] args) {
+		//File dir = new File("/home/sheiden/enslyon_projets/TextomÃ©trie/SpUV/EVS/master 1 STDDAD 2011/enquÃªte 2011/ReÃ§ues")
+		File dir = new File("/home/mdecorde/xml/concattrs/ready")
+		ValidateTRS.checkDirectory(dir);
+		//ValidateTRS.checkTRS(new File("/home/mdecorde/xml/concattrs/int40-21.trs"))
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/TRS2SRT.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/TRS2SRT.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/TRS2SRT.groovy	(revision 728)
@@ -0,0 +1,225 @@
+package org.txm.importer.transcriber
+/**
+ * Converts a file from Transcriber XML to STR subtitle file
+ * 
+ * @author mdecorde
+ *
+ */
+
+
+import java.util.ArrayList
+
+import javax.xml.parsers.*
+import javax.xml.stream.*
+
+import java.net.URL
+
+class TRS2SRT {
+
+	private def url
+	private def inputData
+	private def factory
+	private XMLStreamReader parser
+	def writer
+
+	def colors = ["white", "red", "blue", "green", "yellow", "grey", "violet", "pink", "orange", "brown"];
+	def icolor = 0;
+
+	File trsFile;
+	boolean debug = false
+
+	public TRS2SRT(File trsFile) {
+		inputData = trsFile.toURI().toURL().openStream()
+		factory = XMLInputFactory.newInstance()
+		parser = factory.createXMLStreamReader(inputData)
+
+		this.trsFile = trsFile
+	}
+
+	/**
+	 * Transform the trsFile to STR format
+	 * 
+	 * @param srtFile: result file
+	 */
+	public void process(File srtFile) {
+		writer = srtFile.newWriter("UTF-8")
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					processStartElement()
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					processEndElement()
+					break;
+				case XMLStreamConstants.CHARACTERS:
+					processText()
+					break;
+			}
+		}
+		writer.close()
+	}
+
+	def speakers = [:]
+	def currentSpeakers = []
+	def currentSpeaker = "";
+	def currentSpeach = ""
+	def currentStartTime = ""
+	def currentEndTime = ""
+	def inTurn = false
+	def nTurn = 1
+	def syncCounter = 0;
+	def whoCounter = 0;
+
+	protected void processStartElement() {
+		String localname = parser.getLocalName()
+		switch (localname) {
+			case "Speaker":
+				def info = [:]
+				speakers[parser.getAttributeValue(null, "id")] = info
+				info["name"] = parser.getAttributeValue(null, "name")
+				info["color"] = colors[icolor]
+				info["count"] = 0;
+				icolor++;
+				break;
+			case "Episode":
+				if (debug) println "speakers $speakers"
+				break;
+			case "Turn":
+				if (debug) println "Turn!"
+				currentSpeakers = parser.getAttributeValue(null, "speaker").split(" ")
+				currentSpeaker = currentSpeakers[0]
+				currentSpeach = ""
+				String s = parser.getAttributeValue(null, "startTime")
+				String e = parser.getAttributeValue(null, "endTime")
+				currentStartTime = Float.parseFloat(s)
+				if (e != null) currentEndTime = Float.parseFloat(e)
+				else currentEndTime = currentStartTime+3.0; // temporary fix
+				inTurn = true
+				syncCounter = 0;
+				whoCounter = 0;
+				break;
+			case "Event":
+			if (debug) println "Event!"
+				currentSpeach += " ["+parser.getAttributeValue(null, "desc")+"] "
+				break;
+			case "Sync": // cut a Turn, the Turn@endTime must be replace with Sync@time
+				if (debug) println "Sync!"
+				syncCounter++; 
+				if (syncCounter > 1) { // ignore first 'Sync', there is no speech to write
+					def end = currentEndTime
+					currentEndTime = Float.parseFloat(parser.getAttributeValue(null, "time"))
+					writeSRTTurn() // write previous Turn, so currentEndTime is the Sync@time
+					currentEndTime = end; // restore Turn@endTime
+				}
+				break;
+			case "Who":
+				if (debug) println "Who!"
+				whoCounter++;
+				if (whoCounter > 1) { // ignore first 'Who', there is no speach to write
+					int n = Integer.parseInt(parser.getAttributeValue(null, "nb")) - 1
+					if (currentSpeakers.size() <= n) {
+						println "'Who@nb' Error at "+parser.getLocation()
+						break;
+					}
+					
+					writeSRTTurn() // write previous speach		
+					// switch current speaker
+					currentSpeaker = currentSpeakers[Integer.parseInt(parser.getAttributeValue(null, "nb")) - 1]
+				}
+				break;
+		}
+	}
+
+	protected void processEndElement() {
+		String localname = parser.getLocalName()
+		switch (localname) {
+			case "Speaker":
+				break;
+			case "Turn":
+				inTurn = false
+				writeSRTTurn()
+				break;
+			case "Sync":
+				break;
+			case "Who":
+				break;
+		}
+	}
+
+	protected writeSRTTurn() {
+		currentSpeach = currentSpeach.trim()
+
+		if (currentSpeach.length() == 0) return; // nothing to write
+
+		//println "Writing Turn of '$currentSpeaker': "+speakers[currentSpeaker]
+		def color = speakers[currentSpeaker]["color"]
+
+		if (speakers[currentSpeaker]["count"] < 2) {
+			speakers[currentSpeaker]["count"] = speakers[currentSpeaker]["count"] + 1;
+			currentSpeach = speakers[currentSpeaker]["name"]+"\t"+currentSpeach
+		}
+
+		currentSpeach = "<font color=\"$color\">$currentSpeach</font>".replaceAll("\n", " ")
+
+		def s = formatTime(currentStartTime)
+		def e = formatTime(currentEndTime)
+		currentStartTime = currentEndTime
+		writer.println """
+$nTurn
+$s --> $e
+$currentSpeach"""
+		nTurn++
+		currentSpeach = "" // reset speach
+	}
+
+	protected void processText() {
+		String txt = parser.getText();
+		if (inTurn) {
+			currentSpeach += txt
+		}
+	}
+
+	private String formatTime(float time) {
+		String rez = " ";
+
+		int ms = (time - (int)time) * 1000
+
+		float h = time / 3600;
+		time = time%3600;
+
+		float min = (time%3600) / 60;
+		int sec = (int)time%60
+
+		if (min < 10)
+			rez = ""+(int)h+":0"+(int)min;//+":"+time%60;
+		else
+			rez = ""+(int)h+":"+(int)min;//+":"+time%60;
+
+		if (sec >= 10)
+			rez += ":"+sec;
+		else
+			rez += ":0"+sec;
+
+		rez += "."+ms
+		return rez;
+	}
+
+	public static void main(String[] args) {
+		if (args.length == 0) {
+			println "Usage:"
+			println "java -jar TRS2SRT.jar file1 file2 file3"
+			println "\nResult files are saved in the save directory as fileN files."
+		}
+	//	args = ["/home/mdecorde/CCC/RECETTE/TRS2SRT/victor/pazinterior_ok.trs"]
+		for (String path : args) {
+			println "Processing path=$path ..."
+			
+			File trsFile = new File(path)
+			String name = trsFile.getName()
+			name = name.substring(0, name.lastIndexOf("."))
+			File srtFile = new File(trsFile.getParentFile(), name+".srt")
+			TRS2SRT t = new TRS2SRT(trsFile)
+			t.process(srtFile)
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/CommentIncluder.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/CommentIncluder.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/CommentIncluder.groovy	(revision 728)
@@ -0,0 +1,46 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.importer.transcriber
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class CommentIncluder.
+ */
+class CommentIncluder {
+	
+	/**
+	 * Instantiates a new comment includer.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 */
+	public CommentIncluder(File infile, File outfile)
+	{
+		
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/TokenizeEntities.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/TokenizeEntities.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/TokenizeEntities.groovy	(revision 728)
@@ -0,0 +1,56 @@
+package org.txm.importer.transcriber
+
+import org.txm.importer.StaxIdentityParser
+
+
+/**
+ * Wrap  "entities" span event in "w" tags 
+ * 
+ * @author mdecorde
+ *
+ */
+class TokenizeEntities extends StaxIdentityParser{
+	int wordcount = 1;
+	boolean writeStartWord = false;
+	boolean writeEndWord = false;
+	public TokenizeEntities(URL url) {
+		super(url);
+	}
+	
+	public void processStartElement() {
+		// close previous word
+		if (localname == "Event" && parser.getAttributeValue(null, "type") == "entities") {
+			if (parser.getAttributeValue(null, "extent") == "end") { // end of word
+				writer.writeEndElement();
+				writeEndWord = false;
+			}
+		}
+		
+		super.processStartElement();
+		
+		// start new word if necessary
+		if (localname == "Event" && parser.getAttributeValue(null, "type") == "entities") {
+			if (parser.getAttributeValue(null, "extent") == "begin") { // start of word
+				writeStartWord = true;
+			}
+		}
+	}
+	
+	public void processEndElement() {
+
+		super.processEndElement();
+		
+		if (writeStartWord) {
+			writer.writeStartElement("w");
+			//writer.writeAttribute("id", "w_entity_"+(wordcount++));
+			writeStartWord = false;
+		} 
+	}
+	
+	public static void main(String[] args) {
+		File dir = new File ("C:\\Documents and Settings\\mdecorde\\xml\\minileman2011")
+		File infile = new File(dir, "int05.trs")
+		TokenizeEntities tokenizer = new TokenizeEntities(infile.toURI().toURL());
+		println tokenizer.process(new File(dir, "out.trs")) 
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/pager.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/pager.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/pager.groovy	(revision 728)
@@ -0,0 +1,786 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.importer.transcriber
+
+import java.io.File;
+import java.util.ArrayList;
+
+import javax.xml.stream.*
+
+import org.txm.importer.ApplyXsl2
+import org.txm.metadatas.Metadatas
+import org.txm.utils.FileCopy;
+
+
+// TODO: Auto-generated Javadoc
+/** Build Discours corpus simple edition from a xml-tei.
+ * 
+ *  @author mdecorde
+ *  
+ */
+class pager {
+
+	boolean SIMPLE_TOOLTIP = false; // show less properties in word tooltips
+	String ENQ_HIGHLIGHT_ELEMENT = "b"
+
+	List<String> NoSpaceBefore;
+
+	/** The No space after. */
+	List<String> NoSpaceAfter;
+
+	/** The pages. */
+	def pages = [];
+	def indexes = [];
+
+	/** The wordcount. */
+	int wordcount = 0;
+
+	/** The pagecount. */
+	int pagecount = 0;
+
+	/** The wordmax. */
+	int wordmax = 10;
+
+	/** The wordid. */
+	String wordid;
+
+	/** The first word. */
+	boolean firstWord = true;
+
+	/** The wordvalue. */
+	String wordvalue;
+
+	/** The interpvalue. */
+	String interpvalue;
+
+	/** The lastword. */
+	String lastword = " ";
+
+	/** The wordtype. */
+	String wordtype;
+
+	/** The flagform. */
+	boolean flagform = false;
+
+	/** The flaginterp. */
+	boolean flaginterp = false;
+
+	boolean flagcomment = false;
+
+	/** The url. */
+	private def url;
+
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The writer. */
+	XMLStreamWriter writer;
+	BufferedOutputStream output;
+
+	File txmfile;
+
+	File outfile;
+
+	String corpusname ="";
+	String cuttingTag = "pb"
+	String txtname;
+	File htmlDir;
+	File defaultDir;
+	Metadatas metadatas;
+
+	def interviewers = [];
+	def eventTranslations = ["^^":"mot inconnu", "?":"orthographe incertaine",
+		"()":"rupture de syntaxe", "b":"bruit indÃ©terminÃ©",
+		"*":"mot corrigÃ©",
+		"bb":"bruit de bouche", "bg":"bruit de gorge",
+		"ch":"voix chuchotÃ©e", "conv":"conversations de fond",
+		"e":"expiration", "i":"inspiration",
+		"mic":"bruits micro", "n":"reniflement",
+		"nontrant":"non transcrit", "pap":"froissement de papiers",
+		"pf":"souffle", "pi":"inintelligible",
+		"pif":"inaudible", "r":"respiration",
+		"rire":"rire du locuteur", "shh":"soufle Ã©lectrique",
+		"sif":"sifflement du locuteur", "tx":"toux"];
+	String currentTime = "";
+	boolean bold = false;
+	int writenLength = 0;
+	boolean spokenTurn = false;
+	boolean firstSync = false;
+	boolean firstWho = false;
+	/**
+	 * Instantiates a new pager.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param NoSpaceBefore the no space before
+	 * @param NoSpaceAfter the no space after
+	 * @param max the max
+	 * @param metadatas the metadatas
+	 */
+	pager(File txmfile, File htmlDir, String txtname, List<String> NoSpaceBefore,
+	List<String> NoSpaceAfter, int max, String corpusname, String cuttingTag, Metadatas metadatas) {
+		this.metadatas = metadatas
+		this.wordmax = max;
+		this.cuttingTag = cuttingTag;
+		this.corpusname = corpusname;
+		this.NoSpaceBefore = NoSpaceBefore;
+		this.NoSpaceAfter = NoSpaceAfter;
+		this.url = txmfile.toURI().toURL();
+		this.txmfile = txmfile;
+		this.htmlDir = htmlDir;
+		this.txtname = txtname;
+
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+
+		defaultDir = new File(htmlDir, "default")
+		defaultDir.mkdir()
+		new File(htmlDir, "onepage").mkdir()
+		outfile = new File(htmlDir, "onepage/${txtname}.html");
+		createOutput(outfile)
+
+		try {
+			process();
+		} catch(Exception e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			if (writer != null) {
+				writer.close();
+				output.close();
+			}
+		}
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile) {
+		try {
+			//println "write html in : "+outfile
+			XMLOutputFactory outfactory = XMLOutputFactory.newInstance();
+			output = new BufferedOutputStream(new FileOutputStream(outfile))
+			writer = outfactory.createXMLStreamWriter(output, "UTF-8");//create a new file
+
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/** The events. */
+	List<String> events = [];
+	String previousEvent = "", nextEvent = "";
+	/**
+	 * Process.
+	 */
+	void process() {
+
+		String previousElem = "";
+		boolean parolesRaportees = false;
+		boolean firstWord = true;
+		boolean shouldBreak = false;
+		boolean overlapping = false;
+		int nbBreak = 0;
+		String previousSPK;
+		String localname = "";
+		ArrayList<String> whos = [];
+		HashMap<String, String> speakers = new HashMap<String, String>();
+		HashMap<String, String> topics = new HashMap<String, String>();
+
+		writer.writeStartDocument("UTF-8","1.0");
+		writer.writeStartElement("html");
+		//<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+		writer.writeStartElement("meta");
+		writer.writeAttribute("http-equiv", "Content-Type");
+		writer.writeAttribute("content", "text/html");
+		writer.writeAttribute("charset", "UTF-8");
+		writer.writeEndElement();
+		writer.writeStartElement("head");
+
+		//<link rel="stylesheet" type="text/css" href="class.css" />
+		writer.writeStartElement("link");
+		writer.writeAttribute("rel", "stylesheet");
+		writer.writeAttribute("type", "text/css");
+		writer.writeAttribute("href", "transcriber.css");
+		writer.writeEndElement();
+		writer.writeEndElement();
+
+		nbBreak++
+		writer.writeStartElement("body");
+		writer.writeEmptyElement("pb");
+		writer.writeAttribute("id", ""+nbBreak);
+		pages << new File(defaultDir, "${txtname}_${nbBreak}.html")
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch (localname) {
+						case "text":
+							writer.writeStartElement("h2");
+							writer.writeAttribute("class","titre");
+							String title = parser.getAttributeValue(null, "title");
+							if (title != null) {
+								writer.writeCharacters(title);
+							} else {
+								writer.writeCharacters("Transcription "+txmfile.getName().substring(0, txmfile.getName().length() - 4));
+							}
+							writer.writeEndElement();
+							if(metadatas != null) {
+								writer.writeStartElement("table");
+								boolean grey = false;
+								for (String name : metadatas.getPropertyNames()) {
+									if ("title" == name) continue; // ignore "title" metadata
+									grey = !grey;
+									writer.writeStartElement("tr");
+									if (grey)
+										writer.writeAttribute("style","background-color:lightgrey;")
+									String value = parser.getAttributeValue(null, name);
+									if (value != null) {
+										writer.writeStartElement("td");
+										writer.writeCharacters(name);
+										writer.writeEndElement();
+										writer.writeStartElement("td");
+										writer.writeCharacters(value);
+										writer.writeEndElement();
+									}
+									//get enqueteur to style their names
+									if (name.startsWith("enq")) {
+										interviewers.add(value)
+									}
+									writer.writeEndElement();
+								}
+								writer.writeEndElement();
+							}
+							break;
+						case "Topics":
+						/*writer.writeStartElement("h2");
+					 writer.writeCharacters("Topics");
+					 writer.writeEndElement();
+					 writer.writeStartElement("ul");
+					 */
+							break;
+						case "Topic":
+							topics.put(parser.getAttributeValue(null,"id"), parser.getAttributeValue(null,"desc"))
+						/*writer.writeStartElement("li");
+					 writer.writeCharacters(parser.getAttributeValue(null,"desc"));
+					 writer.writeStartElement("ul");
+					 for(int i = 0 ; i < parser.getAttributeCount() ; i++)
+					 {
+					 if(parser.getAttributeLocalName(i) != "desc")
+					 {
+					 writer.writeStartElement("li");
+					 writer.writeCharacters(parser.getAttributeLocalName(i)+": "+parser.getAttributeValue(i));
+					 writer.writeEndElement();
+					 }
+					 }
+					 writer.writeEndElement();
+					 writer.writeEndElement();
+					 */
+							break;
+						case "Speakers":
+						/*writer.writeStartElement("h2");
+					 writer.writeCharacters("Speakers");
+					 writer.writeEndElement();
+					 writer.writeStartElement("ul");*/
+							break;
+						case "Speaker":
+							whos.add(parser.getAttributeValue(null,"name"));
+							speakers.put(parser.getAttributeValue(null,"id"), parser.getAttributeValue(null,"name"))
+						/*writer.writeStartElement("li");
+					 writer.writeStartElement("ul");
+					 writer.writeCharacters(parser.getAttributeValue(null,"name"));
+					 for(int i = 0 ; i < parser.getAttributeCount() ; i++)
+					 {
+					 if(parser.getAttributeLocalName(i) != "name")
+					 {
+					 writer.writeStartElement("li");
+					 writer.writeCharacters(parser.getAttributeLocalName(i)+": "+parser.getAttributeValue(i));
+					 writer.writeEndElement();
+					 }
+					 }
+					 writer.writeEndElement();
+					 writer.writeEndElement();*/
+							break;
+						case "Comment":
+							spokenTurn = true;
+							writenLength++;
+							writer.writeStartElement("span");
+							writer.writeAttribute("class", "comment");
+							writer.writeCharacters(" ["+parser.getAttributeValue(0)+"] ");
+							writer.writeEndElement();
+							flagcomment = true;
+							break;
+						case "div":
+							writer.writeStartElement("div");
+							writer.writeAttribute("class", "section");
+							String type = parser.getAttributeValue(null,"type");
+							String desc = parser.getAttributeValue(null,"topic");
+							if (type != null && desc != null) {
+								writer.writeStartElement("h3");
+								writer.writeCharacters(type+": "+desc);
+								for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+									String name = parser.getAttributeLocalName(i);
+									if (!"type".equals(name)
+									&& !"topic".equals(name)
+									&& !"startTime".equals(name)
+									&& !"endTime".equals(name)) {
+										writer.writeCharacters(", "+name+": "+parser.getAttributeValue(i));
+									}
+								}
+								writer.writeEndElement(); // h3
+							}
+							break;
+						case "sp":
+							endBoldIfNeeded()
+							firstSync = true;
+							firstWho = true;
+							spokenTurn = false;
+							overlapping = false
+
+							writer.writeStartElement("p");
+							writer.writeAttribute("class", "turn");
+
+							overlapping = ("true" == parser.getAttributeValue(null,"overlap"))
+							String spid = parser.getAttributeValue(null,"speaker");
+							whos = []
+							if (overlapping) {
+								writer.writeEmptyElement("br");
+								writeSpeaker(parser.getAttributeValue(null,"speaker"), false)
+
+								writer.writeEmptyElement("br");
+								whos = spid.split(" ")
+							}
+
+							break;
+						case "u":
+							writer.writeCharacters("\n");
+							this.currentTime = parser.getAttributeValue(null,"time");
+
+							if (previousElem == "u" && writenLength == 0) { // if previous u had no words, it was a silence
+								writer.writeStartElement("span");
+								writer.writeAttribute("class", "event");
+								writer.writeCharacters("[silence]");
+								writer.writeEndElement(); // span
+								writer.writeEmptyElement("br");
+							}
+
+							String spk = parser.getAttributeValue(null, "spk")
+							if (spk != null && spk != previousSPK) {
+								endBoldIfNeeded()
+								writer.writeEmptyElement("br");
+								writeSpeaker(parser.getAttributeValue(null, "spk"), overlapping)
+								startBoldIfNeeded()
+							}
+
+							writeCurrentTime()
+							previousSPK = spk
+
+						//							writenLength = 0;
+						/*writer.writeStartElement("span");
+					 writer.writeAttribute("class", "sync");
+					 writer.writeCharacters("["+parser.getAttributeValue(null,"time")+"]");
+					 writer.writeEndElement();*/
+
+							break;
+						case "event":
+							spokenTurn = true;
+							writenLength++;
+							String desc = parser.getAttributeValue(null,"desc");
+							desc = translateEvent(desc);
+							String type = parser.getAttributeValue(null,"type");
+							if (desc.equals("paroles rapportÃ©es")) {
+								if (parser.getAttributeValue(null, "extent") == "end")
+									writer.writeCharacters("Â» ");
+								else if (parser.getAttributeValue(null, "extent") == "begin")
+									writer.writeCharacters(" Â«");
+							} else {
+								writer.writeStartElement("span");
+								writer.writeAttribute("class", "event");
+								if (parser.getAttributeValue(null, "extent") == "end") {
+									writer.writeCharacters(" <"+desc+"] ");
+									if(events.size() > 0)
+										events.remove(events.size()-1)
+								}
+								else if (parser.getAttributeValue(null, "extent") == "begin") 	{
+
+									writer.writeCharacters(" ["+desc+"> ");
+									events.add(desc)
+								}
+								else if (parser.getAttributeValue(null, "extent") == "previous") {
+									if(parser.getAttributeValue(null, "type") == "pronounce")
+										writer.writeCharacters("_["+desc+"] ");
+									else
+										writer.writeCharacters("_["+desc+"] ");
+									previousEvent = desc;
+								}
+								else if (parser.getAttributeValue(null, "extent") == "next") {
+									writer.writeCharacters(" ["+desc+"]_");
+									nextEvent = desc
+								}
+								else
+									writer.writeCharacters(" ["+desc+"] ");
+								writer.writeEndElement(); // span@class=event
+							}
+							break;
+						case "w":
+							for(int i = 0 ; i < parser.getAttributeCount() ; i++)
+								if(parser.getAttributeLocalName(i) == "id") {
+									wordid = (parser.getAttributeValue(i));
+									break;
+								}
+
+							wordcount++;
+							if (wordcount >= wordmax) {
+								shouldBreak = true;
+							}
+
+							if (firstWord) {
+								indexes << wordid
+								firstWord = false;
+							}
+
+							break;
+
+						case "ana":
+
+							String type = parser.getAttributeValue(null,"type").substring(1);
+							if (SIMPLE_TOOLTIP) {
+								if (type.contains("lemma") || type.contains("pos")) {
+									flaginterp=true;
+									interpvalue+=", ";
+								}
+							} else {
+								flaginterp=true;
+								interpvalue+=", "+type+"="
+							}
+							break;
+
+						case "form":
+							wordvalue="";
+							interpvalue ="";
+							flagform=true;
+							break;
+					}
+					previousElem = localname;
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{
+						case "text":
+							break;
+						case "Topics":
+						//writer.writeEndElement();
+							break;
+						case "Topic":
+							break;
+						case "Speakers":
+						//println "Speakers: "+speakers
+						//writer.writeEndElement();
+							break;
+						case "Speaker":
+							break;
+
+						case "div":
+						//writer.writeCharacters("}");
+
+							writer.writeEndElement(); // div
+							writer.writeCharacters("\n");
+							break;
+						case "sp":
+						//println "CLOSING: "+parser.getLocalName()
+							endBoldIfNeeded()
+							if (!spokenTurn) {
+								writer.writeStartElement("span");
+								writer.writeAttribute("class", "event");
+								writer.writeCharacters("[silence]");
+								writer.writeEndElement();
+								writer.writeEmptyElement("br");
+							}
+
+							writer.writeEndElement(); // p
+
+							if (shouldBreak) {
+								nbBreak++
+								writer.writeEmptyElement("pb");
+								writer.writeAttribute("id", ""+nbBreak);
+								writer.writeCharacters("\n");
+
+								pages << new File(defaultDir, "${txtname}_${nbBreak}.html")
+								indexes << wordid
+
+								wordcount = 0;
+								shouldBreak = false;
+							}
+							writer.writeCharacters("\n");
+							break;
+						case "u":
+						//writer.writeEndElement() // span@class=u
+						//writer.writeEmptyElement("br");
+						//if (overlapping) writer.writeEndElement(); // b
+							break;
+						case "event":
+							break;
+						case "form":
+							flagform = false
+							break;
+						case "ana":
+							flaginterp = false
+							break;
+						case "w":
+							writenLength++;
+							spokenTurn = true;
+							int l = lastword.length();
+							String endOfLastWord = "";
+							if(l > 0)
+								endOfLastWord = lastword.subSequence(l-1, l);
+
+							if(interpvalue != null)
+								interpvalue = interpvalue.replace("\"","&quot;");
+							if(events.size() > 0)
+								interpvalue = interpvalue.replace("event=", "event="+events.toString().replace("\"","&quot;")); // remove ", "
+
+							if(nextEvent.length() > 0)
+							{
+								interpvalue = interpvalue.replace("event=", "event="+nextEvent+", ")
+								nextEvent = ""
+							}
+							interpvalue = interpvalue.replace("=, ","='', "); // add '' to empty interp value
+							if (interpvalue.startsWith(", ")) interpvalue = interpvalue.substring(2)
+						//							println "** SPACE TEST"
+						//							println "NoSpaceBefore: "+NoSpaceBefore+" contains ? "+wordvalue
+						//							println "NoSpaceAfter: "+NoSpaceAfter+" contains ? "+lastword
+						//							println "wordvalue starts with '-' ? "+wordvalue
+						//							println "NoSpaceAfter: "+NoSpaceAfter+" contains endOfLastWord ? "+endOfLastWord
+							if(NoSpaceBefore.contains(wordvalue) ||
+							NoSpaceAfter.contains(lastword) ||
+							wordvalue.startsWith("-") ||
+							NoSpaceAfter.contains(endOfLastWord)) {
+								//								println " NO SPACE"
+							} else {
+								//								println " SPACE"
+								writer.writeCharacters(" ");
+							}
+
+							if (interpvalue.contains("rapp1")) {
+								writer.writeCharacters(" Â«");
+							} else if (wordvalue == "\"") {
+								// don't write this char
+							} else {
+								writer.writeStartElement("span");
+								writer.writeAttribute("class", "word");
+								writer.writeAttribute("title", interpvalue);
+								writer.writeAttribute("id", wordid);
+								writer.writeCharacters(wordvalue);
+								writer.writeEndElement();
+							}
+							if (interpvalue.contains("orth")) {
+								writer.writeStartElement("span");
+								writer.writeAttribute("class", "event");
+								writer.writeCharacters("_[?]");
+								writer.writeEndElement();
+							}
+							if (interpvalue.contains("corr")) {
+								writer.writeStartElement("span");
+								writer.writeAttribute("class", "event");
+								writer.writeCharacters("_[!]");
+								writer.writeEndElement();
+							}
+
+							if (interpvalue.contains("rapp2")) {
+								writer.writeCharacters(" Â» ");
+							}
+
+							lastword=wordvalue;
+							break;
+					}
+
+					break;
+
+				case XMLStreamConstants.CHARACTERS:
+					if(flagform)
+						if(parser.getText().length() > 0)
+							wordvalue+=(parser.getText().trim());
+					if(flaginterp)
+						if(parser.getText().length() > 0)
+							interpvalue+=(parser.getText().trim());
+					break;
+			}
+		}
+		writer.writeEndElement();
+
+		writer.writeEmptyElement("pb");
+		nbBreak++
+		writer.writeAttribute("id", ""+nbBreak);
+
+		writer.writeEndElement();
+		writer.close();
+		output.close();
+
+		File txmhome = new File(org.txm.Toolbox.getParam(org.txm.Toolbox.USER_TXM_HOME));
+		File xlsDir  = new File(txmhome, "xsl");
+		File xslfile = new File(xlsDir,"breakByMilestone.xsl");
+		if (!xslfile.exists()) {
+			println ""
+		}
+		//		println "xsl: "+xslfile
+		//		println "html: "+outfile
+		//		println "pages: "+pages
+		//		println "words: "+indexes
+
+
+		if (pages.size() > 1) {
+			for (int i = 1 ; i < nbBreak ; i++) {
+				ApplyXsl2 a = new ApplyXsl2(xslfile.getAbsolutePath());
+				String[] params = ["pbval1", i,"pbval2", i+1];
+
+				File resultfile = pages[i-1]
+				//println "BBmilestones: "+i+" "+(i+1)+" in file "+resultfile
+				//println "process $outfile -> $resultfile"
+				a.process(outfile.getAbsolutePath(), resultfile.getAbsolutePath(), params);
+			}
+		} else {
+			File page = pages[0]
+			FileCopy.copy(outfile, page)
+		}
+	}
+
+	private void writeCurrentTime()
+	{
+		writer.writeStartElement("span");
+		writer.writeAttribute("class", "sync");
+		writer.writeCharacters(currentTime);
+		writer.writeEndElement();
+	}
+
+	private void writeSpeaker(String spk, boolean overlapping) {
+
+		writer.writeStartElement("span");
+		writer.writeAttribute("class", "spk");
+		if(interviewers.contains(spk))
+			bold = true;
+		else
+			bold = false;
+		spk = spk.replaceAll('^([^0-9]*)([0-9]+)$', '$1 $2');
+		if (overlapping) writer.writeCharacters("// ")
+		writer.writeCharacters(spk+": ")
+		writer.writeEndElement(); // span@class=spk
+	}
+
+	private String translateEvent(String desc) {
+		if(eventTranslations.containsKey(desc))
+			return eventTranslations.get(desc);
+		else
+			return desc;
+	}
+
+	boolean boldOpenned = false;
+	private void startBoldIfNeeded() {
+		if (bold) {
+			writer.writeStartElement(ENQ_HIGHLIGHT_ELEMENT);
+			boldOpenned = true;
+		}
+	}
+
+	private endBoldIfNeeded() {
+		if (boldOpenned) {
+			//			println "CLOSE BOLD"
+			writer.writeEndElement(); // b
+			boldOpenned = false;
+		}
+	}
+
+	//	private String formatTime(float time, boolean doshort)
+	//	{
+	//		String rez = " ";
+	//		//		if(time >= 3600) // >= 1h
+	//		//		{
+	//		float h = time / 3600;
+	//		time = time%3600;
+	//		float min = (time%3600) / 60;
+	//		int sec = (int)time%60;
+	//
+	//		if(min < 10)
+	//			rez = ""+(int)h+":0"+(int)min;//+":"+time%60;
+	//		else
+	//			rez = ""+(int)h+":"+(int)min;//+":"+time%60;
+	//		//if (!doshort)
+	//		if (sec > 9)
+	//			rez += ":"+(int)time%60;
+	//		else
+	//			rez += ":0"+(int)time%60;
+	//		//		}
+	//		//		else if(time >= 60) // >= 1min
+	//		//		{
+	//		//			int min = time/60;
+	//		//			if(min < 10)
+	//		//				rez = "00:0"+min;//+":"+time%60;
+	//		//			else
+	//		//				rez = "00:"+min;//+":"+time%60;
+	//		//			if(!doshort)
+	//		//				rez += ":"+(int)time%60;
+	//		//		}
+	//		//		else // < 60
+	//		//		{
+	//		//			if(time < 10)
+	//		//				return " 0:0"+time;
+	//		//			else
+	//		//				return " 0:"+time;
+	//		//		}
+	//		return rez;
+	//	}
+
+	/**
+	 * Gets the page files.
+	 *
+	 * @return the page files
+	 */
+	public ArrayList<File> getPageFiles() {
+		return pages;
+	}
+
+	/**
+	 * Gets the idx.
+	 *
+	 * @return the idx
+	 */
+	public ArrayList<String> getIdx() {
+		return indexes;
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/FixTiming.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/FixTiming.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/FixTiming.groovy	(revision 728)
@@ -0,0 +1,227 @@
+// Copyright Â© - ENS de Lyon - http://textometrie.ens-lyon.fr
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+// $LastChangedDate: 2011-11-01 16:12:36 +0100 (mar., 01 nov. 2011) $
+// $LastChangedRevision: 2049 $
+// $LastChangedBy: sheiden $
+//
+
+package org.txm.importer.transcriber
+import java.text.DecimalFormat;
+// parameters
+
+String userdir = System.getProperty("user.home")
+File infile = new File(userdir, "xml/concattrs/ReÃ§ues/int23.trs")
+File outfile = new File(userdir, "xml/concattrs/ReÃ§ues/int23-corr.trs")
+
+public boolean checkSpk(String spk) {
+	return spk.matches(ValidateTRS.spkPattern);
+}
+
+public fixTopics(def trs) {
+	
+	def okTopics = ValidateTRS.okTopics;
+	
+	// get Topic ids
+	def ids2desc = [:];
+	def declaredTopics = trs.Topics.Topic;
+	for (def topic : declaredTopics) {
+		ids2desc[topic.@id]=topic.@desc
+	}
+	
+	// fix Sections
+	for(def section : trs.Episode.Section) {
+
+		if (section.@topic != null)
+		if (okTopics.contains(ids2desc[section.@topic])) {
+			section.@topic = ids2desc[section.@topic]
+		}
+	}
+	
+	// fix Section decl
+	for(def topic : trs.Topics.Topic) {
+		if (okTopics.contains(ids2desc[topic.@id])) {
+			topic.@id = topic.@desc
+		}
+	}
+}
+
+def fixTurn(prevTurn, turn) // end < start
+{
+	def start =  Float.parseFloat(turn.'@startTime')
+	def startS = turn.'@startTime'
+	def end =  Float.parseFloat(turn.'@endTime')
+	def endS = turn.'@endTime'
+
+	// patch previous turn
+	if (prevTurn != null) {
+		def prevstart = Float.parseFloat(prevTurn.'@startTime')
+		if (prevstart > end) {
+			println "** FixTiming: Warning: previous turn not updated ($prevstart > $end): $prevTurn"
+		} else {
+			prevTurn.'@endTime' = endS;
+		}
+	} else {
+		turn.parent().'@startTime' = endS
+	}
+
+	// patch current turn
+	turn.'@startTime' = endS;
+	turn.'@endTime' = startS;
+
+	// patch next turn
+	def i = turn.parent().children().indexOf(turn)
+	if (turn.parent().children().size() > i+1) {
+		def nextTurn = turn.parent().children().get(i+1)
+		if (nextTurn != null) {
+			def nextend = Float.parseFloat(nextTurn.'@endTime')
+			nextTurn.'@startTime' = startS; // patch next Turn even if nextTurn.end < start, loop will continue to patch next turns
+		}
+	} else {
+		turn.parent().'@endTime' = startS
+	}
+	println "** FixTiming: fixed Turn: old time[$startS, $endS] to ["+turn.@startTime+", "+turn.@endTime+"]"
+}
+
+def fixTurn2(turn, timeResolution) // start == end
+{
+	DecimalFormat formater = DecimalFormat.getInstance(Locale.ENGLISH)
+	formater.setMaximumFractionDigits(3)
+	//DecimalFormat formater = new DecimalFormat("#.000");
+	def start =  Float.parseFloat(turn.'@startTime')
+	def startS = turn.'@startTime'
+	def end =  Float.parseFloat(turn.'@endTime')+timeResolution*10
+	def endS = formater.format(end)
+	println "ENDS: "+endS
+
+	// patch current turn
+	turn.'@endTime' = endS;
+
+	// patch next turn
+	def i = turn.parent().children().indexOf(turn)
+	if (turn.parent().children().size() > i+1) {
+		def nextTurn = turn.parent().children().get(i+1)
+		if (nextTurn != null) {
+			def nextstart = Float.parseFloat(nextTurn.'@startTime')
+			nextTurn.'@startTime' = endS; // patch next Turn even if nextTurn.end < start, loop will continue to patch next turns
+		}
+	} else {
+		turn.parent().'@endTime' = endS
+	}
+
+	println "** FixTiming: fixed Turn: equal old time[$startS, $endS] to ["+turn.@startTime+", "+turn.@endTime+"]"
+}
+
+def fixSync(turn)
+{
+	def start =  Float.parseFloat(turn.'@startTime')
+	def end =  Float.parseFloat(turn.'@endTime')
+	def syncs = turn.Sync
+	def badSyncList = []
+
+	def lastValidSyncTime = start
+	def firstSync = true
+
+	for (def sync : syncs) {
+		if (firstSync) {
+			if (sync.@time != turn.'@startTime') {
+				println "** FixTiming: fixed first Sync: old time "+sync.@time+" to "+turn.'@startTime'
+			}
+			sync.@time = turn.'@startTime'
+			lastValidSyncTime = start
+			firstSync = false
+		} else {
+			def time = Float.parseFloat(sync.@time)
+			if (time > lastValidSyncTime && time < end) {
+				fixBadSyncList(badSyncList, lastValidSyncTime, time)
+				lastValidSyncTime = time
+				badSyncList = []
+			} else {
+				badSyncList << sync
+			}
+		}
+	}
+	fixBadSyncList(badSyncList, lastValidSyncTime, end)
+}
+
+def fixBadSyncList(list, start, end) {
+	def timeResolution = 0.001
+	if (start >= end) {
+		println("** FixTiming: fixBadSyncList: start($start) >= end($end)")
+		return
+	}
+	if (list.size() > 0) {
+		def dt = (end - start)/(list.size()+1)
+		if (dt < timeResolution) {
+			println("** FixTiming: fixBadSyncList: dt($dt) < $timeResolution seconds")
+			return
+		}
+		def st = start
+		list.each { sync ->
+			st += dt
+			def oldtime = sync.@time
+			sync.@time = ""+st
+			println "** FixTiming: fixed Sync: old time $oldtime to $st"
+		}
+	}
+}
+
+public def fixTRS(File infile, File outfile) {
+	def timeResolution = 0.001
+	URL u = infile.toURI().toURL()
+	InputStream ins = u.openStream()
+
+	// Open input file
+	def slurper = new XmlParser();
+	def trs = slurper.parse(infile.toURI().toString())
+
+	// First fix all <Turn>
+	def prevTurn = null
+	for (def section : trs.Episode.Section) {
+		section.Turn.each{ turn ->
+			def start = Float.parseFloat(turn.'@startTime')
+			def end =  Float.parseFloat(turn.'@endTime')
+			if (end < start) {
+				fixTurn(prevTurn, turn)
+			} else if (start == end) {
+				fixTurn2(turn, timeResolution)
+			}
+			prevTurn = turn
+			//} catch (Exception e){ org.txm.utils.logger.Log.printStackTrace(e); println "start: "+turn.'@startTime' println "end: "+turn.'@endTime'}
+		}
+	}
+
+	// Then fix all <Sync>s of Turns
+	for (def section : trs.Episode.Section) {
+		section.Turn.each{ turn ->
+			fixSync(turn)
+		}
+	}
+	
+	// Finally fix topics declarations
+	fixTopics(trs);
+
+	String xml = "";
+
+	println ""+xml
+	outfile.withWriter("UTF-8"){ writer ->
+		writer.write('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE Trans SYSTEM "trans-14.dtd">\n')
+		new groovy.util.XmlNodePrinter(new PrintWriter(writer)).print(trs) }
+}
+
+/// MAIN ///
+fixTRS(infile, outfile);
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/ChangeSpeaker.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/ChangeSpeaker.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/ChangeSpeaker.groovy	(revision 728)
@@ -0,0 +1,148 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.importer.transcriber;
+
+import org.txm.importer.*;
+import org.txm.utils.*;
+import org.txm.metadatas.*;
+
+import java.io.File;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javax.xml.parsers.*;
+import javax.xml.xpath.*;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+// TODO: Auto-generated Javadoc
+/** remove part of xml given an id. */
+public class ChangeSpeaker {
+	File outfile;
+	
+	/** The doc. */
+	Document doc;
+	
+	/**
+	 * Instantiates a new change speaker.
+	 *
+	 * @param transcriptionfile the transcriptionfile
+	 * @param outfile the outfile
+	 * @param id the id
+	 * @param newid the newid
+	 */
+	public ChangeSpeaker(File transcriptionfile, File outfile, String id, String newid)
+	{
+		this.outfile = outfile;
+		
+		String xpath = "//Turn";
+		DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+		domFactory.setNamespaceAware(true); // never forget this!
+		domFactory.setXIncludeAware(true);
+		DocumentBuilder builder = domFactory.newDocumentBuilder();
+		doc = builder.parse(transcriptionfile);
+		
+		def expr = XPathFactory.newInstance().newXPath().compile(xpath);
+		def nodes = expr.evaluate(doc, XPathConstants.NODESET);
+		
+		
+		
+		for(def node : nodes)
+		{
+			if (node == null) continue;
+			
+			Element elem = (Element)node;
+			if(elem.getAttribute("speaker").contains(id))
+			{
+				String value = elem.getAttribute("speaker");
+				value = value.replace(id, newid);
+				elem.setAttribute("speaker", value);
+			}
+		}
+		
+		def expr2 = XPathFactory.newInstance().newXPath().compile("//Speaker[@id='"+id+"']");
+		def nodes2 = expr2.evaluate(doc, XPathConstants.NODESET);
+		
+		for(def node : nodes2)
+		{
+			if (node == null) continue;
+			
+			Element elem = (Element)node;
+			elem.setAttribute("id", newid);
+		}
+		save()
+	}
+	
+	/**
+	 * Save.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean save()
+	{
+		try {
+			// CrÃ©ation de la source DOM
+			Source source = new DOMSource(doc);
+			
+			// CrÃ©ation du fichier de sortie
+			Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8")); 
+			Result resultat = new StreamResult(writer);
+			
+			// Configuration du transformer
+			TransformerFactory fabrique = new net.sf.saxon.TransformerFactoryImpl();
+			Transformer transformer = fabrique.newTransformer();
+			transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+			transformer.setOutputProperty(OutputKeys.INDENT, "yes"); 
+			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); 
+			
+			// Transformation
+			transformer.transform(source, resultat);
+			writer.close();
+			return true;
+		} catch (Exception e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return false;
+		}
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		String homedir = System.getProperty("user.home")
+		File trs1 = new File(homedir, "xml/concattrs/int18_1.trs")
+		new ChangeSpeaker(trs1, trs1, "spk2", "spk4");
+		new ChangeSpeaker(trs1, trs1, "spk3", "spk2");
+		new ChangeSpeaker(trs1, trs1, "spk4", "spk3");
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/ConcatTrs.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/ConcatTrs.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/ConcatTrs.groovy	(revision 728)
@@ -0,0 +1,436 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.importer.transcriber
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.*;
+
+import javax.xml.stream.*;
+import java.io.File;
+import java.net.URL;
+import java.text.DecimalFormat;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ConcatTrs.
+ */
+class ConcatTrs {
+
+	/** The localname. */
+	String localname;
+
+	/** The prefix. */
+	String prefix;
+
+	/** The input data1. */
+	InputStream inputData1,/** The input data2. */
+	inputData2;
+
+	/** The parser1. */
+	XMLStreamReader parser1,
+	/** The parser2. */
+	parser2;
+
+	/** The output. */
+	BufferedOutputStream output;
+
+	/** The writer. */
+	XMLStreamWriter writer;
+
+	/** The inputfactory. */
+	XMLInputFactory inputfactory = XMLInputFactory.newInstance();
+
+	/** The factory. */
+	XMLOutputFactory factory = XMLOutputFactory.newInstance();
+
+	/** The speakers. */
+	HashMap<File, String> speakers = new HashMap<File, String>();
+
+	/**
+	 * Instantiates a new concat trs.
+	 *
+	 * @param trs1 the trs1
+	 * @param trs2 the trs2
+	 * @param result the result
+	 */
+	public ConcatTrs(File trs1, File trs2, File result)
+	{
+		// t1<-open("t1.trs")
+		// t2<-open("t2.trs")
+		// out<-open("t3.trs", "w")
+		inputData1 = trs1.toURI().toURL().openStream();
+		parser1 = inputfactory.createXMLStreamReader(inputData1);
+
+		inputData2 = trs2.toURI().toURL().openStream();
+		parser2 = inputfactory.createXMLStreamReader(inputData2);
+
+		output = new BufferedOutputStream(new FileOutputStream(result))
+		writer = factory.createXMLStreamWriter(output, "UTF-8");
+
+		// check-heads(t1, t2) // same speakers
+		if(!testSpeakers())
+		{
+			println "stop"
+			return;
+		}
+
+		//get shift time trs1
+		inputData1.close();
+		inputData1 = trs1.toURI().toURL().openStream();
+		parser1 = inputfactory.createXMLStreamReader(inputData1);
+		float shift = getLastTime(parser1);
+
+		//get last time trs2
+		inputData2.close();
+		inputData2 = trs2.toURI().toURL().openStream();
+		parser2 = inputfactory.createXMLStreamReader(inputData2);
+		float end = getLastTime(parser2);
+
+		end += shift;
+		println "shift: $shift ; end: $end"
+
+		// copy-head-body-no-tail(t1, out) // shift<-last("sp", t1).time
+		inputData1.close();
+		inputData1 = trs1.toURI().toURL().openStream();
+		parser1 = inputfactory.createXMLStreamReader(inputData1);
+		writeFirstPartAndGetLastTime(parser1, end);
+
+		// copy-body+tail-time-shifted(t2, out, shift)
+		inputData2.close();
+		inputData2 = trs2.toURI().toURL().openStream();
+		parser2 = inputfactory.createXMLStreamReader(inputData2);
+		writeSecondPartAndShiftTime(parser2, shift);
+
+		writer.flush();
+		writer.close();
+		output.close();
+
+		inputData1.close();
+		inputData2.close();
+	}
+
+	/**
+	 * Test speakers.
+	 *
+	 * @return true, if successful
+	 */
+	protected boolean testSpeakers()
+	{
+		String speakers1 = getSpeaker(parser1);
+		String speakers2 = getSpeaker(parser2);
+
+		boolean ret = speakers1 == speakers2;
+
+		if(!ret)
+		{
+			println "Speakers are differents : "
+			println "  speakers1= $speakers1"
+			println "  speakers2= $speakers2"
+		}
+		else
+			println "speakers OK $speakers1 and $speakers2"
+		return ret;
+	}
+
+	/**
+	 * Gets the speaker.
+	 *
+	 * @param parser the parser
+	 * @return the speaker
+	 */
+	protected String getSpeaker(XMLStreamReader parser)
+	{
+		//println "get speakers of $parser"
+
+		ArrayList<String> spksvalues = [];
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+		{
+			switch (event)
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+				//println localname
+					if(localname == "Speaker")
+					{
+						spksvalues << "("+parser.getAttributeValue(null,"id")+"-"+parser.getAttributeValue(null,"name")+")";
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+					if(localname == "Speakers")
+					{
+						Collections.sort(spksvalues);
+						return spksvalues.toString();
+					}
+					break;
+			}
+		}
+	}
+
+	/**
+	 * Gets the last time.
+	 *
+	 * @param parser the parser
+	 * @return the last time
+	 */
+	protected float getLastTime(XMLStreamReader parser)
+	{
+		float timef = 0.0f
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+		{
+			switch (event)
+			{
+				case XMLStreamConstants.START_ELEMENT:
+
+					localname = parser.getLocalName();
+					prefix = parser.getPrefix();
+
+					if(localname == "Turn")
+					{
+						String time = parser.getAttributeValue(null, "endTime")
+						if(time != null)
+							timef = Float.parseFloat(time)
+					}
+			}
+		}
+		return timef;
+	}
+
+	/**
+	 * Write first part and get last time.
+	 *
+	 * @param parser the parser
+	 * @param end the end
+	 */
+	protected void writeFirstPartAndGetLastTime(XMLStreamReader parser, float end)
+	{
+		println "First part"
+
+		DecimalFormat f = new DecimalFormat("#.000"); //$NON-NLS-1$
+		writer.writeStartDocument("UTF-8", "1.0");
+		writer.writeCharacters("\n")
+		writer.writeDTD("<!DOCTYPE Trans SYSTEM \"trans-14.dtd\">")
+		writer.writeCharacters("\n")
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+		{
+			switch (event)
+			{
+				case XMLStreamConstants.START_ELEMENT:
+
+					localname = parser.getLocalName();
+					prefix = parser.getPrefix();
+
+					if(prefix != null && prefix.length() > 0)
+						writer.writeStartElement(prefix+":"+localname);
+					else
+						writer.writeStartElement(localname);
+
+					for(int i= 0 ; i < parser.getAttributeCount() ;i++ )
+					{
+						String name = parser.getAttributeLocalName(i)
+						String value = parser.getAttributeValue(i);
+
+						if(parser.getAttributePrefix(i)!= "")
+							writer.writeAttribute(parser.getAttributePrefix(i)+":"+name, value);
+						else
+							writer.writeAttribute(name, value);
+					}
+
+
+					break;
+
+				case XMLStreamConstants.END_ELEMENT:
+
+					localname = parser.getLocalName()
+				// dont close the transcription here
+					if(localname != "Trans" && localname != "Episode")
+						writer.writeEndElement();
+					break;
+
+				case XMLStreamConstants.CHARACTERS:
+					writer.writeCharacters(parser.getText());
+					break;
+			}
+		}
+	}
+
+	/**
+	 * Write second part and shift time.
+	 *
+	 * @param parser the parser
+	 * @param shift the shift
+	 */
+	protected void writeSecondPartAndShiftTime(XMLStreamReader parser, float shift)
+	{
+		println "Second part"
+		DecimalFormat f = new DecimalFormat("#.000"); //$NON-NLS-1$
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+		{
+			switch (event)
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					prefix = parser.getPrefix();
+
+				// skip header
+					if(localname == "Trans" || localname == "Episode" || localname == "Topics" || localname == "Topic"
+					|| localname == "Speakers" || localname == "Speaker")
+						break;
+
+					if(prefix != null && prefix.length() > 0)
+						writer.writeStartElement(prefix+":"+localname);
+					else
+						writer.writeStartElement(localname);
+
+					for(int i= 0 ; i < parser.getAttributeCount() ;i++ )
+					{
+						String name = parser.getAttributeLocalName(i);
+						String value = parser.getAttributeValue(i);
+
+						if(name == "time" || name == "endTime" || name == "startTime")
+						{
+							float newf = Float.parseFloat(value)+shift;
+							value = f.format(newf)
+							value = value.replace(",",".")
+						}
+
+						if(parser.getAttributePrefix(i)!= "")
+							writer.writeAttribute(parser.getAttributePrefix(i)+":"+name, value);
+						else
+							writer.writeAttribute(name, value);
+					}
+
+
+					break;
+
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName()
+					if(localname == "Topics" || localname == "Topic"
+					|| localname == "Speakers" || localname == "Speaker" )
+						break;
+					writer.writeEndElement();
+					break;
+
+				case XMLStreamConstants.CHARACTERS:
+					if (parser.getText().trim().length() > 0)
+						writer.writeCharacters(parser.getText());
+					break;
+			}
+		}
+	}
+
+	/**
+	 * Process.
+	 */
+	protected void process()
+	{
+		writer.writeStartDocument("UTF-8", "1.0");
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+		{
+			switch (event)
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					prefix = parser.getPrefix();
+
+					if(prefix != null && prefix.length() > 0)
+						writer.writeStartElement(prefix+":"+localname);
+					else
+						writer.writeStartElement(localname);
+
+
+					for(int i= 0 ; i < parser.getAttributeCount() ;i++ )
+					{
+						String prefix = parser.getAttributePrefix(i)
+						String attname = parser.getAttributeLocalName(i)
+						String attvalue = parser.getAttributeValue(i);
+
+						if(prefix != "")
+							writer.writeAttribute(prefix+":"+attname, attvalue);
+						else
+							writer.writeAttribute(attname, attvalue);
+					}
+
+
+					break;
+
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName()
+					writer.writeEndElement();
+					break;
+
+				case XMLStreamConstants.CHARACTERS:
+					writer.writeCharacters(parser.getText());
+					break;
+			}
+		}
+	}
+
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File homedir = new File(System.getProperty("user.home"),"xml/concattrs/new");
+		//		File trs1 = new File(homedir, "int17A.trs")
+		//		File trs2 = new File(homedir, "int17B.trs")
+		//		File trs3 = new File(homedir, "int17C.trs")
+		//		File trs4 = new File(homedir, "int17D.trs")
+		//		File tmp1 = new File(homedir, "int17tmp1.trs")
+		//		File tmp2 = new File(homedir, "int17tmp2.trs")
+		//		File trs =  new File(homedir, "int17.trs")
+
+		//		File trs1 = new File(homedir, "int24.trs")
+		//		File trs2 = new File(homedir, "int24-2.trs")
+		//		File trs3 = new File(homedir, "int24-3.trs")
+		//		File trs4 = new File(homedir, "int24-4.trs")
+		//		File trs5 = new File(homedir, "int24-5.trs")
+		//		File trs6 = new File(homedir, "int24-6.trs")
+		//		File tmp1 = new File(homedir, "int24tmp1.trs")
+		//		File tmp2 = new File(homedir, "int24tmp2.trs")
+		//		File tmp3 = new File(homedir, "int24tmp3.trs")
+		//		File tmp4 = new File(homedir, "int24tmp4.trs")
+		//		File trs =  new File(homedir, "int24-corr.trs")
+
+		File trs1 = new File(homedir, "int14.trs")
+		File trs2 = new File(homedir, "int14bis.trs")
+		File trs =  new File(homedir, "int14-corr.trs")
+
+		new ConcatTrs(trs1, trs2, trs)
+
+		ValidateTRS.checkTRS(trs)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/importer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/importer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/transcriber/importer.groovy	(revision 728)
@@ -0,0 +1,314 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+
+package org.txm.importer.transcriber
+
+import java.util.ArrayList;
+import org.txm.utils.Pair;
+
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.txm.utils.logger.Log;
+import org.txm.scripts.teitxm.*;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import org.w3c.dom.*;
+import org.xml.sax.SAXException;
+import javax.xml.parsers.*;
+import javax.xml.xpath.*;
+
+import java.util.HashMap;
+import org.txm.importer.*;
+import org.txm.utils.*;
+import org.txm.metadatas.*;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class importer.
+ */
+class importer {
+
+	/** The trans. */
+	HashMap<String, String> trans = ["trans":"//Trans"];
+
+	/** The doc. */
+	def doc;
+
+	/** The infile. */
+	File infile;
+
+	/** The outfile. */
+	File outfile;
+
+	/** The outdir. */
+	File txmDir;
+	File binDir;
+
+	/** The trsfiles. */
+	ArrayList<String> trsfiles;
+
+	/** The metadatas. */
+	Metadatas metadatas;
+	
+	String lang; // language used by the tokenizer
+
+	/**
+	 * Instantiates a new importer.
+	 *
+	 * @param trsfiles the trsfiles
+	 * @param outdir the outdir
+	 * @param metadatas the metadatas
+	 */
+	public importer(ArrayList<File> trsfiles, File binDir, File txmDir, Metadatas metadatas, lang) {
+		this.trsfiles = trsfiles;
+		this.txmDir = txmDir; 
+		this.binDir = binDir;
+		this.metadatas = metadatas;
+		this.lang = lang;
+	}
+
+	/**
+	 * Run.
+	 *
+	 * @return true, if successful
+	 */
+	public boolean run() {
+		if (trsfiles == null) {
+			println "no files to process"
+			return false;
+		}
+		txmDir.mkdir();
+		if (!txmDir.exists()) {
+			println "can't create txmDir: "+txmDir.getAbsolutePath()
+		}
+		
+		// TRS -> TEI
+		println "Converting TRS to TEI "+trsfiles.size()+" files"
+		for (File infile : trsfiles) {
+			print "."
+			String textid = infile.getName()
+			int idx = textid.indexOf(".trs")
+			if (idx > 0) textid = textid.substring(0, idx)
+			File outfile = new File(txmDir, textid+".xml")
+			TRSToTEI p = new TRSToTEI(infile);
+			if (!p.process(outfile)) {
+				println "Error while converting TRS to TEI: "+infile
+				//return false;
+			}
+		}
+		println ""
+
+		if (metadatas != null) {
+			if (metadatas.getHeadersList().size() == 0) {
+				println "Malformed metadata file. Check column and text separator. Columns: "+metadatas.getHeadersList()
+				return false;
+			}
+			println "Injecting metadatas "+metadatas.getHeadersList()+" in "+trsfiles.size()+" files"
+		}
+		trsfiles = txmDir.listFiles();
+		trsfiles.sort()
+		for (File infile : trsfiles) {
+			File outfile = new File(txmDir, "tmp.xml")
+			if (metadatas != null && metadatas.isInitialized()) {
+				print "."
+				if (!metadatas.injectMetadatasInXml(infile, outfile, "text")) {
+					println("Failed to inject metadatas in "+infile)
+					outfile.delete()
+				}
+				if (!infile.delete()) {
+					println "ERROR: could not delete $infile"
+					return false
+				}
+				outfile.renameTo(infile)
+			}
+		}
+		
+		println ""
+		
+		// TOKENIZER ENTITIES
+		println "Tokenizing entities "+txmDir.listFiles().length+" files"
+		for (File pfile : txmDir.listFiles()) {
+			print "."
+			TokenizeEntities tokenizer = new TokenizeEntities(pfile.toURI().toURL());
+			File outfile = File.createTempFile("tok", ".xml", pfile.getParentFile());
+			if (tokenizer.process(outfile)) {
+				if (!(pfile.delete() && outfile.renameTo(pfile))) println "Warning can't rename file "+outfile+" to "+pfile
+			} 
+			outfile.delete();
+		}
+		println ""
+		
+		//TOKENIZE
+		println "Tokenizing "+txmDir.listFiles().length+" files from $txmDir"
+		File tokenizedDir = new File(binDir, "tokenized")
+		tokenizedDir.mkdir()
+		for (File pfile : txmDir.listFiles()) {
+			print "."
+			String filename = pfile.getName().substring(0, pfile.getName().length()-4)
+			File tfile = new File(tokenizedDir, pfile.getName())
+			try {
+				TranscriberTokenizer tokenizer = new TranscriberTokenizer(pfile, tfile, lang)
+				if (!tokenizer.process()) {
+					println("Failed to tokenize "+pfile)
+				}
+			} catch (Exception e) {
+				println "Error tokenizer: "+pfile
+				org.txm.utils.logger.Log.printStackTrace(e);
+				return false;
+			}
+		}
+		println ""
+		
+		//TRANSFORM INTO XML-TEI-TXM
+		println("Building XML-TXM ("+txmDir.listFiles().length+" files)")
+		for (File tfile : tokenizedDir.listFiles()) {
+			print "."
+			String filename = tfile.getName().substring(0, tfile.getName().length()-4)
+			File xmlfile = new File(txmDir, tfile.getName())
+			
+			def correspType = new HashMap<String,String>()
+			correspType.put("event","event");
+			correspType.put("audio","audio");
+			correspType.put("notation","notation");
+			def correspRef = new HashMap<String,String>();
+			correspRef.put("event","trs");
+			correspRef.put("audio","trs");
+			correspRef.put("notation","trs");
+			def respId = ["trs"];
+			def applications = new HashMap<String,HashMap<String,String>>();
+			applications.put("trs",new ArrayList<String>());
+			applications.get("trs").add("Transcriber");//app ident
+			applications.get("trs").add("");//app version
+			applications.get("trs").add(null);//app report file path
+			def taxonomiesUtilisees = new HashMap<String,String[]>();
+			taxonomiesUtilisees.put("ctx1",["event", "audio", "notation"]);//,"lemma","lasla","grace"]);
+			def itemsURI = new HashMap<String,HashMap<String,String>>();
+			itemsURI.put("event",new HashMap<String,String>());
+			itemsURI.get("event").put("tagset","orth|corr");
+			itemsURI.get("event").put("website","");
+			itemsURI.put("audio",new HashMap<String,String>());
+			itemsURI.get("audio").put("tagset","present|absent|partiel");
+			itemsURI.get("audio").put("website","");
+			itemsURI.put("notation",new HashMap<String,String>());
+			itemsURI.get("notation").put("tagset","");
+			itemsURI.get("notation").put("website","");
+			def resps = new HashMap<String,String[]>();
+			resps.put("trs", ["Transcriber annotations","TXM","",""])
+			String wordprefix = "w_";
+			
+			Xml2Ana builder = new Xml2Ana(tfile);
+			builder.setConvertAllAtrtibutes true;
+			builder.setCorrespondances(correspRef, correspType);
+			builder.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)
+			if (!builder.process(xmlfile)) {
+				println("Failed to process "+tfile)
+				xmlfile.delete();
+			}
+		}
+		
+		println ""
+		return txmDir.listFiles() != null;
+	}
+
+	/**
+	 * Process.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param metas the metas
+	 * @return true, if successful
+	 */
+	public boolean process(File infile, File outfile, ArrayList<Pair<String, String>> metas) {
+		//inject metadatas into 	
+		this.infile = infile;
+		this.outfile = outfile;
+		def factory = DocumentBuilderFactory.newInstance()
+		factory.setXIncludeAware(true);
+		def builder = factory.newDocumentBuilder()
+		doc = builder.parse(infile)
+		insert(trans.get("trans"), metas);
+		return save();
+	}
+
+	/**
+	 * Insert.
+	 *
+	 * @param xpath the xpath
+	 * @param pairs the pairs
+	 */
+	public void insert(String xpath, List<Pair<String, String>> pairs) {
+		println ("insert $pairs into $xpath")
+		def expr = XPathFactory.newInstance().newXPath().compile(xpath)
+		def nodes = expr.evaluate(doc, XPathConstants.NODESET)
+		
+		for (Node node : nodes) {
+			Element elem = (Element)node;
+			for (Pair<String, String> p : pairs) {
+				elem.setAttribute(p.getFirst(), p.getSecond());
+			}
+		}
+	}
+
+	/**
+	 * Save.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean save() {
+		try {
+			// CrÃ©ation de la source DOM
+			Source source = new DOMSource(doc);
+			
+			// CrÃ©ation du fichier de sortie
+			Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8")); 
+			Result resultat = new StreamResult(writer);
+			
+			// Configuration du transformer
+			TransformerFactory fabrique = new net.sf.saxon.TransformerFactoryImpl();
+			Transformer transformer = fabrique.newTransformer();
+			transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+			transformer.setOutputProperty(OutputKeys.INDENT, "yes"); 
+			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); 
+			
+			// Transformation
+			transformer.transform(source, resultat);
+			writer.close();
+			return true;
+		} catch (Exception e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return false;
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ApplyXsl2.java
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ApplyXsl2.java	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ApplyXsl2.java	(revision 728)
@@ -0,0 +1,581 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+// 
+// 
+// 
+// $LastChangedDate: 2011-11-03 17:59:23 +0100 (jeu., 03 nov. 2011) $
+// $LastChangedRevision: 2051 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+/**
+ * @author mdecorde
+ */
+
+import java.io.BufferedOutputStream;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.logging.Level;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.URIResolver;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import net.sf.saxon.TransformerFactoryImpl;
+
+import org.txm.stat.utils.ConsoleProgressBar;
+import org.txm.utils.Diff;
+import org.txm.utils.FileCopy;
+import org.txm.utils.IOUtils;
+import org.txm.utils.logger.Log;
+import org.txm.utils.saxon.SaxonNodeSet;
+
+// TODO: Auto-generated Javadoc
+/**
+ * apply a xsl file to a file : use process(File infile, File outfile, String[]
+ * args) to apply the xslt file loaded by the constructor args =
+ * ["name1","value1","name2",value2, ...]
+ * 
+ * @author mdecorde
+ */
+
+public class ApplyXsl2 {
+
+	//	/** The proc. */
+	//	private Processor proc;
+	//	
+	//	/** The comp. */
+	//	private XsltCompiler comp;
+	//	
+	//	/** The exp. */
+	//	private XsltExecutable exp;
+	//
+	//	/** The source. */
+	//	private XdmNode source;
+	//	
+	//	/** The out. */
+	//	private Serializer out;
+	//	
+	//	/** The trans. */
+	//	private XsltTransformer trans;
+
+	net.sf.saxon.TransformerFactoryImpl tFactory;
+	Transformer transformer;
+	private HashMap<String, Object> params = new HashMap<String, Object>();
+	private File xsltfile;
+	boolean debug = false;
+
+	/**
+	 * initialize with the xslt file.
+	 *
+	 * @param xsltfile the xsltfile
+	 * @throws TransformerConfigurationException 
+	 */
+	public ApplyXsl2(String xsltfile) throws TransformerConfigurationException {
+
+		System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl");
+
+		this.xsltfile = new File(xsltfile);
+		tFactory = new TransformerFactoryImpl();
+		transformer = tFactory.newTransformer(new StreamSource(this.xsltfile));
+		
+
+		//Log.info("new tFactory: "+tFactory);
+		//Log.info("new transformer: "+transformer);
+	}
+
+	/**
+	 * initialize with the xslt file.
+	 *
+	 * @param xsltfile the xsltfile
+	 * @throws TransformerConfigurationException 
+	 */
+	public ApplyXsl2(File xsltfile) throws TransformerConfigurationException {
+		this.xsltfile = xsltfile;
+
+		System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl");
+
+		tFactory = new net.sf.saxon.TransformerFactoryImpl();
+		Log.info("new tFactory: "+tFactory);
+		tFactory.getConfiguration().registerExtensionFunction(new SaxonNodeSet());
+		Log.info("ApplyXsl2 from file: "+xsltfile);
+		reload();
+		Log.info("new transformer: "+transformer);
+	}
+
+	/**
+	 * Set a xslt param.
+	 *
+	 * @param name the name
+	 * @param value the value
+	 * @return true, if successful
+	 */
+	public boolean setParams(HashMap<String, String> params) {
+		boolean b = true;
+		for (String k : params.keySet()) b = b & setParam(k, params.get(k));
+		return b;
+	}
+	
+	public void setDebug(boolean d) {
+		this.debug = d;
+	}
+	
+	/**
+	 * Set a xslt param.
+	 *
+	 * @param name the name
+	 * @param value the value
+	 * @return true, if successful
+	 */
+	public boolean setParam(String name, Object value) {
+		if (transformer != null) {
+			transformer.setParameter(name, value);
+			params.put(name, value);
+			return true;
+		} else
+			return false;
+	}
+
+	/**
+	 * Set a xslt param.
+	 *
+	 * @param name the name
+	 * @param value the value
+	 * @return true, if successful
+	 */
+	@Deprecated
+	public boolean SetParam(String name, Object value) {
+		if (transformer != null) {
+			transformer.setParameter(name, value);
+			params.put(name, value);
+			return true;
+		} else
+			return false;
+	}
+	public boolean resetParams() {
+		if (transformer != null) {
+			transformer.reset();
+			params.clear();
+		} else
+			return false;
+		return true;
+	}
+
+	/**
+	 * Force java to clean memory after processing a xslt. If not we might catch
+	 * a JavaHeapspace Exception
+	 * @throws TransformerConfigurationException 
+	 * 
+	 */
+	private void cleanMemory() throws TransformerConfigurationException {
+		reload();
+		for (String name : params.keySet()) { // reload parameters
+			transformer.setParameter(name, params.get(name));
+		}
+	}
+
+	private boolean reload() throws TransformerConfigurationException {
+		//try {
+			transformer = null;
+			transformer = tFactory.newTransformer(new StreamSource(xsltfile));
+//		} catch (TransformerConfigurationException e) {
+//			org.txm.utils.logger.Log.printStackTrace(e);
+//			Log.severe("Error while reloading transformer: "+e);
+//			System.out.println("Error while reloading transformer: "+e);
+//			return false;
+//		}
+		return true;
+	}
+
+	/**
+	 * Process files with xslt args.
+	 *
+	 * @param xmlinfile file to be processed
+	 * @param xmloutfile output file
+	 * @param args xslt args ["arg1","arg1value","arg2","arg2value"...]
+	 * @return true, if successful
+	 * @throws TransformerException 
+	 * @throws FileNotFoundException 
+	 */
+
+	public boolean process(String xmlinfile, String xmloutfile, String[] args) throws Exception {
+		File infile = new File(xmlinfile);
+		File outfile = new File(xmloutfile);
+		
+		//System.out.println(xmlinfile+" Params: "+Arrays.toString(args));
+		for (int i = 0; i < args.length; i = i + 2) {
+			if (!this.setParam(args[i], args[i + 1]))
+				return false;
+		}
+
+		transformer.transform(new StreamSource(xmlinfile), new StreamResult(new BufferedOutputStream(new FileOutputStream(xmloutfile))));
+		cleanMemory(); // save memory
+		// System.out.println("Done");
+		return true;
+	}
+
+	/**
+	 * Process files without xslt args.
+	 *
+	 * @param xmlinfile the xmlinfile
+	 * @param xmloutfile the xmloutfile
+	 * @return true, if successful
+	 * @throws TransformerException 
+	 * @throws IOException 
+	 */
+	public boolean process(File xmlinfile, File xmloutfile) throws TransformerException, IOException {
+		
+		// bufferize result in a String
+		StringWriter strWriter = new StringWriter();
+		StreamResult out = new StreamResult(strWriter);
+		
+		if (debug) {
+			File inputfile_copy = new File("/tmp", xmlinfile.getName());
+			System.out.println("copying inputfile in: "+inputfile_copy.getAbsolutePath());
+			inputfile_copy.delete();
+			FileCopy.copy(xmlinfile, inputfile_copy);
+		}
+
+		transformer.transform(new StreamSource(xmlinfile), out);
+
+		// then write the result in the result file
+		if (xmloutfile != null) {
+			BufferedWriter w = new BufferedWriter(new FileWriter(xmloutfile));
+			w.write(strWriter.toString());
+			w.close();
+			
+			if (debug) {
+				File inputfile_copy = new File("/tmp", xmlinfile.getName());
+				String s = Diff.diffFile(inputfile_copy, xmloutfile);
+				if (s.length() > 0) { // for ultra debug ?
+					System.out.println("Result "+xmlinfile.getName()+" VS "+ xmloutfile.getName()+" diff="+s);
+				} else {
+					System.out.println("Warning: no diff between "+inputfile_copy+" and "+ xmloutfile);
+				}
+			}
+		}
+
+		cleanMemory();
+		return true;
+	}
+
+	/**
+	 * Transform files and select files : nor hidden and nor technical (DTD, XSL, etc.)
+	 * 
+	 * @param xslFile
+	 * @param srcdir
+	 * @param outdir
+	 * @return
+	 * @throws TransformerException
+	 * @throws IOException 
+	 */
+	public static boolean processImportSources(File xslFile, File srcdir, File outdir) throws TransformerException, IOException
+	{
+		HashMap<String, Object> params = new HashMap<String, Object>();
+		return processImportSources(xslFile, srcdir, outdir, params);
+	}
+
+	/**
+	 * Transform files and select files : nor hidden and nor technical (DTD, XSL, etc.)
+	 * 
+	 * @param xslFile
+	 * @param srcdir
+	 * @param outdir
+	 * @param params XSL parameters
+	 * @return
+	 * @throws TransformerException
+	 * @throws IOException 
+	 */
+	public static boolean processImportSources(File xslFile, File srcdir, File outdir, HashMap<String, Object> params) throws TransformerException, IOException
+	{
+		return processImportSources(xslFile, srcdir, outdir, params, false);
+	}
+
+	public static File[] listFiles(File srcdir) {
+		File[] files = srcdir.listFiles(new FileFilter() {
+			@Override
+			public boolean accept(File f) {
+				String name = f.getName();
+				if (f.isHidden() || f.isDirectory()) return false;
+				if (name.endsWith(".properties")) return false;
+				if (name.equals("import.xml")) return false;
+				if (name.endsWith(".csv")) return false;
+				if (name.endsWith(".dtd")) return false;
+				if (name.endsWith(".xsl")) return false;
+				if (name.endsWith("~")) return false;
+				if (name.endsWith(".bak")) return false;
+				if (name.startsWith(".")) return false;
+				return true;
+			}
+		});
+		return files;
+	}
+	
+	/**
+	 * Transform files and select files : nor hidden and nor technical (DTD, XSL, etc.)
+	 * 
+	 * @param xslFile
+	 * @param srcdir
+	 * @param outdir
+	 * @param params XSL parameters
+	 * @return
+	 * @throws TransformerException
+	 * @throws IOException 
+	 */
+	public static boolean processImportSources(File xslFile, File srcdir, File outdir, HashMap<String, Object> params, boolean deleteOutput) throws TransformerException, IOException
+	{
+		outdir.mkdir();
+		if (xslFile.exists()) {
+			ApplyXsl2 builder = new ApplyXsl2(xslFile);
+			boolean debug = Log.getLevel().intValue() < Level.WARNING.intValue();
+			if (debug) {
+				builder.setDebug(true);
+				System.out.println("Debug mode enabled.");
+			}
+			if (!params.containsKey("output-directory"))
+				params.put("output-directory", outdir.getAbsoluteFile().toURI().toString());
+			
+			for (String name : params.keySet())
+				builder.setParam(name, params.get(name));
+			
+			File[] files = listFiles(srcdir); // get files XSL compatible
+			if (files == null) return false;
+			
+			System.out.println("-- Applying "+xslFile+" XSL to "+files.length+" files with parameters: "+params+" on directory "+srcdir+" result written in "+outdir);
+
+			ConsoleProgressBar cpb = new ConsoleProgressBar(files.length);
+			for (File f : files) {
+				String name = f.getName();
+
+				cpb.tick();
+				File outfile = new File(outdir, name);
+				
+				if (!f.getAbsolutePath().equals(outfile.getAbsolutePath()) && f.lastModified() <= outfile.lastModified()) {
+					if (debug) System.out.println("skipped: "+f);
+					continue; // input file is older than output file
+				}
+				
+				if (deleteOutput) outfile = null;
+
+				if (!builder.process(f, outfile)) {
+					System.out.println("Failed to process file "+ f);
+					if (outfile != null) outfile.delete();
+				}
+			}
+			System.out.println("");
+			return true;
+		} else {
+			System.out.println("XSL file does not exists: "+ xslFile);
+		}
+		return false;
+	}
+
+	/**
+	 * Transform files and select files : nor hidden and nor technical (DTD, XSL, etc.)
+	 * 
+	 * Apply one XSL, XML files are replaced 
+	 * 
+	 * @param xslFile
+	 * @param srcdir
+	 * @param outdir
+	 * @param params XSL parameters
+	 * @return
+	 * @throws TransformerException
+	 * @throws IOException 
+	 */
+	public static boolean processImportSources(File xslFile, File[] files, HashMap<String, Object> params) throws TransformerException, IOException
+	{
+		return processImportSources(xslFile, files, params, false);
+	}
+	
+	/**
+	 * Transform files and select files : nor hidden and nor technical (DTD, XSL, etc.)
+	 * 
+	 * Apply one XSL, XML files are replaced 
+	 * 
+	 * @param xslFile
+	 * @param srcdir
+	 * @param outdir
+	 * @param params XSL parameters
+	 * @param deleteOutput to use if the XSL create files and user needs to remove the input file
+	 * @return
+	 * @throws TransformerException
+	 * @throws IOException 
+	 */
+	public static boolean processImportSources(File xslFile, File[] files, HashMap<String, Object> params, boolean deleteOutput) throws TransformerException, IOException
+	{
+		if (xslFile.exists()) {
+			ApplyXsl2 builder = new ApplyXsl2(xslFile);
+			for(String name : params.keySet())
+				builder.setParam(name, params.get(name));
+
+			if (files == null) return false;
+			
+			System.out.println("-- Applying "+xslFile+" XSL to "+files.length+" files with parameters: "+params);
+			
+			ConsoleProgressBar cpb = new ConsoleProgressBar(files.length);
+
+			for (File f : files) {
+				String name = f.getName();
+				if (f.isHidden() || f.isDirectory()) continue;
+				if (name.endsWith(".properties")) continue;
+				if (name.equals("import.xml")) continue;
+				if (name.endsWith(".csv")) continue;
+				if (name.endsWith(".dtd")) continue;
+				if (name.endsWith(".xsl")) continue;
+				if (name.endsWith("~"))	continue;
+				if (name.startsWith(".")) continue;
+				
+				if (!ValidateXml.test(f)) {
+					System.out.println("src file "+f+", is not XML valid");
+					return false;
+				}
+				cpb.tick();
+				
+				if (!builder.process(f, f)) {
+					System.out.println("Failed with file "+ f);
+				}
+				
+				if (deleteOutput) f.delete(); // the XSL has create files
+			}
+			System.out.println("");
+			return true;
+		} else {
+			System.out.println("XSL file does not exists: "+ xslFile);
+		}
+		return false;
+	}
+
+	/** 
+	 * Apply the XSL listed in the xslDirectory. Files are replaced
+	 * 
+	 * @param filesToProcess
+	 * @param xslDirectory
+	 * @param xslParams
+	 * @return
+	 * @throws TransformerException
+	 * @throws IOException
+	 */
+	public static boolean processWithMultipleXSL(File[] filesToProcess, File xslDirectory, HashMap<String, Object> xslParams) throws TransformerException, IOException {
+		if (xslDirectory.exists()) {
+			File[] xslFiles = xslDirectory.listFiles();
+			Arrays.sort(xslFiles);
+			return processWithMultipleXSL(filesToProcess, xslFiles, xslParams);
+		} else {
+			System.out.println("Nothing to do.");
+		}
+		return true;
+	}
+
+	/** 
+	 * Apply the XSL list. Files are replaced
+	 * 
+	 * @param filesToProcess
+	 * @param xslDirectory
+	 * @param xslParams
+	 * @return
+	 * @throws TransformerException
+	 * @throws IOException
+	 */
+	public static boolean processWithMultipleXSL(File[] filesToProcess, File[] xslFiles, HashMap<String, Object> xslParams) throws TransformerException, IOException {
+
+		Arrays.sort(xslFiles);
+		for (File xslFile : xslFiles) {
+			if (xslFile.isDirectory() || xslFile.isHidden() || !xslFile.getName().endsWith(".xsl")) continue;
+			
+			if (processImportSources(xslFile, filesToProcess, xslParams)) {
+				System.out.println("");
+			} else {
+				return false;
+			}
+		}
+
+		return true;
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 * @throws TransformerException 
+	 * @throws FileNotFoundException 
+	 */
+	public static void main(String[] args) throws Exception {
+		//String xslfile = "/home/mdecorde/TXM/xsl/breakByMilestone.xsl";
+		String xslfile = "G:/Feuilles de style/filtre-frantext-query-export4txm.xsl";
+		File xslFile = new File(xslfile);
+		ApplyXsl2 a = new ApplyXsl2(xslFile);
+
+		//File srcdirectory = new File("/home/mdecorde/TXM/corpora/transcribertest/HTML");
+		File srcdirectory = new File("C:/Documents and Settings/alavrent/xml/applyxsl");
+		assert(srcdirectory.exists());
+		assert(srcdirectory.isDirectory());
+		assert(srcdirectory.canRead());
+		assert(srcdirectory.canExecute());
+
+		File[] files = srcdirectory.listFiles();
+		System.out.println("process : "+srcdirectory+"/*");
+		System.out.println("with : "+xslfile);
+		long bigstart = System.currentTimeMillis();
+		for (File infile : files) {
+			if (infile.canRead() && infile.getName().endsWith(".xml")) {
+				File outfile = new File(infile.getAbsolutePath()+".out.xml");
+				long start = System.currentTimeMillis();
+				System.out.println("Process : "+infile.getName()+ " >> ");
+				//String[] params = {"pbval1",""+1,"pbval2",""+2};
+				a.process(infile,outfile); // no parameters
+				//a.process( infile.getAbsolutePath() ,outfile,params);
+				System.out.println("Done : "+(System.currentTimeMillis()-start)+"ms");
+			}
+		}
+		System.out.println("Total time : "+(System.currentTimeMillis()-bigstart)+"ms");
+	}
+}

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ApplyXsl2.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/MetadataGetter.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/MetadataGetter.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/MetadataGetter.groovy	(revision 728)
@@ -0,0 +1,35 @@
+package org.txm.importer
+
+import javax.xml.stream.*;
+
+class MetadataGetter {
+	public static String get(File xmlFile, String struct, String prop) {
+
+		def inputData = xmlFile.toURI().toURL().openStream();
+		def factory = XMLInputFactory.newInstance();
+		XMLStreamReader parser = factory.createXMLStreamReader(inputData);
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				if ("text".equals(parser.getLocalName())) {
+					for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+						if(prop.equals(parser.getAttributeLocalName(i))) {
+							String tmp = parser.getAttributeValue(i)
+							parser.close()
+							return tmp
+						}
+					}
+				}
+			}
+		}
+		parser.close()
+		return null;
+	}
+
+	public static void main(String[] args) {
+		File xmlFile = new File("/home/mdecorde/TXM/corpora/superphenix/txm/SUPERPHENIX/CreysSuper_04_0175.xml")
+		String struct = "text"
+		String prop = "date"
+		println MetadataGetter.get(xmlFile, struct, prop)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/alceste/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/alceste/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/alceste/compiler.groovy	(revision 728)
@@ -0,0 +1,306 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2016-05-26 17:42:36 +0200 (jeu., 26 mai 2016) $
+// $LastChangedRevision: 3219 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.alceste;
+
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+
+import javax.xml.stream.*;
+import java.net.URL;
+import java.io.File;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * build wtc
+ * build CWB indexes
+ * create registry file.
+ *
+ * @author mdecorde
+ */
+class compiler 
+{
+	/** The debug. */
+	private boolean debug = false;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The dir. */
+	private def dir;
+	
+	/** The output. */
+	private def output;
+	
+	/** The url. */
+	private def url;
+	
+	/** The anahash. */
+	private HashMap<String, String> anahash = new HashMap<String, String>() ;
+	
+	/** The text. */
+	String text = "";
+	
+	/** The base. */
+	String base = "";
+	
+	/** The project. */
+	String project = "";
+	
+	/** The text attributes. */
+	String[] textAttributes = null;
+	
+	/** The cwb loc. */
+	String cwbLoc;
+	
+	/** The lang. */
+	String lang = "fr";
+	
+	/**
+	 * initialize.
+	 *
+	 */
+	public compiler(){}
+	
+	
+	/**
+	 * Instantiates a new compiler.
+	 *
+	 * @param url the url
+	 * @param text the text
+	 * @param base the base
+	 * @param project the project
+	 */
+	public compiler(URL url, String text, String base, String project)
+	{
+		this.text = text
+		this.base = base;
+		this.project = project;
+		this.textAttributes = textAttributes;
+		try {
+			this.url = url;
+			inputData = url.openStream();
+			
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+		} catch (Exception ex) {
+			System.err.println("IOException while parsing: "+ex);
+		}
+	}
+	
+	/** The annotation success. */
+	boolean annotationSuccess = false;
+	
+	/**
+	 * Sets the annotation success.
+	 *
+	 * @param val the new annotation success
+	 */
+	public void setAnnotationSuccess(boolean val)
+	{
+		this.annotationSuccess = val;
+	}
+	
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the new cwb path
+	 */
+	public void setCwbPath(String path)
+	{
+		if (!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path;
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param f the f
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File f){
+		try {
+			output = new OutputStreamWriter(new FileOutputStream(f,f.exists()) , "UTF-8");
+			return true;
+		} catch (Exception e) {
+			System.err.println(e);
+			return false;
+		}
+	}
+	
+	/**
+	 * Sets the lang.
+	 *
+	 * @param lang the lang
+	 * @return the java.lang. object
+	 */
+	public setLang(String lang)
+	{
+		this.lang = lang;
+	}
+	
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param basename the basename
+	 * @param textAttributes the text attributes
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, File txmDir, String corpusname, String[] textAttributes) 
+	{
+		if(cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+		
+		if (!new File(cwbLoc).exists()) {
+			println ("CWB path error: "+cwbLoc)
+			return false;
+		}
+		if (!binDir.exists()) {
+			println ("binary directory does not exists: "+binDir)
+			return false;
+		}
+		File wtcFile = new File(binDir,"wtc/"+corpusname+".wtc");
+		new File(binDir, "wtc").deleteDir();
+		new File(binDir, "wtc").mkdir();
+		new File(binDir, "data/$corpusname").deleteDir();
+		new File(binDir, "data/$corpusname").mkdir();
+		new File(binDir, "registry").mkdir();
+		
+		String textid = "";
+		int counttext = 0;
+		List<File> files = txmDir.listFiles();
+		if (files == null || files.size() == 0) {
+			println "no file to compile"
+			return false;
+		}
+		
+		//start corpus
+		if (createOutput(wtcFile)) {
+			output.write("<txmcorpus lang=\""+lang+"\">\n");
+			output.close();
+		}
+		
+		Collections.sort(files);
+		//1- Transform into WTC file
+		XMLTXM2WTC wtcbuilder = null;
+		println("process "+files.size()+" files")
+		for (File f : files) {
+			print "."
+			counttext++;
+			if (!f.exists()) {
+				println("file "+f+ " does not exists")	
+			} else {			
+				wtcbuilder = new XMLTXM2WTC(f.toURI().toURL());
+				String txtname = f.getName().substring(0, f.getName().length()-4);
+				wtcbuilder.setTextInfo(txtname, corpusname, "default");
+
+				wtcbuilder.setBalisesToKeep(["text", "s", "p", "lb"]);
+				wtcbuilder.setSendToPAttributes(["lb":["n"], "p":["n"], "s":["n"]])
+				wtcbuilder.setLang(lang);
+				if (!wtcbuilder.transformFile(wtcFile)) {
+					println("Failed to compile "+f)
+				}
+			}
+		}
+		println ""
+		
+		//end corpus
+		if (createOutput(wtcFile)) {
+			output.write("</txmcorpus>\n");
+			output.close();
+		}
+		
+		if (wtcbuilder == null) {
+			println "there was no files in bin dir : "+txmDir
+			return false;
+		}
+		
+		//2- Import into CWB
+		String rootDir = binDir.getAbsolutePath();
+		CwbEncode cwbEn = new CwbEncode();
+		cwbEn.setDebug(debug);
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		cwbMa.setDebug(debug);
+		
+		List<String> pAttributesList = wtcbuilder.getpAttributs();
+		List<String> sAttributesList = wtcbuilder.getsAttributs();
+		println "pAttrs : "+pAttributesList
+		println "sAttrs : "+sAttributesList
+		String[] pAttributes = pAttributesList.toArray(new String[pAttributesList.size()])
+		String[] sAttributes = sAttributesList.toArray(new String[sAttributesList.size()])
+		
+		try {
+			String regPath = rootDir + "/registry/"+corpusname.toLowerCase(); // CQP wants lowercase registry name
+			cwbEn.run(new File(cwbLoc,"cwb-encode").getAbsolutePath(), rootDir + "/data/${corpusname}", rootDir + "/wtc/"+corpusname+".wtc", regPath,pAttributes, sAttributes);
+			if (!new File(regPath).exists()) {
+				println "The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			cwbMa.run(new File(cwbLoc,"cwb-makeall").getAbsolutePath(), corpusname.toUpperCase(), rootDir + "/registry");
+		} catch (Exception ex) {System.out.println(ex); return false;}
+
+		return true;
+	}
+	
+	/**
+	 * Sets the debug.
+	 */
+	public void setDebug()
+	{
+		this.debug = true;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("~/xml/geo");
+		def c = new compiler();
+		c.setDebug();
+		c.setCwbPath("~/TXM/cwb/bin");
+		c.run(dir,"geo");
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/alceste/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/alceste/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/alceste/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Alceste import module</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/alceste/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/alceste/importer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/alceste/importer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/alceste/importer.groovy	(revision 728)
@@ -0,0 +1,186 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2017-12-13 14:23:35 +0100 (mer., 13 dÃ©c. 2017) $
+// $LastChangedRevision: 3485 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.alceste
+
+
+//import filters.TabulatedToXml.*;
+import org.txm.importer.*;
+import org.txm.importer.filters.*;
+import org.txm.scripts.*;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.utils.FileCopy;
+import org.txm.scripts.teitxm.*;
+
+import javax.xml.stream.*;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintStream;
+import java.net.URL;
+
+import filters.CutHeader.*;
+import filters.Tokeniser.*;
+import filters.FusionHeader.*;
+import filters.TagSentences.*;
+
+import org.txm.Toolbox;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class importer.
+ */
+class importer {
+
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param encoding the encoding
+	 * @param basename the basename
+	 * @return true, if successful
+	 */
+	public static boolean run(File rootDirFile, File binDir, File txmDir, String encoding, String basename, String lang)
+	{
+		if (rootDirFile.listFiles() == null || rootDirFile.listFiles().size() == 0) {
+			println "Error: no file to process in "+rootDirFile;
+			return false;
+		}
+		File srcfile;
+		for (File f : rootDirFile.listFiles()) {
+			if (!f.isHidden() && f.canRead() && f.isFile() && f.getName() != "import.xml" && !f.getName().endsWith("~")) {
+				srcfile = f
+				break;
+			}
+		}
+
+		File splitDir = new File(binDir, "split");
+		File tokenizeDir = new File(binDir, "tokenized");
+		File stokenizeDir = new File(binDir,"stokenized")
+		stokenizeDir.deleteDir();
+		stokenizeDir.mkdir();
+		tokenizeDir.deleteDir();
+		tokenizeDir.mkdir();
+		splitDir.deleteDir();
+		splitDir.mkdir();
+
+		// Build xml files from the alceste file
+		Alceste2Xml transformer = new Alceste2Xml()
+		if (!transformer.run(srcfile, splitDir, encoding)) {
+			return false;
+		}
+
+		// Tokenize xml files
+		List<File> srcfiles = splitDir.listFiles();
+		println (srcfiles.size()+ " texts found in "+srcfile)
+
+		println("Tokenizing files ("+srcfiles.size()+")")
+		for (File f : srcfiles) {
+			print "."
+			File resultfile = new File(tokenizeDir, f.getName());
+			try {
+				def builder = new SimpleTokenizerXml(f, resultfile, lang);
+				builder.setStartTag("text")
+				if (!builder.process()) {
+					println "Failed to tokenize: "+f;
+					resultfile.delete();
+				}
+			}
+			catch(Exception e){org.txm.utils.logger.Log.printStackTrace(e); println "Failed to tokenize: "+f; return false;}
+		}
+		println ""
+		
+		List<File> stokenfiles = tokenizeDir.listFiles();	
+		println("Tagging sentences of "+stokenfiles.size()+" files")
+		for (File f : stokenfiles) {
+			print "."
+			Sequence S = new Sequence();
+			Filter F1 = new CutHeader();
+			Filter F7 = new TagSentences();
+			Filter F11 = new FusionHeader();
+			S.add(F1);
+			S.add(F7);
+			S.add(F11);
+			File infile = f;
+			File xmlfile = new File(stokenizeDir, f.getName());
+			File headerfile = new File(f.getParentFile(), f.getName()+"header.xml");
+
+			S.SetInFileAndOutFile(infile.getPath(), xmlfile.getPath());
+			S.setEncodages("UTF-8","UTF-8");
+			Object[] arguments1 = [headerfile.getAbsolutePath()];
+			F1.SetUsedParam(arguments1);
+			Object[] arguments2 = [headerfile.getAbsolutePath(),F1];
+			F11.SetUsedParam(arguments2);
+			if (!S.proceed()) {
+				println "Failed to tag file: "+f
+			}
+			S.clean();
+			headerfile.delete();//remove the prepared file to clean
+		}
+		println ""
+
+		//TRANSFORM INTO XML-TEI-TXM
+		List<File> tokenfiles = stokenizeDir.listFiles()
+		println("Building xml-tei-txm ("+tokenfiles.size()+" files)")
+		for (File f : tokenfiles) {
+			print "."
+			File file = f;
+			File txmfile = new File(txmDir, f.getName());
+
+			def correspType = new HashMap<String, String>()
+			def correspRef = new HashMap<String, String>()
+			//il faut lister les id de tous les respStmt
+			def respId = [];
+			//fait la correspondance entre le respId et le rapport d'execution de l'outil
+			def applications = new HashMap<String,HashMap<String,String>>();
+			//fait la correspondance entre le respId et les attributs type de la propriÃ©tÃ© ana du w txm
+			//pour construire les ref vers les taxonomies
+			def taxonomiesUtilisees = new HashMap<String,String[]>();
+			//associe un id d'item avec sa description et son URI
+			def itemsURI = new HashMap<String,HashMap<String,String>>();
+			//informations de respStmt
+			//resps (respId <voir ci-dessus>, [description, person, date])
+			def resps = new HashMap<String,String[]>();
+			//lance le traitement
+			def builder = new Xml2Ana(file);
+			builder.setConvertAllAtrtibutes true;
+			builder.setCorrespondances(correspRef, correspType);
+			builder.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)
+			if(!builder.process(txmfile))
+			{
+				println "Failed to build xml-txm of file: "+file;
+				txmfile.delete();
+			}
+		}
+		println ""
+		return true;
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/alceste/Alceste2Xml.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/alceste/Alceste2Xml.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/alceste/Alceste2Xml.groovy	(revision 728)
@@ -0,0 +1,295 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2017-06-26 16:53:47 +0200 (lun., 26 juin 2017) $
+// $LastChangedRevision: 3451 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.alceste;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.txm.importer.CleanFile;
+import org.txm.utils.AsciiUtils;
+import org.txm.utils.CharsetDetector;
+import org.txm.utils.i18n.DetectBOM;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+
+import javax.xml.stream.*;
+
+import java.net.URL;
+
+
+// TODO: Auto-generated Javadoc
+/**
+ * Create a file per text of an alceste file.
+ */
+class Alceste2Xml {
+
+	/** The textno. */
+	String textno = "0001";
+
+	/** The textcount. */
+	int textcount = 0;
+	int nbOfStarNumbers;
+	static def TEXTNUMBERREGEX = /^[0-9]{4,6} .+/
+	static def TEXTSTARREGEX = /^[*]{4,6} .+/
+	/**
+	 * run the script.
+	 *
+	 * @param infile the infile
+	 * @param outdir the outdir
+	 * @param encoding the encoding
+	 */
+	public boolean run(File infile, File outdir, String encoding) {
+		if (encoding == "??") {
+			encoding = new CharsetDetector(infile).getEncoding();
+			println "Guessing encoding of $infile : $encoding"
+		}
+		int noline = 0;
+		int p_n = 1;
+		int lb_n = 1;
+		def duplicatedAttributes = new HashSet<String>();
+		try {
+			outdir.mkdir();
+			boolean star = guessStar(infile, encoding);
+
+			String textname = infile.getName().substring(0,infile.getName().length()-4);// creates file with prefix the name of the alceste file
+
+			FileInputStream input = new FileInputStream(infile);
+			Reader reader = new InputStreamReader(input , encoding);
+
+			input.skip(new DetectBOM(infile).getBOMSize())
+			
+			XMLOutputFactory factory = XMLOutputFactory.newInstance();
+			BufferedOutputStream output;
+			XMLStreamWriter writer;
+
+			String line = reader.readLine();
+			while (line != null) {
+				line = CleanFile.clean(line); // remove ctrl and surrogate chars
+				
+				if (((line ==~ TEXTNUMBERREGEX) || line ==~ TEXTSTARREGEX) && line.contains("*")) { // we found a text declaration with star attributes
+					if (writer != null) { // end previous text if any
+						writer.writeEndElement(); // p
+						writer.writeEndElement(); // text
+						writer.close();
+						output.close()
+					}
+					
+					lb_n = 1; // reset line counter
+					p_n = 1; // reset paragraph counter
+					int idx = line.indexOf(" "); // star metadata starts after the first ' '
+					
+					if (!star) {
+						textno = line.substring(0, idx)
+						textcount++;
+					} else {
+						this.buildNextId(); // update textno
+					}
+
+					String filename = textno;
+					def attributes = new LinkedHashMap<String, String>();
+					filename = filename.trim();
+					output = new BufferedOutputStream(new FileOutputStream(new File(outdir, filename+".xml")))
+					writer = factory.createXMLStreamWriter(output, "UTF-8"); //create a new file
+					writer.writeStartDocument("UTF-8", "1.0")
+					writer.writeStartElement("text");
+					
+					attributes["id"] = filename // writen at the end
+					// get text metadata
+					line = line.substring(idx + 1); // remove the text marker
+					
+					String[] splited = line.split("\\*");
+					for (String s1 : splited) { // for each text star metadata
+						s1 = s1.trim();
+						if (s1.length() == 0) continue;
+
+						String[] splited2 = s1.split("_", 2);
+						if (splited2.length == 1) { // attribute without value
+							
+							if (s1.endsWith("0")) {
+								String attrname = s1.substring(0, s1.length()-1); // remove "0"
+								String attrnamebase = attrname = AsciiUtils.buildId(attrname);
+								int c = 2;
+								while (attributes.containsKey(attrname)) {
+									attrname = attrnamebase+(c++)
+								}
+								if (c > 2) duplicatedAttributes.add(attrname);
+								attributes.put(attrname, "N/A")
+							} else {
+								println "Error: attribute: "+s1+ " with line "+line
+							}
+						} else if (splited2.length == 2) {
+							
+							String attrname = splited2[0].toLowerCase()
+							String attrnamebase = attrname = AsciiUtils.buildId(attrname);
+								int c = 2;
+								while (attributes.containsKey(attrname)) {
+									attrname = attrnamebase+(c++)
+								}
+								if (c > 2) duplicatedAttributes.add(attrname);
+							
+							String attrvalue = splited2[1]
+								
+							attributes.put(attrname, attrvalue)
+						} else {
+						
+							print("wrong size: name_value : "+splited2.length+" : ");
+							for (String s : splited ) print s+""
+							println ""
+						}
+					}
+					
+					for (def attname: attributes.keySet()) { // finally write the XML attributes
+						writer.writeAttribute(attname, attributes[attname]);
+					}
+					writer.writeCharacters("\n");
+					writer.writeStartElement("p"); // we create a tag <p>
+					writer.writeAttribute("n", ""+(p_n++));// then we add attributes to the tag
+
+				} else if (line.startsWith("-*")) {
+					println "ignored locution : "+line;
+				} else {
+					if (writer != null) {
+						if (line.length() > 0) {
+							writer.writeEmptyElement("lb");
+							writer.writeAttribute("n", ""+(lb_n++))
+							writer.writeCharacters("\n");
+						} else if (line.trim().length() == 0) {
+							writer.writeEndElement(); // p
+							writer.writeStartElement("p");
+							writer.writeAttribute("n", ""+(p_n++))
+							writer.writeCharacters("\n");
+						}
+						
+						writer.writeCharacters(line);
+					}
+				}
+				line = reader.readLine();
+				noline++;
+			}
+			// the end
+			if (writer != null) { // end last text
+				writer.writeEndElement(); // p
+				writer.writeEndElement(); // text
+
+				reader.close();
+				writer.close();
+				output.close();
+			}
+		} catch(Exception e) {
+			println "Error line : "+noline;
+			org.txm.utils.logger.Log.printStackTrace(e);
+		}
+		
+		if (duplicatedAttributes.size() > 0){
+			println "Some attributes were duplicated: "+duplicatedAttributes;
+		}
+		
+		if (textcount == 0) {
+			println "Error: no text found in "+infile;
+			return false;
+		}
+		
+		return true;
+	}
+
+	/**
+	 * Builds the next id.
+	 *
+	 * @return the string
+	 */
+	private String buildNextId() {
+		textcount++;
+		textno = ""+textcount;
+		while (textno.length() < nbOfStarNumbers) {
+			textno="0"+textno;
+		}
+		return textno;
+	}
+
+	/**
+	 * allow to guess if the file use **** or 000x format.
+	 *
+	 * @param infile the infile
+	 * @param encoding the file encoding
+	 * @return true, if the text marker is "****"
+	 */
+	private boolean guessStar(File infile, String encoding)
+	{
+		Reader input = new InputStreamReader(new FileInputStream(infile) , encoding);
+		String line = input.readLine();
+		while (line != null) {
+			if (line ==~ /^[0-9]{4,6} .*/) { // 0000
+				int idx = line.indexOf(" ");
+				nbOfStarNumbers = idx;
+				//println "NB NUMBER:" + nbOfStarNumbers
+				input.close();
+				return false;
+			} else if (line ==~ /^[*]{4,6} .*/) { 
+				input.close();
+				int idx = line.indexOf(" ");
+				nbOfStarNumbers = idx;
+				//println "NB STAR:" + nbOfStarNumbers
+				return true;
+			}
+			line = input.readLine();
+		}
+		input.close();
+	}
+
+	/**
+	 * Main.
+	 *
+	 * @param args the args
+	 */
+	static main(args)
+	{
+		//File infile = new File(System.getProperty("user.home")+"/xml/nature/Nature.txt");
+		File infile = new File(System.getProperty("user.home")+"/xml/TESTS2/alceste/Voeux.txt");
+		//File infile = new File("~/xml/geo/src/riviÃ¨res.txt");
+		File outdir = new File(infile.getParentFile(), "out");
+		outdir.mkdir()
+		new Alceste2Xml().run(infile, outdir, "cp1252");
+		println "done: $infile -> $outdir"
+	}
+}
+
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/alceste/alcesteLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/alceste/alcesteLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/alceste/alcesteLoader.groovy	(revision 728)
@@ -0,0 +1,161 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2015-06-03 15:04:53 +0200 (mer., 03 juin 2015) $
+// $LastChangedRevision: 2984 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.alceste;
+
+import org.txm.importer.alceste.importer;
+import org.txm.importer.alceste.compiler;
+import org.txm.importer.xml.pager_old;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/TESTS/alceste2/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- IMPORTER - Reading source files"
+
+if (!(new importer().run(srcDir, binDir, txmDir, encoding, basename, lang))) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools"
+boolean annotationSuccess = false;
+if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
+	annotationSuccess = true;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+c.setAnnotationSuccess(annotationSuccess)
+if (debug) c.setDebug();
+c.setLang(lang);
+if (!c.run(binDir, txmDir, corpusname)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+	
+	if (MONITOR != null) MONITOR.worked(20, "EDITION")
+
+	println "-- EDITION - Building edition"
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+	List<File> filelist = txmDir.listFiles();
+	Collections.sort(filelist);
+	def second = 0
+
+	println "Paginating texts: "
+
+	for (File srcfile : filelist) {
+		print "."
+		String txtname = srcfile.getName();
+		int i = txtname.lastIndexOf(".");
+		if(i > 0) txtname = txtname.substring(0, i);
+
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+		Element text = params.addText(params.corpora.get(corpusname), txtname, srcfile);
+
+		def ed = new pager_old(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, "pb");
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/EncodeTEIQuotes.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/EncodeTEIQuotes.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/EncodeTEIQuotes.groovy	(revision 728)
@@ -0,0 +1,457 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class EncodeTEIQuotes.
+ */
+public class EncodeTEIQuotes
+{
+	
+	/** The name. */
+	def name;
+	
+	/** The initsize. */
+	def initsize;
+	
+	/** The quote. */
+	String quote ="\"";
+	
+	/** The quote_type. */
+	String quote_type= "pon"
+	
+		/**
+		 * Gets the name.
+		 *
+		 * @param node the xml node
+		 * @return the name of the node
+		 */
+	String getName(def node)
+	{
+		def name = node.name();
+		try{name = name.getLocalPart()}catch(Exception e){return name;} // might throw an exception depending on the node class
+		return name;
+	}
+	
+	/**
+	 * method to know if the Node is an element.
+	 *
+	 * @param n the n
+	 * @return true, if is elem
+	 */
+	boolean isElem(def n)
+	{
+		try{ n.name(); return true; }
+		catch(MissingMethodException e){ return false;}
+	}
+	
+	/**
+	 * Contains open quote.
+	 *
+	 * @param selem the node to process
+	 * @return true if the node contains a tag <q> at the beginning
+	 */
+	boolean containsOpenQuote(Node selem)
+	{
+		def children = selem.children()
+		//println "OTS: "+selem.attributes()
+		for(int i = 0 ; i < children.size()-1 ; i++)//on part de la fin jusqu'au 2e w
+		{
+			def child = children.get(i)
+			if(isElem(child))
+			{
+				name = getName(child)
+				if(name == "w" && child.@type != quote_type)
+				{
+					//println "not opening Q"
+					return false;
+				}
+				else if(name == "w" && child.@type == quote_type && child.text().equals(quote))
+				{
+					//println "opening Q"
+					return true;
+				}
+			}
+		}
+		//println "not opening Q"
+		return false;
+	}
+	
+	/**
+	 * Contains close quote.
+	 *
+	 * @param selem the node to process
+	 * @return true if the node contains a tag <q> at the end
+	 */
+	boolean containsCloseQuote(Node selem)
+	{
+		if(selem.w.size() == 0)
+			return false
+		//println "CTS: "+selem.attributes()
+		def children = selem.children()
+		for(int i = children.size()-1 ; i > 0 ; i--)//on part de la fin jusqu'au 2e w
+		{
+			def child = children.get(i)
+			if(isElem(child))
+			{
+				name = getName(child)
+				if(name == "w" && child.@type != quote_type)
+				{
+					//println "not closing Q"
+					return false;
+				}
+				else if(name == "w" && child.@type == quote_type && child.text().equals(quote))
+				{
+					//println "closing Q"
+					return true;
+				}
+			}
+		}
+		return false;
+	}
+	
+	/**
+	 * Next children are words.
+	 *
+	 * @param children the children
+	 * @param index the index
+	 * @return true, if successful
+	 */
+	def boolean nextChildrenAreWords(def children, def index)
+	{
+		//println "at "+children.get(index).attributes()+" test("+children.size()+") "+children
+		for(int i = index ; i < children.size() ; i++)
+		{
+			def nextC = children.get(i)
+			if(isElem(nextC) && getName(nextC) == "w" && nextC.@type != quote_type)
+				return true;
+		}
+		//println "no more words"
+		return false;
+	}
+	
+	/**
+	 * Process containers.
+	 *
+	 * @param root the root
+	 * @param containers the containers
+	 * @return the java.lang. object
+	 */
+	def processContainers(Node root, containers)
+	{
+		int countcontainer = 0;
+		int countinits = 0;
+		int countnews = 0;
+		int countinitquote = 0
+		int quotecount = 0;
+		boolean openq = false;
+		// cut sentences whit a wpon not first nor last
+		int initsizecontainer = root.children().size()
+		//println "process "+initsizecontainer+" elements"
+		for(int k = 0 ; k < initsizecontainer ; k++)
+		{
+			def node = root.children().get(0);
+			root.children().remove(0);
+			//println getName(node)
+			if(isElem(node) && containers.contains(getName(node)))
+			{
+				countcontainer++;
+				Node pelem = node;
+				openq = false;
+				//println "PAB================="
+				int initsize = pelem.children().size()
+				for(int j = 0 ; j < initsize ; j++) // pour chq fils de p
+				{
+					def subnode = pelem.children().get(0);
+					pelem.children().remove(0)
+					//println getName(subnode)
+					if(isElem(subnode) && getName(subnode) == "s") // si c un S
+					{
+						//println "\nS: "+subnode.attributes()
+						def selem = subnode;
+						def newS = pelem.appendNode(selem.name(), selem.attributes())
+						boolean isOpenningQuote = false;
+						if(containsOpenQuote(selem))
+						{
+							isOpenningQuote = true
+							if(openq)
+							{
+								//println "ERROR: unclosed quote before "+selem.@id
+							}
+							openq = false;
+							//println "force openq false"
+						}
+						int tempwponcount = 0
+						for(int i = 0 ; i < selem.children().size() ; i++) // append chacun de ses fils au S courant
+						{
+							def child = selem.children().get(i) // test si == wpon"
+							if(isElem(child) && getName(child) == "w" && child.@type == quote_type && child.text().equals(quote))
+							{
+								countinitquote++
+								//println "Q: "+child.attributes()
+								//println "openq "+openq
+								if(openq)
+								{
+									newS.children().add(child)
+									if(nextChildrenAreWords(selem.children(), i))
+									{                                                                             
+										//println "NEW S"
+										newS = pelem.appendNode(selem.name(), selem.attributes())
+									}
+									//println "set openq false"
+									openq = false;
+								}
+								else
+								{
+									if(tempwponcount != 0)// premier wpon"
+									{
+										//println "pas premier wpon''"
+										if(nextChildrenAreWords(selem.children(), i))// si y'a aut' chose deriere, new S
+										{
+											newS = pelem.appendNode(selem.name(), selem.attributes())
+											//println "NEW S"
+											//println "set openq true"
+											openq = true
+										}
+									}
+									else // tempwponcount == 0
+									{
+										if(!isOpenningQuote)
+										{
+											if(nextChildrenAreWords(selem.children(), i))// si y'a aut' chose deriere, new S
+											{
+												newS = pelem.appendNode(selem.name(), selem.attributes())
+											}
+										}
+										//println "set openq true"
+										openq = true
+									}
+									newS.children().add(child)
+								}
+								tempwponcount++;
+							}
+							else
+							{
+								newS.children().add(child)
+							}
+						}
+					}
+					else
+						pelem.children().add(subnode)
+				}
+			}
+			root.children().add(node)
+		}
+		// A partir d'ici on a que des phrases de la forme :
+		// s q wwww s
+		// s q wwww q s
+		// s wwww q s
+		//println "****"
+		//wrap sentences in q tags
+		initsize = root.children().size()
+		for(int j = 0 ; j < initsize ; j++)
+		{
+			def node = root.children().get(0);
+			root.children().remove(0)
+			if(isElem(node) && containers.contains(getName(node)))
+			{
+				Node pelem = node
+				//println "PPPPPPPP"
+				def newp = root.appendNode(getName(pelem), pelem.attributes());
+				//newp.attribute("test")
+				openq = false;
+				def children = pelem.children()
+				//println children
+				Node qelem;
+				for(Node subnode : children)
+				{
+					if(isElem(subnode) && (getName(subnode) == "s"))
+					{
+						countnews++;
+						//println "ELEM s"
+						Node selem = subnode;
+						if(containsOpenQuote(selem))
+						{
+							// println "openning wpon"
+							if(openq)
+							{
+								// println "ERROR: unclosed quote (found swpon)"
+								//on ferme, et ouvre un new
+								qelem.appendNode("note",[type:"auto"]).setValue("unclosed quote")
+								Map attrs = [:];
+								attrs.put("xml:id",""+(quotecount+1))
+								qelem = newp.appendNode("q", attrs)
+								quotecount++;
+								qelem.appendNode(getName(pelem), selem.attributes(), selem.value());
+								if(containsCloseQuote(selem)) // la phrase Ã©taient bien balisÃ©e
+									openq = false;
+							}
+							else
+							{
+								// println "open q + append current s"
+								openq = true;
+								Map attrs = [:];
+								attrs.put("xml:id",""+(quotecount+1))
+								qelem = newp.appendNode("q", attrs)
+								quotecount++;
+								qelem.appendNode(getName(selem), selem.attributes(), selem.value());
+								if(containsCloseQuote(selem)) // la phrase Ã©taient bien balisÃ©e
+									openq = false;
+							}
+						}
+						else if(containsCloseQuote(selem))
+						{
+							//println "closing wpon"
+							if(openq)
+							{
+								// println "close q + add dernier s du quote"
+								qelem.appendNode(getName(selem), selem.attributes(), selem.value());
+								openq = false;
+							}
+							else
+							{
+								//println "ERROR: unopened quote"
+								Map attrs = [:];
+								attrs.put("xml:id",""+(quotecount+1))
+								qelem = newp.appendNode("q", attrs)
+								qelem.appendNode(getName(selem), selem.attributes(), selem.value());
+								quotecount++;
+								qelem.appendNode("note",[type:"auto"]).setValue("unopened quote")
+							}
+						}
+						else // no wpon
+						{
+							// println "normal s"
+							if(openq)
+							{
+								// println "append to q"
+								qelem.appendNode(getName(selem), selem.attributes(), selem.value());
+							}
+							else
+							{
+								// println "append to p"
+								newp.appendNode(getName(selem), selem.attributes(), selem.value());
+							}
+						}
+					}
+					else
+					{
+						if(openq)
+						{
+							qelem.children().add(subnode)
+						}
+						else
+						{
+							newp.children().add(subnode)
+						}
+					}
+				}
+				if(openq)// un quote fermÃ© a la fin du P !!
+				{
+					// println "ERROR: unmatched quote"
+					qelem.appendNode("note",[type:"auto"]).setValue("unmatched quote")
+				}
+				//root.children().add(newp)
+			}
+			else
+				root.children().add(node)
+		}
+		//count sentences
+		println "processed "+countcontainer+" "+containers
+		println "initial number of &quot; "+countinitquote;
+		println "created "+(countnews )+" init "+ countinits+" s"
+		println "create "+(quotecount)+" quotes elements"
+	}
+	
+	/**
+	 * Instantiates a new encode tei quotes.
+	 *
+	 * @param nodesToInspect the nodes to inspect
+	 * @param containers the containers
+	 * @param quote_value the quote_value
+	 * @param quote_type the quote_type
+	 */
+	public EncodeTEIQuotes(List<Node> nodesToInspect, containers, String quote_value, String quote_type)
+	{
+		this.quote= quote_value;
+		this.quote_type= quote_type;
+		println "process "+nodesToInspect.size()+" elements with containers "+containers
+		for(groovy.util.slurpersupport.Node root : nodesToInspect)//.body)
+		{
+			println(" root : "+root.children().size())
+			processContainers(root, containers)
+		}
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		List<String> containers = ["p","ab"]; // elements qui contiennent des <s>
+		
+		File infile = new File(System.getProperty("user.home"), "xml/quote/gormont.xml")
+		File outfile = new File(System.getProperty("user.home"), "xml/quote/gormont-q.xml")
+		
+		def doc = new XmlParser().parse (infile)
+		List<Node> nodesToInspect = doc.text.body
+		// nodesToInspect << doc.text.body.div // on en rajoute
+		
+		/*************************/
+		new org.txm.importer.EncodeTEIQuotes(nodesToInspect, containers, "\"", "pon");
+		
+		//copy the doc in "outfile" File  
+		String encoding = "UTF-8"
+		OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(outfile) , encoding);
+		writer.write("<?xml version=\"1.0\" encoding=\""+encoding+"\"?>\n")
+		def pwriter = new PrintWriter(writer, true)
+		XmlNodePrinter xmlwriter = new XmlNodePrinter(pwriter)
+		xmlwriter.setPreserveWhitespace(false)
+		xmlwriter.print(doc)
+		pwriter.close()
+		writer.close()
+		xmlwriter = null
+		//println "write output file "+outfile
+		
+		//update counts
+		if(outfile.exists())
+		{
+			String txtid = org.txm.importer.WordCounter.findTextId(infile, "s"); // retrouve l'id du text qui a Ã©tÃ© concatÃ©nÃ© aux id des S originels (ex : s19_12 >> 19)
+			new org.txm.importer.WordCounter(outfile, "s", txtid);
+			new org.txm.importer.WordCounter(outfile, "q", txtid);
+		}
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/HTML2XHTML.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/HTML2XHTML.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/HTML2XHTML.groovy	(revision 728)
@@ -0,0 +1,42 @@
+package org.txm.importer
+
+import org.txm.utils.CharsetDetector;
+import org.txm.importer.ValidateXml;
+
+File infile = new File("/home/mdecorde/Bureau/matrice/tÃ©moignages/CONVERSIONS/jod/odt.html")
+File outfile = new File("/home/mdecorde/Bureau/matrice/tÃ©moignages/CONVERSIONS/jod/odt.xml")
+
+String encoding = new CharsetDetector(infile).getEncoding();
+println "Encoding: $encoding"
+String text = infile.getText(encoding);
+
+//lower case tags
+text = text.replaceAll(/(<[^!][^>]*>)/, 
+	{ full, word -> 
+		//fix attributes TRUC=sdf234
+		word = word.replaceAll("([A-Z]+=)([^\" >]+)([ >])",'$1"$2"$3' )
+		word.toLowerCase() // bourrin
+	} )
+
+//lower case <.> tags
+text = text.replaceAll(/(<.>)/,
+	{ full, word ->
+		word.toLowerCase()
+	} )
+
+//resolve entities
+text = text.replaceAll(/&nbsp;/," ")
+
+//close tags
+text = text.replaceAll(/<br>/,"<br/>")
+text = text.replaceAll(/<meta([^>]*)>/,'<meta$1/>')
+text = text.replaceAll(/<img([^>]*)>/,'<img$1/>')
+
+//remove doctype declaration
+text = text.replace('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">', '')
+
+//write&Validate
+outfile.withWriter(encoding) { writer -> writer.write(text) }
+if (!ValidateXml.test(outfile)) {
+	println "FILE: $outfile"
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxm/xmltxmLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxm/xmltxmLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxm/xmltxmLoader.groovy	(revision 728)
@@ -0,0 +1,239 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+// $LastChangedDate: 2016-05-11 08:38:47 +0200 (mer., 11 mai 2016) $
+// $LastChangedRevision: 3211 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xmltxm
+
+import javax.xml.stream.*;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintStream;
+import java.net.URL;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+import java.io.File;
+import org.txm.importer.*;
+import org.txm.importer.xmltxm.compiler;
+import org.txm.importer.xml.pager;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.metadatas.*;
+import org.txm.utils.i18n.*;
+import org.w3c.dom.Element;
+
+String userDir = System.getProperty("user.home");
+boolean debug = false
+def MONITOR;
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/anapovoas/FOLLOWING TEST OF MATTHIEU/OUTPUT 2/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+String page_element = params.getPageElement("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+File allmetadatasfile = new File(srcDir, "metadata.csv");
+
+// Apply XSL
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(1, "APPLYING XSL")
+if (xsl != null && xslParams != null && xsl.trim().length() > 0) {
+	if (ApplyXsl2.processImportSources(new File(xsl), srcDir, new File(binDir, "src"), xslParams))
+	// return; // error during process
+	srcDir = new File(binDir, "src");
+	println ""
+}
+
+// copy txm files
+println "Copying XML-TXM files..."
+List<File> srcfiles = srcDir.listFiles();
+for (File f : srcfiles) {// check XML format, and copy file into binDir
+	if (f.isHidden() || f.getName().equals("import.xml") || f.getName().equals("metadata.csv") || f.getName().endsWith(".properties"))
+		continue;
+	if (ValidateXml.test(f)) {
+		FileCopy.copy(f, new File(txmDir, f.getName()));
+	} else {
+		println "Won't process file "+f;
+	}
+}
+
+def files = txmDir.listFiles();
+if (files == null || files.size() == 0) {
+	println "No txm file to process"
+	return;
+}
+
+////get metadata values from CSV
+//Metadatas metadatas; // text metadata
+//if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+//if (allmetadatasfile.exists()) {
+//	println "Trying to read metadata from: "+allmetadatasfile
+//	File copy = new File(binDir, "metadata.csv")
+//	if (!FileCopy.copy(allmetadatasfile, copy)) {
+//		println "Error: could not create a copy of metadata file "+allmetadatasfile.getAbsoluteFile();
+//		return;
+//	}
+//	metadatas = new Metadatas(copy, Toolbox.getParam(Toolbox.METADATA_ENCODING), Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR), Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
+//} else {
+//	println "no metadata file: "+allmetadatasfile
+//}
+//
+//if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+//if (MONITOR != null) MONITOR.worked(20, "INJECTING METADATA - from csv file: "+allmetadatasfile)
+//if (metadatas != null) {
+//	println("Injecting metadata: "+metadatas.getHeadersList()+" in texts of directory "+txmDir)
+//	for (File infile : files) {
+//		print "."
+//		File outfile = File.createTempFile("temp", ".xml", infile.getParentFile());
+//
+//		if (!metadatas.injectMetadatasInXml(infile, outfile, "text", null)) {
+//			outfile.delete();
+//		} else {
+//			if (!(infile.delete() && outfile.renameTo(infile))) println "Warning can't rename file "+outfile+" to "+infile
+//			if (!infile.exists()) {
+//				println "Error: could not replace $infile by $outfile"
+//				return false;
+//			}
+//		}
+//	}
+//	println ""
+//}
+
+//sorting files per metadata "date" with format
+def dates = [:]
+def useDates = false
+SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd.MM.yyyy");
+for (File infile : files) { // get dates
+	String str = GetAttributeValue.process(infile, "/TEI/text", "date")
+
+	if (str != "N/A") {
+		dates[infile] = simpleDateFormat.parse(str)
+		useDates = true
+	}
+}
+
+//sort
+if (useDates) {
+	files.sort() { f-> dates[f] }
+} else {
+	files.sort()
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+if (debug) c.setDebug();
+c.setLang(lang);
+if (!c.run(binDir, txmDir, basename, corpusname, Arrays.asList(files))) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	if (MONITOR != null) MONITOR.worked(20, "EDITION")
+	println "-- EDITION - Building edition"
+	
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+
+	def second = 0
+
+	println "Paginating text: "
+	for (File srcfile : files) {
+
+		String txtname = srcfile.getName();
+		int i = txtname.lastIndexOf(".");
+		if(i > 0) txtname = txtname.substring(0, i);
+
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+		Element text = params.addText(params.corpora.get(corpusname), txtname, srcfile);
+
+		if (second) { print(", ") }
+		if (second > 0 && (second++ % 5) == 0) println ""
+		print(".");
+
+		def ed = new pager(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, page_element);
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxm/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxm/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxm/compiler.groovy	(revision 728)
@@ -0,0 +1,533 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2016-05-26 17:42:36 +0200 (jeu., 26 mai 2016) $
+// $LastChangedRevision: 3219 $
+// $LastChangedBy: mdecorde $
+//
+
+
+package org.txm.importer.xmltxm;
+
+import java.util.ArrayList;;
+
+import org.txm.*;
+import org.txm.importer.cwb.BuildCwbEncodeArgs;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+
+import javax.xml.stream.*;
+import java.net.URL;
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class compiler.
+ */
+class compiler
+{
+	String sortMetadata;
+	/** The debug. */
+	private boolean debug= false;
+
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The dir. */
+	private def dir;
+
+	/** The output. */
+	private Writer output;
+
+	/** The url. */
+	private def url;
+
+	/** The text. */
+	String text="";
+
+	/** The base. */
+	String base="";
+
+	/** The project. */
+	String project="";
+
+	/** The cwb loc. */
+	String cwbLoc;
+
+	/** The lang. */
+	private String lang ="fr";
+
+	/** The s attribs. */
+	private static HashMap<String, List<String>> sAttribs;
+
+	/** The anatypes. */
+	private static anatypes = []
+	private static anavalues = [:]
+	
+	/**
+	 * initialize.
+	 *
+	 */
+	public compiler(){}
+
+	/**
+	 * Instantiates a new compiler.
+	 *
+	 * @param url the url
+	 * @param text the text
+	 * @param base the base
+	 * @param project the project
+	 */
+	public compiler(URL url,String text,String base, String project)
+	{
+		this.text = text
+		this.base = base;
+		this.project = project;
+		try {
+			this.url = url;
+			inputData = url.openStream();
+
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+		} catch (Exception ex) {
+			System.out.println("Error while creating indexes: $ex");
+			ex.printStackTrace();
+		}
+	}
+
+	public void setSortMetadata(String sortMetadata)
+	{
+		this.sortMetadata = sortMetadata;
+	}
+
+	/**
+	 * set the language of the corpus.
+	 *
+	 * @param lang the lang
+	 * @return the java.lang. object
+	 */
+	public setLang(String lang)
+	{
+		this.lang = lang;
+	}
+
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the new cwb path
+	 */
+	public void setCwbPath(String path)
+	{
+		if(!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path;
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File f) {
+		try {
+			//File f = new File(dirPathName, fileName)
+			output = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(f,f.exists())) , "UTF-8");
+			return true;
+		} catch (Exception e) {
+		println "Error while create WTC otput file: "+e
+			e.printStackTrace();
+
+			return false;
+		}
+	}
+
+	/**
+	 * Go to text.
+	 */
+	private boolean GoToText()
+	{
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.END_ELEMENT)
+				if (parser.getLocalName().equals("teiHeader") || parser.getLocalName().equals("teiheader")) {
+					return true;
+				}
+		}
+		return false;
+	}
+
+	/**
+	 * Transfom file wtc.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	public boolean transfomFileWtc(File wtcFile)
+	{
+		createOutput(wtcFile);
+		String headvalue=""
+		String vAna = "";
+		String vForm = "";
+		String wordid= "";
+		String vHead = "";
+		String anatype = null;
+		String anavalue = null;
+		int p_id = 0;
+		int s_id = 0;
+
+		boolean captureword = false;
+		boolean flagForm = false;
+		boolean flagAna = false;
+		boolean inW = false;
+		int wcounter = 1;
+		if (!GoToText()) {
+			println "Error: no teiHeader tag found in text '"+this.text+"' (please check file format or content)"
+			return false;
+		}
+		int wc = 0; // TEMP FOR TEST ONLY
+		try {
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+			{
+				switch (event) {
+					case XMLStreamConstants.START_ELEMENT:
+						//println "start: "+parser.getLocalName()
+						switch (parser.getLocalName()) {
+							case "w":
+							
+							inW = true;
+							anavalues = [:]
+							wordid = parser.getAttributeValue(null, "id")
+							if (wordid == null)
+								wordid = "w_"+text+"_"+(wcounter++)
+
+							vAna ="";
+							break;
+
+							case "form":
+							String type2 = parser.getAttributeValue(null, "type");
+							if(type2 == null || type2.equals("default")) {
+								flagForm = true;
+								vForm = "";
+							} else {
+								flagAna = true;
+								vAna += "\t";
+								if(!anatypes.contains(type2))
+									anatypes << type2;
+							}
+							
+							break;
+
+							case "ana":
+							flagAna = true;
+							anavalue = "";
+							anatype = parser.getAttributeValue(null, "type");
+							if (anatype != null) {
+								if(anatype.startsWith("#"))
+									anatype = anatype.substring(1)
+								break;
+							}
+							break;
+
+							default:
+							if (!inW) {
+								output.write("<"+parser.getLocalName().toLowerCase());
+								if (!sAttribs.containsKey(parser.getLocalName()))
+									sAttribs.put(parser.getLocalName().toLowerCase(), []);
+
+								for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+									String attrname = parser.getAttributeLocalName(i).toLowerCase();
+									String attrvalue = parser.getAttributeValue(i);
+									if (!(parser.getLocalName() == "text" && attrname == "id"))
+										output.write(" "+attrname+"=\""+attrvalue.replace("\"", "'")+"\"");
+
+									if (!sAttribs.get(parser.getLocalName().toLowerCase()).contains(attrname))
+										sAttribs.get(parser.getLocalName().toLowerCase()).add(attrname)
+								}
+
+								if (parser.getLocalName() == "text") {
+									output.write(" id=\""+text+"\" base=\""+base+"\" project=\""+project+"\"");
+								}
+								output.write(">\n");
+							}
+						}
+						break;
+
+					case XMLStreamConstants.END_ELEMENT:
+						switch (parser.getLocalName()) {
+							case "TEI":
+								break;
+							case "w":
+							for (String t : anatypes) {
+								def v = anavalues.get(t);
+								if (v != null) vAna +="\t"+v;
+								else vAna +="\t";
+							}
+							
+							output.write( vForm.replaceAll("&", "&amp;").replaceAll("<", "&lt;") +"\t"+wordid+vAna+"\n");
+							vAna = "";
+							vForm = "";
+							inW = false;
+							break;
+
+							case "form":
+							flagForm = false;
+							flagAna = false;
+							break;
+
+							case "ana":
+							anavalues.put(anatype, anavalue)
+							flagAna = false;
+							break;
+
+							default:
+							if(!inW)
+								output.write("</"+parser.getLocalName().toLowerCase()+">\n");
+
+						}
+						break;
+
+					case XMLStreamConstants.CHARACTERS:
+						if(inW)
+						{	
+							if(flagForm) {	
+								vForm += parser.getText().trim();
+							}
+							else if (flagAna) {
+								anavalue += parser.getText().trim();
+							}
+						}
+						break;
+				}
+			}
+
+			output.close();
+			parser.close();
+		}
+		catch (Exception ex) {
+			System.out.println("Error while writing WTC file $ex");
+			ex.printStackTrace();
+			return false;
+		}
+		return true;
+	}
+
+
+
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param basename the basename
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, File txmDir, String basename, String corpusname, List<File> files)
+	{
+		anatypes = new ArrayList<String>();// init only 1 time
+		anavalues = [:]
+		sAttribs = new HashMap<String, List<String>>();// init only 1 time
+		String rootDir = binDir.getAbsolutePath();
+
+		if(cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+
+		if(!new File(cwbLoc).exists()) {
+			println ("CWB path error: "+cwbLoc)
+			return false;
+		}
+		if(!new File(rootDir).exists()) {
+			println ("binary directory does not exists: "+rootDir)
+			return false;
+		}
+
+		File wtcFile = new File(binDir,"wtc/"+corpusname.toLowerCase()+".wtc");
+		new File(rootDir,"/wtc/").deleteDir();
+		new File(rootDir,"/wtc/").mkdir();
+		new File(rootDir,"data/"+corpusname).deleteDir();
+		new File(rootDir,"data/"+corpusname).mkdir();
+		new File(rootDir,"registry/").mkdir();
+
+		String textid = "";
+		int counttext = 0;
+		//List<File> files = txmDir.listFiles();
+		
+		// get all anatypes
+		for (File f : files) {
+			getAnaTypes(f)
+		}
+
+		//0 set Lang
+		if (createOutput(wtcFile)) {
+			output.write("<txmcorpus lang=\""+lang+"\">\n");
+			output.close();
+		}
+		//1- Transform into WTC file
+		def builder = null;
+		for (File f : files) {
+			counttext++;
+			if (!f.exists()) {
+				println("file "+f+ " does not exists")
+			} else {
+				//println("process file "+f)
+				String txtname = f.getName().substring(0,f.getName().length()-4);
+				builder = new compiler(f.toURI().toURL(), txtname, corpusname.toLowerCase(), "default");
+				builder.setLang(lang);
+				if(!builder.transfomFileWtc(wtcFile))
+					return false;
+			}
+		}
+
+		//end corpus
+		if (createOutput(wtcFile)) {
+			output.write("</txmcorpus>\n");
+			output.close();
+		}
+
+		//2- Import into CWB
+
+		CwbEncode cwbEn = new CwbEncode();
+		cwbEn.setDebug(debug);
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		cwbMa.setDebug(debug);
+		List<String> pargs = ["id"];
+		for(String ana : anatypes)
+			pargs.add(ana);
+
+		List<String> sargs = [];
+		//println "Found Sattributes "+this.sAttribs;
+		if(sAttribs.containsKey("text")) {
+			if(!sAttribs.get("text").contains("id"))
+				sAttribs.get("text").add("id");
+			if(!sAttribs.get("text").contains("base"))
+				sAttribs.get("text").add("base");
+			if(!sAttribs.get("text").contains("project"))
+				sAttribs.get("text").add("project");
+		} else {
+			sargs.add("text:0+id+base+project")
+		}
+
+		if (sAttribs.containsKey("txmcorpus")) {
+			if(!sAttribs.get("txmcorpus").contains("lang"))
+				sAttribs.get("txmcorpus").add("lang");
+		} else {
+			sargs.add("txmcorpus:0+lang")
+		}
+
+		for (String tag : this.sAttribs.keySet()) {
+			String sAttr = tag;
+			if(sAttribs.get(tag).size() > 0)
+				sAttr += ":";
+			for(String attr : sAttribs.get(tag))
+				sAttr +="+"+attr;
+			sargs.add(sAttr)
+		}
+
+
+
+		String[] sAttributes = sargs;
+		String[] pAttributes = pargs;
+		println "sAttributes : "+sAttributes;
+		println "pAttributes : "+pAttributes;
+		try {
+			println cwbLoc
+			String regPath = rootDir + "/registry/"+corpusname.toLowerCase() 
+			cwbEn.run(new File(cwbLoc,"cwb-encode").getAbsolutePath(), 
+				rootDir + "/data/$corpusname", 
+				wtcFile.getAbsolutePath(), 
+				regPath, pAttributes, sAttributes);
+			if (!new File(regPath).exists()) {
+				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			cwbMa.run(new File(cwbLoc,"cwb-makeall").getAbsolutePath(), corpusname, rootDir + "/registry");
+
+		} catch (Exception ex) {
+			System.out.println("Error while creating indexes with CQP tools: $ex");
+			ex.printStackTrace();
+			return false;
+		}
+
+		return true;
+	}
+
+	/**
+	 * Sets the debug.
+	 */
+	public void setDebug()
+	{
+		this.debug = true;
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("~/xml/geo");
+		def c = new compiler();
+		c.setDebug();
+		c.setCwbPath("~/TXM/cwb/bin");
+		c.run(dir,"geo");
+	}
+	
+	private void getAnaTypes(File xmlFile) {
+		inputData = xmlFile.toURI().toURL().openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		String ana = "ana"
+		HashSet<String> types = new HashSet<String>();
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) { // start elem
+				if (ana.equals(parser.getLocalName())) { // ana elem
+					for (int i = 0 ; i < parser.getAttributeCount(); i++) { // find @type
+						if ("type".equals(parser.getAttributeLocalName(i))) { // @type
+							types.add(parser.getAttributeValue(i).substring(1)); //remove the #
+							break;
+						}
+					}
+				}
+			}
+		}
+		parser.close()
+
+		for (String type : types)
+			if (!anatypes.contains(type))
+				anatypes << type
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxm/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxm/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxm/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>XML-TXM import module</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxm/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/EncodingConverter.java
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/EncodingConverter.java	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/EncodingConverter.java	(revision 728)
@@ -0,0 +1,217 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-04-11 15:30:35 +0200 (mar., 11 avr. 2017) $
+// $LastChangedRevision: 3426 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+import java.io.*;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Node;
+
+// TODO: Auto-generated Javadoc
+/**
+ * change the encoding of a file.
+ *
+ * @author mdecorde
+ */
+public class EncodingConverter {
+
+	/**
+	 * Instantiates a new encoding converter.
+	 *
+	 * @param in the in
+	 * @param out the out
+	 * @param in_encoding the in_encoding
+	 * @param out_encoding the out_encoding
+	 * @throws IOException Signals that an I/O exception has occurred.
+	 */
+	public EncodingConverter(File in, File out, String in_encoding,
+			String out_encoding) throws IOException {
+		int c;
+		InputStreamReader ist = new InputStreamReader(new FileInputStream(in),
+				in_encoding);
+		OutputStreamWriter ost = new OutputStreamWriter(new FileOutputStream(
+				out), out_encoding);
+
+		while ((c = ist.read()) != -1)
+			ost.write(c);
+
+		ist.close();
+		ost.close();
+	}
+
+	/**
+	 * out encoding is UTF-8.
+	 *
+	 * @param in the in
+	 * @param in_encoding the in_encoding
+	 * @throws IOException Signals that an I/O exception has occurred.
+	 */
+	public EncodingConverter(File in, String in_encoding) throws IOException {
+		String out_encoding = "UTF-8";
+
+		File out = new File("tempencodingconverter");
+		int c;
+		InputStreamReader ist = new InputStreamReader(new FileInputStream(in),
+				in_encoding);
+		OutputStreamWriter ost = new OutputStreamWriter(new FileOutputStream(
+				out), out_encoding);
+		while ((c = ist.read()) != -1)
+			ost.write(c);
+
+		ist.close();
+		ost.close();
+
+		in.delete();
+		out.renameTo(in);
+	}
+
+	/**
+	 * Instantiates a new encoding converter.
+	 *
+	 * @param in : will be replaced
+	 * @param in_encoding the in_encoding
+	 * @param out_encoding the out_encoding
+	 * @throws IOException Signals that an I/O exception has occurred.
+	 */
+	public EncodingConverter(File in, String in_encoding, String out_encoding)
+			throws IOException {
+		File out = new File("tempencodingconverter");
+		int c;
+		InputStreamReader ist = new InputStreamReader(new FileInputStream(in),
+				in_encoding);
+		OutputStreamWriter ost = new OutputStreamWriter(new FileOutputStream(
+				out), out_encoding);
+		while ((c = ist.read()) != -1)
+			ost.write(c);
+
+		ist.close();
+		ost.close();
+
+		in.delete();
+		out.renameTo(in);
+	}
+	
+	/**
+	 * Convert xml.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param encoding the encoding
+	 * @return true, if successful
+	 */
+	public static boolean convertXML(File infile, File outfile, String encoding)
+	{
+		try {
+			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+			factory.setXIncludeAware(true);
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			Node doc = builder.parse(infile);
+			// CrÃ©ation de la source DOM
+			Source source = new DOMSource(doc);
+			
+			// CrÃ©ation du fichier de sortie
+			Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8")); 
+			Result resultat = new StreamResult(writer);
+			
+			// Configuration du transformer
+			TransformerFactory fabrique = new net.sf.saxon.TransformerFactoryImpl();
+			
+			Transformer transformer = fabrique.newTransformer();
+			transformer.setOutputProperty(OutputKeys.INDENT, "yes"); 
+			transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); 
+			
+			// Transformation
+			transformer.transform(source, resultat);
+			writer.close();
+			doc = null;
+			return true;
+		} catch (Exception e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return false;
+		}
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+		File infile = new File("C:\\Documents and Settings\\mdecorde\\xml\\minicedre\\int1.trs");
+		File outfile = new File("C:\\Documents and Settings\\mdecorde\\xml\\minicedre\\int1utf8.trs");
+		EncodingConverter.convertXML(infile, outfile, "UTF-8");
+		/*List<File> files = new ArrayList<File>();
+		LinkedList<File> filefiles = new LinkedList<File>();
+
+		File racine = new File(
+				"~/workspace/org.txm.rcpapplication");
+		String extension = ".properties";
+		String prefix = "messages";
+
+		while (racine != null) {
+			if (racine.exists())
+				for (File f : racine.listFiles()) {
+					// System.out.println("scan file "+f);
+					if (f.isDirectory()) {
+						if (!f.getName().equals(".svn"))
+							filefiles.add(f);
+					} else if (f.isFile()) {
+						if (f.getName().endsWith(extension)
+								&& f.getName().startsWith(prefix))
+							files.add(f);
+					}
+				}
+
+			if (filefiles.size() > 0)
+				racine = filefiles.pop();
+			else
+				racine = null;
+		}
+
+		System.out.println(files);
+
+		for (File f : files) {
+			System.out.println("convert " + f);
+			try {
+				new EncodingConverter(f, "iso-8859-1", "utf-8");
+			} catch (IOException e) {
+				org.txm.utils.logger.Log.printStackTrace(e);
+			}
+		}*/
+	}
+
+}

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/EncodingConverter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/compiler.groovy	(revision 728)
@@ -0,0 +1,305 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.fleurs;
+
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+
+import javax.xml.stream.*;
+import java.net.URL;
+import java.io.File;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class compiler.
+ */
+class compiler{
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private def parser;
+	
+	/** The dir. */
+	private def dir;
+	
+	/** The output. */
+	private def output;
+	
+	/** The url. */
+	private def url;
+	
+	/** The text. */
+	String text="";
+	
+	/** The base. */
+	String base="";
+	
+	/** The project. */
+	String project="";
+	
+	/** The cwb loc. */
+	String cwbLoc;
+	
+	/** The lang. */
+	private String lang ="fr";
+	
+	/**
+	 * Instantiates a new compiler.
+	 */
+	public compiler(){}
+	
+	/**
+	 * initialize.
+	 *
+	 * @param url the url
+	 * @param text the text
+	 * @param base the base
+	 * @param project the project
+	 */
+	public compiler(URL url,String text,String base, String project)
+	{
+		this.text = text
+		this.base = base;
+		this.project = project;
+		
+		try {
+			this.url = url;
+			inputData = url.openStream();
+			
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * set the language of the corpus.
+	 *
+	 * @param lang the lang
+	 * @return the java.lang. object
+	 */
+	public setLang(String lang)
+	{
+		this.lang = lang;
+	}
+	
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the new cwb path
+	 */
+	public void setCwbPath(String path)
+	{
+		if(!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path;
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(String dirPathName, String fileName){
+		try {
+			File f = new File(dirPathName, fileName)
+			output = new OutputStreamWriter(new FileOutputStream(f,f.exists()) , "UTF-8")
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+		
+	/**
+	 * Transfom file wtc.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	public boolean transfomFileWtc(String dirPathName, String fileName)
+	{
+		createOutput(dirPathName, fileName);
+		
+		String vForm = "";
+		String wordid= "";
+		String w_l= "";
+		String w_lemme= "";
+		String w_pos= "";
+		String w_x= "";
+		String w_z= "";
+		
+		boolean flagForm = false;
+		output.write("<txmcorpus lang=\""+lang+"\">\n"); 
+		try 
+		{
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+			{
+				switch (event) 
+				{
+					case XMLStreamConstants.START_ELEMENT:
+					switch (parser.getLocalName()) 
+					{
+					case "recueil":
+						output.write("<text id=\""+text+"\" base=\"fleurs\" project=\"default\">\n");
+						break;
+					case "w":
+						flagForm= true;
+						w_l = parser.getAttributeValue(null,"l");
+						w_lemme = parser.getAttributeValue(null,"lemme");
+						w_pos = parser.getAttributeValue(null,"pos");
+						w_x= parser.getAttributeValue(null,"x");
+						w_z= parser.getAttributeValue(null,"z");
+						wordid= parser.getAttributeValue(null,"id");
+						vForm ="";
+						break;
+					default:
+						output.write("<"+parser.getLocalName())
+						for(int i =0; i < parser.getAttributeCount() ; i++)
+								output.write(" "+parser.getAttributeLocalName(i)+"=\""+parser.getAttributeValue(i)+"\"")
+							output.write(">\n");
+						break;
+					}
+					break;
+					
+					case XMLStreamConstants.END_ELEMENT:
+					switch (parser.getLocalName()) 
+					{
+					case "recueil":
+						output.write("</text>\n");
+						break;
+					case "w":
+						flagForm= false;
+						output.write(vForm+"\t"+wordid+"\t"+w_l+"\t"+w_lemme+"\t"+w_pos+"\t"+w_x+"\t"+w_z+"\n")
+						break;
+					default:
+						output.write("</"+parser.getLocalName()+">\n");
+						break;
+					}
+					break;
+					
+					case XMLStreamConstants.CHARACTERS:
+						if(flagForm)
+							vForm += parser.getText().trim();
+					
+					break;
+				}
+			}
+			output.write("</txmcorpus>"); 
+			output.close();
+			parser.close();
+			inputData.close();
+		}
+		catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}
+		catch (IOException ex) {
+			System.out.println("IOException while parsing " + inputData);
+		}
+		
+		return true;
+	}
+	
+	/**
+	 * Run.
+	 *
+	 * @param rootDir the root dir
+	 */
+	public boolean run(String rootDir) 
+	{
+		//String rootDir = "~/xml/Hyperprince/";
+		if(cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+		
+		new File(rootDir,"wtc/fleurs.wtc").delete();//cleaning&preparing
+		new File(rootDir,"wtc/").deleteDir();
+		new File(rootDir,"wtc/").mkdir();
+		new File(rootDir,"registry/").mkdir();
+		
+		//1- Transform into WTC file
+		List<File> files = new File(rootDir,"txm").listFiles();
+		for (File f : files) {
+			if (!f.exists()) {
+				println("file "+f+ " does not exists")	
+			}
+			else
+			{	
+				println("process file "+f)
+				String txtname = f.getName().substring(0,f.getName().length()-4);
+				def builder = new compiler(f.toURL(), txtname, "fleurs", "default");
+				builder.setLang lang
+				builder.transfomFileWtc(rootDir,"wtc/fleurs.wtc");
+			}
+		}
+		
+		//2- Import into CWB
+		def outDir =rootDir;
+		def outDirTxm = rootDir;
+		
+		CwbEncode cwbEn = new CwbEncode();
+		cwbEn.setDebug true;
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		cwbMa.setDebug true;
+		
+		String[] pAttributes = ["id","l","lemme","pos","x","z"];
+		String[] sAttributes = ["txmcorpus:0+lang", "text:0+id+base+project","poeme:0+titre+genre+type+section+tranche_chrono+date+annee+titre_abr+preorig+schema1+schema2+n","strophe:0+ordre+nb_vers+structure","div:0+type+structure","vers:0+numvers+tphon+stru+n_syl+n_pied+cesure+rime"];
+		
+		try {
+			String regPath = outDirTxm + "/registry/"+"fleurs"
+			cwbEn.run(cwbLoc + "/cwb-encode", outDirTxm + "data", outDir + "/wtc/"+"fleurs.wtc", regPath,pAttributes, sAttributes);
+			if (!new File(regPath).exists()) {
+				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			cwbMa.run(cwbLoc + "/cwb-makeall", "FLEURS", outDirTxm + "/registry");
+			
+		} catch (Exception ex) {System.out.println(ex); return false;}
+		
+		System.out.println("Done.") 
+		return true;
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Fleur import module : Astartex</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/BuildEdition.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/BuildEdition.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/BuildEdition.groovy	(revision 728)
@@ -0,0 +1,264 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.fleurs;
+
+import org.txm.importer.*;
+import org.xml.sax.Attributes;
+import org.txm.importer.filters.*;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.util.ArrayList;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+// TODO: Auto-generated Javadoc
+/** Build Discours corpus simple edition from a xml-tei. @author mdecorde */
+class BuildEdition {
+	int wordcount;
+	
+	/** The No space before. */
+	List<String> NoSpaceBefore;
+	
+	/** The No space after. */
+	List<String> NoSpaceAfter;
+	
+	/** The wordid. */
+	String wordid;
+	
+	/** The wordvalue. */
+	String wordvalue;
+	
+	/** The interpvalue. */
+	String interpvalue;
+	
+	/** The flaginterp. */
+	boolean flaginterp = false;
+	
+	/** The lastword. */
+	String lastword = " ";
+	
+	/** The wordtype. */
+	String wordtype;
+	
+	/** The flagform. */
+	boolean flagform = false;
+	
+	/** The url. */
+	private def url;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The writer. */
+	def writer;
+
+	/**
+	 * Instantiates a new builds the edition.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param NoSpaceBefore the no space before
+	 * @param NoSpaceAfter the no space after
+	 */
+	BuildEdition(File infile, File outfile, List<String> NoSpaceBefore,
+			List<String> NoSpaceAfter) {
+		this.NoSpaceBefore = NoSpaceBefore;
+		this.NoSpaceAfter = NoSpaceAfter;
+		this.url = infile.toURI().toURL();
+
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		createOutput(outfile);
+		process();
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile) {
+		try {
+			writer = new OutputStreamWriter(new FileOutputStream(outfile),
+					"UTF-8");
+
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Process.
+	 */
+	void process()
+	{
+		String localname = "";
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			
+			
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{
+						case "teiHeader":
+						if(parser.getAttributeValue(null,"type").equals("text"))
+						{
+							writer.write("<h1 class=\"text\">Discours</h1>")
+						}
+						else if(parser.getAttributeValue(null,"type").equals("corpus"))
+						{
+							writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+							writer.write("<html>");
+							writer.write("<head>");
+							writer.write("<title>Discours edition</title>");
+							writer.write("</head>");
+							writer.write("<body>");
+						}
+						break;
+						
+						case "text":
+							writer.write("<ul>")
+							writer.write("<li>type : "+parser.getAttributeValue(null,"type")+"</li>")
+							writer.write("<li>locuteur : "+parser.getAttributeValue(null,"loc")+"</li>")
+							writer.write("<li>date : "+parser.getAttributeValue(null,"date")+"</li>")
+							writer.write("</ul>")
+						
+						break;
+						case "p":
+							writer.write("<p>");
+						break;
+						
+						case "w":
+						wordid=parser.getAttributeValue(null,"id");
+						wordcount++;
+						break;
+						
+						case "ana":
+						flaginterp=true;
+						interpvalue+=" "+parser.getAttributeValue(null,"type")+":"
+						break;
+						
+						case "form":
+						wordvalue="";
+						interpvalue ="";
+						flagform=true;
+					}
+				break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{
+						case "teiHeader":
+
+						break;
+						
+						case "p":
+							writer.write("</p>");
+						break;
+						
+						case "form":
+						flagform = false
+						
+						break;
+						
+						case "ana":
+						flaginterp = false
+						break;
+						
+						case "w":
+						int l = lastword.length();
+						interpvalue = interpvalue.replace("\"","&quot;");
+						if(NoSpaceBefore.contains(wordvalue))
+						writer.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+						else if(NoSpaceAfter.contains(lastword.substring(l-1, l)))
+						writer.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+						else if(wordvalue.startsWith("-") && wordvalue.length() > 0)
+						writer.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+						else
+						writer.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+						writer.write(wordvalue);
+						writer.write("</span>");
+						lastword=wordvalue;
+						break;
+					}
+				break;
+				
+				case XMLStreamConstants.CHARACTERS:
+					if(flagform)
+						if(parser.getText().length() > 0)
+							wordvalue+=(parser.getText());
+					if(flaginterp)
+						if(parser.getText().length() > 0)
+							interpvalue+=(parser.getText());
+				break;
+			}
+		}	
+		writer.write("</body>");
+		writer.write("</html>");
+		inputData.close();
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		String rootDir = "~/.txm/cwb/data/discours/src/";
+		new File(rootDir+"/identity/").mkdir();
+		
+		File srcfile = new File(rootDir,"discours-p5.xml");
+		File resultfile = new File(rootDir,"discours-p5.html");
+		List<String> NoSpaceBefore = [",",".",")","]","}"];
+		List<String> NoSpaceAfter = ["'","(","[","{"];
+		println("build discours xml-tei file : "+srcfile+" to : "+resultfile );
+		
+		def builder = new BuildEdition(srcfile,resultfile, NoSpaceBefore, NoSpaceAfter);
+		
+		return;
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/pager.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/pager.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/pager.groovy	(revision 728)
@@ -0,0 +1,335 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.fleurs;
+
+import org.txm.importer.*;
+import org.xml.sax.Attributes;
+import org.txm.importer.filters.*;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+// TODO: Auto-generated Javadoc
+/** Build Discours corpus simple edition from a xml-tei. @author mdecorde */
+class pager {
+	List<String> NoSpaceBefore;
+	
+	/** The No space after. */
+	List<String> NoSpaceAfter;
+
+	/** The wordcount. */
+	int wordcount = 0;
+	
+	/** The pagecount. */
+	int pagecount = 0;
+	
+	/** The wordmax. */
+	int wordmax = 0;
+
+	/** The basename. */
+	String basename;
+	
+	/** The wordid. */
+	String wordid;
+	
+	/** The first word. */
+	boolean firstWord = true;
+	
+	/** The wordvalue. */
+	String wordvalue;
+	
+	/** The interpvalue. */
+	String interpvalue;
+	
+	/** The lastword. */
+	String lastword = " ";
+	
+	/** The wordtype. */
+	String wordtype;
+	
+	/** The flagform. */
+	boolean flagform = false;
+	
+	/** The flaginterp. */
+	boolean flaginterp = false;
+	
+	/** The url. */
+	private def url;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The writer. */
+	OutputStreamWriter writer;
+	
+	/** The multiwriter. */
+	OutputStreamWriter multiwriter = null;
+	
+	/** The infile. */
+	File infile;
+	
+	/** The outfile. */
+	File outfile;
+	
+	/** The pages. */
+	ArrayList<File> pages = new ArrayList<File>();
+	
+	/** The idxstart. */
+	ArrayList<String> idxstart = new ArrayList<String>();
+
+	/**
+	 * Instantiates a new pager.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param NoSpaceBefore the no space before
+	 * @param NoSpaceAfter the no space after
+	 * @param max the max
+	 * @param basename the basename
+	 */
+	pager(File infile, File outfile, List<String> NoSpaceBefore,
+			List<String> NoSpaceAfter, int max, String basename) {
+		this.basename = basename;
+		this.wordmax = max;
+		this.NoSpaceBefore = NoSpaceBefore;
+		this.NoSpaceAfter = NoSpaceAfter;
+		this.url = infile.toURI().toURL();
+		this.infile = infile;
+
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		createOutput(outfile);
+		process();
+	}
+
+	/**
+	 * Creates the next output.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean createNextOutput()
+	{
+		try {
+			if(multiwriter != null)
+			{
+				multiwriter.write("</body>");
+				multiwriter.write("</html>");
+				multiwriter.close();
+			}
+			pagecount++;
+			File f = new File(outfile.getParent()+"/multi/",outfile.getName().substring(0,outfile.getName().length()-5)+"_"+pagecount+".html");
+			pages.add(f);
+			idxstart.add(wordid)
+			multiwriter = new OutputStreamWriter(new FileOutputStream(f) , "UTF-8");
+			
+			multiwriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+			multiwriter.write("<html>");
+			multiwriter.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+			multiwriter.write("<head>");
+			multiwriter.write("<title>"+basename.toUpperCase()+" Edition - Page "+pagecount+"</title>");
+			multiwriter.write("</head>");
+			multiwriter.write("<body>");
+			
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile) {
+		try {
+			this.outfile = outfile;
+
+			writer = new OutputStreamWriter(new FileOutputStream(outfile),
+					"UTF-8");
+			// createNextOutput();
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Gets the page files.
+	 *
+	 * @return the page files
+	 */
+	public ArrayList<File> getPageFiles() {
+		return pages;
+	}
+
+	/**
+	 * Gets the idx.
+	 *
+	 * @return the idx
+	 */
+	public ArrayList<String> getIdx() {
+		return idxstart;
+	}
+
+	/**
+	 * Process.
+	 */
+	void process()
+	{
+		String localname = "";
+		
+		writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+		writer.write("<html>");
+		writer.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+		writer.write("<head>");
+		writer.write("<title>"+basename.toUpperCase()+" edition</title>");
+		writer.write("</head>");
+		writer.write("<body>");
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			
+			
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{
+						case "poeme":
+							createNextOutput();
+						writer.write("<h1 class=\"text\">"+parser.getAttributeValue(null,"titre")+"</h1>")
+						writer.write("<ul>")
+						for(int i =0 ; i < parser.getAttributeCount() ; i++)
+							writer.write("<li>"+parser.getAttributeLocalName(i)+" : "+parser.getAttributeValue(i)+"</li>");
+						writer.write("</ul><br/>")
+						
+						multiwriter.write("<h1 class=\"text\">"+parser.getAttributeValue(null,"titre")+"</h1>")
+						multiwriter.write("<ul>")
+						for(int i =0 ; i < parser.getAttributeCount() ; i++)
+							multiwriter.write("<li>"+parser.getAttributeLocalName(i)+" : "+parser.getAttributeValue(i)+"</li>");
+						multiwriter.write("</ul><br/>")
+						break;
+						
+						case "vers":
+							multiwriter.write("<br/>")
+							writer.write("<br/>")
+							break;
+							
+						case "strophe":
+							multiwriter.write("<br/>")
+							writer.write("<br/>")
+							break;
+							
+						case "w":
+						wordid=parser.getAttributeValue(null,"id");
+						if(firstWord)
+						{
+							firstWord=false;
+							this.idxstart.set(0,wordid);
+						}
+						interpvalue = "";
+						for(int i = 0 ; i < parser.getAttributeCount() ; i++)
+						{
+							if(parser.getAttributeLocalName(i) != "id")
+								interpvalue += " "+parser.getAttributeLocalName(i)+":"+parser.getAttributeValue(i);
+						}
+
+						flagform = true;
+						wordvalue = "";
+						break;
+
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{
+						
+						case "w":
+							int l = lastword.length();
+							String endOfLastWord = "";
+							if(l > 0)
+								endOfLastWord = lastword.subSequence(l-1, l);
+							
+							if(interpvalue != null)
+								interpvalue = interpvalue.replace("\"","&quot;");
+							
+							if(NoSpaceBefore.contains(wordvalue) || 
+									NoSpaceAfter.contains(lastword) || 
+									wordvalue.startsWith("-") || 
+									NoSpaceAfter.contains(endOfLastWord))
+							{
+								writer.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+								multiwriter.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+							}
+							else
+							{
+								writer.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+								multiwriter.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+							}
+							writer.write(wordvalue.replace("<", "&lt;")+"</span>");
+							multiwriter.write(wordvalue.replace("<", "&lt;")+"</span>");
+							lastword=wordvalue;
+						flagform = false;
+						break;
+					}
+					break;
+				
+				case XMLStreamConstants.CHARACTERS:
+					if(flagform)
+						if(parser.getText().length() > 0)
+							wordvalue+=(parser.getText());
+					break;
+			}
+		}	
+		writer.write("</body>");
+		writer.write("</html>");
+		writer.close();
+		multiwriter.write("</body>");
+		multiwriter.write("</html>");
+		multiwriter.close();
+		inputData.close();
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/BuildTEI.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/BuildTEI.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/BuildTEI.groovy	(revision 728)
@@ -0,0 +1,245 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.fleurs;
+
+import javax.xml.stream.*;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class BuildTEI.
+ */
+class BuildTEI {
+	
+	/** The url. */
+	private def url;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The output. */
+	private OutputStreamWriter output;
+
+	/**
+	 * Instantiates a new builds the tei.
+	 *
+	 * @param discoursxml the discoursxml
+	 */
+	public BuildTEI(File discoursxml) {
+		this.url = discoursxml.toURI().toURL();
+
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile) {
+		try {
+			output = new OutputStreamWriter(new FileOutputStream(outfile),
+					"UTF-8");
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Write header.
+	 */
+	public void writeHeader() {
+		output.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+		output
+				.write("<teiCorpus xmlns=\"http://www.tei-c.org/ns/1.0\" xmlns:txm=\"http://textometrie.org/1.0\">\n");
+		output.write("<teiHeader type=\"corpus\">\n");
+		output.write("</teiHeader>\n");
+	}
+
+	/**
+	 * Write footer.
+	 */
+	public void writeFooter() {
+		output.write("</teiCorpus>\n");
+	}
+
+	/**
+	 * Process.
+	 *
+	 * @param outfile the outfile
+	 */
+	public void process(File outfile)
+	{
+		createOutput(outfile);
+		int sentence=0;
+		int paragraph=0;
+		int idword=0;
+		
+		String lastopenlocalname= "";
+		String localname = "";
+				
+		try {
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+				
+				switch (event) {
+					case XMLStreamConstants.START_ELEMENT:
+						localname = parser.getLocalName();
+					lastopenlocalname = localname;
+					switch (localname) {
+						case "corpus":
+							this.writeHeader();
+						break;
+						case "w":
+							idword++;	
+							
+							int para = Integer.parseInt(parser.getAttributeValue(null,"para"));
+							int sent = Integer.parseInt(parser.getAttributeValue(null,"sent"));
+							if(sent != sentence)
+							{
+								output.write("</s>\n")
+								
+								if(para != paragraph)
+								{
+									output.write("</p>\n")
+									output.write("<p id=\"p_"+para+"\">\n");
+									paragraph = para;
+								}
+								
+								output.write("<s id=\"s_"+sent+"\">\n");
+								sentence = sent;
+							}
+
+							output.write("<w id=\"w_"+idword+"\">\n");
+							output.write(" <txm:form>"+parser.getAttributeValue(null,"form")+"</txm:form>\n");
+							output.write(" <txm:ana resp=\"#cordial\" type=\"#pos\">"+parser.getAttributeValue(null,"pos")+"</interp>\n");
+							output.write(" <txm:ana resp=\"#cordial\" type=\"#func\">"+parser.getAttributeValue(null,"func")+"</interp>\n");
+							output.write(" <txm:ana resp=\"#cordial\" type=\"#lemma\">"+parser.getAttributeValue(null,"lem")+"</interp>\n");
+							output.write("</w>\n");
+							
+						break;
+						case "text":
+							output.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+							output.write("<TEI xmlns=\"http://www.tei-c.org/ns/1.0\" xmlns:txm=\"http://textometrie.org/1.0\">\n");
+							output.write("<teiHeader type=\"text\">\n");
+							output.write("<fileDesc>\n");
+							output.write("<titleStmt>\n");
+							output.write("<title>"+parser.getAttributeValue(null,"file")+"</title>\n");
+							output.write("<respStmt>\n");
+							output.write("<resp id=\"cordial\">initial tagging</resp>")
+							output.write("</respStmt>\n");
+							output.write("</titleStmt>\n");
+							output.write("</fileDesc>\n");
+							output.write("<encodingDesc>\n");
+							output.write("<classDecl>\n");
+							output.write("<taxonomy id=\"pos\"><bibl type=\"tagset\"/></taxonomy>\n")
+							output.write("<taxonomy id=\"func\"><bibl type=\"tagset\"/></taxonomy>\n")
+							output.write("<taxonomy id=\"lemma\"><bibl type=\"tagset\"/></taxonomy>\n")
+							output.write("</classDecl>\n");
+							output.write("</encodingDesc>\n");
+							output.write("</teiHeader>\n");
+							output.write("<text id=\""+parser.getAttributeValue(null,"id")+"\" type=\""+parser.getAttributeValue(null,"type")+"\" loc=\""+parser.getAttributeValue(null,"loc")+"\" date=\""+parser.getAttributeValue(null,"date")+"\" file=\""+parser.getAttributeValue(null,"file")+"\">\n");
+							output.write("<p id=\"p_1\">\n");
+							output.write("<s id=\"s_1\">\n");
+							paragraph=1;
+							sentence=1;
+						break;
+					}
+					break;	
+					
+					case XMLStreamConstants.END_ELEMENT:
+						localname = parser.getLocalName();
+					switch (localname) {				
+						
+						case "w":
+						break;
+						
+						case "text":
+							output.write("</s>\n");
+							output.write("</p>\n");
+							paragraph=1;
+							sentence=1;
+							output.write("</text>\n");
+							output.write("</TEI>\n");
+						break;
+						
+						case "corpus":
+							this.writeFooter();
+						break;
+					}
+					break;
+					
+					case XMLStreamConstants.CHARACTERS:
+						//output.write(parser.getText().trim());				
+					break;
+				}
+			}
+			output.close();
+			parser.close();
+			inputData.close();
+		}
+		catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}
+		catch (IOException ex) {
+			System.out.println("IOException while parsing " + inputData);
+		}
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+
+		String rootDir = "~/xml/discours/src";
+
+		File srcfile = new File(rootDir, "discours.xml");
+		File resultfile = new File(rootDir, "discours-tei.xml");
+		println("build discours xml-tei file : " + srcfile + " to : "
+				+ resultfile);
+
+		def builder = new BuildTEI(srcfile);
+		builder.process(resultfile);
+
+		return;
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/importer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/importer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/importer.groovy	(revision 728)
@@ -0,0 +1,239 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.fleurs
+
+import org.txm.importer.*;
+import org.txm.importer.filters.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+import javax.xml.stream.*;
+import java.io.BufferedWriter;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintStream;
+import java.net.URL;
+import java.util.List;
+
+import org.txm.*;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class importer.
+ */
+class importer 
+{
+	
+	/**
+	 * Run.
+	 *
+	 * @param dir the dir
+	 * @param basename the basename
+	 */
+	public void run(File dir, String basename)
+	{
+		String rootDir = dir.getAbsolutePath()+"/"
+		//cleaning
+		File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+		binDir.deleteDir();
+		binDir.mkdir();
+		new File(binDir,"txm").deleteDir();
+		new File(binDir,"txm").mkdir();
+		
+		File srcfile = new File(rootDir).listFiles()[0];
+		File resultfile = new File(binDir,"txm/"+srcfile.getName());
+		
+		this.process(srcfile, resultfile);		
+	}
+	
+	/**
+	 * Process.
+	 *
+	 * @param srcfile the srcfile
+	 * @param resultfile the resultfile
+	 */
+	public void process(File srcfile, File resultfile)
+	{
+		
+		String localname= "";
+		URL url = srcfile.toURI().toURL();
+		def inputData = url.openStream();
+		def factory = XMLInputFactory.newInstance();
+		XMLStreamReader parser = factory.createXMLStreamReader(inputData);
+		OutputStreamWriter output = new OutputStreamWriter(new FileOutputStream(resultfile) , "UTF-8");
+		
+		println resultfile.getAbsolutePath()
+		
+		String poeme_titre ="";
+		String poeme_type ="";
+		String poeme_genre ="";
+		String poeme_section ="";
+		String poeme_tranchechrono ="";
+		String poeme_date ="";
+		String poeme_annee ="";
+		String poeme_titreabr ="";
+		String poeme_preorig ="";
+		String poeme_schema1 ="";
+		String poeme_schema2 ="";
+		
+		int wordid = 1;
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch (localname) {
+						case "M"://f, l, x test si null
+						case "MC":
+						case "PC":
+							String x = parser.getAttributeValue(null,"x");
+							String z = parser.getAttributeValue(null,"z");
+							String l = parser.getAttributeValue(null,"l");
+							String f = parser.getAttributeValue(null,"f");
+							String pos = "none";
+							String lemme = "none";
+							if(l != null)
+							{
+								String[] split = l.split("_");
+								if(split.length == 2)
+								{
+									pos = split[1];
+									lemme = split[0];
+								}
+							}
+						
+							if(x == null)
+								x = "n/a";
+							if(z == null)
+								z = "1";
+							output.write("<w id=\"w_"+(wordid++)+"\" l=\""+l+"\" lemme=\""+lemme+"\" pos=\""+pos+"\" x=\""+x+"\" z=\""+z+"\">"+f+"</w>\n")
+							break;
+						
+						case "RECUEIL":
+							output.write("<recueil>\n");
+						
+							break;
+						case "POEME":
+							poeme_titre = parser.getAttributeValue(null,"TITRE");
+							poeme_type = parser.getAttributeValue(null,"TYPE");
+							poeme_genre = parser.getAttributeValue(null,"GENRE");
+							poeme_section = parser.getAttributeValue(null,"SECTION");
+							poeme_tranchechrono = parser.getAttributeValue(null,"TRANCHE_CHRONO");
+							poeme_date = parser.getAttributeValue(null,"DATE");
+							poeme_annee = parser.getAttributeValue(null,"ANNEE");
+							poeme_titreabr = parser.getAttributeValue(null,"TITRE_ABR");
+							poeme_preorig = parser.getAttributeValue(null,"PREORIG");
+							poeme_schema1 = parser.getAttributeValue(null,"SCHEMA1");
+							poeme_schema2 = parser.getAttributeValue(null,"SCHEMA2");
+							break;	
+						case "ASTX_ATTR":
+							output.write("<poeme");
+							output.write(" titre=\""+poeme_titre+"\"");
+							if(poeme_type == "")
+								output.write(" type=\"v\"");
+							else
+								output.write(" type=\""+poeme_type+"\"");
+							if(poeme_genre == "")
+								output.write(" genre=\"v\"");
+							else
+								output.write(" genre=\""+poeme_genre+"\"");
+							output.write(" section=\""+poeme_section+"\"");
+							output.write(" tranche_chrono=\""+poeme_tranchechrono+"\"");
+							output.write(" date=\""+poeme_date+"\"");
+							output.write(" annee=\""+poeme_annee+"\"");
+							output.write(" titre_abr=\""+poeme_titreabr+"\"");
+							output.write(" preorig=\""+poeme_preorig+"\"");
+							output.write(" schema1=\""+poeme_schema1+"\"");
+							output.write(" schema2=\""+poeme_schema2+"\"");
+							output.write(" n=\""+poeme_schema2+"\"");
+							output.write(">\n");
+							break;
+						
+						case "HUITAIN":
+						case "SIZAIN":
+							output.write("<div type=\""+localname.toLowerCase()+"\"");
+							for(int i =0; i < parser.getAttributeCount() ; i++)
+								output.write(" "+parser.getAttributeLocalName(i).toLowerCase()+"=\""+parser.getAttributeValue(i)+"\"")
+							output.write(">\n");
+							break;
+						case "STROPHE":
+						case "VERS":
+							output.write("<"+localname.toLowerCase());
+							for(int i =0; i < parser.getAttributeCount() ; i++)
+								output.write(" "+parser.getAttributeLocalName(i).toLowerCase()+"=\""+parser.getAttributeValue(i)+"\"")
+							output.write(">\n");
+							break;
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+					switch (localname) {
+						
+						case "RECUEIL":
+							output.write("</recueil>\n");
+							break;
+						
+						case "ASTX_ATTR":
+							output.write("</poeme>\n");
+							break;
+						
+						case "HUITAIN":
+						case "SIZAIN":
+							output.write("</div>\n");
+							break;
+						case "STROPHE":
+						case "VERS":
+							output.write("</"+localname.toLowerCase()+">\n");
+							break;
+					}
+					break;
+				case XMLStreamConstants.CHARACTERS:
+				//output.write(parser.getText().trim());				
+					break;
+			}
+		}
+		output.close();
+		parser.close();
+		inputData.close();
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File(System.getProperty("user.home"),"xml/fleurs/");
+		String rootDir = dir.getAbsolutePath();
+		File homedir = new File(rootDir);
+		def imp = new importer();
+		imp.run(homedir);
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/fleursLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/fleursLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/fleurs/fleursLoader.groovy	(revision 728)
@@ -0,0 +1,145 @@
+/**
+ * Main.
+ *
+ * @param args the args
+ */
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.fleurs
+;
+
+import java.io.File;
+import org.txm.importer.fleurs.compiler;
+import org.txm.importer.fleurs.pager;
+import org.txm.importer.fleurs.importer;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+
+// TODO: Auto-generated Javadoc
+/* (non-Javadoc)
+ * @see groovy.lang.Script#run()
+ */
+String userDir = System.getProperty("user.home");
+String rootDir;
+String lang;
+String encoding;
+String model;
+try{rootDir = rootDirBinding;lang=langBinding;encoding=encodingBinding;model=modelBinding;}
+catch(Exception)
+{	println "DEV MODE";//exception means we debug
+	if(!org.txm.Toolbox.isInitialized())
+	{
+		rootDir = userDir+"/xml/fleurs/";
+		lang="fr";
+		encoding= "UTF-8";// not used
+		model="rgaqcj"; // not used
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File(userDir,"TXMinstall"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"),"TXM"));
+	}
+}
+
+String basename = "fleurs";
+System.out.println("basename : "+basename);
+println "-- IMPORTER - Reading source files"
+File homedir = new File(rootDir);
+def imp = new importer();
+imp.run(homedir, basename);
+
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+rootDir = binDir.getAbsolutePath()+"/";
+
+println "-- ANNOTATE - Running NLP tools"
+println "No annotation to do"
+//new Annotate().run(new File(rootDir),model+".par");
+
+println "-- COMPILING - Building Search Engine indexes"
+List<File> files = new File(rootDir,"txm").listFiles();
+def c = new compiler()
+//c.setCwbPath("")// for developers
+c.setLang(lang);
+c.run(rootDir);
+
+//move registry file to cwb registry dir
+File registryfile = new File(rootDir,"registry/"+basename);
+if(registryfile.exists())
+	FileCopy.copy(registryfile,new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"registry/"+basename.toLowerCase()))
+
+Workspace w = org.txm.Toolbox.workspace;
+
+Project p = w.getProject("default")
+p.removeBase(basename)
+Base b = p.addBase(basename);
+b.addDirectory(new File(rootDir,"txm"));
+b.setAttribute("lang", lang)
+b.propagateAttribute("lang")
+
+println "-- EDITION - Building edition"
+new File(rootDir,"HTML").deleteDir();
+new File(rootDir,"HTML").mkdir();
+new File(rootDir,"HTML/default").mkdir();
+List<File> filelist = new File(rootDir,"txm").listFiles();
+def second = 0
+
+println "Paginating text: "
+for(Text text : b.getTexts())
+{
+	File srcfile = text.getSource();
+	File resultfile = new File(rootDir,"HTML/"+srcfile.getName().substring(0,srcfile.getName().length()-4)+".html");
+	List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+		
+		if (second) { print(", ") }
+		if (second > 0 && (second % 5) == 0) println ""
+		print(srcfile.getName());
+		second++
+	
+	def ed = new pager(srcfile,resultfile, NoSpaceBefore, NoSpaceAfter,500,basename);
+	
+	Edition editionweb = text.addEdition("default","html",resultfile);
+	for(int i = 0 ; i < ed.getPageFiles().size();i++)
+	{
+		File f = ed.getPageFiles().get(i);
+		String idx = ed.getIdx().get(i);
+		editionweb.addPage(f,idx);
+	}
+	
+//	Edition editionbp = text.addEdition("onepage","html",resultfile);
+//	editionbp.addPage(resultfile,ed.getIdx().get(0));
+}
+
+w.save();
+println ""
+
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/CsvToXml.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/CsvToXml.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/CsvToXml.groovy	(revision 728)
@@ -0,0 +1,185 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2015-12-17 12:11:39 +0100 (jeu., 17 dÃ©c. 2015) $
+// $LastChangedRevision: 3087 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer
+
+import java.io.FileInputStream
+import java.io.InputStreamReader
+import java.nio.charset.Charset
+import org.txm.utils.*
+
+import javax.xml.stream.*
+import java.net.URL
+
+/**
+ * The Class CsvToXml: allow to convert CSV files to XML files
+ *
+ * @author mdecorde
+ */
+class CsvToXml {
+
+	/** The titles. */
+	File xmlfile
+	List<String> titles = []
+
+	private CsvReader getCSVReader(File csvfile, String fieldSeparator, String encoding) {
+		CsvReader csvreader = new CsvReader(csvfile.getAbsolutePath(), fieldSeparator.charAt(0), Charset.forName(encoding))
+
+		//get titles
+		csvreader.readHeaders()
+		titles = []
+		for (String title : csvreader.getHeaders()) {
+			titles << title
+		}
+
+		if (titles.size() == 0) {
+			println "the CSV file as no column"
+			return null
+		}
+
+		if (titles.contains("text") == 0) {
+			println "the CSV file as no 'text' column"
+			return null
+		}
+
+		if (titles.contains("id") == 0) {
+			println "the CSV file as no 'id' column"
+			return null
+		}
+		
+		return csvreader
+	}
+	
+	/**
+	 * Convert a CSV file to ONE XML file using the first line to declare metadata
+	 *
+	 * @param csvfile the csvfile
+	 * @param outfile the outfile
+	 * @param fieldSeparator the field separator
+	 * @param textSeparator the text separator
+	 * @param encoding the encoding
+	 * @return true, if successful
+	 */
+	public boolean toOneXMLFile(File csvfile, File xmlfile, String fieldSeparator, String textSeparator, String encoding) {
+		CsvReader csvreader = getCSVReader(csvfile, fieldSeparator, encoding)
+		if (csvreader == null) return false
+		
+		println "Metadata properties declared: "+titles
+
+		XMLOutputFactory factory = XMLOutputFactory.newInstance()
+		FileOutputStream output = new FileOutputStream(xmlfile)
+		XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8")
+
+		writer.writeStartDocument("UTF-8","1.0")
+		writer.writeStartElement("text")
+		while (csvreader.readRecord()) {
+			
+			writer.writeStartElement("div")
+
+			for (int i = 0 ; i < titles.size() ; i++) {
+				if (titles[i] == "text") continue
+				writer.writeAttribute(AsciiUtils.buildId(titles.get(i)), csvreader.get(i))
+			}
+
+			writer.writeCharacters(csvreader.get("text")) // get text content
+			writer.writeEndElement() // div
+		}
+
+		writer.writeEndElement() // text
+		writer.close()
+		output.close()
+		csvreader.close()
+
+		return true;
+	}
+	
+	/**
+	* Convert a CSV file to SEVERAL XML file using the first line to declare metadata
+	*
+	* @param csvfile the csvfile
+	* @param outfile the outfile
+	* @param fieldSeparator the field separator
+	* @param textSeparator the text separator
+	* @param encoding the encoding
+	* @return true, if successful
+	*/
+	public boolean toMultipleXMLFiles(File csvfile, File outDir, String fieldSeparator, String textSeparator, String encoding) {
+		CsvReader csvreader = getCSVReader(csvfile, fieldSeparator, encoding)
+		if (csvreader == null) return false
+		
+		if (!outDir.exists()) outDir.mkdirs()
+		if (!outDir.exists()) {
+			println "Out directory does not exist and could not create it"
+			return false;
+		}
+		
+		while (csvreader.readRecord()) {
+			
+			File xmlfile = new File(outDir, csvreader.get("id")+".xml")
+			
+			XMLOutputFactory factory = XMLOutputFactory.newInstance()
+			FileOutputStream output = new FileOutputStream(xmlfile)
+			XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8")
+	
+			writer.writeStartDocument("UTF-8","1.0")
+			writer.writeStartElement("text")
+			
+			for (int i = 0 ; i < titles.size() ; i++) {
+				if (titles[i] == "text") continue
+				writer.writeAttribute(AsciiUtils.buildId(titles.get(i)), csvreader.get(i))
+			}
+
+			writer.writeCharacters(csvreader.get("text")) // get text content
+			
+			writer.writeEndElement() //text
+			writer.close()
+			output.close()
+		}
+		return true
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	static public void main(String[] args)
+	{
+		String home = System.getProperty("user.home")
+		File csvfile = new File(home, "xml/csv/test.csv")
+		File outfile = new File(home, "xml/csv/test.xml")
+		File outdir = new File(home, "xml/csv/out")
+
+		String fieldSeparator = "\t"
+		String textSeparator = "" //or "'"
+		CsvToXml builder = new CsvToXml()
+		
+		builder.toMultipleXMLFiles(csvfile, outdir, fieldSeparator, textSeparator, "UTF-8")
+		
+		builder.toOneXMLFile(csvfile, outfile, fieldSeparator, textSeparator, "UTF-8")
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/FortranColumns2XML.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/FortranColumns2XML.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/FortranColumns2XML.groovy	(revision 728)
@@ -0,0 +1,325 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+// 
+// 
+// 
+// $LastChangedDate: 2017-04-11 15:30:35 +0200 (mar., 11 avr. 2017) $
+// $LastChangedRevision: 3426 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+import org.txm.utils.i18n.DetectBOM;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+
+import javax.xml.stream.*;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class FortranColumns2XML.
+ */
+class FortranColumns2XML {
+	
+	/** The infile. */
+	
+	File infile;
+	
+	/** The outfile. */
+	File outfile;
+	
+	/** The encoding. */
+	String encoding;
+	
+	/** The column names. */
+	List<String> columnNames
+	
+	/** The word tag. */
+	String wordTag;
+	
+	/** The wordcolumn. */
+	int wordcolumn;
+	
+	/** The linecounter. */
+	int linecounter = 0;
+	
+	/** The check line number. */
+	int checkLineNumber;
+	
+	/** The check line number tag. */
+	String checkLineNumberTag;
+	
+	/** The columnindex. */
+	private List<Integer> columnindex;
+	
+	/** The endcolumnindex. */
+	private List<Integer> endcolumnindex;
+	
+	/** The line. */
+	private String line;
+	
+	/** The writer. */
+	private XMLStreamWriter writer;
+	
+	/** The reader. */
+	private Reader reader;
+	
+	/** The output. */
+	private FileOutputStream output;
+	
+	String textname;
+	
+	/**
+	 * Instantiates a new fortran columns2 xml.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param encoding the encoding
+	 */
+	FortranColumns2XML(File infile, File outfile, String encoding)
+	{
+		this.infile = infile;
+		this.outfile = outfile;
+		
+		textname = infile.getName();
+		int idx = -1;
+		idx = textname.lastIndexOf(".");
+		if (idx > 0)
+			textname = textname.substring(0, idx);
+
+		def input = new FileInputStream(infile) 		
+		reader = new InputStreamReader(input , encoding);
+		DetectBOM bomdetector = new DetectBOM(infile);
+		for (int ibom = 0 ; ibom < bomdetector.getBOMSize() ; ibom++) input.read()
+		
+		XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		output = new FileOutputStream(outfile)
+		writer = factory.createXMLStreamWriter(output, "UTF-8");
+	}
+	
+	/**
+	 * Process.
+	 *
+	 * @return true, if successful
+	 */
+	public boolean process()
+	{
+		line = reader.readLine(); // use the first line to find columns 
+		
+		if(columnindex == null || endcolumnindex == null)
+		{
+			searchNumberOfColumns();
+		}
+		
+		if(columnindex.size() != columnNames.size())
+		{
+			System.err.println("Number of column("+columnindex.size()+") different of number of column name("+columnNames.size()+")");
+			return false;
+		}
+		
+		//write start document
+		writer.writeStartDocument("UTF-8", "1.0");
+		writer.writeStartElement("text")
+		writer.writeAttribute("id",infile.getName())
+		
+		boolean gogogo = true;
+		while(gogogo)
+		{	
+			//println "line : "+line
+			processLine();//split line accordinly to columnindexes
+			linecounter++;
+			
+			//continue to read the document
+			line = reader.readLine();
+			if(line == null)
+				gogogo= false;
+		}
+		
+		writer.writeEndElement();
+		writer.writeEndDocument();
+		writer.close();
+		output.close();
+		
+		return true;
+	}
+	
+	/**
+	 * Process line.
+	 */
+	int wordcount = 1;
+	private void processLine()
+	{
+		String pcdata;
+		if(line.length() > 0)
+		{
+			writer.writeStartElement(wordTag)
+			if(setIds)
+				writer.writeAttribute("id", "w_"+textname+"_"+(wordcount++));
+			for(int i = 0 ; i < columnindex.size(); i++)
+			{
+				if(line.length() > endcolumnindex.get(i))
+				{
+					String substring = line.substring(columnindex.get(i), endcolumnindex.get(i))
+					if(i != wordcolumn)
+					{
+						writer.writeAttribute(columnNames.get(i), substring.trim())
+					}
+					else
+					{
+						pcdata = substring.trim()
+					}
+				}
+				else
+				{
+					println "Error: line $linecounter: len="+line.length()+" maxidx="+endcolumnindex.get(i)
+					println line;
+				}
+			}
+			writer.writeCharacters(pcdata);
+			writer.writeEndElement();
+		}
+	}
+	
+	/**
+	 * Sets the column indexes.
+	 *
+	 * @param starts the starts
+	 * @param ends the ends
+	 */
+	private void setColumnIndexes(List<Integer> starts, List<Integer> ends)
+	{
+		columnindex = starts;
+		endcolumnindex = ends;
+	}
+	
+	boolean setIds = false;
+	public void setAddIds(boolean setIds)
+	{
+		this.setIds = setIds;
+	}
+	
+	/**
+	 * Search number of columns.
+	 */
+	private void searchNumberOfColumns()
+	{
+		columnindex = new ArrayList<Integer>();
+		endcolumnindex = new ArrayList<Integer>();
+		columnindex.add(0);
+		int ic = 0
+		char c;
+		char[] cline = line.toCharArray();
+		int state = 0; // 0 lettre, 1 espace
+		
+		for(ic = 0 ; ic < cline.length ; ic++)
+		{
+			c = cline[ic];
+			if(state == 0)// zone lettre
+			{
+				if(c == " ")
+				{
+					state = 1;
+					
+				}
+			}
+			else // zone espace
+			{
+				if(c != " ")
+				{
+					columnindex.add(ic);
+					endcolumnindex.add(ic-1);
+					state = 0;
+				}
+			}
+		}
+		endcolumnindex.add(cline.length);
+		println columnindex;
+		println endcolumnindex;
+	}
+	
+	/**
+	 * Sets the columns lines names.
+	 *
+	 * @param columnNames the column names
+	 * @param unitTag the unit tag
+	 * @param wordcolumn the wordcolumn
+	 */
+	public void setColumnsLinesNames(List<String> columnNames, String unitTag, int wordcolumn)
+	{
+		this.columnNames = columnNames;
+		this.wordTag = unitTag;
+		this.wordcolumn = wordcolumn;
+	}
+	
+	/**
+	 * Sets the line check.
+	 *
+	 * @param colindex the colindex
+	 * @param tagname the tagname
+	 */
+	public void setLineCheck(int colindex, String tagname)
+	{
+		this.checkLineNumber = colindex;
+		this.checkLineNumberTag = tagname;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File fortranfile = new File(System.getProperty("user.home"),"\\xml\\lasla\\lasla\\L01PlaAmphi.APN");
+		File outfile = new File(System.getProperty("user.home"),"\\xml\\lasla\\out.xml");
+		FortranColumns2XML builder = new FortranColumns2XML(fortranfile, outfile, "iso-8859-1");
+		builder.setColumnIndexes([0, 3, 4, 8, 29, 55, 67],	[3, 4, 8, 28, 54, 66, 79]);
+		builder.setColumnsLinesNames(["ref","s","sent","word","lemme","line","pos"], "w", 3);
+		builder.setLineCheck(3, "l");
+		
+		builder.process();
+	}
+}
+
+
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/SAttributesListener.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/SAttributesListener.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/SAttributesListener.groovy	(revision 728)
@@ -0,0 +1,217 @@
+package org.txm.importer
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import javax.xml.stream.*;
+
+/**
+ * Read an XML file and find out : XML elements, their attributes and recursivity level
+ * names are lowercases
+ * 
+ * @author mdecorde
+ *
+ */
+class SAttributesListener {
+
+	private static HashMap<String,ArrayList<String>> structs = new HashMap<String, ArrayList<String>>();
+	private static HashMap<String, Integer> structsCountProf = new HashMap<String, Integer>();
+	private static HashMap<String, Integer> structsMaxProf = new HashMap<String, Integer>();
+	private static String structPath = "/";
+	private XMLStreamReader parser;
+
+	SAttributesListener() {
+		structs = new HashMap<String, ArrayList<String>>();
+		structsCountProf = new HashMap<String, Integer>();
+		structsMaxProf = new HashMap<String, Integer>();
+		structPath = "/";
+	}
+	
+	SAttributesListener(XMLStreamReader parser) {
+		this();
+		this.parser = parser;
+	}
+	
+	public void appendResultsTo(SAttributesListener another) {
+		structs = another.structs;
+		structsCountProf = another.structsCountProf;
+		structsMaxProf = another.structsMaxProf;
+	}
+
+	public void start(def parser) {
+		this.parser = parser;
+	}
+
+	def W = "w";
+	def ANA = "ana";
+	def FORM = "form";
+	/**
+	 * Call this method for each START_ELEMENT stax event
+	 * @param localname the element localname
+	 */
+	public void startElement(String localname) {
+		localname = localname.toLowerCase();
+
+		//String localname = parser.getLocalName();
+		if(localname.equals(W)) return;
+		if(localname.equals(ANA)) return;
+		if(localname.equals(FORM)) return;
+
+		structPath += localname+"/"
+		//println "add: "+structPath
+		def attrs = structs.get(localname)
+		if (!structs.containsKey(localname)) {
+			attrs = new HashSet();
+			structs.put(localname, attrs);
+			structsCountProf.put(localname, 0)
+			structsMaxProf.put(localname, 0)
+		} //else {
+		
+		// get structure recursion
+		int prof = structsCountProf.get(localname)+1
+		structsCountProf.put(localname, prof)
+		if (structsMaxProf.get(localname) < prof )
+			structsMaxProf.put(localname, prof)
+		
+		// get the structure attributes
+		for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+			attrs << parser.getAttributeLocalName(i).toLowerCase();
+		}
+	}
+
+	/**
+	 * Call this method for each END_ELEMENT stax event
+	 * @param localname the element localname
+	 */
+	public void endElement(String localname) {
+		localname = localname.toLowerCase();
+		//String localname = parser.getLocalName();
+		if(localname.equals(W)) return;
+		if(localname.equals(ANA)) return;
+		if(localname.equals(FORM)) return;
+
+		if (structPath.length() > 1) {
+			int idx = structPath.lastIndexOf("/");
+			if (idx > 0) {
+				structPath = structPath.substring(0, idx)
+				//println "end of $localname "+(structsCountProf.get(localname))
+				//if (structsCountProf.get(localname) != null)
+				structsCountProf.put(localname, structsCountProf.get(localname)-1)
+			}
+			//println "pop: "+structPath
+		}
+	}
+
+	boolean firstGetStructs = true;
+	public HashMap<String,ArrayList<String>> getStructs() {
+		if (structsCountProf.get("div") > 0)
+			structs.remove("div1")
+		if (structsCountProf.get("div") > 1)
+			structs.remove("div2")
+		if (structsCountProf.get("div") > 2)
+			structs.remove("div3")
+		if (structsCountProf.get("div") > 3)
+			structs.remove("div4")
+		if (structsCountProf.get("div") > 4)
+			structs.remove("div5")
+		if (structsCountProf.get("div") > 5)
+			structs.remove("div6")
+
+		if (firstGetStructs) {
+			firstGetStructs = false;
+			def keys = []
+			keys.addAll(structs.keySet());
+			for( String key : keys) {
+				def value = structs.get(key);
+				structs.remove(key)
+				structs.put(key.toLowerCase(), value);
+			}
+		}
+
+		return structs;
+	}
+
+	boolean firstGetstructsCountProf = true;
+	public HashMap<String, Integer> getProfs() {
+
+		//		if (firstGetstructsCountProf) {
+		//			firstGetstructsCountProf = false;
+		//			def keys = []
+		//			keys.addAll(structsCountProf.keySet());
+		//			for( String key : keys) {
+		//				def value = structsCountProf.get(key);
+		//				structsCountProf.remove(key)
+		//				structsCountProf.put(key.toLowerCase(), value);
+		//			}
+		//		}
+		HashMap<String, Integer> clone = new HashMap<String, Integer>();
+		for (String key : structsMaxProf.keySet()) {
+			if (structsMaxProf.get(key) > 0)
+				clone.put(key, structsMaxProf.get(key)-1)
+			else
+				clone.put(key, 0)
+		}
+		return clone;
+	}
+	
+	public static SAttributesListener scanFile(File xmlFile) {
+		return scanFile(xmlFile, null)
+	}
+	
+	public void setParser(def parser) {
+		this.parser = parser;
+	}
+	
+	/**
+	 * Merge results in the parentListener
+	 * 
+	 * @param xmlFile
+	 * @param parentListener results are appended to the parentListener if any
+	 * @return
+	 */
+	public static SAttributesListener scanFile(File xmlFile, SAttributesListener parentListener) {
+		
+		def start = false;
+		def inputData = xmlFile.toURI().toURL().openStream();
+		def factory = XMLInputFactory.newInstance();
+		def parser = factory.createXMLStreamReader(inputData);
+		
+		SAttributesListener listener;
+		if (parentListener != null) {
+			listener = parentListener;
+			listener.setParser(parser)
+		} else {
+			listener = new SAttributesListener(parser);
+		}
+		String TEXT = "text";
+		//HashSet<String> types = new HashSet<String>();
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) { // start elem
+				if (TEXT.equals(parser.getLocalName())) start = true;
+				if (start) listener.startElement(parser.getLocalName())
+			} else if (event == XMLStreamConstants.END_ELEMENT) { // end elem
+				if (start) listener.endElement(parser.getLocalName())
+				if (TEXT.equals(parser.getLocalName())) start = false;
+			}
+		}
+		parser.close()
+		
+		return listener
+	}
+	
+	public static SAttributesListener scanFiles(File xmlDirectory, String wordTag) {
+		SAttributesListener listener = new SAttributesListener()
+		listener.W = wordTag
+		for (File xmlFile : xmlDirectory.listFiles()) {
+			if (xmlFile.isFile() && !xmlFile.isHidden() && xmlFile.getName().toLowerCase().endsWith(".xml")) {
+				scanFile(xmlFile, listener); // results saved in 'listener' data
+//				println "LISTENER RESULT with ${xmlFile.getName()}: "+listener
+//				println " prof: "+listener.getStructs()
+//				println " prof: "+listener.getProfs()
+//				println " path: "+listener.structPath
+			}
+		}
+		
+		return listener;
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/teicmc/SplitTEICMRPerLocutor.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/teicmc/SplitTEICMRPerLocutor.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/teicmc/SplitTEICMRPerLocutor.groovy	(revision 728)
@@ -0,0 +1,200 @@
+package org.txm.importer.teicmc
+
+import java.io.File;
+import java.net.URL;
+
+import javax.xml.stream.*;
+
+import org.txm.importer.StaxIdentityParser;
+import org.txm.importer.StaxStackWriter;
+
+public class SplitTEICMRPerLocutor extends StaxIdentityParser {
+
+	File outputDirectory;
+	def writers = [:];
+
+	public SplitTEICMRPerLocutor(File inputFile, File outputDirectory) {
+		super(inputFile);
+		this.outputDirectory = outputDirectory;
+		outputDirectory.mkdir()
+	}
+
+	protected void processStartElement() {
+		if (parser.getLocalName() == "posting") {
+			for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+				if (parser.getAttributeLocalName(i) == "who") {
+					String loc = parser.getAttributeValue(i)
+					writer = writers.get(loc) // switch writer on locutor
+					break;
+				}
+			}
+		}
+
+		if (writer != null) {
+			processStartElement(writer);
+		} else {
+			for (def swriter : writers.values()) processStartElement(swriter);
+		}
+	}
+
+	protected void processStartElement(def swriter)
+	{
+		String prefix = parser.getPrefix();
+
+		if (prefix != null && prefix.length() > 0)
+			swriter.writeStartElement(Nscontext.getNamespaceURI(prefix), localname)
+		else
+			swriter.writeStartElement(localname);
+
+		for (int i = 0 ; i < parser.getNamespaceCount() ; i++) {
+			swriter.writeNamespace(parser.getNamespacePrefix(i), parser.getNamespaceURI(i));
+		}
+
+		writeAttributes(swriter);
+	}
+
+	private void _processStartElement() {
+		String prefix = parser.getPrefix();
+
+		if (prefix != null && prefix.length() > 0)
+			writer.writeStartElement(Nscontext.getNamespaceURI(prefix), localname)
+		else
+			writer.writeStartElement(localname);
+
+		for (int i = 0 ; i < parser.getNamespaceCount() ; i++) {
+			writer.writeNamespace(parser.getNamespacePrefix(i), parser.getNamespaceURI(i));
+		}
+
+		writeAttributes();
+	}
+
+
+	protected void processNamespace() {
+		if (writer != null) {
+			writer.writeNamespace(parser.getPrefix(), parser.getNamespaceURI());
+		} else {
+			for (def swriter : writers.values()) swriter.writeNamespace(parser.getPrefix(), parser.getNamespaceURI());
+		}
+	}
+
+	protected void writeAttributes() {
+		if (writer != null) {
+			writeAttributes(writer);
+		} else {
+			for (def swriter : writers.values()) writeAttributes(swriter);
+		}
+	}
+
+	protected void writeAttributes(def swriter) {
+		for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+			String attrPrefix = parser.getAttributePrefix(i);
+			if (attrPrefix != null && attrPrefix.length() > 0)
+				swriter.writeAttribute(attrPrefix+":"+parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+			else
+				swriter.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+		}
+	}
+
+	protected void processCharacters()
+	{
+		if (writer != null) {
+			writer.writeCharacters(parser.getText());
+		} else {
+			for (def swriter : writers.values()) swriter.writeCharacters(parser.getText());
+		}
+	}
+
+	protected void processProcessingInstruction()
+	{
+		if (writer != null) {
+			writer.writeProcessingInstruction(parser.getPITarget(), parser.getPIData());
+		} else {
+			for (def swriter : writers.values()) swriter.writeProcessingInstruction(parser.getPITarget(), parser.getPIData());
+		}
+	}
+
+	protected void processDTD()
+	{
+		if (writer != null) {
+			writer.writeDTD(parser.getText());
+		} else {
+			for (def swriter : writers.values()) swriter.writeDTD(parser.getText());
+		}
+	}
+
+	protected void processCDATA()
+	{
+		if (writer != null) {
+			writer.writeCData(parser.getText())
+		} else {
+			for (def swriter : writers.values()) swriter.writeCData(parser.getText())
+		}
+	}
+
+	protected void processComment()
+	{
+		if (writer != null) {
+			writer.writeComment(parser.getText());
+		} else {
+			for (def swriter : writers.values()) swriter.writeComment(parser.getText());
+		}
+	}
+
+	protected void processEndElement()
+	{
+		if (writer != null) {
+			writer.writeEndElement();
+		} else {
+			for (def swriter : writers.values()) swriter.writeEndElement();
+		}
+		if (parser.getLocalName() == "posting") writer = null;
+	}
+
+	protected void processEndDocument() {
+		if (writer != null) {
+			writer.writeEndDocument();
+		} else {
+			for (def swriter : writers.values()) swriter.writeEndDocument();
+		}
+	}
+
+	protected void processEntityReference() {
+		if (writer != null) {
+			writer.writeEntityRef(parser.getLocalName());
+		} else {
+			for (def swriter : writers.values()) swriter.writeEntityRef(parser.getLocalName());
+		}
+	}
+
+	public boolean processLocutors(def locutors) {
+		for (String loc : locutors) {
+			println "Create writer for $loc"
+			writers.put(loc, new StaxStackWriter(new File(outputDirectory, loc+"-teicmr.xml"), "UTF8"))
+		}
+		println "writers: $writers"
+
+		for (def swriter : writers.values()) {
+			swriter.writeStartDocument("UTF-8", "1.0");
+			swriter.writeCharacters("\n");
+		}
+
+		boolean ret = process(writer);
+
+		for (def swriter : writers.values()) {
+			try {swriter.close();} catch(Exception e){println "close writer exep: "+e}
+		}
+
+		if (parser != null)
+			try {parser.close()} catch(Exception e){println "parser exep: "+e}
+
+		return ret;
+	}
+
+	public static void main(String[] args) {
+		File inputFile = new File("/home/mdecorde/xml/comere/ismael-textchat.xml")
+		File outputDirectory = new File("/home/mdecorde/xml/comere/split_out")
+
+		def p = new SplitTEICMRPerLocutor(inputFile, outputDirectory)
+		println p.processLocutors(["s_1", "s_10", "s_11", "s_12", "s_13", "s_14", "s_3", "s_4", "s_5", "s_6", "s_7", "s_8", "s_9", "tt_1", "tt_12", "tt_2", "tt_3", "tt_4", "tt_5", "tt_6", "tt_7", "tt_8"])
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/PartialDomIdentityParser.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/PartialDomIdentityParser.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/PartialDomIdentityParser.groovy	(revision 728)
@@ -0,0 +1,179 @@
+package org.txm.importer
+
+import java.util.ArrayList;
+
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+
+import java.io.File;
+import java.io.Writer;
+import java.net.URL;
+
+import javax.xml.stream.*;
+
+class PartialDomIdentityParser extends StaxIdentityParser {
+	
+	boolean domMode = false;
+	def partialDom = [];
+	def currentNode;
+	
+	public PartialDomIdentityParser(File infile) {
+		super(infile)
+	}
+	
+	protected void processNamespace() {
+		super.processNamespace()
+	}
+	
+	protected void processStartElement()
+	{
+		if (parser.getLocalName() == "test") {
+			println "Build dom..."
+			Tag testTag = new Tag(parser);
+			println testTag.toString()
+			testTag.writeDom(writer)
+		} else {
+			super.processStartElement()
+		}
+	}
+	
+	protected void writeAttributes() {
+		super.writeAttributes();
+	}
+	
+	protected void processCharacters()
+	{
+		super.processCharacters()
+	}
+	
+	protected void processProcessingInstruction()
+	{
+		super.processProcessingInstruction()
+	}
+	
+	protected void processDTD()
+	{
+		super.processDTD()
+	}
+	
+	protected void processCDATA()
+	{
+		super.processCDATA();
+	}
+	
+	protected void processComment()
+	{
+		super.processComment()
+	}
+	
+	protected void processEndElement()
+	{
+		super.processEndElement();
+	}
+	
+	protected void processEndDocument() {
+		super.processEndDocument()
+	}
+	
+	protected void processEntityReference() {
+		super.processEntityReference()
+	}
+	
+	public class Tag {
+		public String[] attnames, attvalues, attprefix;
+		public String localname, prefix
+		int count;
+		public def children = [];
+
+		public Tag(def parser) {
+			prefix = parser.getPrefix()
+			localname = parser.getLocalName();
+			count = parser.getAttributeCount()
+			attnames =  new String[count]
+			attvalues = new String[count]
+			attprefix = new String[count]
+			for (int i = 0 ; i < count ; i++) {
+				attnames[i] = parser.getAttributeLocalName(i)
+				attprefix[i] = parser.getAttributePrefix(i).toString()
+				attvalues[i] = parser.getAttributeValue(i).toString()
+			}
+			buildNodeContent(parser)
+		}
+		
+		private void buildNodeContent(def parser) {
+			try {
+				for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+					//println "event "+event
+					switch (event) {
+						case XMLStreamConstants.START_ELEMENT:
+							children << new Tag(parser);
+							break;
+						case XMLStreamConstants.CHARACTERS:
+							children << parser.getText()
+							break;
+						case XMLStreamConstants.END_ELEMENT:
+							if (localname == parser.getLocalName()) {
+								return; // end of stax parsing, the Tag is built
+							}
+							break;
+						case XMLStreamConstants.END_DOCUMENT:
+							println "ERROR: END OF DOCUMENT REACHED"
+							break;
+					}
+				}
+			} catch(Exception e) {
+				println("Error while parsing partial content of file "+inputurl);
+				println("Location "+parser.getLocation());
+				org.txm.utils.logger.Log.printStackTrace(e);
+				return;
+			}
+		}
+
+		public String toString() {
+			def out = new StringWriter()
+			XMLStreamWriter strwriter = outfactory.createXMLStreamWriter(out);//create a new file
+			println ""+(strwriter != null)
+			writeDom(strwriter);
+			return out.toString()
+		}
+		
+		public writeDom(def writer) {
+			// Open the Tag
+			if (prefix != null && prefix.length() > 0)
+				writer.writeStartElement(prefix+":"+localname)
+			else
+				writer.writeStartElement(localname)
+
+			// write Attributes
+			for (int i = 0 ; i < count ; i++) {
+				if (attprefix[i] != null && attprefix[i].length() > 0) {
+					writer.writeAttribute(attprefix[i]+":"+attnames[i], attvalues[i])
+				} else {
+					writer.writeAttribute(attnames[i], attvalues[i])
+				}
+			}
+			
+			// write children recursivelly
+			for (def child : children) {
+				if (child instanceof String) {
+					writer.writeCharacters(child)
+				} else if (child instanceof Tag) {
+					child.writeDom(writer)
+				} else {
+					println "Error: can't write $child"
+				}
+			}
+			
+			// close the Tag
+			writer.writeEndElement() 
+		}
+	}
+	
+	public static void main(String[] args) {
+		File infile = new File("/home/mdecorde/xml/partialdom/test.xml")
+		File outfile = new File("/home/mdecorde/xml/partialdom/test-o.xml")
+		PartialDomIdentityParser p = new PartialDomIdentityParser(infile);
+		println p.process(outfile)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/AddAttributeInXml.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/AddAttributeInXml.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/AddAttributeInXml.groovy	(revision 728)
@@ -0,0 +1,120 @@
+package org.txm.importer
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.txm.metadatas.Entry
+import org.txm.utils.Pair;
+
+/**
+ * Add a attribute value map in a XML file
+ * Warning: if an attribute already exists its value won't be changed
+ */
+class AddAttributeInXml extends StaxIdentityParser {
+	File xmlfile;
+	String tag;
+	List<Pair<String, String>> attributes;
+	HashMap<String, String> attributesMap;
+	boolean result;
+
+	public AddAttributeInXml(File xmlfile, String tag, List<Pair<String, String>> attributes)
+	{
+		super(xmlfile.toURI().toURL());
+		this.xmlfile = xmlfile;
+		this.tag = tag;
+		this.attributes = attributes;
+	}
+
+	public AddAttributeInXml(File xmlfile, String tag, HashMap<String, String> attributesMap) {
+		super(xmlfile.toURI().toURL());
+		this.xmlfile = xmlfile;
+		this.tag = tag;
+		this.attributesMap = attributesMap;
+	}
+
+	public AddAttributeInXml(File xmlfile, String tag,	ArrayList<org.txm.metadatas.Entry> attributes) {
+		super(xmlfile.toURI().toURL());
+		this.xmlfile = xmlfile;
+		this.tag = tag;
+		this.attributes = attributes;
+	}
+
+	public boolean process(File outfile) {
+		this.result = false;
+		boolean ret = super.process(outfile)
+		return this.result & ret;
+	}
+
+	
+	/**
+	 * Rewrite the processStartElement() to update/add attributes
+	 */
+	public void processStartElement()
+	{
+		String prefix = parser.getPrefix();
+//TODO: uncomment for TXM 0.7.6 and later
+//			if (INCLUDE == localname && XI == prefix) {
+//				processingXInclude();
+//				return;
+//			}
+		
+		if (prefix.length() > 0)
+			writer.writeStartElement(Nscontext.getNamespaceURI(prefix), localname)
+		else
+			writer.writeStartElement(localname);
+
+		for (int i = 0 ; i < parser.getNamespaceCount() ; i++) {
+			writer.writeNamespace(parser.getNamespacePrefix(i), parser.getNamespaceURI(i));
+		}
+
+		HashSet<String> exists = new HashSet<String>();
+		for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+			exists.add(parser.getAttributeLocalName(i));
+			writer.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+		}
+		if (localname == tag && !stopInsertion) { // insert here
+			result = true
+			if (attributes != null) {
+				for (Pair<String, String> meta : attributes) {
+					if(stopAtFirst)
+						stopInsertion = true;
+					if(!exists.contains(meta.getFirst())) // I can add the new attribute
+						writer.writeAttribute(meta.getFirst(), meta.getSecond());
+				}
+			} else if (attributesMap != null) {
+				for (String name : attributesMap.keySet()) {
+					if (stopAtFirst)
+						stopInsertion = true;
+					if (!exists.contains(name)) // I can add the new attribute
+						writer.writeAttribute(name, attributesMap.get(name));
+				}
+			}
+		}
+	}
+	
+	boolean stopAtFirst = false;
+	boolean stopInsertion = false;
+	public void onlyOneElement() {
+		stopAtFirst = true;
+	}
+
+	public static void main(String[] args)
+	{
+		File xmlfile = new File("/home/mdecorde/xml/xmlÃ§Ã Ã©/essai.xml")
+		File temp = File.createTempFile("temp", ".xml", xmlfile.getParentFile());
+		String tag = "titre";
+		ArrayList<Pair<String, String>> metadatas = new ArrayList<Pair<String, String>>();
+		metadatas.add(new Pair<String, String>("name1", "newvalue1"));
+		metadatas.add(new Pair<String, String>("name2", "value2"));
+		metadatas.add(new Pair<String, String>("name3", "value3"));
+
+		AddAttributeInXml builder = new AddAttributeInXml(xmlfile, tag, metadatas);
+		builder.onlyOneElement();
+		if(builder.process(temp)) {
+			if (!(xmlfile.delete() && temp.renameTo(xmlfile))) println "Warning can't rename file "+temp+" to "+xmlfile
+		} else {
+			println "Error during process"
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/TabulatedToXml.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/TabulatedToXml.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/TabulatedToXml.groovy	(revision 728)
@@ -0,0 +1,244 @@
+package org.txm.importer 
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Tool to convert Tabulated file to xml file. Such as CWB files or TreeTagger ouput
+ */
+public class TabulatedToXml {
+	String[] colnames;
+	
+	/** The texttag. */
+	String texttag;
+	
+	/** The tag. */
+	boolean tag;
+	
+	/** The no col form. */
+	int noColForm;
+	
+	/**
+	 * Instantiates a new tabulated to xml.
+	 *
+	 * @param colnames the word properties name
+	 * @param texttag the element that represents a text unit
+	 * @param tag if true, split the file by the texttag, if false wrap the file with an element texttag
+	 */
+	public TabulatedToXml(String[] colnames, String texttag, boolean tag) throws Exception
+	{
+		this.colnames = colnames;
+		this.texttag = texttag;
+		this.tag = tag;
+		this.noColForm = 0;
+	}
+	
+	/**
+	 * Instantiates a new tabulated to xml.
+	 *
+	 * @param colnames the colnames
+	 * @param texttag the texttag
+	 * @param tag the tag
+	 * @param noColForm the no col form
+	 */
+	public TabulatedToXml(String[] colnames, String texttag, boolean tag, int noColForm) throws Exception
+	{
+		this.colnames = colnames;
+		this.texttag = texttag;
+		this.tag = tag;
+		this.noColForm = noColForm;
+	}
+	
+	/**
+	 * Process.
+	 *
+	 * @param tabulatedfile the tabulatedfile
+	 * @param xmlfile the xmlfile
+	 * @param encoding the encoding
+	 * @return true, if successful
+	 */
+	public boolean process(File tabulatedfile, File xmlfile, String encoding)
+	{
+		BufferedReader reader = new BufferedReader(new FileReader(tabulatedfile));
+		FileOutputStream output = new FileOutputStream(xmlfile)
+		
+		XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8"); 
+		
+		writer.writeStartDocument("UTF-8", "1.0")
+		
+		if(!tag) // there is no tag, we must wrap the content in an element
+		{
+			if(texttag.length() == 0)
+			{
+				println "no text element given"
+				return false;
+			}
+			writer.writeStartElement(texttag);
+			String filename = tabulatedfile.getName()
+			filename = filename.substring(0, filename.lastIndexOf("."));
+			writer.writeAttribute("id", filename);
+		}
+		
+		String line = reader.readLine();
+		int noline = 0;
+		while(line != null)
+		{
+			if(tag && line.startsWith("</")) // closing xml tag
+			{
+				writer.writeEndElement();
+			}
+			else if(tag && line.startsWith("<")) // opening xml tag
+			{
+				int firstblank = line.indexOf(" ");
+				String tagname;
+				String[] attrnamevalues = null;
+				if(firstblank > 0) // contains attributes
+				{
+					tagname = line.substring(1, firstblank);
+					line = line.substring(firstblank+1, line.length() -1);
+					attrnamevalues = line.split(" ");
+				}
+				else // no attr
+				{
+					tagname = line.substring(1, line.length() -1);
+				}
+				
+				writer.writeStartElement(tagname);
+				if(attrnamevalues != null)
+				{
+					for(String namevalue : attrnamevalues)
+					{
+						int egalidx = namevalue.indexOf("=");
+						String name = namevalue.substring(0, egalidx);
+						String value = namevalue.substring(egalidx+1, namevalue.length());
+						
+						writer.writeAttribute(name, value.replace("\"",""));
+					}
+				}
+			}
+			else // it's a word
+			{
+				String[] split = line.split("\t");
+				if(split.length != colnames.length)
+				{
+					System.out.println("Error line "+noline+" : missing columns :"+split.length+" instead of "+ colnames.length);
+					println "line: "+line
+				}
+				String form = "";
+				writer.writeStartElement("w");
+				for(int i = 0 ; i < colnames.length ; i++)
+				{
+					if(i == noColForm)
+					{
+						form = split[0];
+					}
+					else
+					{
+						if(split.length <= i)
+						writer.writeAttribute(colnames[i], "N/A");
+						else
+						writer.writeAttribute(colnames[i], split[i]);
+					}
+				}
+				writer.writeCharacters(form);
+				writer.writeEndElement();
+				
+			}
+			noline++;
+			line = reader.readLine();
+		}
+		
+		if(!tag) // there is no tag, we close the wrapping element
+		{
+			writer.writeEndElement();
+		}
+		
+		writer.close();
+		output.close();
+		reader.close();
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		String home = System.getProperty("user.home");
+		// sample_TXM_LA.vrt
+		/*
+		 File tabulatedfile = new File(home, "xml/tabulated/sample_TXM_LA.vrt");
+		 File xmlfile = new File(home, "xml/tabulated/sample_TXM_LA.xml");
+		 String[] colnames = ["form", "pos", "lem", "func"]; // TreeTagger
+		 boolean tag = true;
+		 String encoding = "UTF-8";
+		 try {
+		 TabulatedToXml ttx = new TabulatedToXml(colnames, "", tag);
+		 ttx.process(tabulatedfile, xmlfile, encoding)
+		 } catch (Exception e) {
+		 // TODO Auto-generated catch block
+		 org.txm.utils.logger.Log.printStackTrace(e);
+		 }*/
+		File srcdir = new File(home, "xml/Bendinelli");
+		File outdir = new File(home, "xml/Bendinelli/xml");
+		println "srcdir: "+srcdir
+		outdir.deleteDir();
+		outdir.mkdir();
+		
+		String[] colnames = ["form", "pos", "lem"]; // TreeTagger
+		boolean tag = false;
+		String encoding = "UTF-8";
+		
+		TabulatedToXml ttx = new TabulatedToXml(colnames, "debat", tag);
+		for(File tabulatedfile : srcdir.listFiles())
+		{
+			if(tabulatedfile.getName().endsWith(".txt"))
+			{
+				String filename = tabulatedfile.getName()
+				filename = filename.substring(0, filename.lastIndexOf("."));
+				File xmlfile = new File(outdir, filename+".xml")
+				println "process: "+tabulatedfile
+				ttx.process(tabulatedfile, xmlfile, encoding)
+			}
+		}
+		
+		println "Done"
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/XMLTXM2WTC.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/XMLTXM2WTC.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/XMLTXM2WTC.groovy	(revision 728)
@@ -0,0 +1,508 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-04-11 15:30:35 +0200 (mar., 11 avr. 2017) $
+// $LastChangedRevision: 3426 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer
+
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.txm.importer.filters.*;
+// TODO: Auto-generated Javadoc
+
+/**
+ * The Class XMLTXM2WTC.
+ *
+ * @author mdecorde
+ * simple transofmration of a xml-tei-txm file into wtc file
+ */
+
+class XMLTXM2WTC
+{
+	
+	/** The url. */
+	private def url;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The output. */
+	private def output;
+	
+	/** The hashmap of txm:form and txm:ana values and the attributes hash*/
+	LinkedHashMap<String, String> anahash = new LinkedHashMap<String, String>();
+	LinkedHashMap<String, String> formhash = new LinkedHashMap<String, String>();
+	LinkedHashMap<String, String> wordattributes = new LinkedHashMap<String, String>();
+	
+	/** The balisesfound. */
+	HashMap<String, List<String>> balisesfound;// = new HashMap<String, List<String>>();
+
+	/** The balises to keep. */
+	List<String> balisesToKeep;
+	
+	/** The send to p attributes. */
+	HashMap <String, List<String>> sendToPAttributes;// = new HashMap<String, List<String>>();
+	
+	/** The injected p attributes. */
+	List<String> injectedPAttributes = new ArrayList<String>();
+	
+	/** The default reference : a pattern + the properties to use */
+	List<String> defaultReferences = new ArrayList<String>();
+	String defaultReferencePattern;
+	
+	/** The injected p attributes values. */
+	HashMap <String, String> injectedPAttributesValues;// = new ArrayList<String>();
+	
+	/** The addinfos. */
+	boolean addinfos = false;
+	
+	/** The txtname. */
+	String txtname;
+	
+	/** The base. */
+	String base;
+	
+	/** The project. */
+	String project;
+	
+	/** The lang. */
+	public String lang= "fr";
+	public String currentForm;
+	public String currentAna;
+	
+	/**
+	 * Sets the lang.
+	 *
+	 * @param lang the lang
+	 * @return the java.lang. object
+	 */
+	public setLang(String lang)
+	{
+		this.lang = lang;
+	}
+	
+	/**
+	 * Instantiates a new xMLTX m2 wtc.
+	 *
+	 * @param url the url
+	 */
+	public XMLTXM2WTC(URL url){
+		try {
+			this.url = url;
+			inputData = url.openStream();
+			factory = XMLInputFactory.newInstance();
+			
+			parser = factory.createXMLStreamReader(inputData);
+			
+			
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * Sets the text info.
+	 *
+	 * @param name the name
+	 * @param base the base
+	 * @param project the project
+	 */
+	public void setTextInfo(String name, String base, String project)
+	{
+		this.addinfos = true;
+		this.txtname= name;
+		this.base = base;
+		this.project = project;
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile)
+	{
+		try {
+			output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile, outfile.exists()) , "UTF-8"));
+			return true;
+		} catch (Exception e) {
+			System.err.println(e);
+			return false;
+		}
+	}
+	
+	/** The haspb. */
+	boolean haspb = false;
+	
+	/** The haslb. */
+	boolean haslb = false;
+	
+	/**
+	 * Transform file.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	public boolean transformFile(File outfile)
+	{
+		if(balisesToKeep == null)
+		{
+			println "no element has been defined to be keeped"
+			return false;
+		}
+		
+		haspb = false;
+		haslb = false;	
+		
+		boolean flagAna;
+		boolean flagForm;
+		boolean flagWord;
+		String vWord = "";
+		String vForm = "";
+		String vAna = "";
+		
+		String lb_id = "";
+		String pb_id = "";
+		
+		wordattributes = [:];
+		balisesfound = new HashMap<String, List<String>>();
+		
+		
+		if(!createOutput(outfile))
+			return false;
+		
+		if(sendToPAttributes != null)
+		{
+			for(String tag: sendToPAttributes.keySet())
+				for(String attr : sendToPAttributes.get(tag))
+					injectedPAttributes.add(tag+attr);
+			injectedPAttributesValues = [:];
+		}
+		
+		//output.write("<txmcorpus lang=\""+lang+"\">\n");
+		balisesfound.put("txmcorpus",["lang"]);
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event) 
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					String localname = parser.getLocalName().toLowerCase();
+				
+				// we will only declare found tags in cwb registry
+					if(balisesToKeep.contains(localname)) {
+						if(!balisesfound.containsKey(localname)) {
+							balisesfound.put(localname, []);
+						}
+						
+						List<String> attrlist = balisesfound.get(localname);
+						for (int i= 0 ; i < parser.getAttributeCount() ;i++ )
+							if(!attrlist.contains(parser.getAttributeLocalName(i)))
+								attrlist.add(parser.getAttributeLocalName(i));
+					}
+					
+					switch (localname) {						
+						case "w": // get word id !!
+							wordattributes.put("id", parser.getAttributeValue(null, "id"));
+							break;
+						
+						case "form":
+							flagForm = true;
+							currentForm = parser.getAttributeValue(null, "type");
+							if(currentForm == null)
+								currentForm = "default";
+							vForm = "";
+							break;
+						
+						case "ana":
+							flagAna = true;
+							vAna ="";
+						
+							currentAna = (parser.getAttributeValue(null,"type"));
+							if(currentAna != null)
+								currentAna = currentAna.substring(1)// remove the #
+							else
+								flagAna = false;
+							break;
+						
+						default:
+							
+							if (sendToPAttributes != null) {
+								//println "should store $localname ? with "+sendToPAttributes.keySet()
+								if (sendToPAttributes.keySet().contains(localname)) {
+									//println "store attr of "+localname
+									List<String> attrs = sendToPAttributes.get(localname);
+									for (int i= 0 ; i < parser.getAttributeCount() ;i++ ) {
+										if (attrs.contains(parser.getAttributeLocalName(i))) {
+											injectedPAttributesValues.put(localname+parser.getAttributeLocalName(i).toLowerCase(),parser.getAttributeValue(i)) 
+										}
+									}
+								}
+							}
+							
+							if (balisesToKeep.contains(localname)) {
+								output.write("<"+localname);
+								//println "write <"+localname+"..."
+								//write attributes
+								boolean idwritten = false;
+								boolean basewritten = false;
+								boolean projectwritten = false;
+								for (int i= 0 ; i < parser.getAttributeCount() ;i++ ) {
+									String attrname = parser.getAttributeLocalName(i).toLowerCase();
+									if (attrname == "id")
+										idwritten = true;
+									if (attrname == "base")
+										basewritten = true;
+									if (attrname == "project")
+										projectwritten = true;
+									output.write(" "+attrname+"=\""+parser.getAttributeValue(i).replace("\"", "'")+"\"" );
+								}
+								
+								if (localname.equals("text"))
+									if (addinfos) {
+										List<String> attrlist = balisesfound.get(localname);
+	
+										if (!idwritten) {
+											output.write(" id=\""+txtname+"\"")
+											attrlist.add("id");
+										}
+										if (!basewritten) {
+											output.write(" base=\""+base+"\"");
+											attrlist.add("base");
+										}
+										if (!projectwritten) {
+											output.write(" project=\""+project+"\"");
+											attrlist.add("project");
+										}											
+									}	
+											
+								// finalize tag
+								output.write(">\n");
+							}
+					}
+					break;
+				
+				case XMLStreamConstants.END_ELEMENT:
+					String localname = parser.getLocalName().toLowerCase();
+					switch (localname) {
+						case "form":
+							if(flagForm)
+								formhash.put(currentForm, vForm);
+							flagForm = false; 
+							break;
+						
+						case "ana":
+							if(flagAna)
+								anahash.put(currentAna, vAna);
+							flagAna = false;
+							break;
+						
+						case "w":
+							vWord = "";
+							vWord = formhash.get("default").replaceAll("&", "&amp;").replaceAll("<", "&lt;"); // get default form
+							for (String form : formhash.keySet()) // and the others
+								if (form != "default")
+									vWord += "\t"+formhash.get(form);
+							
+							for (String type : wordattributes.keySet()) // only word id ?
+								vWord+="\t"+wordattributes.get(type)
+						
+							if (sendToPAttributes != null) // word attributes from structure properties
+							{
+								//println "injectedPAttributesValues: "+injectedPAttributesValues
+								for(String pattr : injectedPAttributes)
+									vWord+="\t"+injectedPAttributesValues.get(pattr) ;//les attributs injecter
+							}
+							
+							for (String type : anahash.keySet()) // word annotations in txm:ana
+								vWord+="\t"+anahash.get(type)
+							
+							output.write(vWord+"\n");
+							vWord= "";
+							break;
+						
+						default:
+							if (sendToPAttributes != null) // reset structure properties
+							{
+								if (sendToPAttributes.keySet().contains(localname)) {
+									for (String attr : sendToPAttributes.get(localname)) {
+										injectedPAttributesValues.put(attr, "N/A") 
+									}
+								}
+							}
+							
+							if (balisesToKeep.contains(localname)) {
+								output.write("</"+localname+">\n");
+							}
+					}
+					break;
+				
+				case XMLStreamConstants.CHARACTERS:
+					if (flagForm) {
+						vForm += parser.getText().trim();
+					}
+					if (flagAna) {
+						vAna += parser.getText().trim();
+					}
+					break;
+			}
+		}
+		//output.write("</txmcorpus>\n"); 
+		output.close();
+		parser.close();
+		
+		return true;
+	}
+	
+	/**
+	 * Gets the p attributs.
+	 *
+	 * @return the p attributs
+	 */
+	public List<String> getpAttributs()
+	{
+		def pAttributs = [];
+		
+		for (String wordattr : wordattributes.keySet()) {
+			pAttributs.add(wordattr);
+		}
+		
+		if (sendToPAttributes != null)
+			for (String pAttr : this.injectedPAttributes)
+				pAttributs.add(pAttr);
+		
+		for (String anakey : anahash.keySet()) {
+			pAttributs.add(anakey);
+		}
+		
+		return pAttributs;
+	}
+	
+	/**
+	 * Gets the s attributs.
+	 *
+	 * @return the s attributs
+	 */
+	public List<String> getsAttributs()
+	{
+		println balisesfound
+		def sAttributs = [];
+		for (String balise : this.balisesfound.keySet()) {
+			List<String> sAtt = this.balisesfound.get(balise);
+			String attributes = "";
+			for (String attr : sAtt) {
+				attributes+="+"+attr;
+			}
+			
+			if (sAtt.size() > 0)
+				sAttributs.add(balise +":"+attributes);
+			else
+				sAttributs.add(balise);
+		}
+		return sAttributs;
+	}
+	
+	/**
+	 * Sets the balises to keep.
+	 *
+	 * @param balisesToKeep the new balises to keep
+	 */
+	public void setBalisesToKeep(List<String> balisesToKeep)
+	{
+		if (balisesToKeep != null)
+			this.balisesToKeep = balisesToKeep;
+		else
+			println("Warning: the list of elements to keep is null")
+	}
+	
+	/**
+	 * Sets the defautl reference pattern
+	 * TODO: not implemented
+	 *
+	 * @param balisesToKeep the new balises to keep
+	 */
+	public void setDefaultReference(String pattern, List<String> strucProperties)
+	{
+		if (defaultReferencePattern != null) {
+			this.defaultReferences = defaultReferences;
+			defaultReferencePattern = pattern;
+		}
+	}
+	
+	
+	/**
+	 * Sets the send to p attributes.
+	 *
+	 * @param sendus the sendus
+	 */
+	public void setSendToPAttributes(HashMap<String, List<String>> sendus)
+	{
+		if (sendus != null)
+			this.sendToPAttributes = sendus;
+		else
+			println("Warning: the pAttributes to inject is null")
+	}
+	
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+		
+		String rootDir = "/home/mdecorde/TXM/corpora/CORNEILLEMOLIERETER/txm/CORNEILLEMOLIERETER";
+		
+		File srcfile = new File(rootDir,"CORNEILLEP_AGESILAS_1666.xml");
+		println srcfile.exists()
+		File wtcfile = new File(rootDir, "out/CORNEILLEP_AGESILAS_1666.wtc");
+		new File(rootDir,"out").deleteDir()
+		new File(rootDir,"out").mkdir()
+		
+		System.out.println("XMLTXM2WTC : "+srcfile+" >> "+wtcfile);
+		def builder = new XMLTXM2WTC(srcfile.toURL());
+		def balises = ["text", "s"];
+		builder.setBalisesToKeep(balises);
+		builder.transformFile(wtcfile);
+		
+		println("SATTRIBUTS: "+builder.getsAttributs());
+		println("PATTRIBUTS: "+builder.getpAttributs());
+		return;
+	}
+}
+
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/importer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/importer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/importer.groovy	(revision 728)
@@ -0,0 +1,232 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+
+package org.txm.importer.limsi
+
+import java.util.ArrayList;
+import org.txm.utils.Pair;
+
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.txm.utils.logger.Log;
+import org.txm.scripts.teitxm.*;
+import org.txm.stat.utils.ConsoleProgressBar
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import org.w3c.dom.*;
+import org.xml.sax.SAXException;
+import javax.xml.parsers.*;
+import javax.xml.xpath.*;
+
+import java.util.HashMap;
+import org.txm.importer.*;
+import org.txm.utils.*;
+import org.txm.metadatas.*;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class importer.
+ */
+class importer {
+
+	/** The speakers. */
+	HashMap<String, String> speakers = ["spk1":"//Speaker[@id='spk1']", "spk2":"//Speaker[@id='spk2']"];
+
+	/** The topics. */
+	HashMap<String, String> topics = ["to1":"//Topic[@id='to1']", "to2":"//Topic[@id='to2']"];
+
+	/** The trans. */
+	HashMap<String, String> trans = ["trans":"//Trans"];
+
+	/** The doc. */
+	def doc;
+
+	/** The infile. */
+	File infile;
+
+	/** The outfile. */
+	File outfile;
+
+	/** The outdir. */
+	File txmDir;
+	File binDir;
+
+	/** The trsfiles. */
+	ArrayList<String> trsfiles;
+
+	/** The metadata. */
+	Metadatas metadatas;
+
+	/**
+	 * Instantiates a new importer.
+	 *
+	 * @param trsfiles the trsfiles
+	 * @param outdir the outdir
+	 * @param metadata the metadata
+	 */
+	public importer(ArrayList<File> trsfiles, File binDir, File txmDir)
+	{
+		this.trsfiles = trsfiles;
+		this.txmDir = txmDir;
+		this.binDir = binDir;
+	}
+
+	/**
+	 * Run.
+	 *
+	 * @return true, if successful
+	 */
+	public boolean run()
+	{
+		if (trsfiles == null) {
+			println "no files to process"
+			return false;
+		}
+		txmDir.mkdir();
+		if (!txmDir.exists()) {
+			println "can't create txmDir: "+txmDir.getAbsolutePath()
+		}
+
+		println "Convert from LIMSI files to CQP files ("+trsfiles.size()+")."
+		ConsoleProgressBar cpb = new ConsoleProgressBar(trsfiles.size());
+		for (File infile : trsfiles) {
+			cpb.tick();
+
+			String filename = infile.getName();
+			int idx = filename.lastIndexOf(".");
+			if (idx > 0) filename = filename.substring(0, idx)
+
+			File outfile = new File(txmDir, filename+".wtc")
+			
+			if (outfile.exists() && outfile.lastModified() >= infile.lastModified()) {
+				// skip
+			} else {
+				def processor = new LimsiToCQP(infile);
+				processor.process(outfile);
+			}
+		}
+
+		println ""
+		return txmDir.listFiles() != null;
+	}
+
+	/**
+	 * Process.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param metas the metas
+	 * @return true, if successful
+	 */
+	public boolean process(File infile, File outfile, ArrayList<Pair<String, String>> metas)
+	{
+		//inject metadata into
+		this.infile = infile;
+		this.outfile = outfile;
+		def factory = DocumentBuilderFactory.newInstance()
+		factory.setXIncludeAware(true);
+		def builder = factory.newDocumentBuilder()
+		
+		doc = builder.parse(infile)
+		insert(trans.get("trans"), metas);
+		return save();
+	}
+
+	/**
+	 * Insert.
+	 *
+	 * @param xpath the xpath
+	 * @param pairs the pairs
+	 */
+	public void insert(String xpath, List<Pair<String, String>> pairs)
+	{
+		println ("insert $pairs into $xpath")
+		def expr = XPathFactory.newInstance().newXPath().compile(xpath)
+		def nodes = expr.evaluate(doc, XPathConstants.NODESET)
+
+		for (Node node : nodes) {
+			Element elem = (Element)node;
+			for (Pair<String, String> p : pairs) {
+				elem.setAttribute(p.getFirst(), p.getSecond());
+			}
+		}
+	}
+
+	/**
+	 * Save.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean save()
+	{
+		try {
+			// CrÃ©ation de la source DOM
+			Source source = new DOMSource(doc);
+
+			// CrÃ©ation du fichier de sortie
+			Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8"));
+			Result resultat = new StreamResult(writer);
+
+			// Configuration du transformer
+			TransformerFactory fabrique = new net.sf.saxon.TransformerFactoryImpl();
+			Transformer transformer = fabrique.newTransformer();
+			transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+			transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+
+			// Transformation
+			transformer.transform(source, resultat);
+			writer.close();
+			return true;
+		} catch (Exception e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return false;
+		}
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		String userhome = System.getProperty("user.home");
+		File metadatasfile = new File(userhome,"/xml/transcriber/metadatas.xml");
+		File infile = new File(userhome,"/xml/transcriber/dialogue.trs");
+		File outfile = new File(userhome,"/xml/transcriber/dialogue-out.trs");
+		new importer().run(infile, outfile, metadatasfile);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/LimsiToCQP.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/LimsiToCQP.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/LimsiToCQP.groovy	(revision 728)
@@ -0,0 +1,78 @@
+package org.txm.importer.limsi
+
+import javax.xml.stream.*
+import java.net.URL
+
+class LimsiToCQP {
+
+	File xmlfile;
+
+	public LimsiToCQP(File xmlfile) {
+		this.xmlfile = xmlfile;
+	}
+
+	public boolean process(File outfile) {
+		if (!xmlfile.exists()) return false;
+		
+		URL url = xmlfile.toURI().toURL();
+		String filename = outfile.getName()
+		filename = filename.substring(0, filename.length()-4); // remove ".wtc"
+		def inputData = url.openStream();
+		XMLInputFactory factory = XMLInputFactory.newInstance();
+		XMLStreamReader parser = factory.createXMLStreamReader(inputData);
+
+		def output = new OutputStreamWriter(new FileOutputStream(outfile) , "UTF-8");
+		
+		boolean flagWord = false
+		String word = ""
+		
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event)
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					String localname = parser.getLocalName()
+					//println "start $localname"
+					switch(localname) {
+						case "AudioDoc":
+							output.println "<text id=\"$filename\">"
+							break
+						case "Word":
+							flagWord = true
+							word = ""
+						break;
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					String localname = parser.getLocalName()
+					switch(localname) {
+						case "AudioDoc":
+						output.println "</text>"
+						break
+						case "Word":
+							flagWord = false
+							output.println word.trim()
+						//	println "WORD: $word"
+						break;
+					}
+					break
+				case XMLStreamConstants.CHARACTERS:
+					if (flagWord) {
+						word += parser.getText();
+					}
+					break
+			}
+		}
+		output.flush()
+		output.close()
+		//println "$xmlfile -> $outfile"
+		return true;
+	}
+
+	public static void main(String[] args) {
+		File infile = new File("/home/mdecorde/xml/limsi","20071220_1900_1920_inter.xml")
+		File outfile = new File("/home/mdecorde/xml/limsi","out.wtc")
+		def processor = new LimsiToCQP(infile);
+		println processor.process(outfile);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/limsiLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/limsiLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/limsiLoader.groovy	(revision 728)
@@ -0,0 +1,223 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.importer.limsi;
+
+import org.eclipse.swt.widgets.*;
+import org.txm.importer.transcriber.compiler.*;
+import org.txm.importer.transcriber.pager.*;
+import org.txm.importer.transcriber.*;
+
+import java.io.File;
+
+import org.txm.scripts.teitxm.*;
+import org.txm.stat.utils.ConsoleProgressBar
+import org.txm.*;
+import org.txm.objects.*;
+import org.txm.utils.i18n.*;
+import org.txm.utils.*;
+import org.txm.importer.*;
+import org.txm.utils.FileCopy;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+import org.txm.rcpapplication.commands.*
+
+
+//PARAMETERS
+boolean removeInterviewer = false;//if true the transcription of speakers (en1 and enq2) defined in metadatas file will be ignored
+boolean includeComments = false;
+boolean ignoreTranscriberMetadata = false;
+int csvHeaderNumber = 1;
+int maxlines = 200;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	//
+		params = new BaseParameters(new File(userDir, "xml/limsi/files/import.xml"))
+		println "loading "+params.paramFile
+		params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+//binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+//txmDir.deleteDir();
+txmDir.mkdirs();
+
+try {
+	// select only xml files
+	String ext = ".xml";
+	ArrayList<File> limsiFiles = srcDir.listFiles(); //find all trs files
+	if (limsiFiles  == null) {
+		println ("No files in "+srcDir.getAbsolutePath())
+		return false;
+	}
+	
+	// remove non XML files
+	for (int i = 0 ; i < limsiFiles.size() ; i++) {
+		File f = limsiFiles.get(i);
+		if (f.getName().equals("import.xml") || !f.getName().endsWith(ext) || !f.canRead() || f.isHidden()) {
+			limsiFiles.remove(i)
+			i--;
+		}
+	}
+
+	if (limsiFiles.size() == 0) {
+		println ("No transcriptions in "+srcDir.getAbsolutePath())
+		return false;
+	} else {
+		println "Number of transcriptions: "+limsiFiles.size();
+	}
+
+	if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	println "-- IMPORTER"
+	def imp = new importer(limsiFiles, binDir, txmDir) //put result in the txm folder of binDir
+	if (!imp.run()) {
+		println "Failed to prepare files - Aborting";
+		return;
+	}
+	if (MONITOR != null) MONITOR.worked(20)
+
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+	println "-- ANNOTATE CQP- Running NLP tools"
+	boolean annotationSuccess = false;
+	if (annotate && new AnnotateWTC().run(binDir, txmDir, model+".par")) {
+		annotationSuccess = true;
+	}
+
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+	println "--COMPILING - Building Search Engine indexes"
+	limsiFiles = txmDir.listFiles();
+
+	def comp = new compiler()
+	if(debug) comp.setDebug();
+	comp.setAnnotationSuccess(annotationSuccess)
+	if (!comp.run(binDir, txmDir, corpusname)) {
+		println "Failed to compile files";
+		return;
+	}
+	
+	// create HTML directory but don't build an edition
+	File htmlDir = new File(binDir,"HTML/$corpusname");
+	htmlDir.mkdirs();
+	
+	def filelist;
+	if (annotationSuccess)
+		filelist = new File(binDir, "annotations").listFiles();
+	else 
+		filelist = txmDir.listFiles();
+	filelist.sort();
+	def second = 0
+	
+	println "Registering texts: "+filelist.size()
+	ConsoleProgressBar cpb = new ConsoleProgressBar(filelist.size());
+	for (File txmFile : filelist) {
+		cpb.tick()
+		
+		String txtname = txmFile.getName();
+		int i = txtname.lastIndexOf(".");
+		if(i > 0) txtname = txtname.substring(0, i);
+		
+		Element text = params.addText(corpusElem, txtname, txmFile);
+	}
+}
+catch (Exception e){org.txm.utils.logger.Log.printStackTrace(e);}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
+
+
+// load corpus
+println "Loading corpus..."
+try {LoadBinaryCorpus.loadBase(binDir)} catch(Exception e777){try {AddBases.loadBase(binDir, MONITOR)} catch(Exception e){}} // LoadBinaryCorpus does not exist if TXM version is < 0.7.7
+
+Toolbox.restartWorkspace();
+Toolbox.restartSearchEngine();
+
+Display.getDefault().syncExec(new Runnable() {
+	@Override
+	public void run() {
+		println "Reloading corpora view..."
+		RestartTXM.reloadViews();
+		println "import done."
+	}
+});
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/limsiLoader.groovy
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/compiler.groovy	(revision 728)
@@ -0,0 +1,200 @@
+
+
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2012-01-05 14:27:34 +0100 (jeu., 05 janv. 2012) $
+// $LastChangedRevision: 2096 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.limsi
+
+import org.txm.Toolbox;
+import org.txm.importer.cwb.*
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.stat.utils.ConsoleProgressBar
+import org.txm.utils.FileCopy;
+import org.txm.utils.treetagger.TreeTagger;
+import java.util.ArrayList;
+import javax.xml.stream.*;
+import java.net.URL;
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class compiler.
+ */
+class compiler
+{
+	/** The debug. */
+	boolean debug = false
+
+	/** The dir. */
+	private def dir
+
+	/** The cwb loc. */
+	String cwbLoc
+	boolean annotationSuccess = false
+
+	public def pAttributesList = []
+	public def sAttributesList = []
+
+	/**
+	 * Sets the debug.
+	 *
+	 * @return the java.lang. object
+	 */
+	public setDebug()
+	{
+		debug = true
+	}
+
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the new cwb path
+	 */
+	public void setCwbPath(String path)
+	{
+		if (!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path
+	}
+
+	/**
+	 * Sets the annotation success.
+	 *
+	 * @param val the new annotation success
+	 */
+	public void setAnnotationSuccess(boolean val)
+	{
+		this.annotationSuccess = val
+	}
+
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param basename the basename
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, File txmDir, String corpusname)
+	{
+		if (cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+
+		if (!new File(cwbLoc).exists()) {
+			println ("CWB path error: "+cwbLoc)
+			return false
+		}
+		if (!binDir.exists()) {
+			println ("binary directory does not exists: "+binDir)
+			return false
+		}
+
+		//File wtcFile = new File(binDir,"wtc/"+corpusname+".wtc")
+		new File(binDir, "wtc").deleteDir()
+		new File(binDir, "wtc").mkdir()
+		new File(binDir, "data").deleteDir()
+		new File(binDir, "data").mkdir()
+		new File(binDir, "registry").mkdir()
+
+		//1- Merge WTC files
+		if (annotationSuccess) {
+			File annotationDir = new File(binDir, "annotations")
+			if (annotationDir.exists()) txmDir = annotationDir;
+		}
+		def files = txmDir.listFiles()
+		files.sort(); // sort files by name
+
+		//2- Import into CWB
+		def outDir = binDir.getAbsolutePath()+"/";
+
+		CwbEncode cwbEn = new CwbEncode()
+		CwbMakeAll cwbMa = new CwbMakeAll()
+		cwbEn.setDebug(debug)
+		cwbMa.setDebug(debug)
+
+		def pAttrs = []; // cast to array
+		if (annotationSuccess) {
+			pAttrs << "frpos"
+			pAttrs << "frlemma"
+		}
+		def sAttrs = ["text:0+id", "txmcorpus:0+lang"]; // cast to array
+
+
+		String[] pAttributes = pAttrs // cwb-encode needs String[]
+		String[] sAttributes = sAttrs // cwb-encode needs String[]
+		println "pAttrs : "+pAttrs
+		println "sAttrs : "+sAttrs
+
+		try {
+			cwbEn.setDebug(debug)
+			cwbMa.setDebug(debug)
+			String regPath =outDir + "/registry/"+corpusname.toLowerCase()
+			cwbEn.run(cwbLoc + "cwb-encode", outDir + "/data/$corpusname",
+					null,
+					regPath, pAttributes, sAttributes);
+
+			def output = new OutputStreamWriter(cwbEn.getOutputStream());
+			if (output == null) {println "CWB-ENCODE OUTPUT NULL"; return false;}
+			ConsoleProgressBar cpb = new ConsoleProgressBar(files.size())
+			println "processing "+files.size()+" files."
+			output.write("<txmcorpus lang=\"fr\">\n")
+			for (File f : files) {
+				cpb.tick()
+				output.write(f.getText("UTF-8"))
+				output.flush();
+				output.write("\n")
+			}
+			output.write("</txmcorpus>\n")
+			output.close()
+			cwbEn.endProcess();
+			
+			if (!new File(regPath).exists()) {
+				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			cwbMa.run(cwbLoc + "cwb-makeall", corpusname, outDir + "/registry")
+			return true
+		} catch (Exception ex) {System.out.println("Error while compiling indexes: $ex"); ex.printStackTrace(); return false;}
+
+		return true;
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("~/xml/perrault/txm/")
+		List<File> files = dir.listFiles()
+		new compiler().run(files)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Limsi format transformation scripts</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/limsi/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/txt/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/txt/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/txt/compiler.groovy	(revision 728)
@@ -0,0 +1,291 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-04-11 15:30:35 +0200 (mar., 11 avr. 2017) $
+// $LastChangedRevision: 3426 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.txt
+
+import org.txm.Toolbox;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.cwb.PatchCwbRegistry;
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+
+import javax.xml.stream.*;
+
+import java.net.URL;
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class compiler.
+ */
+class compiler {
+	
+	/** The debug. */
+	boolean debug = false;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The dir. */
+	private def dir;
+	
+	/** The output. */
+	private def output;
+	
+	/** The url. */
+	private def url;
+	
+	/** The anahash. */
+	private HashMap<String,String> anahash = new HashMap<String,String>() ;
+	
+	/** The text. */
+	String text="";
+	
+	/** The base. */
+	String base="";
+	
+	/** The project. */
+	String project="";
+	
+	/** The cwb loc. */
+	String cwbLoc;
+	
+	/** The lang. */
+	private String lang ="fr";
+	
+	/**
+	 * initialize.
+	 *
+	 * @param url the url
+	 * @param text the text
+	 * @param base the base
+	 * @param project the project
+	 */
+	
+	public compiler(URL url,String text,String base, String project)
+	{
+		this.text = text
+		this.base = base;
+		this.project = project;
+		this.url = url;
+	}
+	
+	/**
+	 * Sets the debug.
+	 *
+	 * @return the java.lang. object
+	 */
+	public setDebug()
+	{
+		debug =true;
+	}
+	
+	/** The annotation success. */
+	boolean annotationSuccess = false;
+	
+	/**
+	 * Sets the annotation success.
+	 *
+	 * @param val the new annotation success
+	 */
+	public void setAnnotationSuccess(boolean val)
+	{
+		this.annotationSuccess = val;
+	}
+	
+	/** The metadata s attributes. */
+	String metadataSAttributes = "";
+	
+	/**
+	 * Sets the metadata attributes.
+	 *
+	 * @param attrsdecl the new metadata attributes
+	 */
+	public void setMetadataAttributes(String attrsdecl)
+	{
+		metadataSAttributes = attrsdecl;
+	}
+	
+	/**
+	 * set the language of the corpus.
+	 *
+	 * @param lang the lang
+	 * @return the java.lang. object
+	 */
+	public setLang(String lang)
+	{
+		this.lang = lang;
+	}
+	
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the new cwb path
+	 */
+	public void setCwbPath(String path)
+	{
+		if (!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path;
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param f the f
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File f) {
+		try {
+			output = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(f,f.exists())) , "UTF-8");
+			return true;
+		} catch (Exception e) { 
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+	
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param basename the basename
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, File txmDir, String corpusname) 
+	{
+		if (cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+		
+		if (!new File(cwbLoc).exists()) {
+			println ("CWB path error: "+cwbLoc)
+			return false;
+		}
+		if (!binDir.exists()) {
+			println ("Binary directory does not exists: "+binDir)
+			return false;
+		}
+		
+		File wtcFile = new File(binDir,"wtc/"+corpusname+".wtc");
+		new File(binDir, "wtc").deleteDir();
+		new File(binDir, "wtc").mkdir();
+		new File(binDir, "data").deleteDir();
+		new File(binDir, "data").mkdir();
+		new File(binDir, "registry").mkdir();
+		
+		String textid="";
+		int counttext =0;
+		
+		//start corpus
+		if (createOutput(wtcFile)) {
+			output.write("<txmcorpus lang=\""+lang+"\">\n");
+			output.close();
+		}
+		
+		//1- Transform into WTC file
+		println("Compiling "+txmDir.listFiles().length+" files")
+		XMLTXM2WTC wtcbuilder = null;
+		ArrayList<File> files = txmDir.listFiles();
+		Collections.sort(files);
+		for (File txmfile : files) {
+			print "."
+			wtcbuilder = new XMLTXM2WTC(txmfile.toURI().toURL());
+			String txtname = txmfile.getName().substring(0,txmfile.getName().length()-4);
+			wtcbuilder.setTextInfo(txtname, this.base, this.project);
+
+			wtcbuilder.setBalisesToKeep(["text","s"]);
+			wtcbuilder.setSendToPAttributes(["lb":["n"]]);
+			wtcbuilder.setLang(lang);
+			if (!wtcbuilder.transformFile(wtcFile)) {
+				println("Failed to compile "+txmfile)
+			}
+			
+//			println "$txmfile pAttrs : "+wtcbuilder.getpAttributs()
+//			println "$txmfile sAttrs : "+wtcbuilder.getsAttributs()
+		}
+		println ""
+		
+		//end corpus
+		if (createOutput(wtcFile)) {
+			output.write("</txmcorpus>\n");
+			output.close();
+		}
+		
+		//2- Import into CWB
+		def outDir = binDir.getAbsolutePath()+"/";
+		
+		CwbEncode cwbEn = new CwbEncode();
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		cwbEn.setDebug(debug);
+		cwbMa.setDebug(debug);
+		
+		if(wtcbuilder == null)
+			return false;
+		
+		List<String> pAttributesList = wtcbuilder.getpAttributs(); // use last text s and p attributes
+		List<String> sAttributesList = wtcbuilder.getsAttributs();
+		println "pAttrs : "+pAttributesList
+		println "sAttrs : "+sAttributesList
+		String[] pAttributes = pAttributesList.toArray(new String[pAttributesList.size()])
+		String[] sAttributes = sAttributesList.toArray(new String[sAttributesList.size()])
+		
+		try {
+			String regPath = outDir + "/registry/"+corpusname.toLowerCase();
+			cwbEn.run(cwbLoc + "cwb-encode", outDir + "/data/$corpusname", outDir + "/wtc/"+corpusname+".wtc", regPath, pAttributes, sAttributes);
+			if (!new File(regPath).exists()) {
+				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			cwbMa.run(cwbLoc + "cwb-makeall", corpusname, outDir + "/registry");
+		} catch (Exception ex) {System.out.println("CWB error: "+ex); return false;}
+		
+		return true;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("~/xml/perrault/txm/");
+		List<File> files = dir.listFiles();
+		new compiler().run(files);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/txt/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/txt/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/txt/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Quick import module : text files</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/txt/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/txt/importer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/txt/importer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/txt/importer.groovy	(revision 728)
@@ -0,0 +1,297 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2017-06-26 16:53:47 +0200 (lun., 26 juin 2017) $
+// $LastChangedRevision: 3451 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.txt
+
+import javax.xml.stream.*
+
+import org.txm.*
+import org.txm.importer.*
+import org.txm.importer.filters.*
+import org.txm.scripts.*
+import org.txm.scripts.teitxm.*
+import org.txm.utils.*
+import org.txm.utils.i18n.DetectBOM
+
+import filters.CutHeader.*
+import filters.FusionHeader.*
+import filters.TagSentences.*
+import filters.Tokeniser.*
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class importer.
+ */
+class importer {
+
+	/**
+	 * Run.
+	 *
+	 * @param rootfile the rootfile
+	 * @param encoding the encoding
+	 * @param suffixes the suffixes
+	 * @param basename the basename
+	 * @return true, if successful
+	 */
+	public static boolean run(File srcDir, File binDir, File txmDir, String encoding, List<String> suffixes, String basename, String lang)
+	{
+
+		File ptokenizedDir = new File(binDir,"ptokenized");
+		ptokenizedDir.deleteDir();
+		ptokenizedDir.mkdir();
+		File tokenizedDir = new File(binDir,"tokenized");
+		tokenizedDir.deleteDir();
+		tokenizedDir.mkdir();
+
+		List<File> files = null;
+
+		ArrayList<String> milestones = new ArrayList<String>();//the tags who stay milestones
+		milestones.add("tagUsage");
+		milestones.add("pb");
+		milestones.add("lb");
+
+		// Build the list of src files
+		List<File> srcfiles = DeleteDir.scanDirectory(srcDir, true)
+		for (int i = 0; i < srcfiles.size(); i++) {
+			File srcfile = srcfiles.get(i);
+			int point = srcfile.getName().indexOf(".");
+			String filename, fileext;
+			if (point >= 1 && point < srcfile.getName().length()) {
+				filename = srcfile.getName().substring(0, point)
+				fileext = srcfile.getName().substring(point+1, srcfile.getName().length());
+			} else {
+				filename = srcfile.getName()
+				fileext = "";
+			}
+
+			if (!suffixes.contains(fileext)) {
+				srcfiles.remove(i);
+				i--;
+			}
+		}
+		
+		if (srcfiles != null && srcfiles.size() == 0) {
+			println "No 'txt' file to process in directory $srcDir"
+			return false;
+		}
+
+		//CREATE SIMPLE XML FILE
+		HashSet<String> existingfiles = new HashSet<String>();
+		String currentpath = srcDir.getAbsolutePath()
+
+		String encodingAll = null;
+		if (encoding == "??") {
+			encodingAll = new CharsetDetector(srcDir).getEncoding();
+			println "Guessed encoding: $encodingAll"
+		}
+
+		println("Create simple XML files ("+srcfiles.size()+" files)")
+		for (File srcfile : srcfiles) {
+			if (srcfile.length() == 0) {
+				println "Skipping empty file: "+srcfile
+				continue;
+			}
+			print "."
+			File xmlfile;
+			try {
+				int point = srcfile.getName().indexOf(".");
+				String filename;
+				String fileext;
+				if (point >= 1 && point < srcfile.getName().length() ) {
+					filename = srcfile.getName().substring(0, point)
+					fileext = srcfile.getName().substring(point+1, srcfile.getName().length());
+				} else {
+					filename = srcfile.getName()
+					fileext = "";
+				}
+
+				String filepath = srcfile.getParentFile().getAbsolutePath();
+				filepath = filepath.substring(currentpath.length());
+				xmlfile = new File(txmDir, filename+".xml");
+
+				while (existingfiles.contains(xmlfile.getName()))//to not erase a file with the same name
+				{
+					xmlfile = new File(txmDir, "_"+xmlfile.getName());
+				}
+				existingfiles.add(xmlfile.getName());
+
+				//println "ENCODING "+encoding
+				String tmpEncoding = encoding;
+				if (encodingAll != null) {
+					tmpEncoding = encodingAll
+					if (srcfile.length() > CharsetDetector.MINIMALSIZE) {
+						tmpEncoding = new CharsetDetector(srcfile).getEncoding();
+						//println "file encoding: $tmpEncoding"
+					}
+				}
+				def input = new FileInputStream(srcfile)
+				Reader reader = new InputStreamReader(input , tmpEncoding);
+				DetectBOM bomdetector = new DetectBOM(srcfile);
+				for (int ibom = 0 ; ibom < bomdetector.getBOMSize() ; ibom++) input.read()
+
+				int lb = 1;
+				int np = 1;
+				int countlb = 0;
+
+				BufferedOutputStream output = new BufferedOutputStream(new FileOutputStream(xmlfile))
+				XMLOutputFactory factory = XMLOutputFactory.newInstance();
+				XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8");
+
+				writer.writeStartDocument("UTF-8","1.0");
+				writer.writeStartElement ("TEI");
+				writer.writeDefaultNamespace("http://www.tei-c.org/ns/1.0");
+				writer.writeNamespace("txm", "http://textometrie.org/1.0");
+				writer.writeStartElement ("teiHeader");
+				writer.writeStartElement("fileDesc");
+				writer.writeStartElement("titleStmt");
+				writer.writeStartElement("title")
+				writer.writeCharacters(xmlfile.getName())
+				writer.writeEndElement(); // title
+				writer.writeEndElement(); //titleStmt
+				writer.writeStartElement("publicationStmt");
+				writer.writeEndElement(); // publicationStmt
+				writer.writeStartElement("sourceDesc");
+				writer.writeStartElement("p");
+				writer.writeCharacters("Generated by TXM TXT+CSV import module - TXM project - http://textometrie.org");
+				writer.writeEndElement(); // p
+				writer.writeEndElement(); // sourceDesc
+				writer.writeEndElement(); // fileDesc
+				writer.writeStartElement("encodingDesc")
+				writer.writeStartElement("http://textometrie.org/1.0", "applicationDesc")
+				writer.writeEndElement();
+				writer.writeEndElement();
+				writer.writeEndElement (); // teiHeader
+				writer.writeStartElement ("text");
+				writer.writeAttribute("id",filename)
+
+				reader.eachLine{String line ->
+					line = CleanFile.clean(line); // remove ctrl and surrogate chars
+					
+					//writer.writeStartElement("p");
+					//writer.writeAttribute("id",""+np++)
+					line = FixString.normalize(line);
+					writer.writeStartElement("lb")
+					writer.writeAttribute("n",""+lb++)
+					writer.writeEndElement(); // close lb
+					writer.writeCharacters(line.replace("\t"," "))
+					//writer.writeEndElement(); // p
+					writer.writeCharacters("\n"); // XML readability
+					//}
+				}
+
+				writer.writeEndElement();//text
+				writer.writeEndElement();// TEI
+				
+				writer.close();
+				output.close();
+			}
+			catch(Exception e) {
+				println("Failed to process file "+srcfile);
+				xmlfile.delete()
+			}
+		}
+		println ""
+
+		println("Tokenizing "+txmDir.listFiles().length+" files")
+		for (File pfile : txmDir.listFiles()) {
+			print "."
+			File tfile = new File(tokenizedDir, pfile.getName());
+
+			SimpleTokenizerXml tokenizer = new SimpleTokenizerXml(pfile, tfile, lang);
+			tokenizer.setStartTag("text")
+			if (!tokenizer.process()) {
+				println("Failed to tokenize file "+pfile)
+				tfile.delete()
+			}
+		}
+		println ""
+		
+		// Tag sentences
+		List<File> stokenfiles = tokenizedDir.listFiles()
+		File stokenizeDir = new File(tokenizedDir.getParentFile(), "stokenized")
+		stokenizeDir.mkdir();
+		println("Tagging sentences of "+stokenfiles.size()+" files")
+		for (File f : stokenfiles) {
+			print "."
+			Sequence S = new Sequence();
+			Filter F1 = new CutHeader();
+			Filter F7 = new TagSentences();
+			Filter F11 = new FusionHeader();
+			S.add(F1);
+			S.add(F7);
+			S.add(F11);
+			File infile = new File(tokenizedDir, f.getName());
+			File xmlfile = new File(stokenizeDir, f.getName());
+			File headerfile = new File(tokenizedDir, f.getName()+"header.xml");
+
+			S.SetInFileAndOutFile(infile.getPath(), xmlfile.getPath());
+			S.setEncodages("UTF-8","UTF-8");
+			Object[] arguments1 = [headerfile.getAbsolutePath()];
+			F1.SetUsedParam(arguments1);
+			Object[] arguments2 = [headerfile.getAbsolutePath(), F1];
+			F11.SetUsedParam(arguments2);
+			if (!S.proceed()) {
+				println "Failed to tag file: "+f
+			}
+			
+			S.clean();
+			S = F1 = F7 = F11 = null;
+			headerfile.delete();//remove the prepared file to clean
+		}
+		println ""
+
+		//TRANSFORM INTO XML-TEI-TXM
+		println("Building xml-tei-txm ("+stokenizeDir.listFiles().length+" files)")
+		for (File tfile : stokenizeDir.listFiles()) {
+			print  "."
+			File xmlfile = new File(txmDir, tfile.getName());
+
+			def correspType = new HashMap<String,String>()
+			def correspRef = new HashMap<String,String>()
+			def respId = [];
+			def applications = new HashMap<String,HashMap<String,String>>();
+			def taxonomiesUtilisees = new HashMap<String,String[]>();
+			def itemsURI = new HashMap<String,HashMap<String,String>>();
+			def resps = new HashMap<String,String[]>();
+
+			//println "file : $tfile"
+			Xml2Ana builder = new Xml2Ana(tfile);
+			builder.setCorrespondances(correspRef, correspType);
+			builder.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)
+			if (!builder.process(xmlfile)) {
+				println("Failed to process file "+tfile)
+				new File(xmlfile.getParent(),xmlfile.getName()).delete()
+			}
+		}
+		println ""
+		
+		files = txmDir.listFiles()
+		if (files == null || files.size() == 0) return false
+		
+		return true;
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/txt/txtLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/txt/txtLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/txt/txtLoader.groovy	(revision 728)
@@ -0,0 +1,198 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2017-04-11 15:30:35 +0200 (mar., 11 avr. 2017) $
+// $LastChangedRevision: 3426 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.txt;
+
+import org.txm.importer.txt.importer;
+import org.txm.importer.txt.compiler;
+import org.txm.importer.xml.pager;
+import org.txm.objects.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.*;
+import org.txm.utils.i18n.*;
+import org.txm.metadatas.*;
+import org.txm.utils.FileCopy;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+def MONITOR;
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "TXM/clipboard/clipboard2/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:/Program Files/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH, new File("C:/Program Files/TreeTagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH, new File("C:/Users/mdecorde/TXM/treetagger"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(userDir, "TXM"));
+	}
+}
+if (params == null) { println "No parameters file. Aborting"; return;}
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir, "txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+//get metadata values from CSV
+Metadatas metadatas; // text metadata
+File allmetadatasfile = new File(srcDir, "metadata.csv");
+
+if (allmetadatasfile.exists()) {
+	println "Trying to read metadata from: "+allmetadatasfile
+	File copy = new File(binDir, "metadata.csv")
+	if (!FileCopy.copy(allmetadatasfile, copy)) {
+		println "Error: could not create a copy of metadata file "+allmetadatasfile.getAbsoluteFile();
+		return;
+	}
+	metadatas = new Metadatas(copy, Toolbox.getParam(Toolbox.METADATA_ENCODING), Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR), Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
+} else {
+	println "No metadata file: "+allmetadatasfile
+}
+
+def suffixes = ["txt", "TXT"]
+println "-- IMPORTER - Reading source files with extension "+suffixes
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "IMPORTER - Reading source files with extension "+suffixes)
+if (!new importer().run(srcDir, binDir, txmDir,encoding, suffixes, basename, lang)) {
+	println "Import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "INJECTING METADATA - from csv file: "+allmetadatasfile)
+if (metadatas != null) {
+	println "-- INJECTING METADATA - from csv file: "+allmetadatasfile
+	println("Injecting metadata: "+metadatas.getHeadersList()+" in texts of directory "+txmDir)
+	for (File infile : txmDir.listFiles()) {
+		print "."
+		File outfile = File.createTempFile("temp", ".xml", infile.getParentFile());
+
+		if (!metadatas.injectMetadatasInXml(infile, outfile, "text", null)) {
+			outfile.delete();
+		} else {
+			if (!(infile.delete() && outfile.renameTo(infile))) println "Warning can't rename file "+outfile+" to "+infile
+			if (!infile.exists()) {
+				println "Error: could not replace $infile by $outfile"
+				return false;
+			}
+		}
+	}
+	println ""
+}
+
+println "-- ANNOTATE - Running NLP tools"
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE - Running NLP tools")
+boolean annotationSuccess = true;
+if (annotate && !new Annotate().run(binDir, txmDir, model+".par")) {
+	annotationSuccess = false;
+}
+
+println "-- COMPILING - Building Search Engine indexes"
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "COMPILING - Building Search Engine indexes")
+def c = new compiler(null, "", corpusname, "default");
+//c.setCwbPath(userDir+"/TXM/cwb/bin/")// for developers
+if (metadatas != null)
+	c.setMetadataAttributes(metadatas.getSattributes())
+c.setLang(lang);
+c.setAnnotationSuccess(annotationSuccess)
+if (debug) c.setDebug();
+if (!c.run(binDir, txmDir, corpusname)) {
+	println "Import process stopped";
+	return;
+}
+//println "basename :"+basename;
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	println "-- EDITION - Building edition"
+	if (MONITOR != null) MONITOR.worked(20, "EDITION - Building edition")
+	
+	File outdir = new File(binDir, "HTML/$corpusname/default/");
+	outdir.mkdirs();
+	List<File> filelist = txmDir.listFiles();
+	Collections.sort(filelist);
+	def second = 0
+
+
+	for (File srcfile : filelist) {
+		print "."
+		String txtname = srcfile.getName();
+		int i = txtname.lastIndexOf(".");
+		if (i > 0) txtname = txtname.substring(0, i);
+
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+		Element text = params.addText(params.corpora.get(corpusname), txtname, srcfile);
+
+		def ed = new pager(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, null);
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/StaxParser.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/StaxParser.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/StaxParser.groovy	(revision 728)
@@ -0,0 +1,166 @@
+package org.txm.importer
+
+import groovy.transform.CompileStatic
+import java.io.File;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+import java.io.File;
+import java.net.URL;
+import javax.xml.stream.*;
+import org.txm.importer.filters.*;
+import org.txm.importer.graal.PersonalNamespaceContext;
+
+@CompileStatic
+class StaxParser {
+
+	protected URL inputurl;
+	protected InputStream inputData;
+	protected XMLInputFactory factory;
+	protected XMLStreamReader parser;
+	
+	
+	protected static PersonalNamespaceContext Nscontext = new PersonalNamespaceContext();
+	
+	protected String localname;
+	
+	public StaxParser(File infile)
+	{
+		this(infile.toURI().toURL());
+	}
+	
+	public StaxParser(URL inputurl)
+	{
+		this.inputurl = inputurl;
+		inputData = inputurl.openStream();
+		factory = XMLInputFactory.newInstance();
+		
+		parser = factory.createXMLStreamReader(inputData);
+	}
+	
+	protected void before()
+	{
+		
+	}
+	
+	protected void after()
+	{
+		factory = null;
+		if (parser !=null) parser.close();
+		parser = null;
+	}
+	
+	protected void closeForError() {
+		parser.close();
+	}
+
+	public boolean process()
+	{
+		try {
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+				switch (event) {
+					case XMLStreamConstants.NAMESPACE:
+						processNamespace();
+						break;
+					case XMLStreamConstants.START_ELEMENT:
+						localname = parser.getLocalName();
+						processStartElement();
+						break;		
+					case XMLStreamConstants.CHARACTERS:
+						processCharacters();
+						break;
+					case XMLStreamConstants.PROCESSING_INSTRUCTION:
+						processProcessingInstruction();
+						break;
+					case XMLStreamConstants.DTD:
+						processDTD();
+						break;
+					case XMLStreamConstants.CDATA:
+						processCDATA();
+						break;
+					case XMLStreamConstants.COMMENT:
+						processComment();
+						break;
+					case XMLStreamConstants.END_ELEMENT:
+						localname = parser.getLocalName();
+						processEndElement();	
+						break;
+					case XMLStreamConstants.END_DOCUMENT:
+						processEndDocument();
+						break;
+					case XMLStreamConstants.ENTITY_REFERENCE:
+						processEntityReference();
+						break;
+				}
+			}
+		} catch(Exception e) {
+			println("Unexpected error while parsing file "+inputurl+" : "+e);
+			println("Location line: "+parser.getLocation().getLineNumber()+" character: "+parser.getLocation().getColumnNumber());
+			org.txm.utils.logger.Log.printStackTrace(e);
+			parser.close();
+			return false;
+		}
+		
+		after(); // if you need to do something before closing the parser();
+		return true;
+	}
+
+	public def getLocation() {
+		if (parser != null)
+			return "Line: "+parser.getLocation().getLineNumber()+" Col: "+parser.getLocation().	getColumnNumber()
+		return null;
+	}
+	
+	protected void processNamespace() {
+	}
+	
+	protected void processStartElement()
+	{
+	}
+
+	protected void processCharacters()
+	{
+	}
+	
+	protected void processProcessingInstruction()
+	{
+	}
+	
+	protected void processDTD()
+	{
+	}
+	
+	protected void processCDATA()
+	{
+	}
+	
+	protected void processComment()
+	{
+	}
+	
+	protected void processEndElement()
+	{
+	}
+	
+	protected void processEndDocument() {
+	}
+	
+	protected void processEntityReference() {
+	}
+	
+	public static void main(String[] args)
+	{
+		File input = new File("/home/mdecorde/xml/xiinclude/master.xml")
+		File output = new File("/home/mdecorde/xml/xiinclude/merged.xml")
+		if (!(input.exists() && input.canRead())) {
+			println "cannot found $input";
+			return;
+		}
+		def builder = new StaxParser(input.toURI().toURL());
+		if (builder.process()) {
+			println "success ? "+ValidateXml.test(output);
+		} else {
+			println "failure !"
+		}
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/MileStoneProjection.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/MileStoneProjection.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/MileStoneProjection.groovy	(revision 728)
@@ -0,0 +1,111 @@
+package org.txm.importer
+
+import java.io.File;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+import java.io.File;
+import java.net.URL;
+import javax.xml.stream.*;
+import org.txm.importer.filters.*;
+import org.txm.importer.graal.PersonalNamespaceContext;
+
+/**
+ * add 2 attributes per element to encode the distance to the previous milestone and next milestone
+ * TODO: only the first attribute is implemented
+ * 
+ * @author mdecorde
+ *
+ */
+class MileStoneProjection extends StaxIdentityParser {
+	String wordTag
+	String mileStoneTag
+	String startTag
+	boolean start = false
+
+	int mileStoneDistance = 0
+
+	String mileStoneID = ""
+	def milestonesLength = []
+	int milestonesCounter = 0
+	boolean secondPass = false
+	
+	String msIdAttributeName
+	String msStartAttributeName
+	String msEndAttributeName
+
+	public MileStoneProjection(File inputFile, String startTag, String wordTag, String mileStoneTag) {
+		super(inputFile)
+
+		this.wordTag = wordTag
+		this.mileStoneTag = mileStoneTag
+		mileStoneID = mileStoneTag+"_0"
+		this.startTag = startTag
+		this.start = false;
+		
+		msIdAttributeName = mileStoneTag+"id";
+		msStartAttributeName = mileStoneTag+"start";
+		msEndAttributeName = mileStoneTag+"end";
+
+		fetchMilestoneLengths();
+		start = false // reset
+	}
+
+	public void fetchMilestoneLengths() {
+		def inputData = inputurl.openStream();
+		def factory = XMLInputFactory.newInstance();
+		def parser = factory.createXMLStreamReader(inputData);
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName()
+					if (start && localname == mileStoneTag) {
+						milestonesLength << mileStoneDistance;
+						mileStoneDistance = 0
+						milestonesCounter++;
+					} else if (start && localname == wordTag) {
+						mileStoneDistance++
+					} else if (localname == startTag) {
+						start = true
+					}
+					break;
+			}
+		}
+		milestonesLength[milestonesCounter] = mileStoneDistance;
+		parser.close()
+		milestonesCounter = 0;
+	}
+
+
+	
+	public void processStartElement() {
+		super.processStartElement();
+
+		if (start && localname == mileStoneTag) {
+			mileStoneDistance = 0
+			mileStoneID = parser.getAttributeValue(null, "id")
+			if (mileStoneID == null) mileStoneID = parser.getAttributeValue("xml", "id");
+			if (mileStoneID == null) mileStoneID = "0";
+			
+			milestonesCounter++;
+		} else if (start && localname == wordTag) {
+			// println "end of $milestonesCounter len="+milestonesLength[milestonesCounter]+" dist="+mileStoneDistance
+			writer.writeAttribute(msEndAttributeName, Integer.toString((milestonesLength[milestonesCounter] - mileStoneDistance - 1)))
+			writer.writeAttribute(msStartAttributeName, Integer.toString(mileStoneDistance))
+			writer.writeAttribute(msIdAttributeName, mileStoneID)
+
+			mileStoneDistance++
+		} else if (localname == startTag) {
+			start = true
+		}
+	}
+
+	public static void main(String[] args) {
+		File inputFile = new File("/home/mdecorde/TXM/corpora/BVHEPISTEMON2016/tokenized/1538_MarotAdole.xml")
+		File outputFile = new File("/home/mdecorde/TEMP/tmp.xml")
+
+		MileStoneProjection msp = new MileStoneProjection(inputFile, "body", "w", "lb");
+		println "Sucess: "+msp.process(outputFile)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperbase/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperbase/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperbase/compiler.groovy	(revision 728)
@@ -0,0 +1,316 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2016-05-26 17:42:36 +0200 (jeu., 26 mai 2016) $
+// $LastChangedRevision: 3219 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.hyperbase;
+
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+
+import javax.xml.stream.*;
+import java.net.URL;
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class compiler.
+ */
+class compiler 
+{
+	
+	/** The debug. */
+	private boolean debug= false;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The dir. */
+	private def dir;
+	
+	/** The output. */
+	private def output;
+	
+	/** The url. */
+	private def url;
+	
+	/** The anahash. */
+	private HashMap<String,String> anahash = new HashMap<String,String>() ;
+	
+	/** The text. */
+	String text="";
+	
+	/** The base. */
+	String base="";
+	
+	/** The project. */
+	String project="";
+	
+	/** The text attributes. */
+	String[] textAttributes = null;
+	
+	/** The cwb loc. */
+	String cwbLoc;
+	
+	/** The lang. */
+	private String lang ="fr";
+	
+	/**
+	 * initialize.
+	 *
+	 */
+	public compiler(){}
+	
+	/**
+	 * Instantiates a new compiler.
+	 *
+	 * @param url the url
+	 * @param text the text
+	 * @param base the base
+	 * @param project the project
+	 */
+	public compiler(URL url,String text,String base, String project)
+	{
+		this.text = text
+		this.base = base;
+		this.project = project;
+		this.textAttributes = textAttributes;
+		try {
+			this.url = url;
+			inputData = url.openStream();
+			
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.err.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * set the language of the corpus.
+	 *
+	 * @param lang the lang
+	 * @return the java.lang. object
+	 */
+	public setLang(String lang)
+	{
+		this.lang = lang;
+	}
+	
+	/** The annotation success. */
+	boolean annotationSuccess = false;
+	
+	/**
+	 * Sets the annotation success.
+	 *
+	 * @param value the value
+	 * @return the java.lang. object
+	 */
+	public setAnnotationSuccess(boolean value)
+	{
+		this.annotationSuccess = value
+	}
+	
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the new cwb path
+	 */
+	public void setCwbPath(String path)
+	{
+		if(!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path;
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param f the f
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File f){
+		try {
+			output = new OutputStreamWriter(new FileOutputStream(f,f.exists()) , "UTF-8");
+			return true;
+		} catch (Exception e) {
+			System.err.println(e);
+			
+			return false;
+		}
+	}
+	
+	/**
+	 * Go to text.
+	 */
+	private void GoToText()
+	{
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			if(event == XMLStreamConstants.END_ELEMENT)
+				if(parser.getLocalName().equals("teiHeader"))
+					return;
+		}
+	}
+	
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param basename the basename
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, File txmDir, String corpusname) 
+	{
+		String rootDir = binDir.getAbsolutePath();
+		
+		if(cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+		
+		if(!new File(cwbLoc).exists())
+		{
+			println ("CWB path error: "+cwbLoc)
+			return false;
+		}
+		if(!binDir.exists())
+		{
+			println ("binary directory does not exists: "+rootDir)
+			return false;
+		}
+		File wtcFile = new File(binDir,"wtc/"+corpusname+".wtc");
+		new File(binDir,"wtc").deleteDir();
+		new File(binDir,"wtc").mkdir();
+		new File(binDir,"data").deleteDir();
+		new File(binDir,"data").mkdir();
+		new File(binDir,"registry").mkdir();
+		
+		//start corpus
+		if (createOutput(wtcFile)) {
+			output.write("<txmcorpus lang=\""+lang+"\">\n");
+			output.close();
+		}
+		
+		String textid="";
+		int counttext =0;
+		List<File> files = txmDir.listFiles();
+		Collections.sort(files);
+		//1- Transform into WTC file
+		XMLTXM2WTC wtcbuilder = null;
+		println("Compiling "+files.size()+" files")
+		for (File f : files) {
+			print "."
+			counttext++;
+			if (!f.exists()) {
+				println("file "+f+ " does not exists")	
+			}
+			else {	
+				wtcbuilder = new XMLTXM2WTC(f.toURI().toURL());
+				String txtname = f.getName().substring(0,f.getName().length()-4);
+				wtcbuilder.setTextInfo(txtname, corpusname, "project");
+
+				wtcbuilder.setBalisesToKeep(["text","p","s"]);
+				wtcbuilder.setSendToPAttributes(["s":["n"]]);
+				wtcbuilder.setLang(lang);
+				if (!wtcbuilder.transformFile(wtcFile)) {
+					println("Failed to compile "+f)
+				}
+			}
+		}
+		println ""
+		
+		//end corpus
+		if (createOutput(wtcFile)) {
+			output.write("</txmcorpus>\n");
+			output.close();
+		}
+		
+		if (wtcbuilder == null) return false;
+		
+		//2- Import into CWB
+		def outDir =rootDir;
+		
+		CwbEncode cwbEn = new CwbEncode();
+		cwbEn.setDebug(debug);
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		cwbMa.setDebug(debug);
+		
+		List<String> pAttributesList = wtcbuilder.getpAttributs();
+		List<String> sAttributesList = wtcbuilder.getsAttributs();
+		println "word properties : "+pAttributesList
+		println "structures : "+sAttributesList
+		String[] pAttributes = pAttributesList.toArray(new String[pAttributesList.size()])
+		String[] sAttributes = sAttributesList.toArray(new String[sAttributesList.size()])
+		
+		try {
+			String regPath = outDir + "/registry/"+corpusname.toLowerCase();
+			cwbEn.run(new File(cwbLoc,"cwb-encode").getAbsolutePath(), outDir + "/data/$corpusname", outDir + "/wtc/"+corpusname+".wtc", regPath,pAttributes, sAttributes);
+			if (!new File(regPath).exists()) {
+				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			cwbMa.run(new File(cwbLoc,"cwb-makeall").getAbsolutePath(), corpusname, outDir + "/registry");
+			
+		} catch (Exception ex) {System.out.println(ex); return false;}
+		
+		return true;
+	}
+	
+	/**
+	 * Sets the debug.
+	 */
+	public void setDebug()
+	{
+		this.debug = true;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("~/xml/geo");
+		def c = new compiler();
+		c.setDebug();
+		c.setCwbPath("~/TXM/cwb/bin");
+		c.run(dir,"geo");
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperbase/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperbase/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperbase/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Hyperbase import module</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperbase/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperbase/importer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperbase/importer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperbase/importer.groovy	(revision 728)
@@ -0,0 +1,187 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2015-06-03 15:04:53 +0200 (mer., 03 juin 2015) $
+// $LastChangedRevision: 2984 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.hyperbase
+
+//import filters.TabulatedToXml.*;
+import org.txm.importer.*;
+import org.txm.importer.filters.*;
+import org.txm.scripts.*;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+//import org.txm.utils.treetagger.TreeTagger;
+import javax.xml.stream.*;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintStream;
+import java.net.URL;
+
+import filters.CutHeader.*;
+import filters.Tokeniser.*;
+import filters.FusionHeader.*;
+import filters.TagSentences.*;
+
+import org.txm.*;
+import org.txm.utils.*;
+// TODO: Auto-generated Javadoc
+
+/**
+ * The Class importer.
+ */
+class importer {
+
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param encoding the encoding
+	 * @param basename the basename
+	 * @return true, if successful
+	 */
+	public static boolean run(File srcDir, File binDir, File txmDir, String encoding, String basename, String lang)
+	{
+		String rootDir = srcDir.getAbsolutePath()+"/"
+		//cleaning
+
+		new File(binDir,"ptokenized").deleteDir();
+		new File(binDir,"ptokenized").mkdir();
+		new File(binDir,"tokenized").deleteDir();
+		new File(binDir,"tokenized").mkdir();
+		new File(binDir,"split").deleteDir();
+		new File(binDir,"split").mkdir();
+
+		ArrayList<String> milestones = new ArrayList<String>();//the tags who you want them to stay milestones
+		milestones.add("tagUsage");
+		milestones.add("pb");
+		milestones.add("lb");
+
+		//build xml files
+		if (srcDir.listFiles() == null || srcDir.listFiles().size() == 0 ) {
+			println "No corpus file in: "+srcDir;
+			return false;
+		}
+		File corpusfile = null;
+		for (File f : srcDir.listFiles()) {
+			if (!f.isHidden() && f.canRead() && f.isFile() && f.getName() != "import.xml") {
+				corpusfile = f;
+				break;
+			}
+		}
+
+		System.out.println("Corpus file: "+corpusfile);
+		if (!new Hyperbase2Xml().run(corpusfile, new File(binDir, "split"), encoding)) {
+			println("Failed to split the corpus file into text: "+corpusfile);
+			return false;
+		}
+
+		//TOKENIZE ALL FILES
+		List<File> srcfiles = new File(binDir, "split").listFiles();
+		println("Tokenizing "+srcfiles.size()+" files");
+		for (File pfile : srcfiles) {
+			print "."
+			String filename = pfile.getName().substring(0, pfile.getName().length()-4)
+			File tfile = new File(binDir, "tokenized/"+filename+".xml");
+
+			SimpleTokenizerXml tokenizer = new SimpleTokenizerXml(pfile, tfile, lang);
+			if (!tokenizer.process()) {
+				println("Failed to tokenize file: "+pfile);
+				tfile.delete();
+			}
+		}
+		println ""
+
+		//Tag sentences
+		List<File> stokenfiles = new File(binDir,"tokenized").listFiles()
+		new File(binDir,"stokenized").mkdir();
+		println("Tag sentences of "+stokenfiles.size()+" files")
+		for (File f : stokenfiles) {
+			print "."
+			try {
+				Sequence S = new Sequence();
+				Filter F1 = new CutHeader();
+				Filter F7 = new TagSentences();
+				Filter F11 = new FusionHeader();
+				S.add(F1);
+				S.add(F7);
+				S.add(F11);
+				File infile = new File(binDir, "tokenized/"+f.getName());
+				File xmlfile = new File(binDir, "stokenized/"+f.getName());
+				File headerfile = new File(binDir, "tokenized/"+f.getName()+"header.xml");
+
+				S.SetInFileAndOutFile(infile.getPath(), xmlfile.getPath());
+				S.setEncodages("UTF-8","UTF-8");
+				Object[] arguments1 = [headerfile.getAbsolutePath()];
+				F1.SetUsedParam(arguments1);
+				Object[] arguments2 = [headerfile.getAbsolutePath(),F1];
+				F11.SetUsedParam(arguments2);
+				S.proceed();
+				S.clean();
+				headerfile.delete();//remove the prepared file to clean
+			} catch (Exception e) {println "Failed to sentence file "+f;println e;}
+		}
+		println ""
+
+		//TRANSFORM INTO XML-TEI-TXM
+		List<File> tokenfiles = new File(binDir, "stokenized").listFiles()
+		println("Building xml-txm ("+tokenfiles.size()+" files)")
+		for (File f : tokenfiles) {
+			print "."
+			File file = f;
+			String txmfile = f.getName();
+
+			def correspType = new HashMap<String,String>()
+			def correspRef = new HashMap<String,String>()
+			//il faut lister les id de tous les respStmt
+			def respId = [];
+			//fait la correspondance entre le respId et le rapport d'execution de l'outil
+			def applications = new HashMap<String,HashMap<String,String>>();
+			//fait la correspondance entre le respId et les attributs type de la propriÃ©tÃ© ana du w txm
+			//pour construire les ref vers les taxonomies
+			def taxonomiesUtilisees = new HashMap<String,String[]>();
+			//associe un id d'item avec sa description et son URI
+			def itemsURI = new HashMap<String,HashMap<String,String>>();
+			//informations de respStmt
+			//resps (respId <voir ci-dessus>, [description, person, date])
+			def resps = new HashMap<String,String[]>();
+			//lance le traitement
+			def builder = new Xml2Ana(file);
+			builder.setCorrespondances(correspRef, correspType);
+			builder.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)
+			//builder.setAddTEIHeader();
+			if (!builder.process(new File(txmDir,txmfile))) {
+				println("Failed to process "+f);
+				new File(txmDir, txmfile).delete();
+			}
+		}
+		println ""
+		return true;
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperbase/hyperbaseLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperbase/hyperbaseLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperbase/hyperbaseLoader.groovy	(revision 728)
@@ -0,0 +1,161 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2015-06-03 15:04:53 +0200 (mer., 03 juin 2015) $
+// $LastChangedRevision: 2984 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.hyperbase;
+
+
+import org.txm.importer.hyperbase.importer;
+import org.txm.importer.hyperbase.compiler;
+import org.txm.importer.xml.pager;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/TESTS/hyperbase/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- IMPORTER - Reading source files"
+
+if (!(new importer().run(srcDir, binDir, txmDir, encoding, basename, lang))) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools"
+boolean annotationSuccess = false;
+if ((new Annotate().run(binDir, txmDir, model+".par"))) {
+	annotationSuccess = true
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+c.setAnnotationSuccess(annotationSuccess);
+if (debug) c.setDebug();
+c.setLang(lang);
+if (!c.run(binDir, txmDir, corpusname)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	println "-- EDITION - Building edition"
+	if (MONITOR != null) MONITOR.worked(20, "EDITION")
+	
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+	List<File> filelist = txmDir.listFiles();
+	Collections.sort(filelist);
+	def second = 0
+
+	println "Paginating texts: "
+
+	for (File srcfile : filelist) {
+		print "."
+		String txtname = srcfile.getName();
+		int i = txtname.lastIndexOf(".");
+		if(i > 0) txtname = txtname.substring(0, i);
+
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+		Element text = params.addText(params.corpora.get(corpusname), txtname, srcfile);
+
+		def ed = new pager(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, "pb");
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Importer.java
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Importer.java	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Importer.java	(revision 728)
@@ -0,0 +1,24 @@
+package org.txm.importer.xtz;
+
+import java.io.File;
+
+/**
+ * Takes any form of source files
+ * 
+ * After this step, the XML-TXM files are created.
+ * 
+ * they are validated before continuing 
+ * @author mdecorde
+ *
+ */
+public abstract class Importer extends ImportStep {
+
+	public Importer(ImportModule module) {
+		super(module);
+		inputDirectory = module.getSourceDirectory();
+		outputDirectory = new File(module.getBinaryDirectory(), "txm/"+module.getCorpusName());
+		outputDirectory.mkdirs();
+	}
+
+	public abstract void checkFiles();
+}

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Importer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZFacsPagerStep.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZFacsPagerStep.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZFacsPagerStep.groovy	(revision 728)
@@ -0,0 +1,351 @@
+package org.txm.importer.xtz
+
+import org.txm.importer.*
+import org.xml.sax.Attributes
+import org.txm.importer.filters.*
+import java.util.ArrayList
+import javax.xml.parsers.*
+import javax.xml.stream.*
+import java.net.URL
+import org.xml.sax.InputSource
+import org.xml.sax.helpers.DefaultHandler
+import java.io.FileFilter
+
+class XTZFacsPagerStep extends Step {
+
+	private def url
+	private def inputData
+	private def factory
+	private XMLStreamReader parser
+	OutputStreamWriter writer
+	StaxStackWriter pagedWriter = null
+
+	File editionDir
+	File imageDirectory // contains all the images sub-diretories
+	int iImages
+	File textImagesDirectory // contains the images for the txtname
+	File xmlFile
+	File htmlFile
+
+	def pages = []
+	def imageAttributes = [:];
+	
+	def tag, attribute, txtname, corpusname
+	boolean firstWord
+	boolean cutBefore = true;
+	String wtag;
+	boolean debug = false;
+
+	public XTZFacsPagerStep(File xmlFile, File editionDir, File imageDirectory, String txtname, String corpusname, String tag, String attribute, String wtag, boolean debug) {
+		inputData = xmlFile.toURI().toURL().openStream()
+		factory = XMLInputFactory.newInstance()
+		parser = factory.createXMLStreamReader(inputData)
+
+		this.xmlFile = xmlFile
+		this.editionDir = editionDir
+		editionDir.mkdirs()
+		this.imageDirectory = imageDirectory
+		this.tag = tag
+		this.attribute = attribute
+		this.txtname = txtname
+		this.corpusname= corpusname
+		this.wtag= wtag;
+		this.debug = debug
+
+		imageAttributes = ["src":"", 
+			"id":"txm_image", 
+			"alt":"Le fac-similÃ© de cette page n'est pas accessible", 
+			//"style":"display:block;width:100%;", 
+			"onLoad":"viewer.toolbarImages='images/icons';viewer.onload=viewer.toolbar;new viewer({image: this, frame: ['100%','100%']});"
+			]
+		
+		if (imageDirectory != null)
+			textImagesDirectory = new File(imageDirectory, txtname)
+		iImages = 0;
+	}
+
+	int n = 1;
+	private boolean createNextOutput() {
+		try {
+			def tags = closeMultiWriter();
+			for (int i = 0 ; i < tags.size() ; i++) {
+				String tag = tags[i]
+				if ("div" != tag) {
+					tags.remove(i--)
+				} else {
+					tags.remove(i--) // remove first "div"
+					break; // remove elements until first "div" tag
+				}
+			}
+
+			if (wordid != null) {//wordid = "w_0";
+				//println " add page $n $wordid, page=$pages"
+				pages << [htmlFile, wordid] // store the previous page
+				n++
+			}
+
+			// Page suivante
+			htmlFile = new File(editionDir, "${txtname}_${n}.html")
+
+			firstWord = true
+			//println "SET FIRST WORD=true"
+			pagedWriter = new StaxStackWriter(htmlFile, "UTF-8");
+			if (debug) println "Create file $htmlFile"
+			pagedWriter.writeStartDocument("UTF-8", "1.0")
+			pagedWriter.writeStartElement("html");
+			pagedWriter.writeStartElement("head");
+			pagedWriter.writeStartElement("title")
+			pagedWriter.writeCharacters(corpusname+" Edition - Page "+n)
+			pagedWriter.writeEndElement(); // </title>
+			pagedWriter.writeStartElement("meta", ["http-equiv":"Content-Type", "content":"text/html","charset":"UTF-8"]);
+			pagedWriter.writeEndElement()
+			pagedWriter.writeStartElement("link", ["rel":"stylesheet", "media":"all", "type":"text/css","href":"txm.css"]);
+			pagedWriter.writeEndElement()
+			pagedWriter.writeStartElement("link", ["rel":"stylesheet", "media":"all", "type":"text/css","href":"${corpusname}.css"]);
+			pagedWriter.writeEndElement()
+			pagedWriter.writeStartElement("script", ["type":"text/javascript", "src":"js/viewer/Simple_Viewer_beta_1.1-min.js"]);
+			pagedWriter.writeEndElement()
+			pagedWriter.writeStartElement("script", ["type":"text/javascript", "src":"js/viewer/toolbar-ext.js"]);
+			pagedWriter.writeEndElement()
+			pagedWriter.writeStartElement("link", ["rel":"stylesheet", "media":"all", "type":"text/css","href":"js/viewer/toolbar-ext.css"]);
+			pagedWriter.writeEndElement()
+			pagedWriter.writeEndElement() // </head>
+			pagedWriter.writeStartElement("body") //<body>
+			pagedWriter.writeStartElement("div", ["id":"txmeditionpage"]);
+			pagedWriter.writeStartElements(tags);
+
+			wordid = "${wtag}_0"; // default value if no word is found
+			return true;
+		} catch (Exception e) {
+			System.out.println("Error while creating HTML file: "+e);
+			return false;
+		}
+	}
+
+	private def closeMultiWriter()
+	{
+		if (pagedWriter != null) {
+			def tags = pagedWriter.getTagStack().clone();
+
+			if (firstWord) { // there was no words
+				pagedWriter.writeCharacters("");
+				pagedWriter.write("<span id=\"${wtag}_0\"/>");
+			}
+			pagedWriter.writeEndElements();
+			pagedWriter.close();
+			return tags;
+		} else {
+			return [];
+		}
+	}
+
+	private writeImg(String src) {
+		
+		
+		if (src == null || src.length() == 0) {
+			pagedWriter.writeStartElement("p", ["class":"no-img"]);
+			pagedWriter.writeCharacters("Cette page n'est pas disponible en mode fac-similÃ©.");
+			pagedWriter.writeEndElement(); // </div>
+		} else {
+			imageAttributes["src"] = src
+			pagedWriter.writeEmptyElement("img", imageAttributes);
+		}
+		
+	}
+
+	/**
+	 * Process the XML-TXM file. if imageDirectory is not null, then it will be use to fetch the images, if not then the pb@facs attribute contains the image path
+	 */
+	public boolean process() {
+		if (textImagesDirectory != null) {
+			return processWithImages();
+		} else {
+			return processWithoutImages();
+		}
+	}
+	
+	String wordid = null;
+	def imagesFiles;
+	public boolean processWithImages() {
+
+		if (!textImagesDirectory.exists()) {
+			println ("No images directory found: "+textImagesDirectory)
+			return false;
+		}
+
+		// Scan textImagesDirectory for images
+		imagesFiles = textImagesDirectory.listFiles(new FileFilter() {
+					public boolean accept(File f) {
+						return !f.isHidden() && !f.isDirectory()
+					}
+				});
+		if (imagesFiles == null || imagesFiles.size() == 0) {
+			println ("No facs images found in "+textImagesDirectory)
+			return false;
+		}
+		imagesFiles.sort(); // sort by name
+		iImages = 0;
+		//println "For text "+xmlFile.getName()
+		//println " using images : $imagesFiles"
+
+		// parse XML-TXM files
+		boolean start = false
+		String localname
+
+		createNextOutput(); // empty page
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch (localname) {
+						case "text":
+							start = true
+							printStartPage();
+							break;
+							break;
+						case wtag:
+							if (firstWord) {
+								wordid = parser.getAttributeValue(null, "id");
+								//println "found word: $wordid"
+								firstWord = false;
+							}
+							break;
+						case tag:
+							if (debug) println "** TAG $tag $attribute : "+parser.getAttributeValue(null, attribute);
+
+							if (iImages >= imagesFiles.size() ) {
+								println " ERROR Cound not find the $iImages th image for file $xmlFile at location "+parser.getLocation().getLineNumber()
+							} else {
+								String imgPath = "res/images/$corpusname/${editionDir.getName()}/$txtname/"+imagesFiles[iImages].getName()
+								if (imgPath == null) {
+									println " ERROR in $xmlFile no value found for tag=$tag attribute=@$attribute iImages=@iImages at location "+parser.getLocation().getLineNumber()
+								} else {
+									if (cutBefore) {
+										if (debug) println " cut before"
+										createNextOutput()
+										if (debug) println " write img $imgPath"
+										writeImg(imgPath)
+									} else {
+										if (debug) println " write img $imgPath"
+										writeImg(imgPath)
+										if (debug) println " cut after"
+										createNextOutput()
+									}
+								}
+							}
+							iImages++ // next image file
+							break;
+					}
+					break;
+			}
+		}
+		closeMultiWriter()
+		pages << [htmlFile, wordid] // add the last page (no pb encountered
+
+		return pages.size() > 1
+	}
+
+	public boolean processWithoutImages() {
+
+		// parse XML-TXM files
+		boolean start = false
+		String localname
+
+		createNextOutput(); // empty page
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch (localname) {
+						case "text":
+							start = true
+							printStartPage()
+							break;
+							
+						case wtag:
+							if (firstWord) {
+								wordid = parser.getAttributeValue(null, "id");
+								//println "found word: $wordid"
+								firstWord = false;
+							}
+							break;
+							
+						case tag:
+							String url = "" // get image URL 
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+								if (parser.getAttributeLocalName(i).equals(attribute)) {
+									url = parser.getAttributeValue(i);
+									continue;
+								}
+							}
+							if (debug) println "** TAG $tag $attribute : $url"
+
+							if (cutBefore) {
+								if (debug) println " cut before"
+								createNextOutput()
+								if (debug) println " write img $url"
+								writeImg(url)
+							} else {
+								if (debug) println " write img $url"
+								writeImg(url)
+								if (debug) println " cut after"
+								url()
+							}
+
+							break;
+					}
+					break;
+			}
+		}
+		closeMultiWriter()
+		pages << [htmlFile, wordid] // add the last page (no pb encountered
+
+		return pages.size() > 1
+	}
+
+	public void printStartPage() {
+		LinkedHashMap attributes = new LinkedHashMap();
+		for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+			attributes[parser.getAttributeLocalName(i)] = parser.getAttributeValue(i).toString()
+		}
+		pagedWriter.write("\n");
+		pagedWriter.writeStartElement("p")
+		if (attributes.containsKey("id")) {
+			pagedWriter.writeElement("h3", attributes["id"])
+		}
+		
+		pagedWriter.writeStartElement("table");
+		for (String k : attributes.keySet()) {
+			if (k == "id") continue;
+			pagedWriter.writeStartElement("tr");
+			pagedWriter.writeElement("td", k);
+			pagedWriter.writeElement("td", attributes[k]);
+			pagedWriter.writeEndElement();
+		}
+		pagedWriter.writeEndElement() // table
+		pagedWriter.writeEndElement() // p
+		
+		pagedWriter.writeCharacters("");
+	}
+	
+	public def getPageFiles() {
+		return pages
+	}
+	
+	public static void main(String[] args) {
+		File txmFile = new File("/home/mdecorde/TXM/corpora/BVHEPISTEMON2016/txm/BVHEPISTEMON2016/1546_RabelaisTL.xml")
+		String txtname = "1532_RabelaisPrnstctn"
+		String corpusname = "BVH"
+		File newEditionDirectory = new File("/tmp/xtzpagertest/")
+		newEditionDirectory.deleteDir()
+		newEditionDirectory.mkdir()
+		File imageDirectory = null;
+		
+		def ed = new XTZFacsPagerStep(txmFile, newEditionDirectory, imageDirectory, txtname, corpusname, "pb", "facs", "w", true);
+		if (!ed.process()) {
+			println "Fail to build edition for text: $txmFile"
+		}
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/ImportKeys.java
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/ImportKeys.java	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/ImportKeys.java	(revision 728)
@@ -0,0 +1,16 @@
+package org.txm.importer.xtz;
+
+public class ImportKeys {
+
+	public static final String CLEAN = "clean.directories";
+	public static final String TTMODEL = "annotate.model";
+	public static final String TTANNOTATE = "annotate.run";
+	public static final String LANG = "lang";
+	
+	public static final String MULTITHREAD = "multithread";
+	public static final String DEBUG = "debug";
+	public static final String UPDATECORPUS = "corpus.update";
+	
+	public static final String NORMALISEANAVALUES = "normalize.ana.values";
+	public static final String NORMALISEATTRIBUTEVALUES = "normalize.attribute.values";
+}
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/ImportKeys.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/ImportStep.java
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/ImportStep.java	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/ImportStep.java	(revision 728)
@@ -0,0 +1,54 @@
+package org.txm.importer.xtz;
+
+import java.io.File;
+import java.util.HashMap;
+
+/**
+ * One of the step of an import module
+ * 
+ * @author mdecorde
+ *
+ */
+public abstract class ImportStep {
+
+	protected File inputDirectory, outputDirectory;
+	protected ImportModule module;
+	
+	protected HashMap<String, Object> stepProperties = new HashMap<String, Object>();
+	protected boolean isSuccessFul = false;
+	protected String reason = "not set.";
+	protected boolean stopAtFirstError = true;
+	protected boolean debug = true;
+	
+	public ImportStep(ImportModule module) {
+		this.module = module;
+		debug = module.debug;
+	}
+	
+	public File getInputDirectory() {
+		return inputDirectory;
+	}
+	
+	public File getOutputDirectory() {
+		return outputDirectory;
+	}
+	
+	public ImportModule getImportModule() {
+		return module;
+	}
+	
+	public boolean isSuccessFul() {
+		return isSuccessFul;
+	}
+	
+	public String getReason() {
+		return reason;
+	}
+	
+	/**
+	 * Called when a step is interrupted to clean streams and stuff
+	 */
+	public abstract void cancel();
+	
+	public abstract void process();
+}

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/ImportStep.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/TTAnnotater.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/TTAnnotater.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/TTAnnotater.groovy	(revision 728)
@@ -0,0 +1,56 @@
+package org.txm.importer.xtz
+
+import java.io.File;
+
+import org.txm.scripts.teitxm.Annotate
+
+
+/**
+ * Wraps current Annotate class into the import workflow
+ * 
+ * @author mdecorde
+ *
+ */
+class TTAnnotater extends Annotater {
+
+	Annotate a;
+	
+	public TTAnnotater(ImportModule module) {
+		super(module);
+	}
+
+	@Override
+	public void process() {
+
+		//String model = module.getParameters().get(ImportKeys.TTMODEL);
+		String cleanDirectories = module.getParameters().getKeyValueParameters().get(ImportKeys.CLEAN);
+		
+		String corpusname = module.getParameters().getCorpusName();
+		def corpusElem = module.getParameters().getCorpora().get(corpusname);
+		String lang = corpusElem.getAttribute("lang");
+
+		def hash = [:]
+		for (File txmFile : inputDirectory.listFiles()) {
+			hash[txmFile.getName()] = lang;
+		}
+		
+		a = new Annotate()
+		if (module.isMultiThread()) {
+			isSuccessFul = a.run(module.getBinaryDirectory(), inputDirectory, hash);
+		} else {
+			isSuccessFul = a.run(module.getBinaryDirectory(), inputDirectory, lang+".par");
+		}
+		
+		if ("true".equals(cleanDirectories)) {
+			new File(module.getBinaryDirectory(), "treetagger").deleteDir()
+			new File(module.getBinaryDirectory(), "annotations").deleteDir()
+		}
+		
+		if (!isSuccessFul) reason = "TreeTagger annotation failed."
+	}
+
+	@Override
+	public void cancel() {
+		a.setCancelNow();
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZPager.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZPager.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZPager.groovy	(revision 728)
@@ -0,0 +1,461 @@
+package org.txm.importer.xtz
+
+import java.io.File;
+import java.util.ArrayList;
+
+import org.txm.objects.BaseParameters
+import org.w3c.dom.Element
+import org.txm.importer.*
+import org.txm.stat.utils.ConsoleProgressBar
+import org.txm.utils.BundleUtils;
+import org.txm.utils.FileCopy;
+import org.txm.utils.i18n.*
+
+import javax.xml.stream.*
+
+class XTZPager extends Pager {
+
+	BaseParameters params;
+
+	Element corpusElem;
+	String lang;
+	String page_element;
+	String wordTag;
+	int wordsPerPage;
+
+	File cssDirectory, jsDirectory, imagesDirectory;
+
+	public XTZPager(ImportModule module) {
+		super(module, "default");
+
+		params = module.getParameters()
+
+		corpusElem = params.corpora.get(corpusname);
+		lang = corpusElem.getAttribute("lang");
+		wordsPerPage = params.getWordsPerPage("default")
+		page_element = params.getPageElement("default")
+		wordTag = module.getParameters().getWordElement().getTextContent()
+
+		cssDirectory = new File(module.getSourceDirectory(), "css")
+		jsDirectory = new File(module.getSourceDirectory(), "js")
+		imagesDirectory = new File(module.getSourceDirectory(), "images")
+	}
+
+	public void process(ArrayList<File> files) {
+		super.process(files);
+		
+		if (files == null) {
+			files = inputDirectory.listFiles();
+			if (files != null) Collections.sort(files);
+		}
+		
+		if (!doDefaultEditionStep()) return;
+		if (!doFacsEditionStep()) return;
+		if (!doPostEditionXSLStep()) return;
+
+		isSuccessFul = true;
+		println ""
+	}
+
+	public boolean doDefaultEditionStep() {
+		
+		boolean build_edition = module.getParameters().getDoEdition("default")
+		if (!build_edition) {
+			return true;
+		}
+		
+		def second = 0
+
+		println "-- Building 'default' edition of  ${files.size()} texts..."
+
+		def css = ["css/txm.css", "css/${corpusname}.css"] // default CSS inclusion
+
+		// scan existing css files that must be declared in each HTML page
+		if (cssDirectory.exists()) {
+			def cssFiles = cssDirectory.listFiles();
+			if (cssFiles != null)
+				for (File cssFile : cssFiles) {
+					if (cssFile.isFile() && !cssFile.isHidden() && cssFile.getName().endsWith(".css"))
+						css << "css/"+cssFile.getName();
+				}
+		}
+		ConsoleProgressBar cpb = new ConsoleProgressBar(files.size())
+		for (File txmFile : files) {
+			cpb.tick()
+			String textname = txmFile.getName();
+			int i = textname.lastIndexOf(".");
+			if (i > 0) textname = textname.substring(0, i);
+
+			File firstHTMLPageFile = new File(outputDirectory, textname+"_1.html");
+			if (firstHTMLPageFile.exists() && firstHTMLPageFile.lastModified() >= txmFile.lastModified()) continue;
+
+			List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+			List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+			Element texts = params.getTextsElement(corpusElem);
+			Element text = params.getTextElement(texts, textname);
+			if (text == null) { // just in case
+				text = params.addText(corpusElem, textname, txmFile)
+			}
+			def ed = new XTZDefaultPagerStep(this, txmFile, textname, NoSpaceBefore, NoSpaceAfter, css);
+			Element edition = params.getEditionElement(text, "default");
+			if (edition == null) {
+				edition = params.addEdition(text, "default", outputDirectory.getAbsolutePath(), "html");
+			} else { // remove existing pages if any
+				def children = edition.getChildNodes();
+				while (children.getLength() > 0 ) {
+					edition.removeChild(children.item(0))
+				}
+			}
+
+			for (i = 0 ; i < ed.getPageFiles().size();) {
+				File f = ed.getPageFiles().get(i);
+				String wordid = ed.getIdx().get(i);
+				params.addPage(edition, ""+(++i), wordid);
+			}
+		}
+		
+		// copy default TXM css file in the "facs" edition directory
+		File csshtmlDirectory = new File(outputDirectory, "css")
+		csshtmlDirectory.mkdirs()
+		BundleUtils.copyFiles("org.txm.toolbox", "res", "org/txm/css", "txm.css", csshtmlDirectory);
+		
+		// copy CSS files in the "default" edition directory
+		if (cssDirectory.exists()) {
+			FileCopy.copyFiles(cssDirectory, csshtmlDirectory)
+		}
+		if (jsDirectory.exists()) {
+			File jshtmlDirectory = new File(outputDirectory, "js")
+			FileCopy.copyFiles(jsDirectory, jshtmlDirectory)
+		}
+		if (imagesDirectory.exists()) {
+			File imageshtmlDirectory = new File(outputDirectory, "images")
+			FileCopy.copyFiles(imagesDirectory, imageshtmlDirectory)
+		}
+
+		// save changes
+		println ""
+		return true;
+	}
+
+	public boolean doFacsEditionStep() {
+
+		boolean mustBuildFacsEdition = module.getParameters().getDoFacsEdition();
+		if (!mustBuildFacsEdition) return true;
+		
+		String imageDirectoryPath = module.getParameters().getFacsEditionImageDirectory().trim();
+		File imageDirectory = new File(imageDirectoryPath);
+		if (!imageDirectoryPath.startsWith("http") && imageDirectoryPath.length()== 0 && !imageDirectory.exists() && !imageDirectory.isDirectory()) {
+			imageDirectory = null;
+		}
+
+		def second = 0
+
+		println "-- Building 'facs' edition of ${files.size()} texts..."
+		File newEditionDirectory = new File(htmlDirectory, "facs");
+		newEditionDirectory.mkdir();
+
+		// declare the "facs" edition
+		Element editionDefinitionElement = params.getEditionDefinitionElement(corpusElem, "facs");
+		if (editionDefinitionElement == null) {
+			editionDefinitionElement = params.addEditionDefinition(corpusElem, "facs", "groovy", "XTZPager.groovy")
+		}
+		Element textsElement = params.getTextsElement(corpusElem)
+
+		ConsoleProgressBar cpb = new ConsoleProgressBar(files.size())
+		for (File txmFile : files) {
+			cpb.tick()
+			String txtname = txmFile.getName();
+			int i = txtname.lastIndexOf(".");
+			if (i > 0) txtname = txtname.substring(0, i);
+
+			File firstHTMLPageFile = new File(newEditionDirectory, txtname+"_1.html");
+			if (firstHTMLPageFile.exists() && firstHTMLPageFile.lastModified() >= txmFile.lastModified()) continue;
+
+			List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+			List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+			// the text should already exists
+			Element text = params.getTextElement(textsElement, txtname)
+			if (text == null) { // just in case
+				text = params.addText(corpusElem, txtname, txmFile)
+			}
+			Element edition = params.getEditionElement(text, "facs");
+			if (edition == null) {
+				edition = params.addEdition(text, "facs", newEditionDirectory.getAbsolutePath(), "html");
+			} else {
+				def children = edition.getChildNodes();
+				while (children.getLength() > 0 ) {
+					edition.removeChild(children.item(0))
+				}
+			}
+
+			try {
+				def ed = new XTZFacsPagerStep(txmFile, newEditionDirectory, imageDirectory, txtname, corpusname, "pb", "facs", wordTag, debug);
+				if (!ed.process()) {
+					println "Fail to build edition for text: $txmFile"
+					continue;
+				}
+
+				def pages = ed.getPageFiles()
+				for (i = 0 ; i < pages.size();) {
+					File f = pages[i][0];
+					String wordid = pages[i][1]
+					params.addPage(edition, ""+(++i), wordid);
+					//println "add facs page: $f $wordid"
+				}
+			} catch (Exception e) {
+				println "Error while processing $txmFile text: "+e
+				e.printStackTrace();
+				return false;
+			}
+		}
+
+		if (!imageDirectoryPath.startsWith("http") && imageDirectory != null) { // copy files only if local
+			File editionImagesDirectory = new File(newEditionDirectory, "res/images/"+corpusname+"/facs");
+			editionImagesDirectory.mkdirs();
+			FileCopy.copyFiles(imageDirectory, editionImagesDirectory);
+		}
+		
+		// copy SimpleViewer files in the "facs" edition directory
+		File jshtmlDirectory = new File(newEditionDirectory, "js")
+		jshtmlDirectory.mkdirs()
+		BundleUtils.copyFiles("org.txm.toolbox", "res", "org/txm/js", "viewer", jshtmlDirectory);
+		BundleUtils.copyFiles("org.txm.toolbox", "res", "org/txm/", "images", newEditionDirectory);
+		
+		// copy default TXM css file in the "facs" edition directory
+		File csshtmlDirectory = new File(newEditionDirectory, "css")
+		csshtmlDirectory.mkdirs()
+		BundleUtils.copyFiles("org.txm.toolbox", "res", "org/txm/css", "txm.css", csshtmlDirectory);
+		
+		// copy CSS/JS/Images sources files in the "facs" edition directory
+		if (cssDirectory.exists()) {
+			FileCopy.copyFiles(cssDirectory, csshtmlDirectory)
+		}
+		if (jsDirectory.exists()) {
+			FileCopy.copyFiles(jsDirectory, jshtmlDirectory)
+		}
+		if (imagesDirectory.exists()) {
+			File imageshtmlDirectory = new File(newEditionDirectory, "images")
+			FileCopy.copyFiles(imagesDirectory, imageshtmlDirectory)
+		}
+		
+		Element editionsElement = params.getEditionsElement(corpusElem);
+		editionsElement.setAttribute("default","default,facs");
+
+		println ""
+		return true;
+	}
+
+	/**
+	 * read from $bindir/txm and write the result in $bindir/txm
+	 *
+	 */
+	public boolean doPostEditionXSLStep() {
+
+		File xslDirectory = new File(module.getSourceDirectory(), "xsl/4-edition")
+		if (xslDirectory.exists()) {
+
+			// prepare XSL parameters
+			def xslParams = module.getParameters().getXsltParams(corpusElem);
+			String s = module.getParameters().getWordsPerPage("default");
+			if (s != null && s.length() > 0)
+
+			// shared XSL parameters
+			xslParams["number-words-per-page"] = Integer.parseInt(s);
+			xslParams["pagination-element"] = module.getParameters().getPageElement("default")
+			xslParams["import-xml-path"] = module.getParameters().paramFile.toURI().toString()
+			//println "XSL PARAMS: "+xslParams
+
+			def xslFiles = xslDirectory.listFiles()
+			xslFiles.sort()
+			def editionsCreated = [:]
+			for (File xslFile : xslFiles) {
+				if (xslFile.isDirectory() || xslFile.isHidden() || !xslFile.getName().endsWith(".xsl")) continue;
+				if (!xslFile.getName().matches("[1-9]-.+")) continue;
+				
+				String xslName = xslFile.getName().substring(2); // remove the "1-", "2-", etc.
+				int idx2 = xslName.indexOf(".")
+				if (idx2 > 0) xslName = xslName.substring(0, idx2)
+				else {
+					println "$xslFile is not a '.xsl' file"
+					continue;
+				}
+				int idx3 = xslName.indexOf("-")
+				if (idx3 < 0) {
+					println "$xslFile file does not follow the '{Number}-{editionName}-{step}.xsl' name pattern"
+					continue;
+				}
+				String pagerStep = xslName.substring(idx3 + 1);
+				String editionName = xslName.substring(0, idx3);
+
+				int idx = editionName.indexOf(".")
+				if (idx > 0) editionName = editionName.substring(0, idx);
+				println "-- Building '$editionName' XSL edition with step '$pagerStep'..."
+
+				File newEditionDirectory = new File(htmlDirectory, editionName);
+				xslParams["output-directory"] = newEditionDirectory.toURI().toString()
+
+				if (editionsCreated[editionName] == null) { // first XSL, replace an edition
+					editionsCreated[editionName] = xslFile
+					//if (!importModule.isUpdatingCorpus()) {
+					//TODO: optimisation if update is enable,
+					newEditionDirectory.deleteDir(); // delete previous edition if any
+					//}
+					newEditionDirectory.mkdir()
+
+					boolean deleteOutputFiles = "pager" == pagerStep;
+					if (ApplyXsl2.processImportSources(xslFile, inputDirectory, newEditionDirectory, xslParams, deleteOutputFiles)) {
+						println ""
+					} else {
+						reason = "Fail to apply edition XSL: $xslFile"
+						return false;
+					}
+
+					// copy CSS files in the newEditionDirector edition directory
+					if (cssDirectory.exists()) {
+						File csshtmlDirectory = new File(newEditionDirectory, "css")
+						FileCopy.copyFiles(cssDirectory, csshtmlDirectory)
+					}
+					if (jsDirectory.exists()) {
+						File jshtmlDirectory = new File(newEditionDirectory, "js")
+						FileCopy.copyFiles(jsDirectory, jshtmlDirectory)
+					}
+					if (imagesDirectory.exists()) {
+						File imageshtmlDirectory = new File(newEditionDirectory, "images")
+						FileCopy.copyFiles(imagesDirectory, imageshtmlDirectory)
+					}
+				} else { // N+1 XSL working with HTML files
+					def htmlFiles = newEditionDirectory.listFiles()
+					htmlFiles.sort()
+
+					if (ApplyXsl2.processImportSources(xslFile, htmlFiles, xslParams)) {
+						if ("pager".equals(pagerStep)) {
+							// delete the one page HTML files only if the XSL step is "pager"
+							for (File f : htmlFiles) f.delete();
+						}
+						//	println ""
+					} else {
+						reason = "Fail to apply edition XSL: $xslFile"
+						return false;
+					}
+				}
+			}
+
+			// UPDATE import.xml: for each XML-TXM file, we must retrieve the first word ID from the XSL output files
+			//println "retrieve word ids from $inputDirectory"
+			println "-- Fetching page word IDs..."
+			ConsoleProgressBar cpb = new ConsoleProgressBar(editionsCreated.keySet().size())
+			for (String editionName : editionsCreated.keySet()) {
+				cpb.tick()
+				//ensure edition definition is declared
+				def editionsElement = params.getEditionsElement(corpusElem)
+				def e = params.getEditionDefinitionElement(editionsElement, editionName);
+				if (e == null) {
+					params.addEditionDefinition(corpusElem, editionName, "xsl", editionsCreated[editionName].toString());
+				}
+
+				File newEditionDirectory = new File(htmlDirectory, editionName);
+				File xslFile = editionsCreated[editionName]
+				for (File txmFile : inputDirectory.listFiles()) {
+					if (txmFile.isDirectory()) continue;
+					String textName = txmFile.getName()
+					int idx4 = textName.indexOf(".")
+					if (idx4 > 0) textName = textName.substring(0, idx4);
+
+					getFirstWordIDs(textName, editionName, newEditionDirectory, xslFile);
+				}
+			}
+			println ""
+		}
+		return true;
+	}
+
+	private void getFirstWordIDs(String textName, String editionName, File newEditionDirectory, File xslFile) {
+		//		println "call getFirstWordIDs textName=$textName editionName=$editionName dir=$newEditionDirectory xsl=$xslFile"
+		Element textsElement = params.getTextsElement(corpusElem)
+		Element textElement = params.getTextElement(textsElement, textName)
+		if (textElement == null) { // just in case
+			textElement = params.addText(corpusElem, textName, new File(inputDirectory, textName+".xml"))
+		}
+
+		Element editionElement = params.getEditionElement(textElement, editionName);
+		if (editionElement == null) { // the edition does not exist, declare it
+			editionElement = params.addEdition(textElement, editionName, newEditionDirectory.getAbsolutePath(), "html");
+		} else { // the edition already exists, remove pages from the existing edition
+			def children = editionElement.getChildNodes();
+			while (children.getLength() > 0 ) {
+				editionElement.removeChild(children.item(0))
+			}
+		}
+		editionElement.setAttribute("mode", "xsl");
+		editionElement.setAttribute("script", xslFile.getName());
+
+		LinkedHashMap<File, String> words = new LinkedHashMap<File, String>()
+		def files = []
+		newEditionDirectory.eachFile() {it -> if (it.isFile()) files << it}
+
+		files.sort() { f1, f2 ->
+			String s1 = f1.getName()
+			String s2 = f2.getName()
+			int n1 = Integer.parseInt(s1.substring(s1.lastIndexOf("_")+1, s1.lastIndexOf(".")))
+			int n2 = Integer.parseInt(s2.substring(s2.lastIndexOf("_")+1, s2.lastIndexOf(".")))
+			return n1 - n2;
+		}
+
+		for (File f : files) {
+			String pagename = f.getName();
+			if (pagename.startsWith(textName+"_")) { // this is a page
+				String firstWordID = getMetaContent(f);
+				pagename = pagename.substring((textName+"_").length(), pagename.indexOf(".html")) // !!!!
+				params.addPage(editionElement, pagename, firstWordID)
+			}
+		}
+	}
+
+	public static String getMetaContent(File f) {
+		def inputData = f.toURI().toURL().openStream();
+		def factory = XMLInputFactory.newInstance();
+		factory.setProperty("javax.xml.stream.supportDTD", false); // ignore the DTD declared in doctype
+
+		def parser = factory.createXMLStreamReader(inputData);
+		String META = "meta"
+		String BODY = "body"
+		String NAME = "name"
+		String DESCRIPTION = "txm:first-word-id"
+		String CONTENT = "content"
+
+		String content = "";
+		String desc = "";
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) { // start elem
+
+				if (META.equals(parser.getLocalName())) { // ana elem
+					desc = "";
+					// fetch attribute values
+					for (int i = 0 ; i < parser.getAttributeCount(); i++) { // scan attributes
+						if (NAME.equals(parser.getAttributeLocalName(i))) { // found @name
+							desc = parser.getAttributeValue(i)
+						} else if (CONTENT.equals(parser.getAttributeLocalName(i))) { // found @content
+							content = parser.getAttributeValue(i)
+						}
+					}
+					if (DESCRIPTION.equals(desc)) { // stop now
+						break;
+					}
+				} else if (BODY.equals(parser.getLocalName())) { // no need to go further, meta@name="description" not found :(
+					content = "";
+					break;
+				}
+			}
+		}
+		parser.close()
+
+		return content;
+	}
+
+	public static void main(def args) {
+		println "RESULT: "+getMetaContent(new File("/home/mdecorde/TXM/corpora/QGRAALXTZ/HTML/QGRAALXTZ/default", "qgraal_cm_test201510_page_160_2.html"))
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZDefaultPagerStep.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZDefaultPagerStep.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZDefaultPagerStep.groovy	(revision 728)
@@ -0,0 +1,535 @@
+package org.txm.importer.xtz;
+
+import java.io.File;
+import java.io.OutputStreamWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.stream.*;
+
+import org.txm.importer.StaxStackWriter;
+
+public class XTZDefaultPagerStep {
+
+	List<String> NoSpaceBefore;
+
+	/** The No space after. */
+	List<String> NoSpaceAfter;
+
+	/** The wordcount. */
+	int wordcount = 0;
+
+	/** The pagecount. */
+	int pagecount = 0;
+
+	/** The wordmax. */
+	int wordmax = 0;
+
+	/** The basename. */
+	String basename = "";
+	String txtname = "";
+	File outdir;
+
+	/** The wordid. */
+	String wordid;
+
+	/** The first word. */
+	boolean firstWord = true;
+
+	/** The wordvalue. */
+	String wordvalue = "";
+
+	/** The interpvalue. */
+	String interpvalue = "";
+
+	/** The lastword. */
+	String lastword = " ";
+
+	/** The wordtype. */
+	String wordtype;
+
+	/** The flagform. */
+	boolean flagform = false;
+
+	/** The flaginterp. */
+	boolean flaginterp = false;
+
+	/** The url. */
+	private def url;
+
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The writer. */
+	OutputStreamWriter writer;
+
+	/** The pagedWriter. */
+	StaxStackWriter pagedWriter = null;
+
+	/** The infile. */
+	File infile;
+
+	/** The outfile. */
+	File outfile;
+
+	/** The pages. */
+	ArrayList<File> pages = new ArrayList<File>();
+
+	/** The idxstart. */
+	ArrayList<String> idxstart = new ArrayList<String>();
+	String paginationElement;
+	def cssList;
+	def wordTag = "w";
+	def noteElements = new HashSet<String>();
+	def outOfTextElements = new HashSet<String>();
+	XTZPager pager;
+	
+
+	/**
+	 * Instantiates a new pager.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param NoSpaceBefore the no space before
+	 * @param NoSpaceAfter the no space after
+	 * @param max the max
+	 * @param basename the basename
+	 */
+	public XTZDefaultPagerStep(XTZPager pager, File infile, String txtname, List<String> NoSpaceBefore,
+	List<String> NoSpaceAfter, def cssList) {
+		this.pager = pager;
+		this.paginationElement = pager.page_element;
+		this.cssList = cssList;
+		this.basename = pager.corpusname;
+		this.txtname = txtname;
+		this.outdir = pager.outputDirectory;
+		this.wordmax = pager.wordsPerPage;
+		this.NoSpaceBefore = NoSpaceBefore;
+		this.NoSpaceAfter = NoSpaceAfter;
+		this.url = infile.toURI().toURL();
+		this.infile = infile;
+		this.wordTag= pager.wordTag;
+		outdir.mkdirs()
+
+		inputData = new BufferedInputStream(url.openStream());
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		
+		String notesListString = pager.getImportModule().getParameters().getNoteElement().getTextContent()
+		if (notesListString != null) for (def s : notesListString.split(",")) noteElements << s;
+		
+		String elems = pager.getImportModule().getParameters().getOutSideTextTagsAndKeepContentElement().getTextContent()
+		if (elems != null) for (def s : elems.split(",")) outOfTextElements << s;
+		
+		process();
+	}
+	
+	public String getAttributeValue(def parser, String ns, String name) {
+		for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+			if (name == parser.getAttributeLocalName(i)) {
+				return parser.getAttributeValue(i).toString()
+			}
+		}
+		return "";
+	}
+
+
+	private def closeMultiWriter() {
+		if (pagedWriter != null) {
+			def tags = pagedWriter.getTagStack().clone();
+
+			if (firstWord) { // there was no words
+				pagedWriter.writeCharacters("");
+				this.idxstart.add("${wordTag}_0")
+				pagedWriter.write("<span id=\"${wordTag}_0\"/>");
+				//				}
+			}
+			pagedWriter.writeEndElements();
+
+			if (notes.size() > 0) {
+				pagedWriter.writeEmptyElement("hr", ["id":"notes", "width":"20%", "align":"left"]);
+				//pagedWriter.writeStartElement("ol");
+				int i = 1;
+				for (String note : notes) {
+					//pagedWriter.writeStartElement("li");
+					pagedWriter.writeStartElement("a", ["href":"#noteref_"+i, "name":"note_"+i]);
+					pagedWriter.writeStartElement("sup")
+					pagedWriter.writeCharacters(""+i)
+					pagedWriter.writeEndElement() // </sub>
+					pagedWriter.writeEndElement() // </a>
+					pagedWriter.writeCharacters(note)
+					pagedWriter.writeEmptyElement("br")
+					//pagedWriter.writeEndElement() // </li>
+					i++;
+				}
+				//pagedWriter.writeEndElement() // </ol>
+				notes.clear()
+			}
+
+			pagedWriter.close();
+			return tags;
+		} else {
+			return [];
+		}
+	}
+
+	/**
+	 * Creates the next output.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean createNextOutput() {
+		wordcount = 0;
+		try {
+
+			def tags = closeMultiWriter();
+			for (int i = 0 ; i < tags.size() ; i++) {
+				String tag = tags[i]
+				if ("div" != tag) {
+					tags.remove(i--)
+				} else {
+					tags.remove(i--) // remove first "div"
+					break; // remove elements until first "div" tag
+				}
+			}
+			File outfile = new File(outdir, txtname+"_"+(++pagecount)+".html")
+			pages.add(outfile);
+			firstWord = true; // waiting for next word
+
+			pagedWriter = new StaxStackWriter(outfile, "UTF-8");
+
+			pagedWriter.writeStartDocument("UTF-8", "1.0")
+			pagedWriter.writeStartElement("html");
+			pagedWriter.writeEmptyElement("meta", ["http-equiv":"Content-Type", "content":"text/html","charset":"UTF-8"]);
+			for (String css : cssList) {
+				pagedWriter.writeEmptyElement("link", ["rel":"stylesheet", "type":"text/css","href":"$css"]);
+			}
+			pagedWriter.writeStartElement("head");
+			pagedWriter.writeStartElement("title")
+			pagedWriter.writeCharacters(basename.toUpperCase()+" Edition - Page "+pagecount)
+			pagedWriter.writeEndElement(); // </title>
+			pagedWriter.writeEndElement() // </head>
+			pagedWriter.writeStartElement("body") //<body>
+			pagedWriter.writeStartElement("div", ["class": "txmeditionpage"]) //<div>
+			pagedWriter.writeStartElements(tags);
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput() {
+		try {
+			return createNextOutput();
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Gets the page files.
+	 *
+	 * @return the page files
+	 */
+	public ArrayList<File> getPageFiles() {
+		return pages;
+	}
+
+	/**
+	 * Gets the idx.
+	 *
+	 * @return the idx
+	 */
+	public ArrayList<String> getIdx() {
+		return idxstart;
+	}
+
+	/**
+	 * Go to text.
+	 */
+	private void goToText() {
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.END_ELEMENT)
+				if (parser.getLocalName().matches("teiHeader"))
+					return;
+		}
+	}
+
+	def notes = []
+	def currentOutOfTextElements = [] // stack of element with out of text to edit opened element
+	def writeOutOfTextToEditText = false
+	/**
+	 * Process.
+	 */
+	public boolean process() {
+		boolean flagNote = false;
+		String noteContent = "";
+		String rend = ""
+		goToText();
+
+		String localname = "";
+		createNextOutput();
+
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			rend = "";
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					if (outOfTextElements.contains(localname)) {
+						currentOutOfTextElements << localname
+						writeOutOfTextToEditText = true;
+					} else if (currentOutOfTextElements.size() > 0) {
+						currentOutOfTextElements << localname
+					}			
+					
+					if (localname == paginationElement) {
+						createNextOutput();
+						wordcount=0;
+						pagedWriter.write("\n");
+						if (getAttributeValue(parser, null,"n") != null) {
+							pagedWriter.writeElement("p", ["class":"txmeditionpb", "align":"center"], getAttributeValue(parser, null,"n"))
+						}
+					}
+					
+					rend = getAttributeValue(parser, null, "rend")
+					if (rend == null) rend = "";
+					switch (localname) {
+						case "text":
+							LinkedHashMap attributes = new LinkedHashMap();
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+								attributes[parser.getAttributeLocalName(i)] = parser.getAttributeValue(i).toString()
+							}
+							
+							pagedWriter.write("\n");
+							pagedWriter.writeStartElement("p")
+							pagedWriter.writeAttribute("class", rend);
+							if (attributes.containsKey("id")) {
+								pagedWriter.writeElement("h3", attributes["id"])
+							}
+
+							pagedWriter.writeStartElement("table");
+							for (String k : attributes.keySet()) {
+								if (k == "id") continue;
+								if (k == "rend") continue;
+
+								pagedWriter.writeStartElement("tr");
+								pagedWriter.writeElement("td", k);
+								pagedWriter.writeElement("td", attributes[k]);
+								pagedWriter.writeEndElement();
+							}
+							pagedWriter.writeEndElement() // table
+							pagedWriter.writeEndElement() // p
+
+							pagedWriter.writeCharacters("");
+							break;
+						case "ref":
+							pagedWriter.writeStartElement("a")
+							pagedWriter.writeAttribute("href", getAttributeValue(parser, null, "target"));
+
+							pagedWriter.writeAttribute("target", "_blank");
+							pagedWriter.writeAttribute("class", rend);
+							break;
+						case "head":
+							pagedWriter.write("\n");
+							pagedWriter.writeStartElement("h2", ["class":rend])
+							break;
+						case "graphic":
+							pagedWriter.write("\n");
+							String url = getAttributeValue(parser, null, "url")
+							if (url != null) {
+								pagedWriter.writeStartElement("center", ["class":rend])
+								pagedWriter.writeEmptyElement("img", ["src":url, "align":"middle"])
+								pagedWriter.writeEndElement() // div
+							}
+							break;
+						case "table":
+							pagedWriter.writeStartElement("table", ["class":rend])
+							pagedWriter.write("\n");
+							break;
+						case "row":
+							pagedWriter.writeStartElement("tr", ["class":rend])
+							break;
+						case "cell":
+							pagedWriter.writeStartElement("td", ["class":rend])
+							break;
+						case "list":
+							String type = getAttributeValue(parser, null,"type");
+							if ("unordered" == type) {
+								pagedWriter.writeStartElement("ul", ["class":rend])
+							} else {
+								pagedWriter.writeStartElement("ol", ["class":rend])
+							}
+							break
+						case "item":
+							pagedWriter.writeStartElement("li", ["class":rend])
+							break;
+						case "hi":
+						case "emph":
+							if ("i".equals(rend) || "italic".equals(rend)) {
+								pagedWriter.writeStartElement("i", ["class":rend])
+							} else if ("b".equals(rend) || "bold".equals(rend)) {
+								pagedWriter.writeStartElement("b", ["class":rend])
+							} else {
+								if ("emph".equals(localname)) {
+									pagedWriter.writeStartElement("i", ["class":rend])
+								} else { // hi
+									pagedWriter.writeStartElement("b", ["class":rend])
+								}
+							}
+
+							break;
+						case "p":
+							pagedWriter.write("\n");
+							pagedWriter.writeStartElement("p", ["class":rend])
+							break;
+						case "lb":
+							pagedWriter.writeEmptyElement("br")
+							break;
+						case wordTag:
+							wordid = getAttributeValue(parser, null,"id");
+							
+							wordcount++;
+							if (wordcount >= wordmax) {
+								createNextOutput();
+							}
+							
+							if (firstWord) {
+								firstWord = false;
+								this.idxstart.add(wordid);
+							}
+							
+							break;
+						case "ana":
+							flaginterp=true;
+							interpvalue+=" "+getAttributeValue(parser, null, "type").substring(1)+":"
+							break;
+						case "form":
+							wordvalue="";
+							interpvalue ="";
+							flagform=true;
+							break;
+						default:
+							if (noteElements.contains(localname)) {
+								flagNote = true;
+								noteContent = ""
+							}
+							break;
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+					if (currentOutOfTextElements.size() > 0) currentOutOfTextElements.pop()
+					writeOutOfTextToEditText = currentOutOfTextElements.size() > 0
+					
+					switch (localname) {
+						case "p":
+							pagedWriter.writeEndElement() // </p>
+							pagedWriter.write("\n");
+							break;
+						case "head":
+							pagedWriter.writeEndElement() // </h2>
+							pagedWriter.write("\n");
+							break;
+						case "list":
+							pagedWriter.writeEndElement(); // ul or ol
+							pagedWriter.write("\n");
+							break
+						case "item":
+							pagedWriter.writeEndElement(); // li
+							pagedWriter.write("\n");
+							break;
+						case "hi":
+							pagedWriter.writeEndElement(); // b
+							break;
+						case "emph":
+							pagedWriter.writeEndElement(); // i
+							break;
+						case "table":
+							pagedWriter.writeEndElement(); // table
+							pagedWriter.write("\n");
+							break;
+						case "row":
+							pagedWriter.writeEndElement(); // tr
+							break;
+						case "cell":
+							pagedWriter.writeEndElement(); // td
+							break;
+						case "ref":
+							pagedWriter.writeEndElement() // </a>
+							break;
+						case "form":
+							flagform = false
+							break;
+						case "ana":
+							flaginterp = false
+							break;
+						case wordTag:
+							int l = lastword.length();
+							String endOfLastWord = "";
+							if (l > 0)
+								endOfLastWord = lastword.subSequence(l-1, l);
+
+							if (interpvalue != null)
+								interpvalue = interpvalue;
+
+							if (NoSpaceBefore.contains(wordvalue) ||
+							NoSpaceAfter.contains(lastword) ||
+							wordvalue.startsWith("-") ||
+							NoSpaceAfter.contains(endOfLastWord)) {
+								pagedWriter.writeStartElement("span", ["title":interpvalue, "id":wordid]);
+							} else {
+								pagedWriter.writeCharacters(" ");
+								pagedWriter.writeStartElement("span", ["title":interpvalue, "id":wordid]);
+							}
+
+							pagedWriter.writeCharacters(wordvalue);
+							pagedWriter.writeEndElement();
+							lastword=wordvalue;
+							break;
+						default:
+							if (noteElements.contains(localname)) {
+								flagNote = false;
+								if (noteContent.length() > 0) {
+									notes << noteContent;
+									pagedWriter.writeStartElement("a", ["href":"#note_"+notes.size(), "name":"noteref_"+notes.size(), "title":noteContent]);
+									pagedWriter.writeStartElement("sup")
+									pagedWriter.writeCharacters(""+notes.size())
+									pagedWriter.writeEndElement() // </sub>
+									pagedWriter.writeEndElement() // </span>
+								}
+							}
+							break;
+					}
+					break;
+				case XMLStreamConstants.CHARACTERS:
+					if (flagform && parser.getText().length() > 0) {
+						wordvalue+=(parser.getText());
+						if (flagNote == parser.getText().length() > 0)
+							noteContent += parser.getText().replace("\n", " ");
+					} else	if (flaginterp && parser.getText().length() > 0) {
+						interpvalue+=(parser.getText());
+					} else if (flagNote == parser.getText().length() > 0) {
+						noteContent += parser.getText().replace("\n", " ");
+					} else if (writeOutOfTextToEditText) {
+						pagedWriter.writeCharacters(parser.getText())
+					}
+					break;
+			}
+		}
+		closeMultiWriter();
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Compiler.java
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Compiler.java	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Compiler.java	(revision 728)
@@ -0,0 +1,61 @@
+package org.txm.importer.xtz;
+
+import java.io.File;
+import java.util.ArrayList;
+
+import org.txm.utils.DeleteDir;
+
+/**
+ * Takes XML-TXM files, build the WTC files and call cwb utils
+ * 
+ * @author mdecorde
+ *
+ */
+public class Compiler extends ImportStep {
+
+	protected File wtcDirectory, registryDirectory, dataDirectory;
+	protected ArrayList<File> files;
+	
+	/**
+	 * Creates the output directories
+	 * 
+	 * @param module
+	 */
+	public Compiler(ImportModule module) {
+		super(module);
+
+		inputDirectory = new File(module.getBinaryDirectory(), "txm/"+module.getCorpusName());
+		wtcDirectory = new File(module.getBinaryDirectory(), "wtc");		
+		outputDirectory = new File(module.getBinaryDirectory(), "data");
+		registryDirectory = new File(module.getBinaryDirectory(), "registry");
+		dataDirectory = new File(outputDirectory, module.getCorpusName());
+
+		DeleteDir.deleteDirectory(outputDirectory);
+		outputDirectory.mkdirs();
+		
+		DeleteDir.deleteDirectory(dataDirectory);
+		dataDirectory.mkdirs();
+		
+		DeleteDir.deleteDirectory(registryDirectory);
+		registryDirectory.mkdirs();
+		
+		if (!module.isUpdatingCorpus()) {
+			DeleteDir.deleteDirectory(wtcDirectory);
+			wtcDirectory.mkdir();
+		}
+	}
+
+	@Override
+	public void cancel() {
+		// TODO Auto-generated method stub
+	}
+
+	@Override
+	public void process() {
+		process(null); // no default files order set
+	}
+	
+	public void process(ArrayList<File> files) {
+		this.files = files;
+	}
+}

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Compiler.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Step.java
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Step.java	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Step.java	(revision 728)
@@ -0,0 +1,12 @@
+package org.txm.importer.xtz;
+
+public class Step {
+
+	public Step() {
+		// TODO Auto-generated constructor stub
+	}
+
+	public boolean process() {
+		return true;
+	}
+}

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Step.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZImporter.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZImporter.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZImporter.groovy	(revision 728)
@@ -0,0 +1,480 @@
+package org.txm.importer.xtz
+
+import filters.Tokeniser.SimpleTokenizerXml
+
+import java.io.File;
+
+import net.sf.saxon.style.XSLParam;
+
+import org.txm.importer.ApplyXsl2;
+import org.txm.importer.CleanFile;
+import org.txm.importer.MileStoneProjection;
+import org.txm.importer.ValidateXml;
+import org.txm.*;
+
+import javax.xml.parsers.SAXParser
+import javax.xml.parsers.SAXParserFactory
+import javax.xml.stream.*;
+
+import org.w3c.dom.Element
+import org.xml.sax.XMLReader
+import org.txm.importer.DomUtils;
+import org.txm.metadatas.Metadatas
+import org.txm.objects.BaseParameters
+import org.txm.scripts.teitxm.Xml2Ana
+import org.txm.stat.utils.ConsoleProgressBar
+import org.txm.utils.*;
+
+class XTZImporter extends Importer {
+
+	boolean cancelNow = false;
+	def filesToProcess = []
+
+	File frontXSLResultDirectory;
+	File tokenizedDirectory;
+	File sentencedDirectory;
+
+	String xslPath;
+	def xslParams;
+	String lang;
+	String wordTag;
+	boolean skipDoTokenizeStep = false;
+
+	Metadatas metadata = null; // text metadata
+
+	public XTZImporter(ImportModule module) {
+		super(module);
+	}
+
+	public Metadatas getMetadata() {
+		return metadata;
+	}
+
+	public void process() {
+
+		BaseParameters params = module.getParameters();
+		File binDir = module.getBinaryDirectory();
+
+		String corpusname = params.getCorpusName();
+		Element corpusElem = params.corpora.get(corpusname);
+
+		def srcFiles = [];
+		def files = inputDirectory.listFiles();
+		if (files == null) {
+			reason = "No file to process in "+inputDirectory
+			return; // no file to process in the directory
+		}
+
+		for (File f : files) {
+			if (f.isHidden() || f.isDirectory())
+				continue;
+			else if (f.getName().endsWith(".properties"))
+				continue;
+			else if (f.getName().equals("import.xml"))
+				continue;
+			else if (f.getName().endsWith(".csv"))
+				continue;
+			else if (f.getName().endsWith(".dtd"))
+				continue;
+			else if (f.getName().endsWith(".xsl"))
+				continue;
+			else if (f.getName().endsWith("~"))
+				continue;
+			else if (f.getName().startsWith("."))
+				continue;
+
+			srcFiles << f
+		}
+
+		if (srcFiles.size() == 0) {
+			reason = "No suitable file to process in "+inputDirectory
+			return; // no file to process in the directory
+		}
+
+		// prepare front XSL if any
+		xslPath = params.getXsltElement(corpusElem).getAttribute("xsl")
+		xslParams = params.getXsltParams(corpusElem);
+
+		lang = corpusElem.getAttribute("lang");
+
+		wordTag = module.getParameters().getWordElement().getTextContent()
+		this.skipDoTokenizeStep = module.getParameters().getSkipTokenization()
+
+		//prepare metadata if any
+		File allmetadatafile = new File(inputDirectory, "metadata.csv");
+		if (allmetadatafile.exists()) {
+			File copy = new File(binDir, "metadata.csv")
+			if (!FileCopy.copy(allmetadatafile, copy)) {
+				println "Error: could not create a copy of the metadata file "+allmetadatafile.getAbsoluteFile();
+				return;
+			}
+			metadata = new Metadatas(copy,
+			Toolbox.getParam(Toolbox.METADATA_ENCODING),
+			Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR),
+			Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
+		}
+
+		String cleanDirectories = module.getParameters().getKeyValueParameters().get(ImportKeys.CLEAN);
+		
+		if (!doFixSurrogates()) return;
+		if (!doSplitMergeXSLStep()) return;
+		if (!doFrontXSLStep()) return;
+		if (!doCheckXMLFileStep()) return;
+		if (!doTokenizeStep()) return;
+		if (!doPostTokenizeXSLStep()) return;
+		if (!doEncodeMileStonesStep()) return;
+		if (!doToXMLTXMStep()) return;
+		if (!doInjectMetadataStep()) return;
+
+		isSuccessFul = filesToProcess.size() > 0
+
+		if ("true".equals(cleanDirectories)) {
+			new File(module.getBinaryDirectory(), "tokenized").deleteDir()
+			new File(module.getBinaryDirectory(), "src").deleteDir()
+		}
+	}
+
+	/**
+	 * read from source directory and remove the surrogate chars not well managed
+	 * save the result in $bindir/src
+	 *
+	 * 
+	 *
+	 */
+	public boolean doFixSurrogates() {
+		File srcDirectory = new File(module.getBinaryDirectory(), "src")
+		srcDirectory.mkdir()
+		def files = inputDirectory.listFiles()
+		if (files == null) {
+			reason = "No file to process in $inputDirectory"
+			return false;
+		}
+
+		for (File file : files) {
+			def outputFile = new File(srcDirectory, file.getName());
+			if (file.getName().toLowerCase().endsWith(".xml")) {
+				CleanFile.removeSurrogateFromXmlFile(file, outputFile)
+			} else {
+				FileCopy.copyFiles(file, outputFile)
+			}
+		}
+
+		inputDirectory = srcDirectory; // the files to process are now in the "src" directory
+		return true;
+	}
+
+	/**
+	 * read from source directory and write the result in $bindir/txm
+	 * 
+	 * only one XSL is applied
+	 *
+	 */
+	public boolean doSplitMergeXSLStep() {
+		File srcDirectory = new File(module.getBinaryDirectory(), "src")
+		srcDirectory.mkdir()
+		xslParams["output-directory"] = srcDirectory.getAbsoluteFile().toURI().toString();
+
+		File xslDirectory = new File(module.getSourceDirectory(), "xsl/1-split-merge")
+		println "-- Split-Merge XSL Step with $xslDirectory"
+		def xslFiles = xslDirectory.listFiles()
+		if (xslDirectory.exists() && xslFiles != null && xslFiles.size() > 0) {
+
+			xslFiles.sort()
+			for (File xslFile : xslFiles) {
+				if (xslFile.isDirectory() || xslFile.isHidden() || !xslFile.getName().endsWith(".xsl")) continue;
+				//if (!xslFile.getName().matches("[1-9]-.+")) continue;
+
+				if (ApplyXsl2.processImportSources(xslFile, inputDirectory.listFiles(), xslParams, false)) {
+					println ""
+				} else {
+					reason = "Fail to apply split-merge XSL: $xslPath"
+				}
+				break; // THERE IS ONLY ONE XSL FILE TO APPLY
+			}
+			inputDirectory = srcDirectory; // the files to process are now in the "src" directory
+		} else {
+			//println "Nothing to do."
+		}
+		return true;
+	}
+
+	public boolean doEncodeMileStonesStep() {
+		filesToProcess = new File(module.getBinaryDirectory(), "tokenized").listFiles()
+		def milestonesString = module.getParameters().getMilestonesElement().getTextContent().trim()
+		if (milestonesString.length() == 0) return true;
+
+		def milestones = milestonesString.split(",")
+		//def milestones = ["lb", "pb", "cb"]
+		//println "milestones=$milestones type="+milestones.getClass()+" size="+milestones.size()
+		if (milestones.size() == 0) return true;
+
+		println "-- Encoding milestone $milestones into XML files..."
+		ConsoleProgressBar cpb = new ConsoleProgressBar(milestones.size())
+		for (def milestone : milestones) {
+			milestone = milestone.trim()// just in case
+			cpb.tick()
+
+			for (File inputFile : filesToProcess) {
+				File outputFile = File.createTempFile("tmp", inputFile.getName(),inputFile.getParentFile());
+				println "$inputFile, 'text', $wordTag, $milestone, $outputFile"
+				MileStoneProjection msp = new MileStoneProjection(inputFile, "text", wordTag, milestone)
+				if (!msp.process(outputFile)) {
+					println "Fail to encode $milestone in $inputFile"
+					return false
+				} else {
+					if (inputFile.delete()) {
+						outputFile.renameTo(inputFile)
+					} else {
+						println "Fail to encode $milestone in ${inputFile}: could not replace the file."
+						return false
+					}
+				}
+			}
+		}
+		println ""
+		return true;
+	}
+
+	/**
+	 * read from $inputDirectory and write the result in $bindir/txm 
+	 *
+	 */
+	public boolean doFrontXSLStep() {
+
+		//filesToProcess = inputDirectory.listFiles();
+
+		File frontXSLdirectory = new File(module.getSourceDirectory(), "xsl/2-front")
+		println "-- Front XSL Step with $frontXSLdirectory"
+		def xslFiles = frontXSLdirectory.listFiles()
+		if (frontXSLdirectory.exists() && xslFiles != null && xslFiles.size() > 0) {
+
+			xslFiles.sort()
+			for (File xslFile : xslFiles) {
+				if (xslFile.isDirectory() || xslFile.isHidden() || !xslFile.getName().endsWith(".xsl")) continue;
+				//if (!xslFile.getName().matches("[1-9]-.+")) continue;
+
+				if (ApplyXsl2.processImportSources(xslFile, inputDirectory, outputDirectory, xslParams)) {
+					inputDirectory = outputDirectory; // the files to process are now in the "txm" directory
+					println ""
+				} else {
+					reason = "Fail to apply front XSL: $xslPath"
+					return false;
+				}
+			}
+		} else {
+			//println "Nothing to do."
+		}
+		return true;
+	}
+
+	public boolean doCheckXMLFileStep() {
+		filesToProcess = []
+		println "-- Check XML files for well-formedness."
+		def files = inputDirectory.listFiles()
+
+		if (files == null || files.size() == 0) {
+			println "No XML file (*.xml) to process. Aborting"
+			return false;
+		}
+		files = files.sort()
+
+		ConsoleProgressBar cpb = new ConsoleProgressBar(files.size())
+		for (File f : files) {
+			cpb.tick()
+			if (f.getName().toLowerCase().endsWith(".xml"))
+				if (!f.isHidden() && f.canRead() && !f.getName().endsWith(".properties")
+				&& !f.getName().startsWith("metadata") && !f.isDirectory())
+			{
+
+				if (!ValidateXml.test(f)) {
+					continue;
+				} else {
+					if (!f.getName().equals("import.xml"))
+						filesToProcess << f
+				}
+			}
+		}
+		println ""
+		if (filesToProcess.size() == 0) {
+			reason = "No file suitable to process in "+inputDirectory
+			return false;
+		} else {
+			return true;
+		}
+	}
+
+
+	public boolean doTokenizeStep() {
+
+		println "-- Tokenizing "+filesToProcess.size()+" files"
+		new File(module.getBinaryDirectory(),"tokenized").mkdir()
+
+		String outSideTextTagsRegex = "";
+		String outSideTextTagsAndKeepContentRegex = "";
+		String noteRegex = "";
+		// get the element names to ignore
+		Element textualPlanEelement = module.getParameters().getTextualPlans();
+
+		if (textualPlanEelement != null) {
+			Element e1 = module.getParameters().getOutSideTextTagsElement()
+			def split  = e1.getTextContent().split(",")
+			for (String s : split) {
+				outSideTextTagsRegex += "|"+s.trim()
+			}
+			if (outSideTextTagsRegex.trim().length() > 0) {
+				outSideTextTagsRegex = outSideTextTagsRegex.substring(1) // remove the first "|"
+			}
+
+			Element e2 = module.getParameters().getOutSideTextTagsAndKeepContentElement()
+			def split2  = e2.getTextContent().split(",")
+			for (String s : split2) {
+				outSideTextTagsAndKeepContentRegex += "|"+s.trim()
+			}
+			if (outSideTextTagsAndKeepContentRegex.trim().length() > 0) {
+				outSideTextTagsAndKeepContentRegex = outSideTextTagsAndKeepContentRegex.substring(1) // remove the first "|"
+			}
+
+			Element e3 = module.getParameters().getNoteElement()
+			def split3  = e3.getTextContent().split(",")
+			for (String s : split3) {
+				noteRegex += "|"+s.trim()
+			}
+			if (noteRegex.trim().length() > 0) {
+				noteRegex = noteRegex.substring(1) // remove the first "|"
+			}
+		}
+
+		//if (wordTag != "w") {
+		if (skipDoTokenizeStep ) {
+			println "No tokenization do to."
+			// ConsoleProgressBar cpb = new ConsoleProgressBar(filesToProcess.size())
+			for (File f : filesToProcess) {
+				File outfile = new File(module.getBinaryDirectory(),"tokenized/"+f.getName());
+				FileCopy.copy(f, outfile);
+			}
+			return true;
+		} else {
+			ConsoleProgressBar cpb = new ConsoleProgressBar(filesToProcess.size())
+			for (File f : filesToProcess) {
+				cpb.tick()
+				File infile = f;
+				File outfile = new File(module.getBinaryDirectory(),"tokenized/"+f.getName());
+				SimpleTokenizerXml tokenizer = new SimpleTokenizerXml(infile, outfile, lang)
+				if (wordTag.length() > 0)
+					tokenizer.setWord_tags(wordTag);
+				tokenizer.setWord_element_to_create(wordTag)
+
+				if (outSideTextTagsRegex != null && outSideTextTagsRegex.trim().length() > 0) {
+					tokenizer.setOutSideTextTags(outSideTextTagsRegex)
+				}
+
+				if (outSideTextTagsAndKeepContentRegex != null && outSideTextTagsAndKeepContentRegex.trim().length() > 0) {
+					tokenizer.setOutSideTextTagsAndKeepContent(outSideTextTagsAndKeepContentRegex)
+				}
+
+				if (noteRegex != null && noteRegex.trim().length() > 0) {
+					tokenizer.setNote(noteRegex)
+				}
+
+				// tokenize ! \o/
+				if (!tokenizer.process()) {
+					println("Failed to process "+f)
+					outfile.delete()
+				}
+			}
+		}
+
+		filesToProcess = new File(module.getBinaryDirectory(),"tokenized").listFiles()
+		println ""
+
+		return true;
+	}
+
+	/**
+	 * read from $bindir/tokenized and write the result in $bindir/tokenized
+	 *
+	 */
+	public boolean doPostTokenizeXSLStep() {
+
+		filesToProcess = new File(module.getBinaryDirectory(),"tokenized").listFiles()
+		File xslDirectory = new File(module.getSourceDirectory(), "xsl/3-posttok")
+		def xslFiles = xslDirectory.listFiles()
+		if (!xslDirectory.exists() || xslFiles == null || xslFiles.size() == 0) return true;
+
+		println "-- Posttokenize XSL Step with $xslDirectory"
+		return ApplyXsl2.processWithMultipleXSL(filesToProcess, xslDirectory, xslParams)
+	}
+
+	public boolean doInjectMetadataStep() {
+		if (metadata != null) {
+			println("-- INJECTING METADATA - "+metadata.getHeadersList()+" in texts of directory "+outputDirectory)
+			ConsoleProgressBar cpb = new ConsoleProgressBar(filesToProcess.size())
+			for (File infile : filesToProcess) {
+				cpb.tick()
+				File outfile = File.createTempFile("temp", ".xml", infile.getParentFile());
+				if (metadata.injectMetadatasInXml(infile, outfile, "text", null)) {
+					if (!(infile.delete() && outfile.renameTo(infile))) println "Warning can't rename file "+outfile+" to "+infile
+					if (!infile.exists()) {
+						println "Error: could not replace $infile by $outfile"
+						return false;
+					}
+				} else {
+					outfile.delete(); // fail
+				}
+			}
+			println ""
+		}
+		return true;
+	}
+
+	public boolean doToXMLTXMStep() {
+		filesToProcess = new File(module.getBinaryDirectory(),"tokenized").listFiles()
+		ConsoleProgressBar cpb = new ConsoleProgressBar(filesToProcess.size())
+		println("-- Building XML-TXM ("+filesToProcess.size()+" files)")
+		for (File f : filesToProcess) {
+			//ArrayList<String> milestones = new ArrayList<String>();
+			cpb.tick()
+			File file = f;
+			String txmfile = f.getName();
+
+			def correspType = new HashMap<String,String>()
+			def correspRef = new HashMap<String,String>()
+			//il faut lister les id de tous les respStmt
+			def respId = [];
+			//fait la correspondance entre le respId et le rapport d'execution de l'outil
+			def applications = new HashMap<String,HashMap<String,String>>();
+			//fait la correspondance entre le respId et les attributs type de la propriÃ©tÃ© ana du w txm
+			//pour construire les ref vers les taxonomies
+			def taxonomiesUtilisees = new HashMap<String,String[]>();
+			//associe un id d'item avec sa description et son URI
+			def itemsURI = new HashMap<String,HashMap<String,String>>();
+			//informations de respStmt
+			//resps (respId <voir ci-dessus>, [description, person, date])
+			def resps = new HashMap<String,String[]>();
+			//lance le traitement
+			def builder = new Xml2Ana(file);
+			builder.setWordTag(module.getParameters().getWordElement().getTextContent())
+			builder.setConvertAllAtrtibutes true;
+			builder.setCorrespondances(correspRef, correspType);
+			builder.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)
+			//builder.setAddTEIHeader();
+			if (!builder.process(new File(outputDirectory, txmfile))) {
+				println("Failed to process "+f);
+				new File(outputDirectory,txmfile).delete();
+			}
+		}
+		filesToProcess = outputDirectory.listFiles();
+		println ""
+		return true;
+	}
+
+	@Override
+	public void checkFiles() {
+		//isSuccessFul = isSuccessFul && outputDirectory.listFiles() != null;
+	}
+
+	@Override
+	public void cancel() {
+		cancelNow = true;
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/xtzLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/xtzLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/xtzLoader.groovy	(revision 728)
@@ -0,0 +1,82 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2015-06-03 15:04:53 +0200 (mer., 03 juin 2015) $
+// $LastChangedRevision: 2984 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xtz;
+
+import javax.xml.stream.*
+
+import org.txm.*
+import org.txm.metadatas.*
+import org.txm.objects.*
+import org.txm.scripts.teitxm.*
+import org.txm.tokenizer.TokenizerClasses
+import org.txm.utils.*
+import org.txm.utils.i18n.*
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/srcmfmadridxmltxm/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+
+		TokenizerClasses.loadFromNode(params.getTokenizerElement(params.getCorpusElement()));
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		//Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File("C:\\Program Files\\treetagger\\models"));//for Windows
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+
+if (params == null) { println "no parameters. Aborting"; return; }
+
+//params.getKeyValueParameters().put(ImportKeys.CLEAN, "false")
+//params.getKeyValueParameters().put(ImportKeys.MULTITHREAD, "false")
+//params.getKeyValueParameters().put(ImportKeys.DEBUG, "false")
+//params.getKeyValueParameters().put(ImportKeys.UPDATECORPUS, "false")
+
+XTZImport i = new XTZImport(params);
+/*
+ * To customize the XTZ import, replace the importer, compiler, annotater or pager objects before calling process()
+		i.importer = new XTZImporter(i)
+		i.compiler = new XTZCompiler(i)
+		i.annotater = new TTAnnotater(i);
+		i.pager = new XTZPager(i)
+ */
+i.process();
+readyToLoad = i.isSuccessful
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/ImportModule.java
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/ImportModule.java	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/ImportModule.java	(revision 728)
@@ -0,0 +1,255 @@
+package org.txm.importer.xtz;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.logging.Level;
+
+import org.txm.Toolbox;
+import org.txm.functions.ProgressWatcher;
+import org.txm.importer.DomUtils;
+import org.txm.objects.BaseParameters;
+import org.txm.utils.DeleteDir;
+import org.txm.utils.logger.Log;
+
+public class ImportModule {
+
+	public BaseParameters importParameters;
+	
+	public String corpusVersionProduced;
+
+	public File sourceDirectory;
+	public File binaryDirectory;
+
+	public Importer importer;
+	public Annotater annotater;
+	public Compiler compiler;
+	public Pager pager;
+
+	public boolean isSuccessful = true;
+	public String reason = "none";
+	public boolean debug = false;
+	public boolean multithread = false;
+	public boolean updateCorpus = false;
+	public String corpusName;
+
+	ProgressWatcher monitor;
+	
+	public void setMonitor(ProgressWatcher monitor) {
+		this.monitor = monitor;
+	}
+
+	
+	public boolean isMultiThread() {
+		return multithread;
+	}
+
+	public boolean isDebugging() {
+		return debug;
+	}
+
+	public ImportModule(File importParametersFile) {
+		try {
+			BaseParameters b = new BaseParameters(importParametersFile);
+			init(b);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	public ImportModule(BaseParameters p) {
+		init(p);
+	}
+	
+	public boolean isUpdatingCorpus() {
+		return updateCorpus;
+	}
+
+	protected void init(BaseParameters p) {
+		this.importParameters = p;
+		this.importParameters.load();
+		corpusName = importParameters.name;
+		//this.debug = "true".equals(importParameters.getKeyValueParameters().get(ImportKeys.DEBUG));
+		
+		if (Log.getLevel().intValue() < Level.WARNING.intValue()) {
+			debug = true;
+		}
+		this.multithread = "true".equals(importParameters.getKeyValueParameters().get(ImportKeys.MULTITHREAD));
+		this.updateCorpus = "true".equals(importParameters.getKeyValueParameters().get(ImportKeys.UPDATECORPUS));
+
+		
+		this.sourceDirectory = importParameters.paramFile.getParentFile();
+		this.binaryDirectory = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "corpora/"+corpusName.toUpperCase());
+
+		if (!updateCorpus) { // clean directories only if it's a new import
+			DeleteDir.deleteDirectory(binaryDirectory);
+			binaryDirectory.mkdir();
+			
+			File txmDir = new File(binaryDirectory, "txm");
+			txmDir.mkdir();
+		}
+	}
+
+	public void start() throws InterruptedException {
+
+		binaryDirectory.mkdirs(); // ensure output exists
+		//System.out.println("ImportModule.start");
+		if (!updateCorpus) { // create XML-TXM files and annotate
+			//System.out.println("ImportModule.start: not updating");
+			if (importer != null) {
+				//System.out.println("ImportModule.start: importer: "+importer);
+				if (monitor != null) System.out.println("-- IMPORTER - Reading source files");
+				importer.process();
+				//importer.checkFiles();
+				isSuccessful = isSuccessful & importer.isSuccessFul();
+				if (!isSuccessful) {
+					System.out.println("Error while importing corpus during 'importer' step, reason="+importer.getReason());
+					return;
+				}
+			} else {
+				System.out.println("XML-TXM files already produced in "+new File(binaryDirectory, "txm/"+corpusName));
+			}
+
+			boolean annotate = "true".equals(importParameters.getCorpusElement().getAttribute("annotate"));
+			if (annotate && annotater != null) {
+				if (monitor != null) System.out.println("-- ANNOTATE - Running NLP tools");
+				annotater.process();
+				isSuccessful = isSuccessful & annotater.isSuccessFul();
+				if (!isSuccessful) {
+					System.out.println("Error while importing corpus during 'annotate' step, reason="+annotater.getReason());
+					return;
+				}
+			} else {
+				//System.out.println("XML-TXM files already annotated.");
+			}
+		} else {
+			System.out.println("Updating corpus...");
+		}
+		
+		//System.out.println("GET FILES ORDER");
+		final ArrayList<File> files = getTXMFilesOrder();
+		
+		Thread Tcompiler = new Thread() {
+			public void run() {
+				if (compiler != null) {
+					if (monitor != null) System.out.println("-- COMPILING - Building Search Engine indexes");
+					compiler.process(files);
+					isSuccessful = isSuccessful & compiler.isSuccessFul();
+					if (!isSuccessful) {
+						System.out.println("Error while importing corpus during 'compiler' step, reason="+compiler.getReason());
+						return;
+					}
+				} else {
+					System.out.println("No CQP index created.");
+				}
+			}
+		};
+
+		Thread Tpager = new Thread() {
+			public void run() {
+
+				if (pager != null) {
+					if (monitor != null) System.out.println("-- EDITION - Building edition");
+					pager.process(files);
+					isSuccessful = isSuccessful & pager.isSuccessFul();
+					if (!isSuccessful) {
+						System.out.println("Error while importing corpus during 'pager' step, reason="+pager.getReason());
+						return;
+					}
+				} else {
+					System.out.println("No edition produced.");
+				}
+			}
+		};
+
+		Tcompiler.start();
+		if (!multithread) {
+			Tcompiler.join(); // wait for the end if not multithreaded
+			if (!isSuccessful) { // don't call pager is compiler step failed
+				return;
+			}
+		}
+		
+		Tpager.start();
+		if (multithread) Tcompiler.join(); // wait for both thread to end
+		Tpager.join();		
+	}
+	
+	protected ArrayList<File> getTXMFilesOrder() {
+		//System.out.println("DEFAULT FILES ORDER");
+		File txmDirectory = new File(binaryDirectory, "txm/"+corpusName);
+		ArrayList<File> files = new ArrayList<File>(Arrays.asList(txmDirectory.listFiles(new FileFilter() {
+			@Override
+			public boolean accept(File file) {
+				return file.isFile() && file.getName().endsWith(".xml");
+			}
+		})));
+		
+		Collections.sort(files);
+		
+		return files;
+	}
+
+
+	public void end() {
+		File paramFile = new File(binaryDirectory, "import.xml");
+		try {
+			DomUtils.save(importParameters.root.getOwnerDocument(), paramFile);
+			isSuccessful = true;
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			isSuccessful = false;
+		}
+	}
+	
+	public String getCorpusName() {
+		return corpusName;
+	}
+
+	public String getReason() {
+		return reason;
+	}
+
+	public boolean isSuccessFul() {
+		return isSuccessful;
+	}
+
+	public BaseParameters getParameters() {
+		return importParameters;
+	}
+
+	public File getSourceDirectory() {
+		return sourceDirectory;
+	}
+
+	public File getBinaryDirectory() {
+		return binaryDirectory;
+	}
+	
+	public void process() throws InterruptedException {
+		start();
+		if (isSuccessful)
+			end();
+	}
+
+	public static void main(String[] args) {
+		File importParametersFile = new File("/home/mdecorde/xml/brown/import.xml");
+
+		ImportModule module = new ImportModule(importParametersFile);
+		System.out.println("Parameters: "+module.getParameters());
+		try {
+			module.start();
+
+			if (module.isSuccessful) {
+				System.out.println("Import sucessful. reloading corpora...");
+			} else {
+				System.out.println("Import failed, reason = "+module.getReason());
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+}

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/ImportModule.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZCompilerStep.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZCompilerStep.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZCompilerStep.groovy	(revision 728)
@@ -0,0 +1,267 @@
+package org.txm.importer.xtz;
+
+import java.io.File;
+import javax.xml.stream.*
+import java.net.URL
+import java.util.HashMap;
+import org.txm.utils.*
+
+public class XTZCompilerStep {
+
+	static String FORM = "form";
+	static String ANA = "ana";
+	static String ID = "id";
+	static String TYPE = "type";
+	static String TAB = "\t";
+	static String QUOTE = "\"";
+
+	File xmlFile
+	File wtcFile
+	String textname, corpusname, projectname;
+	boolean normalizeAttributeValues = false;
+	boolean normalizeAnaValues = true;
+	boolean normalizeFormValues = true;
+
+	def inputData;
+	XMLInputFactory factory;
+	XMLStreamReader parser;
+	OutputStreamWriter output;
+
+	def anavalues = [:];
+	def anatypes;
+
+	String WTAG = "w"
+
+	public void setNormalizeAttributeValues(boolean n) {
+		this.normalizeAttributeValues = n;
+	}
+
+	public void setNormalizeAnaValues(boolean n) {
+		this.normalizeAnaValues = n;
+	}
+
+	public void setNormalizeFormValues(boolean n) {
+		this.normalizeFormValues = n;
+	}
+
+	public XTZCompilerStep(File xmlFile, File wtcFile, String textname, String corpusname, String projectname, def anatypes, def wtag) {
+		this.xmlFile = xmlFile;
+		this.wtcFile = wtcFile;
+		this.textname = textname
+		this.corpusname = corpusname;
+		this.projectname = projectname;
+		this.anatypes = anatypes;
+		this.WTAG = wtag
+
+		try {
+			inputData = xmlFile.toURI().toURL().openStream();
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+
+		} catch (Exception ex) {
+			System.err.println("Exception while parsing $xmlFile : "+ex);
+		}
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File f) {
+		try {
+			output = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(f)) , "UTF-8");
+			return true;
+		} catch (Exception e) {
+			System.err.println(e);
+			return false;
+		}
+	}
+
+	/**
+	 * Transfom file wtc.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	public boolean process()
+	{
+		if (!createOutput(wtcFile))
+			return false;
+
+		String headvalue=""
+		String vAna = "";
+		String vForm = "";
+		String wordid= "";
+		String vHead = "";
+
+
+		int p_id = 0;
+		int s_id = 0;
+
+		def divs = []
+		def ncounts = [:] // contains the n values per tags with no attribute
+
+		boolean captureword = false;
+		boolean flagWord = false;
+		boolean flagForm = false;
+		boolean flagAna = false;
+
+		String anatype = "";
+		String anavalue = "";
+		boolean stopAtFirstSort = true;
+		boolean foundtei = false;
+		boolean foundtext = false;
+
+		try {
+			String localname;
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+			{
+				switch (event) {
+					case XMLStreamConstants.START_ELEMENT:
+						localname = parser.getLocalName().toLowerCase();
+						if ("tei".equals(localname)) foundtei = true;
+						switch (localname) {
+							case "text":
+								foundtext = true;
+								output.write("<text id=\""+textname+"\" base=\""+corpusname+QUOTE + " project=\""+projectname+QUOTE);
+								for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+									String attrname = parser.getAttributeLocalName(i);
+									String attrvalue = parser.getAttributeValue(i)
+
+									if (normalizeAttributeValues)
+										attrvalue = attrvalue.trim();
+
+									if (attrname != ID)
+										output.write(" "+attrname.toLowerCase()+"=\""+attrvalue+QUOTE)
+								}
+								output.write(">\n");
+
+								break;
+
+							case WTAG:
+								for (int i = 0 ; i < parser.getAttributeCount(); i++) {
+									if (parser.getAttributeLocalName(i).equals(ID)) {
+										wordid = parser.getAttributeValue(i);
+									}
+								}
+								anavalues = [:];
+								flagWord = true
+								break;
+							case FORM:
+								flagForm = true;
+								vForm = "";
+								vAna = "";
+								break;
+
+							case ANA:
+								flagAna = true;
+								anavalue = "";
+								for (int i = 0 ; i < parser.getAttributeCount(); i++) {
+									//println parser.getAttributeLocalName(i)+"="+parser.getAttributeValue(i)
+									if (TYPE.equals(parser.getAttributeLocalName(i))) {
+										anatype = parser.getAttributeValue(i).substring(1);//remove the #
+										break;
+									}
+								}
+								break;
+
+							default:
+								if (foundtei && !foundtext) break;
+
+								output.write("<"+localname);
+
+								for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+									String attrname = parser.getAttributeLocalName(i);
+
+									String attrvalue = parser.getAttributeValue(i)
+									if (normalizeAttributeValues)
+										attrvalue = attrvalue.trim();
+
+									output.write(" "+attrname.toLowerCase()+"=\""+attrvalue+QUOTE)
+								}
+								if (parser.getAttributeCount() == 0) { // add the n attribute
+									if (!ncounts.containsKey(localname)) ncounts.put(localname, 0);
+									int ncount = ncounts.get(localname);
+									ncounts.put(localname, ncount+1);
+									output.write(" n=\""+ncount+QUOTE)
+								}
+								output.write(">\n");
+						}
+						break;
+
+					case XMLStreamConstants.END_ELEMENT:
+						localname = parser.getLocalName().toLowerCase();
+						switch (localname) {
+							case WTAG:
+								for (String type : anatypes) {
+									def v = anavalues.get(type);
+									if (v != null) vAna +=TAB+v;
+									else vAna +=TAB;
+								}
+								vForm = vForm.replaceAll("\n", "").replaceAll("&", "&amp;").replaceAll("<", "&lt;");
+								if (vAna != null) {
+									output.write(vForm+TAB+wordid+vAna+"\n");
+								}
+								vAna = "";
+								vForm = "";
+								flagWord = false;
+								break;
+
+							case "tei":
+								break;
+							case FORM:
+								flagForm = false;
+								break;
+							case ANA:
+								anavalues.put(anatype, anavalue)
+								flagAna = false;
+								break;
+							default:
+								if (foundtei && !foundtext) break;
+
+								output.write("</"+localname+">\n");
+						}
+						break;
+
+					case XMLStreamConstants.CHARACTERS:
+						if (flagWord) {
+							if (flagForm) {
+								if (normalizeFormValues) {
+									vForm += parser.getText().trim();
+								} else {
+									vForm += parser.getText();
+								}
+							}
+							if (flagAna) {
+								if (normalizeAnaValues)
+									anavalue += parser.getText().trim();
+								else
+									anavalue += parser.getText();
+							}
+						}
+						break;
+				}
+			}
+
+			output.close();
+			parser.close();
+		} catch (Exception ex) {
+			System.out.println("Exception while parsing " + inputData+" of Text "+textname+" : "+ex);
+			File errorDir = null
+			try {
+				errorDir = new File(wtcFile.getParentFile(), "compiler-error")
+				println "Warning: Moving $xmlFile to $errorDir"
+				errorDir.mkdir();
+				FileCopy.copy(xmlFile, new File(errorDir, xmlFile.getName()))
+			} catch(Exception eCopy) {
+				println "Error while moving "+xmlFile+" to "+errorDir+" : "+eCopy
+			}
+			return false;
+		}
+		return true;
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZCompiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZCompiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZCompiler.groovy	(revision 728)
@@ -0,0 +1,249 @@
+package org.txm.importer.xtz
+
+import java.io.File;
+
+import org.txm.*
+import org.txm.importer.SAttributesListener
+import org.txm.importer.cwb.*
+import org.txm.stat.utils.ConsoleProgressBar
+
+import javax.xml.stream.*
+
+
+class XTZCompiler extends Compiler {
+
+	SAttributesListener sattrsListener; // store scanned structures
+	private def anatypes = new HashSet<String>() // store scanned word attributes
+	
+	String regPath;
+	String cwbLoc;
+	String corpusname;
+	String wtag;
+	
+	boolean doNormalizeAttributeValues = false;
+	boolean doNormalizeAnaValues = true;
+	
+	public XTZCompiler(ImportModule module) {
+		super(module);
+
+		corpusname = module.getParameters().getCorpusName();
+		regPath = module.getBinaryDirectory().getAbsolutePath() + "/registry/"+corpusname.toLowerCase()
+		cwbLoc = Toolbox.getParam(Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+		
+		wtag = module.getParameters().getWordElement().getTextContent();
+		
+		doNormalizeAttributeValues = "true".equals(module.getParameters().getKeyValueParameters().get(ImportKeys.NORMALISEATTRIBUTEVALUES))
+		doNormalizeAnaValues = "true".equals(module.getParameters().getKeyValueParameters().get(ImportKeys.NORMALISEANAVALUES))
+	}
+
+	public void process(ArrayList<File> files) {
+		super.process(files); // set member
+		
+		if (files == null) files = inputDirectory.listFiles();
+		
+		if (!doScanStep()) return;
+		if (!doWTCStep()) return;
+		if (!doCWBEncodeStep()) return;
+		if (!doCWBMakeAllStep()) return;
+		
+		String cleanDirectories = module.getParameters().getKeyValueParameters().get(ImportKeys.CLEAN);
+		if ("true".equals(cleanDirectories)) {
+			new File(module.getBinaryDirectory(), "wtc").deleteDir()
+		}
+		
+		isSuccessFul = true;
+	}
+
+	/**
+	 * Scan all XML-TXM files to find out structures and word properties
+	 */
+	public boolean doScanStep() {
+		// get all anatypes		
+		sattrsListener = SAttributesListener.scanFiles(inputDirectory, wtag)
+		println "-- Listing structures&properties to create for "+files.size()+" XML-TXM files..."
+		ConsoleProgressBar cpb = new ConsoleProgressBar(files.size())
+		for (File f : files) {
+			try {
+				cpb.tick();
+				getAnaTypes(f)
+			} catch (Exception e) {
+				println "Error while processing $f text: "+e
+				e.printStackTrace();
+				return false;
+			}
+		}
+		println ""
+		return true;
+	}
+	
+	private void getAnaTypes(File xmlFile) {
+		def inputData = xmlFile.toURI().toURL().openStream();
+		def factory = XMLInputFactory.newInstance();
+		def parser = factory.createXMLStreamReader(inputData);
+		boolean start = false;
+		String ANA = "ana"
+		String TYPE = "type"
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) { // start elem
+				if (wtag.equals(parser.getLocalName())) {
+					start = true;
+				} else if (start && ANA.equals(parser.getLocalName())) { // ana elem
+					for (int i = 0 ; i < parser.getAttributeCount(); i++) { // find @type
+						if (TYPE.equals(parser.getAttributeLocalName(i))) { // @type
+							anatypes.add(parser.getAttributeValue(i).substring(1)); //remove the #
+							break;
+						}
+					}
+				}
+			} else if (event == XMLStreamConstants.END_ELEMENT) { // start elem
+				if (wtag.equals(parser.getLocalName())) {
+					start = false;
+				}	
+			}
+		}
+		parser.close()
+
+//		for (String type : types)
+//			if (!anatypes.contains(type))
+//				anatypes << type
+	}
+
+	def wtcFiles = []
+	public boolean doWTCStep() {
+		println "-- Building WTC files $inputDirectory..."
+		wtcDirectory.mkdir(); // if not created
+		
+		ConsoleProgressBar cpb = new ConsoleProgressBar(files.size())
+		for (File xmlFile : files) {
+			cpb.tick();
+			String textname = xmlFile.getName();
+			int idx = textname.lastIndexOf(".")
+			if (idx > 0) textname = textname.substring(0, idx)
+			
+			File wtcFile = new File(wtcDirectory, textname + ".wtc")
+			wtcFiles << wtcFile
+			// skip step if wtcFile is more recent than xmlFile
+			if (wtcFile.exists() && wtcFile.lastModified() >= xmlFile.lastModified()) continue;
+			
+			XTZCompilerStep step = new XTZCompilerStep(xmlFile, wtcFile, textname, corpusname, "default", anatypes, wtag)
+			step.setNormalizeAnaValues(doNormalizeAnaValues)
+			step.setNormalizeAttributeValues(doNormalizeAttributeValues)
+			if (!step.process()) {
+				reason = "Fail to process $xmlFile."
+				return false;
+			}
+		}
+		println ""
+		return true;
+	}
+
+	public boolean doCWBEncodeStep() {
+		println "-- Running cwb-encode..."
+		CwbEncode cwbEn = new CwbEncode()
+		cwbEn.setDebug(debug)
+		
+		List<String> pargs = []
+		pargs.add("id")
+		for (String ana : anatypes)
+			pargs.add(ana)
+
+		String[] pAttrs = pargs
+
+		def structs = sattrsListener.getStructs()
+		def structsProf = sattrsListener.getProfs()
+
+		if (debug) {
+			println structs
+			println structsProf
+		}
+		
+		List<String> sargs = new ArrayList<String>()
+		def tmpTextAttrs = []
+		for (String name : structs.keySet()) {
+			if (name == "text") {
+				for (String value : structs.get(name)) // append the attributes
+					tmpTextAttrs << value // added after
+				continue;
+			}
+
+			String concat = name+":"+structsProf.get(name); // append the depth
+			for (String attributeName : structs.get(name)) // append the attributes
+				concat += "+"+attributeName.toLowerCase();
+				
+			if (structs.get(name).size() == 0) {
+				concat += "+n";
+			} else {
+				if (!structs.get(name).contains("n"))
+					concat += "+n"
+			}
+				
+			if ((name == "p" || name == "body" || name == "back" || name == "front")
+				 && !concat.contains("+n+") && !concat.endsWith("+n"))
+				concat += "+n"
+				
+			sargs.add(concat)
+		}
+
+		String textSAttributes = "text:0+id+base+project";
+		for (String name : tmpTextAttrs) {
+			if (!("id".equals(name) || "base".equals(name) || "project".equals(name)))
+				textSAttributes += "+"+name.toLowerCase()
+		}
+
+		sargs.add(textSAttributes)
+		sargs.add("txmcorpus:0+lang")
+
+		sargs.sort()
+
+		String[] sAttributes = sargs
+		String[] pAttributes = pAttrs
+		println " Word properties: "+pAttributes
+		println " Structures: "+sargs
+		File allwtcFile = new File(wtcDirectory, "all.wtc");
+		try {		
+			if (!CwbEncode.concat(wtcFiles, allwtcFile)) {
+				println "Fail to write the master wtc file: "+allwtcFile
+				return false;
+			}
+						
+			cwbEn.run(cwbLoc + "cwb-encode", outputDirectory.getAbsolutePath() + "/$corpusname",
+					allwtcFile.getAbsolutePath(),
+					regPath, pAttributes, sAttributes, false);
+				
+			allwtcFile.delete(); // clean
+		} catch (Exception e) {
+			println "Error while running cwb-encode: "+e
+			e.printStackTrace()
+			allwtcFile.delete(); // clean 
+			return false;
+		}
+		println ""
+		return true;
+	}
+
+	public boolean doCWBMakeAllStep() {
+		println "-- Running cwb-makeall..."
+		try {
+			CwbMakeAll cwbMa = new CwbMakeAll();
+			cwbMa.setDebug(debug);
+
+			if (!new File(regPath).exists()) {
+				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			cwbMa.run(new File(cwbLoc,"cwb-makeall").getAbsolutePath(), corpusname, module.getBinaryDirectory().getAbsolutePath() + "/registry");
+			
+			// remove milestones from CWB registry and data files
+			FixMilestoneDeclarations fm = new FixMilestoneDeclarations(
+				new File(regPath), new File(outputDirectory.getAbsolutePath(), corpusname));			
+			if (!fm.process()) {
+				println "Fail to verify&fix milestone declarations"
+				return false
+			}
+		} catch (Exception e) {
+			println "Error while running cwb-makeall: "+e
+			return false;
+		}
+		return true;
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZImport.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZImport.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/XTZImport.groovy	(revision 728)
@@ -0,0 +1,155 @@
+package org.txm.importer.xtz;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+
+import org.txm.functions.ProgressWatcher;
+import org.txm.importer.DomUtils;
+import org.txm.metadatas.Metadatas
+import org.txm.objects.BaseParameters
+import org.txm.utils.FileCopy;
+import org.txm.*
+import org.w3c.dom.Element
+
+public class XTZImport extends ImportModule {
+
+	public XTZImport(File importParametersFile) {
+		super(importParametersFile);
+	}
+
+	public XTZImport(BaseParameters importParameters) {
+		super(importParameters);
+	}
+
+	@Override
+	public void init(BaseParameters p) {
+		super.init(p);
+		
+		importer = new XTZImporter(this)
+		compiler = new XTZCompiler(this)
+		annotater = new TTAnnotater(this);
+		pager = new XTZPager(this)
+	}
+	
+	@Override
+	protected ArrayList<File> getTXMFilesOrder() {
+		//System.out.println("XTZ FILES ORDER");
+		if (importer == null) {
+			println "no importer step, using default text order"
+			return super.getTXMFilesOrder();
+		}
+		Metadatas metadata = importer.getMetadata();
+		if (metadata == null) {
+			println "no metadata, using default text order"
+			return super.getTXMFilesOrder();
+		}
+		File txmDirectory = new File(binaryDirectory, "txm/"+corpusName);
+		ArrayList<File> files = new ArrayList<File>(Arrays.asList(txmDirectory.listFiles(new FileFilter() {
+			@Override
+			public boolean accept(File file) {
+				return file.isFile() && file.getName().endsWith(".xml");
+			}
+		})));
+	
+		final HashMap<File, String> textorder = new HashMap<File, String>();
+		for (File f : files) {
+			HashMap<String, String> m = metadata.getTextMetadata(f);
+			if (m != null && m.containsKey("textorder")) textorder[f] = m["textorder"];
+		}
+		println "Sorting texts using 'textorder' metadata values: "+textorder
+		Collections.sort(files, new Comparator<File>() {
+			public int compare(File f1, File f2) {
+				String o1 = textorder[f1];
+				String o2 = textorder[f2];
+				if (o1 == null && o2 == null) {
+					return f1.getName().compareTo(f2.getName());
+				} else if (o1 == null) {
+					return 1
+				} else if (o2 == null) {
+					return -1
+				} else {
+					int c = o1.compareTo(o2);
+					if (c == 0) return f1.getName().compareTo(f2.getName());
+					else return c;
+				}
+			}
+		});
+		//println files
+		return files;
+	}
+	
+	public void start() throws InterruptedException {
+		super.start();
+
+		if (isSuccessful) {
+			
+			//declare a local KR
+			List<String> krnames = importParameters.getKnowledgeRepositoryNames();
+			if (krnames.size() == 0) {
+				importParameters.createKnowledgeRepositoryElement("DEFAULT"); // set a default KR shared by all XTZ corpus
+			} else if (krnames.size() == 1 && krnames.get(0).equals("DEFAULT")) {
+				// nothing to do
+			} else {
+				println("Corpus is using custom Knowledge repositories: "+importParameters.getKnowledgeRepositoryNames());
+			}
+			
+			//copy sub directories
+			if (isUpdatingCorpus()) {
+
+			} else {
+				def dirToCopy = ["xsl", "css", "dtd"]
+				println "--- Copying subdirectories $dirToCopy"
+				for (String dir : dirToCopy) {
+					File origDirectory = new File(this.sourceDirectory, dir)
+					if (origDirectory.exists()) {
+						print "."
+						File copyDirectory = new File(this.binaryDirectory, dir)
+						FileCopy.copyFiles(origDirectory, copyDirectory)
+					}
+				}
+				println ""
+			}
+		}
+	}
+
+	public static void main(String[] args) {
+
+		long start = System.currentTimeMillis()
+
+		String userDir = System.getProperty("user.home")
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		//Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File("C:\\Program Files\\treetagger\\models"));//for Windows
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(userDir, "TXM"));
+
+		//File importParametersFile = new File("/home/mdecorde/xml/brown-for-xtz/import.xml");
+		//		File importParametersFile = new File("/home/mdecorde/xml/qgraalc/qgraal_cw/import.xml"); // new import
+		//File importParametersFile = new File("/home/mdecorde/TXM/corpora/QGRAALXTZ/import.xml"); // corpus update
+		//		File importParametersFile = new File("/home/mdecorde/xml/annotation/import.xml"); // new import
+		//File importParametersFile = new File("/home/mdecorde/xml/baiptest/import.xml"); // new import
+		//File importParametersFile = new File("/home/mdecorde/TXM/corpora/BAIP/import.xml"); // corpus update
+		File importParametersFile = new File("/home/mdecorde/xml/xtzsmall/import.xml");
+		BaseParameters b = new BaseParameters(importParametersFile);
+		b.getKeyValueParameters().put(ImportKeys.CLEAN, "false")
+		b.getKeyValueParameters().put(ImportKeys.MULTITHREAD, "false")
+		b.getKeyValueParameters().put(ImportKeys.DEBUG, "true")
+		b.getKeyValueParameters().put(ImportKeys.UPDATECORPUS, "false")
+
+		XTZImport i = new XTZImport(b);
+		i.start();
+		
+		println "Done: "+i.isSuccessful
+
+		long end = System.currentTimeMillis()
+		println "TIME: "+(end-start)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Annotater.java
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Annotater.java	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Annotater.java	(revision 728)
@@ -0,0 +1,21 @@
+package org.txm.importer.xtz;
+
+import java.io.File;
+
+
+/**
+ * 
+ * Takes the XML-TXM files and wrap a TAL Tool to update the XML-TXM files
+ * 
+ * @author mdecorde
+ *
+ */
+public abstract class Annotater extends ImportStep {
+
+	public Annotater(ImportModule module) {
+		super(module);
+		
+		inputDirectory = new File(module.getBinaryDirectory(), "txm/"+module.corpusName);
+		outputDirectory = new File(module.getBinaryDirectory(), "txm");
+	}
+}

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Annotater.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Pager.java
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Pager.java	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Pager.java	(revision 728)
@@ -0,0 +1,49 @@
+package org.txm.importer.xtz;
+
+import java.io.File;
+import java.util.ArrayList;
+
+import org.txm.utils.DeleteDir;
+
+/**
+ * Takes the XML-TXM files and build an edition
+ * 
+ * @author mdecorde
+ *
+ */
+public class Pager extends ImportStep {
+
+	protected File htmlDirectory;
+	protected String corpusname;
+	protected ArrayList<File> files;
+
+	public Pager(ImportModule module, String editionName) {
+		super(module);
+
+		corpusname = module.getCorpusName();
+
+		inputDirectory = new File(module.getBinaryDirectory(), "txm/"+module.getCorpusName());
+		htmlDirectory = new File(module.getBinaryDirectory(), "HTML/"+corpusname);
+		outputDirectory  = new File(htmlDirectory, editionName);
+
+		if (!module.isUpdatingCorpus()) {
+			DeleteDir.deleteDirectory(outputDirectory);
+			outputDirectory.mkdirs();
+		}
+	}
+
+	@Override
+	public void cancel() {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void process() {
+		process(null); // no default files order set
+	}
+	
+	public void process(ArrayList<File> files) {
+		this.files = files;
+	}
+}

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xtz/Pager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/StaxStackWriter.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/StaxStackWriter.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/StaxStackWriter.groovy	(revision 728)
@@ -0,0 +1,259 @@
+package org.txm.importer
+
+import java.nio.charset.Charset;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.*;
+
+import org.eclipse.core.runtime.Platform;
+
+public class StaxStackWriter implements XMLStreamWriter {
+
+	XMLStreamWriter writer;
+	OutputStream output;
+	def events = [];
+	
+	public StaxStackWriter(File file) {
+		this(new BufferedOutputStream(new FileOutputStream(file)));
+	}
+	
+	public StaxStackWriter(File file, String encoding) {
+		this(new BufferedOutputStream(new FileOutputStream(file)), encoding);
+	}
+	
+	public StaxStackWriter(OutputStream output) {
+		this(output, "UTF-8");//create a new file
+	}
+	
+	public StaxStackWriter(OutputStream output, String encoding) {
+		XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		this.output = output
+		this.writer = factory.createXMLStreamWriter(output, encoding);//create a new file
+	}
+
+	Charset UTF8 = Charset.forName("UTF-8");
+	public void write(String txt) {
+		output.write(txt.getBytes(UTF8))
+	}
+	
+	public void writeEndElements() {
+		int size = events.size();
+		for (int i = 0 ; i < size ; i++) {
+			writeEndElement();
+		}
+		events = [];
+	}
+
+	public void writeStartElements(def tagsToWrite) {
+		for (String tag : tagsToWrite)
+			writeStartElement(tag);
+	}
+
+	public def getTagStack() {
+		return events;
+	}
+
+	@Override
+	public void close () throws XMLStreamException {
+		writer.close();
+		output.close();
+	}
+
+	@Override
+	public void flush () throws XMLStreamException {
+		writer.flush();
+
+	}
+
+	@Override
+	public NamespaceContext getNamespaceContext() {
+		return writer.getNamespaceContext();
+	}
+
+	@Override
+	public String getPrefix (String uri) throws XMLStreamException {
+		return writer.getPrefix(uri);
+	}
+
+	@Override
+	public Object getProperty (String name) throws IllegalArgumentException {
+		return writer.getProperty(name);
+	}
+
+	@Override
+	public void setDefaultNamespace (String uri) throws XMLStreamException {
+		writer.setDefaultNamespace(uri);
+	}
+
+	@Override
+	public void setNamespaceContext(NamespaceContext context)
+	throws XMLStreamException {
+		writer.setNamespaceContext(context);
+	}
+
+	@Override
+	public void setPrefix (String prefix, String uri) throws XMLStreamException {
+		writer.setPrefix(prefix, uri);
+	}
+
+	@Override
+	public void writeAttribute (String localName, String value) throws XMLStreamException {
+		writer.writeAttribute(localName, value);
+	}
+
+	@Override
+	public void writeAttribute (String namespaceURI, String localName, String value) throws XMLStreamException {
+		writer.writeAttribute(namespaceURI, localName, value);
+	}
+
+	@Override
+	public void writeAttribute (String prefix, String namespaceURI, String localName, String value) throws XMLStreamException {
+		writer.writeAttribute(prefix, namespaceURI, localName, value);
+	}
+
+	@Override
+	public void writeCData (String data) throws XMLStreamException {
+		writer.writeCData(data);
+	}
+
+	@Override
+	public void writeCharacters (String text) throws XMLStreamException {
+		writer.writeCharacters(text);
+	}
+
+	@Override
+	public void writeCharacters (char[] text, int start, int len) throws XMLStreamException {
+		writer.writeCharacters(text, start, len);
+	}
+
+	@Override
+	public void writeComment (String data) throws XMLStreamException {
+		writer.writeComment(data);
+	}
+
+	@Override
+	public void writeDTD (String dtd) throws XMLStreamException {
+		writer.writeDTD(dtd);
+	}
+
+	@Override
+	public void writeDefaultNamespace(String namespaceURI)
+	throws XMLStreamException {
+		writer.writeDefaultNamespace(namespaceURI);
+	}
+
+	public void writeElement (String localName, String text) throws XMLStreamException {
+		writer.writeStartElement(localName);
+		writer.writeCharacters(text);
+		writer.writeEndElement();
+	}
+	
+	public void writeElement (String localName, def map, String text) throws XMLStreamException {
+		writer.writeStartElement(localName);
+		for (def key : map.keySet()) writeAttribute(key.toString(), map[key].toString());
+		writer.writeCharacters(text);
+		writer.writeEndElement();
+	}
+
+	@Override
+	public void writeEmptyElement (String localName) throws XMLStreamException {
+		writer.writeEmptyElement(localName);
+	}
+
+	public void writeEmptyElement (String localName, def map) throws XMLStreamException {
+		writer.writeEmptyElement(localName);
+		for (def key : map.keySet())
+			writeAttribute(key.toString(), map[key].toString());
+	}
+
+	@Override
+	public void writeEmptyElement(String namespaceURI, String localName)
+	throws XMLStreamException {
+		writer.writeEmptyElement(namespaceURI, localName);
+	}
+
+	@Override
+	public void writeEmptyElement (String prefix, String localName, String namespaceURI) throws XMLStreamException {
+		writer.writeEmptyElement(prefix, localName, namespaceURI);
+	}
+
+	@Override
+	public void writeEndDocument () throws XMLStreamException {
+		writer.writeEndDocument();
+	}
+
+	@Override
+	public void writeEndElement () throws XMLStreamException {
+		writer.writeEndElement();
+		events.pop()
+
+	}
+
+	@Override
+	public void writeEntityRef (String name) throws XMLStreamException {
+		writer.writeEntityRef(name);
+	}
+
+	@Override
+	public void writeNamespace(String prefix, String namespaceURI)
+	throws XMLStreamException {
+		writer.writeNamespace(prefix, namespaceURI);
+	}
+
+	@Override
+	public void writeProcessingInstruction(String target)
+	throws XMLStreamException {
+		writer.writeProcessingInstruction(target);
+	}
+
+	@Override
+	public void writeProcessingInstruction(String target, String data)
+	throws XMLStreamException {
+		writer.writeProcessingInstruction(target, data);
+	}
+
+	@Override
+	public void writeStartDocument () throws XMLStreamException {
+		writer.writeStartDocument();
+
+	}
+
+	@Override
+	public void writeStartDocument (String version) throws XMLStreamException {
+		writer.writeStartDocument(version);
+	}
+
+	@Override
+	public void writeStartDocument(String encoding, String version)
+	throws XMLStreamException {
+		writer.writeStartDocument(encoding, version);
+	}
+
+	@Override
+	public void writeStartElement (String localName) throws XMLStreamException {
+		writer.writeStartElement(localName);
+		events << localName
+
+	}
+	
+	public void writeStartElement (String localName, def map) throws XMLStreamException {
+		writeStartElement(localName);
+		for (def key : map.keySet()) {
+			writeAttribute(key.toString(), map[key].toString());
+		}
+	}
+
+	@Override
+	public void writeStartElement(String namespaceURI, String localName)
+	throws XMLStreamException {
+		writer.writeStartElement(namespaceURI, localName);
+		events << localName
+	}
+
+	@Override
+	public void writeStartElement(String prefix, String localName,
+	String namespaceURI) throws XMLStreamException {
+		writer.writeStartElement(prefix, localName, namespaceURI);
+		events << localName
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/BuildGraalGSP.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/BuildGraalGSP.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/BuildGraalGSP.groovy	(revision 728)
@@ -0,0 +1,205 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.graal;
+
+import org.txm.importer.*
+// TODO: Auto-generated Javadoc
+
+/**
+ * The Class BuildGraalGSP.
+ *
+ * @author sheiden
+ */
+
+public class BuildGraalGSP{
+ 	
+	 /** The cwb loc. */
+	 String cwbLoc;
+	
+	/** The root dir. */
+	String rootDir;
+	
+	/** The in dir. */
+	String inDir;
+	
+	/** The in dir xsl. */
+	String inDirXsl;
+	 	
+	//dossier qui contiendra les gsp et vues dipl, cour, facs, trad et wtc
+	
+	/** The out dir. */
+	String outDir;
+	//dossiers qui contient le registre cqp et le dossier data (qui contient les corpus)
+	
+	/** The out dir txm. */
+	String outDirTxm;
+	//dossier qui contient les xml sources dÃ©coupÃ©s
+	
+	/** The out dir cut. */
+	String outDirCut;
+	
+	/** The in file. */
+	String inFile;
+	
+	/** The in file2. */
+	String inFile2;
+	
+	/** The out file. */
+	String outFile;
+	
+	/** The out file2. */
+	String outFile2;
+	
+	/**
+	 * Instantiates a new builds the graal gsp.
+	 *
+	 * @param rootDir the directory which contains sources and which will contains result files
+	 * @param cwbLoc the location of cwb-encode and cwb-makeall
+	 * @param inFile the path to the graalcm file
+	 * @param inFile2 the path to the graalfrmod file
+	 * @param outFile the prefix of gsp outfiles
+	 * @param outFile2 the prefix of gsp outfiles
+	 */
+	public BuildGraalGSP(String	rootDir, String cwbLoc, String inFile,
+	String inFile2,	String outFile,	String outFile2)
+	{
+		this.rootDir = rootDir;
+		this.cwbLoc = cwbLoc;
+		this.inFile = inFile;
+		this.inFile2 = inFile2;
+		this.outFile = outFile;
+		this.outFile2 = outFile2;
+		this.inDir = this.rootDir;
+		this.inDirXsl = this.rootDir + "/src/xsl";
+		this.outDir = this.rootDir + "/imported/form/";//outdir of the .gsp
+		this.outDirTxm = this.rootDir + "/imported/corpora/";//outdir for data files & registry
+		this.outDirCut = this.rootDir + "/imported/cut/";
+		this.createDirs();
+	}
+	
+	/**
+	 * create outputs dir to prevent from "dir not found" error.
+	 */
+	private void createDirs()
+	{
+		new File(outDir).mkdir();
+		new File(outDir+"/dipl").mkdir();
+		new File(outDir+"/trad").mkdir();
+		new File(outDir+"/facs").mkdir();
+		new File(outDir+"/cour").mkdir();
+		new File(outDirTxm).mkdir();
+		new File(outDirCut).mkdir();
+	}
+
+	/**
+	 * process !!!.
+	 */
+	public boolean start()
+	{
+		if(!ValidateXml.test(new File(inDir + "src/"+inFile+".xml")))
+		{
+			println "Invalid source: "+inDir + "src/"+inFile+".xml";
+			return false;
+		}
+		
+		if(!ValidateXml.test(new File(inDir + "src/"+inFile2+".xml")))
+		{
+			println "Invalid source: "+inDir + "src/"+inFile2+".xml";
+			return false;
+		}
+		
+		def timportWTCestG
+		def nPage;
+		def temp;
+		def BBM;
+		def MAN;
+		def MAF;
+		def MAD;
+		def MTR;
+		//Ouverture des Xsl
+		//Decoupe et mise en forme des page
+		println "start"
+		for (int index = 1; index < 268; index++) 
+		{
+			println "loop" + index
+			
+			//URL url = new URL("file:///" + inDirXsl + "/breakByMilestone.xsl");
+			BBM = new ApplyXsl( inDirXsl + "/breakByMilestone.xsl");
+			//println "xsl applied"
+			MAN = new GraalApplyXsl(new URL("file:///" + inDirXsl + "/qgraal_cour.xsl"));
+			//println "xsl applied 2"
+			MAF = new GraalApplyXsl(new URL("file:///" + inDirXsl + "/qgraal_facs.xsl"));
+			//println "xsl applied 3 "
+			MAD = new GraalApplyXsl(new URL("file:///" + inDirXsl + "/qgraal_dipl.xsl"));
+			//println "xsl applied 4"
+			MTR = new GraalApplyXsl(new URL("file:///" + inDirXsl + "/qgraal_frmod.xsl"));
+			//println "xsl applied 5"
+			def testG = new GraalXpath();
+			//println "xpath done"
+			
+			nPage = testG.getXpathResponse(inDir + "src/"+inFile+ ".xml",  index+"").substring(4);//recuperation du numero de page
+			//nPage=index
+			println "npage = " + nPage
+			
+			URL url = new URL("file:///" + inDir + inFile+ ".xml");
+			//System.out.println("--Converting " + url.getFile() + " to web pages.");
+			
+			//BBM.setParam("pbval1", index);
+			//println "params set 1 : "
+			//BBM.setParams("pbval2", index + 1);
+			String[] params = ["pbval1", index,"pbval2", index+1]
+			//println "params set 2"
+			BBM.process(new URL("file:///" + inDir + "/src/" + inFile+ ".xml").getFile(), outDirCut+"/"+ inFile + "_" + nPage + ".xml",params);//decoupe ancienne version
+			println "BBM Done : "+inFile + "_" + nPage + ".xml"
+			//System.out.println "L'index est : " + index + " npage " + nPage;
+				System.out.println "----Pages gsp";
+				if (index<260) {
+				BBM.process(new URL("file:///" + inDir + "/src/" + inFile2+ ".xml").getFile(), outDirCut+"/"+ inFile2 + "_" + nPage + ".xml",params);//decoupe nouvelle version
+				}
+				System.out.println "----Break By MileStone.";
+				if(index<10)
+				{					
+				MAF.ApplyXsl(new URL("file:///" + outDirCut + "/" + inFile + "_" + nPage+ ".xml"), outDir + "facs", "_" + outFile + "_facs_" + nPage + ".gsp");//mise en page facsimilaire
+				System.out.println "----Building facsimile version.";
+				}
+				MAD.ApplyXsl(new URL("file:///" + outDirCut + "/" + inFile + "_" + nPage+ ".xml"), outDir + "dipl", "_" + outFile + "_dipl_" + nPage + ".gsp");//mise en page diplomatique
+				System.out.println "----Building diplomatic version.";
+				if(index<260)
+				{					
+				MTR.ApplyXsl(new URL("file:///" + outDirCut + "/" + inFile2 + "_" + nPage+ ".xml"), outDir + "trad", "_" + outFile2 + "_trad_" + nPage + ".gsp");//mise en forme traduction
+				System.out.println "----Building traduction version.";
+				}
+
+			MAN.ApplyXsl(new URL("file:///" + outDirCut + "/" + inFile + "_" + nPage + ".xml"), outDir + "cour", "_" + outFile + "_norm_" + nPage + ".gsp");//mise en forme courante
+			System.out.println "----Building current version.";
+			System.out.println "--Page " + nPage + " OK";
+		}
+		println "end"
+		return true;
+	}
+}
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/BuildGraalGSP.groovy
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_norm.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_norm.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_norm.xsl	(revision 728)
@@ -0,0 +1,129 @@
+<?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.
+-->
+
+
+
+<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: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: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: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: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: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: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: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="del">
+
+</xsl:template>
+
+
+
+<xsl:template match="name">
+	<xsl:value-of select="@reg"/>
+</xsl:template>
+
+                -->
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_norm.xsl
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_facs.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_facs.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_facs.xsl	(revision 728)
@@ -0,0 +1,235 @@
+<?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.
+-->
+
+<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: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: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: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: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: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="//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="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="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: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:name">
+                                                <xsl:value-of select="@reg"/>
+                                                </xsl:template>
+                                                
+                                -->
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_facs.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/qgraal_facs.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/qgraal_facs.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/qgraal_facs.xsl	(revision 728)
@@ -0,0 +1,192 @@
+<?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.
+-->
+
+                <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: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

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/qgraal_facs.xsl
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_cms.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_cms.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_cms.xsl	(revision 728)
@@ -0,0 +1,193 @@
+<?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">
+
+    <!-- ElÃ©ments communs Ã  toutes les prÃ©sentations -->
+
+    <xsl:output method="html" encoding="UTF-8" version="4.0" indent="yes"/>
+
+    <xsl:strip-space elements="*"/>
+
+    <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="//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 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: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: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>
+
+    <!-- fin Ã©lÃ©ments communs -->
+
+
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_cms.xsl
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_common.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_common.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_common.xsl	(revision 728)
@@ -0,0 +1,158 @@
+<?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">
+
+    <!-- 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: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;"'/>
+
+                
+                
+                <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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_common.xsl
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_dipl.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_dipl.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_dipl.xsl	(revision 728)
@@ -0,0 +1,183 @@
+<?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.
+-->
+
+<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:variable name="mode">dipl</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: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: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: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: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[@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: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: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>
+
+                <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:name">
+	<xsl:value-of select="@reg"/>
+</xsl:template>
+
+                -->
+</xsl:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/mdv_dipl.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/qgraal_frmod.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/qgraal_frmod.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/qgraal_frmod.xsl	(revision 728)
@@ -0,0 +1,175 @@
+<?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"> 
+
+                <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>
+
+                <!-- TEI-Header Processing -->
+                
+                <xsl:template match="//tei:teiHeader">
+                </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">
+                                <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

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/qgraal_frmod.xsl
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/breakByMilestone.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/breakByMilestone.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/breakByMilestone.xsl	(revision 728)
@@ -0,0 +1,75 @@
+<?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">
+
+    <!-- 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: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: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: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="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>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/breakByMilestone.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/qgraal_cour.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/qgraal_cour.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/qgraal_cour.xsl	(revision 728)
@@ -0,0 +1,583 @@
+<?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)
+
+                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"> 
+
+                <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="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>
+
+                <!-- 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>
+
+                <!-- 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: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

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/qgraal_cour.xsl
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/qgraal_dipl.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/qgraal_dipl.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/qgraal_dipl.xsl	(revision 728)
@@ -0,0 +1,407 @@
+<?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.
+-->
+
+
+
+<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: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>
+
+
+                
+                <!-- 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

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/qgraal_dipl.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/test.xsl
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/test.xsl	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/test.xsl	(revision 728)
@@ -0,0 +1,69 @@
+<?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: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/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 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:stylesheet>

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/xsl/test.xsl
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/GraalApplyXsl.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/GraalApplyXsl.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/GraalApplyXsl.groovy	(revision 728)
@@ -0,0 +1,122 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2014-09-15 10:51:15 +0200 (lun., 15 sept. 2014) $
+// $LastChangedRevision: 2836 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.graal
+
+import javax.xml.stream.*;
+import java.net.URL;
+import java.lang.Boolean
+import javax.xml.transform.TransformerFactory
+import javax.xml.transform.stream.StreamResult
+import javax.xml.transform.stream.StreamSource
+import java.util.Map
+
+// TODO: Auto-generated Javadoc
+/** The trans data. @author ayepdieu previous version of the script ApplyXsl */
+public class GraalApplyXsl{
+	private def transData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The source. */
+	private def source;
+	
+	/** The transformer. */
+	private def transformer;
+	
+	/**
+	 * Instantiates a new graal apply xsl.
+	 *
+	 * @param urlXsl the url xsl
+	 */
+	public GraalApplyXsl(URL urlXsl){
+		try 
+		{
+			FileInputStream inputStream = new FileInputStream(new File(urlXsl.getFile()));
+			factory = new net.sf.saxon.TransformerFactoryImpl();
+			source = new StreamSource(inputStream)
+			source.setSystemId(urlXsl.getPath());
+			transformer = factory.newTransformer(source)
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * Sets the params.
+	 *
+	 * @param name the name
+	 * @param value the value
+	 */
+	public void setParams(String name, int value) {
+	    transformer.setParameter(name, value);
+	}
+	
+	/**
+	 * Sets the params.
+	 *
+	 * @param name the name
+	 * @param value the value
+	 */
+	public void setParams(String name, String value) {
+	    transformer.setParameter(name, value);
+	}
+	
+	/**
+	 * Apply xsl.
+	 *
+	 * @param urlXml the url xml
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	public boolean ApplyXsl(URL urlXml, String dirPathName, String fileName) {
+		FileInputStream inputData = new FileInputStream(new File(urlXml.getFile()));
+		def output = new File(dirPathName, fileName)
+
+		transformer.transform( new StreamSource(inputData), new StreamResult(output) )
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) 
+	{
+		String sortie = "Page-test"
+		for (int index = 0; index < 1; index++) {
+			GraalApplyXsl DecTxt = new GraalApplyXsl(new URL("file:///home/ayepdieu/srcQuete/Sources/breakByMilestone.xsl"));
+			DecTxt.setParams("pbval1", index + 1);
+			DecTxt.setParams("pbval2", index + 2);
+			DecTxt.ApplyXsl(new URL("file:///home/ayepdieu/srcQuete/Sources/qgraal_cm_2009-07-d.xml"), "/home/ayepdieu/srcQuete/Decoupe", sortie + "_" + (index+ 1) + ".xml");
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/GraalImportCqp.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/GraalImportCqp.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/GraalImportCqp.groovy	(revision 728)
@@ -0,0 +1,397 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.graal
+
+import javax.xml.stream.*;
+import java.net.URL;
+import java.lang.Boolean
+import java.lang.System
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class GraalImportCqp.
+ *
+ * @author ayepdieu
+ * parse graal xml file to build the wtc the next step is to call importInCWB script
+ */
+public class GraalImportCqp{
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private def parser;
+	
+	/** The dir. */
+	private def dir;
+	
+	/** The output. */
+	private def output;
+	
+	
+	/**
+	 * initialize.
+	 *
+	 * @param url the url to the xmlfile to transform
+	 */
+	public GraalImportCqp(URL url){
+		try {
+			inputData = url.openStream();
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+			//System.out.println "ouverture du document en entree reussi";
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * create the output file writer.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(String dirPathName, String fileName){
+		try {
+			dir = new File(dirPathName)
+			output = new OutputStreamWriter(new FileOutputStream(new File(dir, fileName)) , "UTF-8")
+			//System.out.println "ouverture du document en sortie reussi";
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+	
+	/**
+	 * process !!!.
+	 *
+	 * @param dirPathName the output directory
+	 * @param fileName the outfile name
+	 * @return true, if successful
+	 */
+	public boolean transfomFileWtc(String dirPathName, String fileName){
+		if(findBody() && createOutput(dirPathName, fileName)){
+			String idColumn;
+			int idParagraph = 0;
+			int idSentence = 0;
+			int idLine = 0;
+			int q_id =0;
+			String idLinesuiv;
+			String idWord;
+			boolean flagVersion = false;
+			boolean flagWord = false;
+			boolean flagNorm = false;
+			boolean flagDipl = false;
+			boolean flagFacs = false;
+			//boolean flagSupplied = false;
+			int levelSupplied = 0;
+			int levelq = 0;
+			String typeWord = "";
+			String vWordDipl = "";
+			String vWordFacs = "";
+			String vWordNorm = "";
+			try {
+				for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+					switch (event) {
+						case XMLStreamConstants.START_ELEMENT:
+							switch (parser.getLocalName()) {
+								case "milestone":
+									if (parser.getAttributeValue(0) == "column") {
+										idColumn = parser.getAttributeValue(1);
+										idColumn = idColumn.substring(4);
+									}
+								break;
+								case "p":
+									idParagraph = parser.getAttributeValue(0).toInteger();
+									output.write "<p n=" + idParagraph +">\n";
+									//if(idParagraph < 13 && idParagraph > 4){
+										flagVersion = true;
+									/*}else{
+										flagVersion = false;
+									}*/
+								break;
+								case "s":
+//									String no = parser.getAttributeValue(0);
+//									if(no == null)
+//										idSentence = -1;
+//									else
+//										idSentence = no.toInteger();
+								idSentence++;
+									output.write "<s n=" + idSentence + " id=\"" + parser.getAttributeValue(1) + "\">\n";
+								break;
+								case "q":
+									output.write "<q n=\""+q_id+"\">\n";
+									q_id++;
+									//new
+									levelq = levelq + 1;
+								break;
+								
+								case "supplied":
+								levelSupplied++;
+								break;								
+								
+								case "lb":
+									idLinesuiv = parser.getAttributeValue(0);
+									if(!("facs" == idLinesuiv)){
+										idLine = idLinesuiv.toInteger();
+									}
+								break;
+								case "w":
+									typeWord = parser.getAttributeValue(0);
+									if(flagVersion  && null != parser.getAttributeValue(2)){
+										idWord = parser.getAttributeValue(2);
+									}else{
+										idWord = parser.getAttributeValue(1);
+									}
+									flagWord = true;
+									flagNorm = true;
+								break;
+								case "norm":
+									flagNorm = true;
+								break;
+								case "dipl":
+									flagDipl = true;
+								break;
+								case "facs":
+									flagFacs = true;
+								break;
+							}
+						break;
+						
+						case XMLStreamConstants.END_ELEMENT:
+							switch (parser.getLocalName()) {
+								case "p":
+									output.write "</p>\n";
+								break;
+								case "s":
+									output.write "</s>\n";
+								break;
+								case "q":
+									output.write "</q>\n";
+									levelq = levelq - 1;
+								break;
+								case "supplied":
+									levelSupplied = levelSupplied - 1;
+								break;
+								case "w":
+									output.write vWordNorm + "\t" + typeWord + "\t" + levelq + "\t" + levelSupplied.toString().substring(0,1) + "\t" + idColumn + "\t" + idLine + "\t" + idWord + "\t" + vWordDipl + "\t" + vWordFacs + "\n";
+									vWordNorm = "";
+									vWordDipl = "";
+									vWordFacs = "";
+									flagNorm = false;
+									flagDipl = false;
+									flagFacs = false;
+									flagWord = false; 
+								break;
+								case "norm":
+									flagNorm = false;
+								break;
+								case "dipl":
+									flagDipl = false;
+								break;
+								case "facs":
+									flagFacs = false;
+								break;
+							}
+						break;
+						
+						case XMLStreamConstants.CHARACTERS:
+							if(flagWord){
+								vWordNorm.trim();
+								if(flagNorm){
+									vWordNorm += parser.getText().trim();
+								}else if(flagDipl){
+									vWordDipl += parser.getText().trim();
+								}else if(flagFacs){
+									vWordFacs += parser.getText().trim();
+								}
+							}
+						break;
+					}
+				}
+				output.close();
+				parser.close();
+			}
+			catch (Exception ex) {
+				System.out.println("Xml Location: "+parser.getLocation());
+				System.out.println(ex);
+			}
+			
+		}
+	}
+	
+	/**
+	 * a simplier version of transform file to process a non-facette xml.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	public boolean transfomFileWtcBrut(String dirPathName, String fileName){
+		if(findBody() && createOutput(dirPathName, fileName)){
+			String idColumn = "";
+			int idParagraph = 0;
+			int idSentence = 0;
+			String idWord;
+			boolean flagWord = false;
+			boolean flagCont = true;
+			boolean flagStart = true;
+			String typeWord = "";
+			String vWord = "";
+			try {
+				for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT && flagCont; event = parser.next()) {
+					switch (event) {
+						case XMLStreamConstants.START_ELEMENT:
+							//System.out.println parser.getLocalName();
+							switch (parser.getLocalName()) {
+								case "milestone":
+									if (parser.getAttributeValue(0) == "p") {
+										idParagraph = parser.getAttributeValue(1).toInteger();
+										if(flagStart){
+											output.write "<p n=" + idParagraph + ">\n";
+										}else{
+											output.write "</p>\n<p n=" + idParagraph + ">\n";
+										}
+									}else if(parser.getAttributeValue(0) == "column"){
+										idColumn = parser.getAttributeValue(1);
+										idColumn = idColumn.substring(4);
+									}else if (parser.getAttributeValue(0) != "s"){
+										idColumn = "";
+									}
+								break;
+								case "s":
+									idSentence = parser.getAttributeValue(0).toInteger();
+									output.write "<s n=" + idSentence + ">\n";
+								break;
+								case "w":
+									if(null != parser.getAttributeValue(1)){
+										typeWord = parser.getAttributeValue(0);
+										idWord = parser.getAttributeValue(1);
+									}else{
+										idWord = parser.getAttributeValue(0);
+										typeWord = "";
+									}
+									flagWord = true;
+								break;
+								case "div":
+									if (parser.getAttributeValue(0) == "note") {
+										output.write "</s>\n</p>";
+										flagCont = false;
+									}
+								break;
+							}
+						break;
+						
+						case XMLStreamConstants.END_ELEMENT:
+							switch (parser.getLocalName()) {
+								case "w":
+									output.write vWord + "\t" + typeWord + "\t" + idWord + "\t" + idColumn + "\n";
+									flagWord = false; 
+								break;
+							}
+						break;
+						case "s":
+							output.write "</s>\n";
+						break;						
+						case XMLStreamConstants.CHARACTERS:
+							if(flagWord){
+								vWord = parser.getText().trim();
+							}
+						break;
+					}
+				}
+				output.close();
+				parser.close();
+			}
+			catch (XMLStreamException ex) {
+				System.out.println(ex);
+			}
+			catch (IOException ex) {
+				System.out.println("IOException while parsing " + input);
+			}
+		}
+	}
+	
+	/**
+	 * test if the current element if the body.
+	 *
+	 * @param name the name
+	 * @return true, if is body
+	 */
+	private static boolean isBody(String name) {
+		if (name.equals("body")) return true;
+	}
+	
+	/**
+	 * bring the parser to the body element.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean findBody(){
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()){
+			if(event == XMLStreamConstants.START_ELEMENT){
+				if (isBody(parser.getLocalName())){
+					return true;
+				}
+			}
+		}
+		return false;
+	} 
+	
+	/**
+	 * no args needed.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+	 	def inDir = "/home/txm/src";
+	 	def outDir = "/home/txm/";
+	 	def inFile = "qgraal_cm_2009-07-d.xml";
+		System.out.println "file://"+ inDir + "/" + inFile;
+
+		if (args.length == 0) {
+			GraalImportCqp traitTxt = new GraalImportCqp(new URL("file://"+ inDir + "/" + inFile));
+			traitTxt.transfomFileWtc("/home/ayepdieu/srcQuete/result", "graal.wtc");
+		}else if(args.length == 3){
+			GraalImportCqp traitTxt = new GraalImportCqp(new URL(args[0]));
+			traitTxt.transfomFileWtc(args[1], args[2]);
+		}else{
+			System.err.println("Usage: java XHTMLOutliner url" );
+			return;
+		}
+		return
+	}
+	
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/PersonalNamespaceContext.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/PersonalNamespaceContext.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/PersonalNamespaceContext.groovy	(revision 728)
@@ -0,0 +1,118 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2016-02-01 09:53:38 +0100 (lun., 01 fÃ©vr. 2016) $
+// $LastChangedRevision: 3101 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.graal
+
+import java.util.Iterator;
+
+import javax.xml.*;
+import javax.xml.namespace.NamespaceContext;
+
+import org.xml.sax.helpers.NamespaceSupport;
+
+/**
+ * Instantiates a new personal namespace context.
+ *
+ * @author ayepdieu, mdecorde
+ * 
+ * do correpondances between namespace and uri
+ */
+public class PersonalNamespaceContext implements NamespaceContext {
+	
+	public static HashMap<String, String> adress2name = new HashMap<String, String>();
+	public static HashMap<String, String> name2adress = new HashMap<String, String>();
+	static {
+		addNamespace("tei", "http://www.tei-c.org/ns/1.0")
+		addNamespace("me", "http://www.menota.org/ns/1.0")
+		addNamespace("bfm", "http://bfm.ens-lsh.fr/ns/1.0")
+		addNamespace("txm", "http://textometrie.org/1.0")
+		addNamespace("xi", "http://www.w3.org/2001/XInclude")
+		addNamespace("fn", "http://www.w3.org/2005/xpath-functions")
+		addNamespace("xhtml", "http://www.w3.org/1999/xhtml")
+		addNamespace("svg", "http://www.w3.org/2000/svg")
+		addNamespace(XMLConstants.XML_NS_PREFIX, XMLConstants.XML_NS_URI)
+	}
+	/*
+	String TEINS = "http://www.tei-c.org/ns/1.0"
+	String MENS = "http://www.menota.org/ns/1.0";
+	String BFMNS = "http://bfm.ens-lsh.fr/ns/1.0";
+	String TXMNS = "http://textometrie.org/1.0";
+	String XINS = "http://www.w3.org/2001/XInclude";
+	String FNNS = "http://www.w3.org/2005/xpath-functions";
+	String XHTMLNS = "http://www.w3.org/1999/xhtml";
+	String SVGNS = "http://www.w3.org/2000/svg"
+	String XMLNS = "http://www.w3.org/XML/1998/namespace"
+
+	String TEINSNAME = "tei"
+	String MENSNAME = "me";
+	String BFMNSNAME = "bfm";
+	String TXMNSNAME = "txm";
+	String XINSNAME = "xi";
+	String FNNSNAME = "fn";
+	String XHTMLNSNAME = "xhtml";
+	String SVGNSNAME = "svg"
+*/
+	public PersonalNamespaceContext() {
+		super();
+	}
+
+	public static void addNamespace(String name, String address) {
+		adress2name.put(address, name);
+		name2adress.put(name, address);
+	}
+	
+	/* (non-Javadoc)
+	 * @see javax.xml.namespace.NamespaceContext#getNamespaceURI(java.lang.String)
+	 */
+	public String getNamespaceURI(String prefix) {
+		if (!name2adress.containsKey(prefix)) return XMLConstants.NULL_NS_URI;
+		return name2adress.get(prefix)
+	}
+
+	private static String NONE = "";
+	/**
+	 * 
+	 * @param uri the uri
+	 * @return the prefix
+	 */
+	public String getPrefix(String uri) {
+		
+		if (uri == null) return NONE;
+		if (!adress2name.containsKey(uri)) return NONE;
+		return adress2name.get(uri)
+	}
+
+	/**
+	 * This method isn't necessary for XPath processing either.
+	 *
+	 * @param uri the uri
+	 * @return the prefixes
+	 */
+	public Iterator getPrefixes(String uri) {
+		throw new UnsupportedOperationException();
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/package.html	(revision 728)
@@ -0,0 +1,4 @@
+<html>
+<body>Deprecated: Graal import module
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/GraalXpath.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/GraalXpath.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/GraalXpath.groovy	(revision 728)
@@ -0,0 +1,120 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.graal
+
+import org.txm.importer.*;
+import java.io.IOException;
+import org.w3c.dom.*;
+import org.xml.sax.SAXException;
+import javax.xml.parsers.*;
+import javax.xml.xpath.*;
+import javax.xml.stream.*;
+import java.net.URL;
+
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class GraalXpath.
+ *
+ * @authors ayepdieu, mdecorde, vchabanis
+ * 
+ * return the id of a bfm tag <milestone/>
+ */
+public class GraalXpath
+{
+	
+	/**
+	 * Gets the xpath response.
+	 *
+	 * @param fileName the xmlfile
+	 * @param N the id of the milestone
+	 * @return the id of a bfm tag <milestone/>
+	 */
+	public static String getXpathResponse(def fileName, String N) throws ParserConfigurationException, SAXException, IOException, XPathExpressionException 
+	{	
+		if (System.getProperty("os.name").contains("Windows"))
+		{
+			
+			XMLInputFactory factory = XMLInputFactory.newInstance();
+			FileInputStream inputStream = new FileInputStream(new File(fileName));
+			XMLStreamReader parser = factory.createXMLStreamReader(inputStream);
+
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+			{
+				if( event== XMLStreamConstants.START_ELEMENT)
+				{
+					if(parser.getLocalName() == "milestone")
+					{
+						if(parser.getAttributeValue(null , "n")== N)
+						{
+							if(parser.getAttributeValue(null , "unit")== "column")
+							{
+								//TODO : changer l'acces par une clef String au lieu d'un index, prob avec le namespace
+								return parser.getAttributeValue(1);
+							}
+						}		
+					}
+				}
+			}
+			println( "FAILED TO FIND MILESTONE WITH N = "+N);
+			return null;
+		}
+		else
+		{
+			def testG = new XPathResult(new File(fileName));
+			String npage =testG.getXpathResponse("//tei:milestone[@unit='column' and @n='"+N+"']","xml:id")
+			return npage;
+			/*String Query = "//tei:milestone[@unit='column' and @n='"+N+"']"
+			DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+		    domFactory.setNamespaceAware(true); // never forget this!
+		    DocumentBuilder builder = domFactory.newDocumentBuilder();
+		    Document doc = builder.parse(fileName);
+		   
+		    XPathFactory factory = XPathFactory.newInstance();
+		    XPath xpath = factory.newXPath();
+		    xpath.setNamespaceContext(new PersonalNamespaceContext());
+		    XPathExpression expr = xpath.compile(Query);
+
+		    Object result = expr.evaluate(doc, XPathConstants.NODESET); // don't work on windows
+		    NodeList nodes = (NodeList) result;
+		    return nodes.item(0).getAttributes().getNamedItem("xml:id").getNodeValue();
+		    */
+		}
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+		def testG = new GraalXpath();
+		String npage =testG.getXpathResponse("C:\\Documents and Settings\\H\\Bureau\\resourcesTXM\\corpora\\data\\qgraal\\qgraal_cm_2009_03.xml","2")
+		println "found npage : "+npage;
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/ImportInCWB.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/ImportInCWB.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/ImportInCWB.groovy	(revision 728)
@@ -0,0 +1,176 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2016-05-26 17:42:36 +0200 (jeu., 26 mai 2016) $
+// $LastChangedRevision: 3219 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.graal;
+
+import java.net.URL;
+import java.lang.Boolean
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ImportInCWB.
+ *
+ * @author sheiden,mdecorde
+ * 
+ * import graal wtc fiel into cwb
+ */
+public class ImportInCWB{
+
+ 	/** The cwb loc. */
+	 def cwbLoc;//chemin vers executable cqp
+	
+	/** The root dir. */
+	def rootDir;//chemin du dossier qui contien src/ et xsl/
+	
+	/** The in dir. */
+	def inDir;
+	 	
+	//dossier qui contiendra les gsp et vues dipl, cour, facs, trad et wtc
+	
+	/** The out dir. */
+	def outDir;
+	//dossiers qui contient le registre cqp et le dossier data (qui contient les corpus)
+	
+	/** The out dir txm. */
+	def outDirTxm;
+	
+ 	/** The in file. */
+	 def inFile;
+	
+	/** The in file2. */
+	def inFile2;
+	
+	/** The out file. */
+	def outFile;
+	
+	/** The out file2. */
+	def outFile2;
+	
+	/**
+	 * same args as GraalInportCqp.
+	 *
+	 * @param rootDir the root dir
+	 * @param cwbLoc the cwb loc
+	 * @param inFile the in file
+	 * @param inFile2 the in file2
+	 * @param outFile the out file
+	 * @param outFile2 the out file2
+	 */
+	public ImportInCWB(	rootDir,
+						cwbLoc,
+						inFile,
+						inFile2,
+						outFile,
+						outFile2)
+	{
+		this.rootDir = rootDir;
+		if(cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+		else
+			this.cwbLoc = cwbLoc;
+		this.inFile = inFile;
+		this.inFile2 = inFile2;
+		this.outFile = outFile;
+		this.outFile2 = outFile2;
+		this.inDir = this.rootDir+"src" ;
+		this.outDir = this.rootDir ;//outdir of the .gsp
+		this.outDirTxm = this.rootDir ;//outdir for data files & registry
+		this.createDirs();
+	}
+	
+	/**
+	 * create dirs to prevent errors.
+	 */
+	private void createDirs()
+	{
+		new File(outDir).mkdir();
+		new File(outDir+"/wtc").mkdir();
+		new File(outDirTxm).mkdir();
+		new File(outDirTxm+"registry").mkdir();
+		new File(outDirTxm+"data").mkdir();
+	}
+	
+	/**
+	 * call :
+	 * GraalImportCqp
+	 * cwb-encode
+	 * cwb-makeall.
+	 */
+	public void start()
+	{//transfome en wtc et compile les index
+		System.out.println "file:///"+ inDir + "/" + inFile+ ".xml";
+		CwbEncode cwbEn = new CwbEncode();
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		
+		GraalImportCqp traitTxt = new GraalImportCqp(new URL("file:///"+ inDir + "/" + inFile+ ".xml"));
+		traitTxt.transfomFileWtc(outDir+"/wtc/", outFile + ".wtc");
+		
+		traitTxt = new GraalImportCqp(new URL("file:///"+ inDir + "/" + inFile2+ ".xml"));
+		traitTxt.transfomFileWtcBrut(outDir+"/wtc/", outFile2 + ".wtc");
+		
+		System.out.println("--Building index files ...") 
+		String[] pAttributecm = ["pos", "q", "supplied", "col", "line", "id", "dipl", "facs"];
+		String[] sAttributecm = ["p:0+n", "q:1+n", "s:0+n+id"];
+		
+		String[] pAttributes = ["pos", "id", "col"];
+		String[] sAttributes = ["p:0+n", "s:0+n"];
+		try {
+			if (System.getProperty("os.name").contains("Windows"))
+			{
+				cwbEn.run(cwbLoc + "cwb-encode.exe", outDirTxm + "data/"+outFile, outDir +"/wtc/"+outFile+".wtc", outDirTxm + "registry/"+outFile,pAttributecm, sAttributecm);
+				cwbMa.run(cwbLoc + "cwb-makeall.exe", outFile.toUpperCase(), outDirTxm + "registry");
+				
+				cwbEn.run(cwbLoc + "cwb-encode.exe", outDirTxm + "data/"+outFile2, outDir + "/wtc/"+outFile2+".wtc", outDirTxm + "registry/"+outFile2, pAttributes, sAttributes);
+				cwbMa.run(cwbLoc + "cwb-makeall.exe", outFile2.toUpperCase(), outDirTxm + "registry");
+			}
+			else
+			{
+				cwbEn.run(cwbLoc + "cwb-encode", outDirTxm + "data/"+outFile, outDir + "/wtc/"+outFile+".wtc", outDirTxm + "registry/"+outFile,pAttributecm, sAttributecm);
+				cwbMa.run(cwbLoc + "cwb-makeall", outFile.toUpperCase(), outDirTxm + "registry");
+				
+				cwbEn.run(cwbLoc + "cwb-encode", outDirTxm + "data/"+outFile2, outDir +"/wtc/"+ outFile2+".wtc", outDirTxm + "registry/"+outFile2, pAttributes, sAttributes);
+				cwbMa.run(cwbLoc + "cwb-makeall", outFile2.toUpperCase(), outDirTxm + "registry");
+			}
+		} catch (Exception ex) {System.out.println(ex);}
+				System.out.println("Done.") 
+	}
+	
+	/**
+	 * test.
+	 */
+	public void run() 
+	{
+		System.out.println "Starting script : importWTC.groovy ...";
+		System.setProperty("javax.xml.transform.TransformerFactory",  
+				 			"net.sf.saxon.TransformerFactoryImpl");  
+		this.importWTC();
+		System.out.println "GraalImport.groovy done."
+	}
+}
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/ImportInCWB.groovy
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/qgraalLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/qgraalLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/qgraalLoader.groovy	(revision 728)
@@ -0,0 +1,116 @@
+// TODO: Auto-generated Javadoc
+/* (non-Javadoc)
+ * @see groovy.lang.Script#run()
+ */
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-08-29 14:23:55 +0200 (Thu, 29 Aug 2013) $
+// $LastChangedRevision: 2519 $
+// $LastChangedBy: nilskredens $ 
+//
+package org.txm.importer.graal
+
+//
+//import org.txm.importer.graal.BuildGraalGSP;
+//import org.txm.importer.graal.ImportInCWB;
+//
+//import org.txm.importer.cwb.CwbEncode
+//import org.txm.importer.cwb.CwbMakeAll
+//import org.txm.importer.cwb.PatchCwbRegistry;
+//import org.txm.objects.*;
+//import org.txm.utils.*;
+//String userDir = System.getProperty("user.home");
+//
+//String rootDir;
+//try{rootDir = rootDirBinding;}//srcDir the selected directoy in TXM RCP via the Binding 
+//catch(Exception)
+//{	println "DEV MODE";//exception means we debug
+//	if(!org.txm.Toolbox.isInitialized())
+//	{
+//		rootDir = userDir+"/xml/qgraal/";
+//		org.txm.Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
+//		org.txm.Toolbox.setParam(org.txm.Toolbox.INSTALL_DIR,new File(userDir,"TXM"));
+//	}
+//}
+//
+//String pathToCwbBinaries = org.txm.Toolbox.getParam(org.txm.Toolbox.INSTALL_DIR)+"/cwb/bin/";//chemin vers executable cqp de l'installation
+//
+//	//2- create GSP & import to WTC
+//	println "EDITION"
+//	def edition = new BuildGraalGSP(rootDir,//rootdir
+//	pathToCwbBinaries// cwb utils dir
+//	,"qgraal_cm_2009-07-d",	"qgraal_frmod_2009-07-w",//infile1 , infile2
+//	"qgraalcm","qgraalfrmod"); //outfile1 & outfile2
+//	edition.start();
+//	
+//	println "COMPILATION"
+//	def compiler = new ImportInCWB(rootDir,//rootdir
+//	pathToCwbBinaries// cwb utils dir
+//	,"qgraal_cm_2009-07-d",	"qgraal_frmod_2009-07-w",//infile1 , infile2
+//	"qgraalcm","qgraalfrmod"); //outfile1 & outfile2
+//	compiler.start();
+//
+//	//THIS IS AN OLD SCRIPT WE HAVE TO MOVE SOMES FILES
+//	new File(rootDir,"txm").deleteDir()
+//	new File(rootDir,"txm").mkdir()
+//	new File(rootDir,"HTML").deleteDir()
+//	new File(rootDir,"HTML").mkdir()
+//	//txm : copy src
+//	FileCopy.copy(new File(rootDir+"/src","qgraal_cm_2009-07-d.xml"),new File(rootDir+"/txm","qgraal.xml"))
+//	
+//	//HTML : get from/cour
+//	for(File f : new File(rootDir+"/imported/form/cour").listFiles())
+//	{
+//		String name = f.getName();
+//		String pageid= name.substring(15,name.length()-4);
+//		String newfilename = "qgraal_"+pageid+".html";
+//		println newfilename
+//		FileCopy.copy(f,new File(rootDir+"/HTML/multi",newfilename));
+//	}
+//	
+//	//data
+//	new File(rootDir,"data/qgraalcm").renameTo(new File(rootDir,"dataCM"));
+//	new File(rootDir,"data").deleteDir();
+//	new File(rootDir,"dataCM").renameTo(new File(rootDir,"data"));
+//	
+//	//registry
+//	File registryfiletopatch = new File(rootDir+"/registry",qgraalcm);
+//	File cwbindex = new File(rootDir,"data");
+//	try {
+//		PatchCwbRegistry.patch(registryfiletopatch, cwbindex);
+//	} catch (IOException e) {org.txm.utils.logger.Log.printStackTrace(e);}
+//	
+//	// copy reg
+//	try {
+//		FileCopy.copy(registryfiletopatch, new File(registrypath,"qgraalcm"));
+//	} catch (IOException e) {org.txm.utils.logger.Log.printStackTrace(e);}
+//	
+//	
+//	Workspace w = org.txm.Toolbox.workspace;
+//	Project p = w.getProject("default")
+//	p.removeBase("qgraal")
+//	Base b = p.addBase("qgraal");
+//	b.addDirectory(new File(rootDir,"txm"));
+//
+//	
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/graal/qgraalLoader.groovy
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/pager.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/pager.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/pager.groovy	(revision 728)
@@ -0,0 +1,459 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.hyperprince;
+
+import org.txm.objects.*;
+import org.txm.importer.XPathResult;
+import org.xml.sax.Attributes;
+import org.txm.importer.filters.*;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+import org.txm.utils.i18n.*;
+
+// TODO: Auto-generated Javadoc
+/** Build Discours corpus simple edition from a xml-tei. @author mdecorde */
+class pager {
+	List<String> NoSpaceBefore;
+	
+	/** The No space after. */
+	List<String> NoSpaceAfter;
+
+	/** The wordcount. */
+	int wordcount = 0;
+	
+	/** The pagecount. */
+	int pagecount = 0;
+	
+	/** The wordmax. */
+	int wordmax = 0;
+
+	/** The wordid. */
+	String wordid;
+	
+	/** The first word. */
+	boolean firstWord = true;
+	
+	/** The wordvalue. */
+	String wordvalue;
+	
+	/** The interpvalue. */
+	String interpvalue;
+	
+	/** The lastword. */
+	String lastword = " ";
+	
+	/** The wordtype. */
+	String wordtype;
+	
+	/** The flagform. */
+	boolean flagform = false;
+	
+	/** The flaginterp. */
+	boolean flaginterp = false;
+	
+	/** The url. */
+	private def url;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The writer. */
+	def writer;
+	
+	/** The multiwriter. */
+	def multiwriter = null;
+	
+	/** The infile. */
+	File infile;
+	
+	/** The outfile. */
+	File outfile;
+	
+	/** The pages. */
+	ArrayList<File> pages = new ArrayList<File>();
+	
+	/** The idxstart. */
+	ArrayList<String> idxstart = new ArrayList<String>();
+	
+	/** The segid. */
+	String segid;
+	
+	/** The title. */
+	String title;
+
+	/**
+	 * Instantiates a new pager.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param NoSpaceBefore the no space before
+	 * @param NoSpaceAfter the no space after
+	 * @param max the max
+	 */
+	pager(File infile, File outfile, List<String> NoSpaceBefore,
+			List<String> NoSpaceAfter, int max) {
+		this.wordmax = max;
+		this.NoSpaceBefore = NoSpaceBefore;
+		this.NoSpaceAfter = NoSpaceAfter;
+		this.url = infile.toURI().toURL();
+		this.infile = infile;
+
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		createOutput(outfile);
+		process();
+	}
+
+	/**
+	 * Creates the next output.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean createNextOutput()
+	{
+		try {
+			
+			if(multiwriter != null)
+			{
+				multiwriter.write("</body>");
+				multiwriter.write("</html>");
+				multiwriter.close();
+			}
+			pagecount++;
+			File f = new File(outfile.getParent()+"/multi/",outfile.getName().substring(0,2)+"_"+"page_"+pagecount+".html");
+			pages.add(f);
+			idxstart.add(wordid)
+			multiwriter = new OutputStreamWriter(new FileOutputStream(f) , "UTF-8");
+			
+			multiwriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+			multiwriter.write("<html>");
+			multiwriter.write("<head>");
+			multiwriter.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+			
+			if(segid != null)
+			{
+				multiwriter.write("<title>Hyperprince "+segid+"</title>");
+			}else {
+				multiwriter.write("<title>Hyperprince "+title+"</title>");
+			}
+			multiwriter.write("</head>");
+			multiwriter.write("<body>");
+			
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile) {
+		try {
+			this.outfile = outfile;
+
+			writer = new OutputStreamWriter(new FileOutputStream(outfile),
+					"UTF-8");
+			createNextOutput();
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Gets the page files.
+	 *
+	 * @return the page files
+	 */
+	public ArrayList<File> getPageFiles() {
+		return pages;
+	}
+
+	/**
+	 * Gets the idx.
+	 *
+	 * @return the idx
+	 */
+	public ArrayList<String> getIdx() {
+		return idxstart;
+	}
+
+	/**
+	 * Process.
+	 */
+	void process()
+	{
+		String localname = "";
+		String query = "//tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:author/text()";
+		title = XPathResult.getXpathResponse(infile, query);
+		
+		writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+		writer.write("<html>");
+		writer.write("<head>");
+		writer.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+		writer.write("<title>Hyperprince "+title+"</title>");
+		writer.write("</head>");
+		writer.write("<body>");
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			
+			
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{	
+						case "text":
+							//XPathResult testG = new XPathResult(infile);
+							
+							//String title = testG.getXpathResponse("//tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title","")
+							//testG = null;
+							writer.write("<h1>"+title+"</h1>\n")
+							multiwriter.write("<h1>"+title+"</h1>\n")
+							break;
+						
+						case "front":
+							writer.write("<h2>"+parser.getAttributeValue(null, "type")+"</h2>\n")
+							multiwriter.write("<h2>"+parser.getAttributeValue(null, "type")+"</h2>\n")
+							break;
+						
+						case "div0":
+							writer.write("<h2>Book</h2>\n")
+							multiwriter.write("<h2>Book</h2>\n")
+							break;
+						
+						case "back":
+							writer.write("<h2>"+parser.getAttributeValue(null, "type")+"</h2>\n")
+							multiwriter.write("<h2>"+parser.getAttributeValue(null, "type")+"</h2>\n")
+							break;
+						
+						case "seg":
+							segid=parser.getAttributeValue(null,"id");
+							createNextOutput();
+							
+							writer.write("<p>\n");
+							multiwriter.write("<p>\n");
+							break;
+						
+						case "w":
+							wordid=parser.getAttributeValue(null,"id");
+							if(firstWord)
+							{
+								firstWord=false;
+								this.idxstart.set(0,wordid);
+							}
+							/*wordcount++;
+							if(wordcount >= wordmax)
+							{
+								createNextOutput();
+								wordcount=0;
+							}*/
+							break;
+						
+						case "ana":
+							flaginterp=true;
+							interpvalue+=" "+parser.getAttributeValue(null,"type")+":"
+							break;
+						
+						case "form":
+							wordvalue="";
+							interpvalue ="";
+							flagform=true;
+							break;
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{
+						case "teiHeader":
+						
+							break;
+						
+						case "seg":
+							writer.write("</p>\n");
+							break;
+						
+						case "form":
+							flagform = false
+						
+							break;
+						
+						case "ana":
+							flaginterp = false
+							break;
+						
+						case "w":
+							int l = lastword.length();
+							String endOfLastWord = "";
+							if(l > 0)
+								endOfLastWord = lastword.subSequence(l-1, l);
+							
+							if(interpvalue != null)
+								interpvalue = interpvalue.replace("\"","&quot;");
+							
+							if(NoSpaceBefore.contains(wordvalue) || 
+									NoSpaceAfter.contains(lastword) || 
+									wordvalue.startsWith("-") || 
+									NoSpaceAfter.contains(endOfLastWord))
+							{
+								writer.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+								multiwriter.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+							}
+							else
+							{
+								writer.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+								multiwriter.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+							}
+							writer.write(wordvalue.replace("<", "&lt;")+"</span>");
+							multiwriter.write(wordvalue.replace("<", "&lt;")+"</span>");
+							lastword=wordvalue;
+							break;
+						
+					}
+					break;
+				
+				case XMLStreamConstants.CHARACTERS:
+					if(flagform)
+						if(parser.getText().length() > 0)
+							wordvalue+=(parser.getText());
+					if(flaginterp)
+						if(parser.getText().length() > 0)
+							interpvalue+=(parser.getText());
+					break;
+			}
+		}	
+		writer.write("</body>");
+		writer.write("</html>");
+		writer.close();
+		multiwriter.write("</body>");
+		multiwriter.write("</html>");
+		multiwriter.close();
+		
+		parser.close();
+		inputData.close();
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		/*String rootDir = System.getProperty("user.home")+"/xml/hyperprince/";
+		new File(rootDir,"HTML/").deleteDir();
+		new File(rootDir+"HTML/").mkdir();
+		new File(rootDir+"HTML/multi/").mkdir();
+		List<File> filelist = new File(rootDir,"txm").listFiles();
+		
+		for(File srcfile : filelist)
+		{
+			File resultfile = new File(rootDir+"HTML",srcfile.getName().substring(0,2)+".html");
+			List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+			List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+			println("build discours xml-tei file : "+srcfile+" to : "+resultfile );
+			
+			def builder = new pager(srcfile,resultfile, NoSpaceBefore, NoSpaceAfter,1500);
+		}
+		
+		return;*/
+		
+		
+		String userDir = System.getProperty("user.home");
+		String lang= "fr"
+		String rootDir;
+		println "DEV MODE";//exception means we debug
+		if(!org.txm.Toolbox.isInitialized()){
+			rootDir = "D:\\Travail_Sev\\Projets\\Corpus\\TXM\\hyperprince"; //userDir+"/xml/hyperprince/";//"D:\\Travail_Sev\\Projets\\Corpus\\TXM\\hyperprince";
+			org.txm.Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
+			org.txm.Toolbox.setParam(org.txm.Toolbox.INSTALL_DIR,new File(userDir,"TXM"));
+		}
+		
+		Workspace w = org.txm.Toolbox.workspace;
+		Project p = w.getProject("default")
+		p.removeBase("hyperprince")
+		Base b = p.addBase("hyperprince");
+		b.addDirectory(new File(rootDir,"txm"));
+		
+		
+		println "-- EDITION"
+		new File(rootDir+"/HTML/").deleteDir();
+		new File(rootDir+"/HTML/").mkdir();
+		new File(rootDir,"/HTML/multi").mkdir();
+		List<File> filelist = new File(rootDir,"txm").listFiles();
+
+		for(String textname : b.getTextsID())
+		{
+			Text text = b .getText(textname);
+			File srcfile = text.getSource();
+			File resultfile = new File(rootDir+"/HTML",srcfile.getName().substring(0,srcfile.getName().length()-4)+".html");
+			List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+			List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+			println("build hyperprince xml-tei file : "+srcfile+" to : "+resultfile );
+			
+			def ed = new pager(srcfile,resultfile, NoSpaceBefore, NoSpaceAfter,500);
+			
+			Edition editionweb = text.addEdition("default","html",resultfile);
+			//println("pages "+ed.getPageFiles())
+			//println("idx "+ed.getIdx())
+			for(int i = 0 ; i < ed.getPageFiles().size();i++)
+			{
+				File f = ed.getPageFiles().get(i);
+				String idx = ed.getIdx().get(i);
+				editionweb.addPage(f,idx);
+			}
+			
+			//Edition (version Pincemin)
+//			Edition editionbp = text.addEdition("onepage","html",resultfile);
+//			editionbp.addPage(resultfile,ed.getIdx().get(0));
+		}
+		w.save();
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/hyperprinceLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/hyperprinceLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/hyperprinceLoader.groovy	(revision 728)
@@ -0,0 +1,137 @@
+/**
+ * Main.
+ *
+ * @param args the args
+ */
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.hyperprince;
+
+import org.txm.importer.hyperprince.importer;
+import org.txm.importer.hyperprince.compiler;
+import org.txm.objects.*;
+import org.txm.Toolbox;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+
+// TODO: Auto-generated Javadoc
+/* (non-Javadoc)
+ * @see groovy.lang.Script#run()
+ */
+String userDir = System.getProperty("user.home");
+String rootDir;
+String lang;
+String encoding;
+String model;
+try{rootDir = rootDirBinding;lang=langBinding;encoding=encodingBinding;model=modelBinding;}
+catch(Exception)
+{	println "DEV MODE";//exception means we debug
+	if(!org.txm.Toolbox.isInitialized())
+	{
+		rootDir = userDir+"/xml/hyperprince/";
+		lang="fr";
+		encoding= "UTF-8";
+		model="rgaqcj";
+		Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File(userDir,"TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"TXM/treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"TXM/treetagger/models"));
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"),"TXM"));
+	}
+}
+
+File homedir = new File(rootDir);
+String corpusSrc = "Corpus-Hyperprince_2009-06-10.xml";//"Corpus-Hyperprince_2010-04-06.xml";
+
+//IMPORT TXT
+if(!new File(rootDir,corpusSrc).exists())
+{
+	println("source file : "+new File(rootDir,corpusSrc)+" does not exists")
+	return false;
+}
+
+println "-- IMPORTER - Reading source files"
+List<File> srcfiles = [new File(rootDir,corpusSrc)];
+new importer().run(rootDir, corpusSrc);
+
+//ANNOTATE
+println "-- ANNOTATE - Running NLP tools"
+new Annotate().run(homedir,model+".par");
+
+//COMPILATION
+println "COMPILING"
+def c = new compiler()
+//c.setCwbPath("D:\\Travail_Sev\\Logiciels\\TXM\\cwb\\bin"); // for developers
+c.setLang(lang);
+c.run(rootDir);
+
+//move registry file to cwb registry dir
+File registryfile = new File(rootDir+"/registry","hyperprince");
+if(registryfile.exists())
+	org.txm.utils.FileCopy.copy(registryfile,new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"registry/hyperprince"))
+
+Workspace w = org.txm.Toolbox.workspace;
+Project p = w.getProject("default")
+p.removeBase("hyperprince")
+Base b = p.addBase("hyperprince");
+b.addDirectory(new File(rootDir,"txm"));
+b.setAttribute("lang", lang)
+b.propagateAttribute("lang")
+
+println "-- EDITION"
+new File(rootDir+"/HTML/").deleteDir();
+new File(rootDir+"/HTML/").mkdir();
+new File(rootDir,"/HTML/default").mkdir();
+List<File> filelist = new File(rootDir,"txm").listFiles();
+
+for(String textname : b.getTextsID())
+{
+	Text text = b .getText(textname);
+	File srcfile = text.getSource();
+	File resultfile = new File(rootDir+"/HTML",srcfile.getName().substring(0,srcfile.getName().length()-4)+".html");
+	List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+	List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+	println("build hyperprince xml-tei file : "+srcfile+" to : "+resultfile );
+	
+	def ed = new pager(srcfile,resultfile, NoSpaceBefore, NoSpaceAfter,500);
+	
+	Edition editionweb = text.addEdition("default","html",resultfile);
+	//println("pages "+ed.getPageFiles())
+	//println("idx "+ed.getIdx())
+	for(int i = 0 ; i < ed.getPageFiles().size();i++)
+	{
+		File f = ed.getPageFiles().get(i);
+		String idx = ed.getIdx().get(i);
+		editionweb.addPage(f,idx);
+	}
+	
+//	Edition editionbp = text.addEdition("onepage","html",resultfile);
+//	editionbp.addPage(resultfile,ed.getIdx().get(0));
+}
+
+w.save()
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/importer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/importer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/importer.groovy	(revision 728)
@@ -0,0 +1,186 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2015-06-03 15:04:53 +0200 (mer., 03 juin 2015) $
+// $LastChangedRevision: 2984 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.hyperprince
+
+import org.txm.importer.*;
+import org.txm.importer.filters.*;
+import org.txm.scripts.*;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+import javax.xml.stream.*;
+import java.net.URL;
+
+import filters.CutHeader.*;
+import filters.Tokeniser.*;
+import filters.TagSentences.*;
+import filters.FusionHeader.*;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class importer.
+ *
+ * @author mdecorde
+ * simple import in cwb of RGAQCJ
+ * structunits : initial, s, lb ...
+ * wordproperties : form, pos and n
+ */
+
+class importer
+{		
+	
+	/** The align list. */
+	HashSet<String>  alignList;
+	
+	/** The aa. */
+	AnalyzeAlignement aa ;
+
+	/**
+	 * Run.
+	 *
+	 * @param rootDir the root dir
+	 * @param corpusSrc the corpus src
+	 */
+	public void run(String rootDir, String corpusSrc)//List<File> srcfiles = [new File(rootDir,"Corpus-Hyperprince_2009-06-10.xml")];
+	{
+		//String ActionHome = "~/Bureau/trunkToolbox/0.4.6/org.txm.toolbox/GroovyImportScripts/filters";
+		
+		//-0 split, parceque c'est un corpus et ca a pls header partout partout
+		ArrayList<String> milestones = new ArrayList<String>();//the tags which stay milestones
+		milestones.add("tagUsage");
+		milestones.add("pb");
+		milestones.add("lb");
+		
+		File corpussrc = new File(rootDir,corpusSrc);
+		rootDir = corpussrc.getParent()+"/";
+		
+		new File(rootDir+"ptokenized").deleteDir();
+		new File(rootDir+"ptokenized").mkdir();
+		new File(rootDir+"tokenized").deleteDir();
+		new File(rootDir+"tokenized").mkdir();
+		new File(rootDir+"split").deleteDir();
+		new File(rootDir+"split").mkdir();
+		new File(rootDir+"txm").deleteDir();
+		new File(rootDir+"txm").mkdir();
+		
+		String xslfile = rootDir+"/xsl/splitcorpus.xsl";
+		String outfile = rootDir+"split_temp.xml";
+		
+		aa = new AnalyzeAlignement(corpussrc);
+		alignList = aa.process()
+		ApplyXsl a = new ApplyXsl(xslfile);
+		a.process(corpussrc.getAbsolutePath(),outfile);
+		new File(outfile).delete()
+
+		
+		List<File> files = new File(rootDir,"split").listFiles();//scan directory split
+		//PREPARE EACH FILE TO BE TOKENIZED
+		for(File f : files)
+		{
+			File srcfile = f;
+			//new EncodingConverter(srcfile, "iso-8859-1");
+			File resultfile = new File(rootDir+"ptokenized",f.getName());
+			println("prepare tokenizer file : "+srcfile+" to : "+resultfile );
+			
+			def builder = new OneTagPerLine(srcfile.toURL(), milestones);
+			builder.process(resultfile);
+		}
+		
+		//TOKENIZE FILES
+		//Manager<Filter> filterManager = new FilterManager(ActionHome);
+		files = new File(rootDir,"ptokenized").listFiles();//scan directory split
+		for(File infile : files)
+		{
+			Sequence S = new Sequence();
+			Filter F1 = new CutHeader();
+			Filter F6 = new Tokeniser(infile);
+			Filter F7 = new TagSentences();
+			Filter F11 = new FusionHeader();
+			S.add(F1);
+			S.add(F6);
+			//S.add(F7);
+			S.add(F11);
+			
+			//File infile = new File(rootDir+"tokenized",f.getName()+"-src.xml");
+			File xmlfile = new File(rootDir+"tokenized",infile.getName());
+			println("Tokenizing "+xmlfile)
+			S.setEncodages("UTF-8","UTF-8");
+			S.SetInFileAndOutFile(infile.getAbsolutePath(), xmlfile.getAbsolutePath());
+			
+			Object[] arguments1 = [infile.getParent()+"/"+infile.getName()+"header.xml"];
+			F1.SetUsedParam(arguments1);
+			Object[] arguments2 = [infile.getParent()+"/"+infile.getName()+"header.xml",F1];
+			F11.SetUsedParam(arguments2);
+			
+			S.proceed();
+		}
+		
+		files = new File(rootDir,"tokenized").listFiles()			
+		//TRANSFORM INTO XML-TEI-TXM
+		for(File f : files)
+		{
+			//ArrayList<String> milestones = new ArrayList<String>();
+			println("Building xml-tei-txm "+f+ " >> "+f.getName()+".xml")
+			File file = f; 
+			String txmfile = f.getName().subSequence(0, 2)+".xml";
+			
+			def correspType = new HashMap<String,String>()
+			def correspRef = new HashMap<String,String>()
+			
+			//il faut lister les id de tous les respStmt
+			def respId = [];
+			//fait la correspondance entre le respId et le rapport d'execution de l'outil
+			def applications = new HashMap<String,HashMap<String,String>>();	
+			//fait la correspondance entre le respId et les attributs type de la propriÃ©tÃ© ana du w txm
+					//pour construire les ref vers les taxonomies
+			def taxonomiesUtilisees = new HashMap<String,String[]>();
+			//associe un id d'item avec sa description et son URI
+			def itemsURI = new HashMap<String,HashMap<String,String>>();
+			//informations de respStmt
+			//resps (respId <voir ci-dessus>, [description, person, date])
+			def resps = new HashMap<String,String[]>();
+			
+			//lance le traitement
+			def builder = new Xml2Ana(file);
+			builder.setCorrespondances(correspRef, correspType);
+			builder.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)
+			builder.transformFile(rootDir+"txm/",txmfile);
+		}
+		
+		//rename files correctly
+		files = new File(rootDir,"txm").listFiles();
+		for(File file : files)
+		{
+			String txmfile = file.getName();
+			file = aa.addAlignement(file, alignList);
+			txmfile = txmfile.tokenize(".").get(0)+".xml"
+			file.renameTo(new File(file.getParent(),txmfile));
+		}
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/AnalyzeAlignement.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/AnalyzeAlignement.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/AnalyzeAlignement.groovy	(revision 728)
@@ -0,0 +1,281 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+// 
+// 
+// 
+// $LastChangedDate: 2015-12-17 12:11:39 +0100 (jeu., 17 dÃ©c. 2015) $
+// $LastChangedRevision: 3087 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.hyperprince
+
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import javax.xml.stream.*;
+
+import org.txm.functions.concordances.comparators.NullComparator;
+
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AnalyzeAlignement.
+ */
+class AnalyzeAlignement {
+	
+	/** The url. */
+	private def url;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/**
+	 * Instantiates a new analyze alignement.
+	 *
+	 * @param file the file
+	 */
+	public AnalyzeAlignement(File file){
+		try {
+			this.url = file.toURI().toURL();
+			inputData = url.openStream();
+			factory = XMLInputFactory.newInstance();
+			factory.setProperty(XMLInputFactory.IS_VALIDATING,false)
+			parser = factory.createXMLStreamReader(inputData);
+			
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * Process.
+	 *
+	 * @return the list
+	 */
+	public List <Set <String>> process(){
+		List <Set <String>> list = new ArrayList <Set <String>>();
+		
+		String localname = "";
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			
+			String prefix = parser.getPrefix();
+			if(prefix == null || prefix == "")
+				prefix = "";
+			else
+				prefix +=":";
+			
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+				
+				// <link targets="#i1_Pr-Seg0 #f1_Pr-Seg0 #f3_Pr-Seg0 #f5_Pr-Seg0 #f4_Pr-Seg0 "/>
+					if(localname == "link"){
+						for(int i= 0 ; i < parser.getAttributeCount() ;i++ )
+						{
+							String att = parser.getAttributeLocalName(i)
+							if(att == "targets"){
+								List<String> vals = parser.getAttributeValue(i).split(" ");
+								HashSet<String> newVals = new HashSet<String>();
+								//vals*.trim(); dans le cas du #
+								vals.each{ it->
+									newVals << it.substring(1);
+								}
+								list.add(newVals);
+							}
+						}
+					}
+			}
+		}
+		parser.close()
+		return list;
+	}
+	
+	/**
+	 * Adds the alignement.
+	 *
+	 * @param file the file
+	 * @param alignIds the align ids
+	 * @return the file
+	 */
+	public File addAlignement(File file, HashSet<String> alignIds){
+		try {
+			this.url = file.toURI().toURL();
+			inputData = url.openStream();
+			factory = XMLInputFactory.newInstance();
+			factory.setProperty(XMLInputFactory.IS_VALIDATING,false)
+			parser = factory.createXMLStreamReader(inputData);
+			
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+		
+		/*
+		 File outfile = new File(outdir,textname+language+".xml");
+		 Writer output = new OutputStreamWriter(new FileOutputStream(outfile) , "UTF-8");
+		 def writer = factory.createXMLStreamWriter(output, "UTF-8")*/
+		String textname = file.getName().substring(0,file.getName().length()-4)+"_";
+		
+		// create XML writer
+		File tempFile = new File(file.getParent(),textname+"temp.xml");
+		XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		FileOutputStream output = new FileOutputStream(tempFile)
+		def writer = factory.createXMLStreamWriter(output, "UTF-8")
+		
+		
+		String localname = "";
+		writer.writeStartDocument("UTF-8","1.0");
+		writer.writeStartElement ("TEI");
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			
+			String prefix = parser.getPrefix();
+			if(prefix == null || prefix == "")
+				prefix = "";
+			else
+				prefix +=":";
+			
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					if(prefix == null){
+						writer.writeStartElement(prefix, localname);
+					}else {
+						writer.writeStartElement(localname);
+					}
+					for(int i= 0 ; i < parser.getAttributeCount() ;i++ )
+					{
+						writer.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i))
+						if("id" == parser.getAttributeLocalName(i)){
+							if((parser.getAttributeValue(i)).startsWith("w")){
+							}else {
+								String idAlign = searchForAlignId(parser.getAttributeValue(i), alignIds);
+								writer.writeAttribute("pid", idAlign);
+								if(idAlign == "-1"){
+									System.out.println(parser.getAttributeValue(i)+" - ALIGN ID is ? "+idAlign);
+								}
+							}
+						}
+					}
+				
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					writer.writeEndElement();
+				
+					break;
+				case XMLStreamConstants.CHARACTERS:
+					writer.writeCharacters(parser.getText());
+					break;
+			}
+		}
+		writer.writeEndElement(); // close TEI
+		parser.close();
+		writer.close();
+		output.close()
+		inputData.close();
+		return copyfile(tempFile.getAbsolutePath(), file.getAbsolutePath());
+
+	}
+	
+	/**
+	 * Copyfile.
+	 *
+	 * @param srFile the sr file
+	 * @param dtFile the dt file
+	 * @return the file
+	 */
+	private static File copyfile(String srFile, String dtFile){
+		File f2 ;
+		try{
+			File f1 = new File(srFile);
+			f2 = new File(dtFile);
+			InputStream inStr = new FileInputStream(f1);
+			
+			//For Append the file.
+			//OutputStream out = new FileOutputStream(f2,true);
+			
+			//For Overwrite the file.
+			OutputStream out = new FileOutputStream(f2);
+			
+			byte[] buf = new byte[1024];
+			int len;
+			while ((len = inStr.read(buf)) > 0){
+				out.write(buf, 0, len);
+			}
+			inStr.close();
+			out.close();
+			System.out.println("File copied.");
+		}
+		catch(FileNotFoundException ex){
+			System.out.println(ex.getMessage() + " in the specified directory.");
+			return null;
+		}
+		catch(IOException e){
+			System.out.println(e.getMessage());      
+		}
+		return f2;
+	}
+	
+	/**
+	 * Search for align id.
+	 *
+	 * @param id the id
+	 * @param alignIds the align ids
+	 * @return the string
+	 */
+	public String searchForAlignId(String id, HashSet<String> alignIds){
+		int i = 0;
+		for(Set<String> set: alignIds){
+			i++;
+			if(set.contains(id)){
+				return ""+i;
+			}
+		}
+		return "-1";
+	}
+	
+	
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/compiler.groovy	(revision 728)
@@ -0,0 +1,387 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.hyperprince
+;
+
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+
+import javax.xml.stream.*;
+import java.net.URL;
+import java.io.File;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class compiler.
+ */
+class compiler 
+{
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private def parser;
+	
+	/** The dir. */
+	private def dir;
+	
+	/** The output. */
+	private def output;
+	
+	/** The url. */
+	private def url;
+	
+	/** The anahash. */
+	private HashMap<String,String> anahash =new HashMap<String,String>() ;
+	
+	/** The text. */
+	String text="";
+	
+	/** The base. */
+	String base="";
+	
+	/** The project. */
+	String project="";
+	
+	/** The cwb loc. */
+	String cwbLoc;
+	
+	/** The lang. */
+	private String lang ="fr";
+	
+	/**
+	 * Instantiates a new compiler.
+	 */
+	public compiler(){}
+	
+	/**
+	 * initialize.
+	 *
+	 * @param url the url
+	 * @param text the text
+	 * @param base the base
+	 * @param project the project
+	 */
+	public compiler(URL url,String text,String base, String project)
+	{
+		this.text = text
+		this.base = base;
+		this.project = project;
+		
+		try {
+			this.url = url;
+			inputData = url.openStream();
+			
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the new cwb path
+	 */
+	public void setCwbPath(String path)
+	{
+		if(!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path;
+	}
+	
+	/**
+	 * set the language of the corpus.
+	 *
+	 * @param lang the lang
+	 * @return the java.lang. object
+	 */
+	public setLang(String lang)
+	{
+		this.lang = lang;
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(String dirPathName, String fileName){
+		try {
+			File f = new File(dirPathName, fileName)
+			output = new OutputStreamWriter(new FileOutputStream(f,f.exists()) , "UTF-8")
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+	
+	/**
+	 * clear anaHash variable, it is used to store ana tags values then print it when the end element </ana> is found.
+	 */
+	private void fillanaHash()
+	{
+		anahash.clear();
+		for(String s : types)
+		anahash.put( s,"-" );
+	}
+	
+	/**
+	 * Transfom file wtc.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @param idtext the idtext
+	 * @return true, if successful
+	 */
+	public boolean transfomFileWtc(String dirPathName, String fileName,idtext)
+	{
+		createOutput(dirPathName, fileName);
+		
+		String author = "";
+		String date = "";
+		String lang = "";
+		String vAna = "";
+		String vForm = "";
+		String wordid= "";
+		
+		boolean flagAuthor = false;
+		boolean flagDate = false;
+		boolean flagForm = false;
+		boolean flagAna = false;
+		output.write("<txmcorpus lang=\""+lang+"\">\n"); 
+		try 
+		{
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+			{
+				switch (event) 
+				{
+					case XMLStreamConstants.START_ELEMENT:
+					switch (parser.getLocalName()) 
+					{
+						
+						case "monogr"://get attr lang
+						lang = parser.getAttributeValue(null,"lang");
+						//idtext = parser.getAttributeValue(null,"id");
+						break;
+						
+						case "author"://get text
+						flagAuthor = true;
+						author ="";
+						break;
+						
+						case "date"://get text
+						flagDate = true;
+						date = "";
+						break;
+						
+						case "text"://write tag+ lang + date + author
+						output.write("<text lang=\""+lang+"\" auteur=\""+author+"\" date=\""+date+"\" id=\""+idtext+"\" base=\""+base+"\" project=\""+project+"\">\n");
+						break;
+						
+						case "front"://get type,id, write tag
+						case "back"://get type,id, write tag
+						case "head"://get type,id, write tag
+						case "seg"://get type,id,n write tag
+						output.write("<"+parser.getLocalName()+" id=\""+parser.getAttributeValue(null,"id")+"\" type=\""+parser.getAttributeValue(null,"type")+"\">\n");
+						break;
+						
+						case "body"://get type,id, write tag BODY
+						//	for(int i = 0 ; i < parser.getAttributeCount(); i++)
+								
+						output.write("<body id=\""+parser.getAttributeValue(null,"id")+"\" type=\""+parser.getAttributeValue(null,"type")+"\">\n");
+						break;
+						
+						case "s":
+						output.write( "<s>\n");
+						break;
+						
+						case "w":
+						wordid = parser.getAttributeValue(null,"id")
+						break;
+						case "form":
+						flagForm = true;
+						vForm = "";
+						vAna ="";
+						break;
+						
+						case "ana":
+						flagAna = true;
+						break;
+					}
+					break;
+					
+					case XMLStreamConstants.END_ELEMENT:
+					switch (parser.getLocalName()) 
+					{
+						case "author"://get text
+						flagAuthor = false;
+						break;
+						
+						case "date"://get text
+						flagDate = false;
+						break;
+						
+						case "text"://write tag+ lang + date + author
+						output.write("</text>\n");
+						break;
+						
+						case "front"://get type,id, write tag
+						case "back"://get type,id, write tag
+						case "head"://get type,id, write tag
+						case "seg"://get type,id,n write tag
+						output.write("</"+parser.getLocalName()+">\n");
+						break;
+						
+						case "div0"://get type,id, write tag BODY
+						output.write("</body>\n");
+						break;
+						
+						case "s":
+						output.write( "</s>\n");
+						break;
+						
+						case "w":
+						output.write( vForm +vAna+"\t"+wordid+"\n");
+						vAna = "";
+						vForm = "";
+						break;
+						
+						case "form":
+						flagForm = false;
+						break;
+						
+						case "ana":
+						flagAna = false;
+						break;
+					}
+					break;
+					
+					case XMLStreamConstants.CHARACTERS:
+					if(flagForm)
+					vForm += parser.getText().trim();
+					if(flagAna)
+					vAna += "\t" +parser.getText().trim();
+					if(flagDate)
+					date += parser.getText().trim();
+					if(flagAuthor)
+					author += parser.getText().trim();
+					break;
+				}
+			}
+			output.write("</txmcorpus>"); 
+			output.close();
+			parser.close();
+			inputData.close();
+		}
+		catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}
+		catch (IOException ex) {
+			System.out.println("IOException while parsing " + inputData);
+		}
+		
+		return true;
+	}
+	
+	/**
+	 * Run.
+	 *
+	 * @param rootDir the root dir
+	 */
+	public boolean run(String rootDir) 
+	{
+		//String rootDir = "~/xml/Hyperprince/";
+		if(cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+		
+		new File(rootDir,"wtc/hyperprince.wtc").delete();//cleaning&preparing
+		new File(rootDir,"wtc/").deleteDir();
+		new File(rootDir,"wtc/").mkdir();
+		new File(rootDir,"registry/").mkdir();
+		
+		//1- Transform into WTC file
+		List<File> files = new File(rootDir,"txm").listFiles();
+		for(File f : files) {
+			if(!f.exists()) {
+				println("file "+f+ " does not exists")	
+			}
+			else
+			{	
+				println("process file "+f)
+				String txtname = f.getName().substring(0,f.getName().length()-4);
+				def builder = new compiler(f.toURL(),txtname, "hyperprince", "default");
+				builder.setLang lang
+				builder.transfomFileWtc(rootDir,"wtc/hyperprince.wtc",f.getName());
+			}
+		}
+		
+		//2- Import into CWB
+		def outDir =rootDir;
+		def outDirTxm = rootDir;
+		
+		CwbEncode cwbEn = new CwbEncode();
+		cwbEn.setDebug true;
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		cwbMa.setDebug true;
+		
+		String[] pAttributes = ["pos","lemme","id"];
+		String[] sAttributes = ["txmcorpus:0+lang", "text:0+auteur+date+id+lang+base+project","front:0+type+id","body:0+type+id","back:0+type+id","head:0+type+id", "seg:0+type+n+id"];
+		
+		try {
+			String regPath =outDirTxm + "/registry/"+"hyperprince"
+			cwbEn.run(cwbLoc + "/cwb-encode", outDirTxm + "data", outDir + "/wtc/"+"hyperprince.wtc", regPath,pAttributes, sAttributes);
+			if (!new File(regPath).exists()) {
+				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			cwbMa.run(cwbLoc + "/cwb-makeall", "HYPERPRINCE", outDirTxm + "/registry");
+		} catch (Exception ex) {System.out.println(ex); return false;}
+		
+		System.out.println("Done.") 
+		return true;
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Hyperprince import module : multi-ling corpus</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/hyperprince/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/GetPagesFromURL.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/GetPagesFromURL.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/GetPagesFromURL.groovy	(revision 728)
@@ -0,0 +1,74 @@
+package org.txm.importer
+
+import org.w3c.tidy.Tidy
+
+def workDir = new File("/home/mdecorde/TEMP")
+def outdir = new File("/home/mdecorde/TEMP/out")
+
+def src = "http://txm.sourceforge.net/doc/manual/manual1.xhtml";
+def base = src.substring(0, src.lastIndexOf("/"));
+
+def url_xpath = """//*/a[@href]/@href""";
+def url_regexp = /.+/;
+def duplicates = false; // 'true' not implemented
+def filename_regexp = /zer/;
+def content_xpath = "//*/div[@id=\"content\"]";
+
+def xhtmlFile = new File(workDir, "src.xhtml")
+URL2XHTMLFILE(src, xhtmlFile, workDir);
+
+println "finding urls of $xhtmlFile"
+XPathResult xpathResult = new XPathResult(xhtmlFile);
+def urls = new LinkedHashSet<String>();
+
+for (String url : xpathResult.getXpathResponses(url_xpath))
+	if (urls ==~ url_regexp ) urls << url
+println urls
+
+int i = 1;
+for (String url : urls) {
+	//url = url.replaceAll()
+	def subxHtmlFile = new File(workDir, url)
+	URL2XHTMLFILE(base+"/"+url, subxHtmlFile, workDir);
+	
+	def txtFile = new File(outdir, url+".xhtml")
+	def writer = txtFile.newWriter("UTF-8");
+	for (def node : xpathResult.getNodes(content_xpath)) {
+		writer.println(node)
+	}
+	writer.close()
+	i++
+}
+
+def URL2XHTMLFILE(String url, File outfile, File workDir) {
+	println "getting src: $url"
+	def htmlFile = new File(workDir, "base.html")
+	def filestream = new FileOutputStream(htmlFile)
+	def out = new BufferedOutputStream(filestream)
+	out << new URL(url).openStream()
+	out.close()
+	
+	println "xHTMLize HTML $htmlFile"
+	Tidy tidy = new Tidy(); // obtain a new Tidy instance
+	tidy.setXHTML(true); // set desired config options using tidy setters
+	tidy.setInputEncoding("UTF-8")
+	tidy.setOutputEncoding("UTF-8")
+	tidy.setShowErrors(0)
+	tidy.setTabsize(10)
+	tidy.setShowWarnings(false)
+	File xhtmlFile = new File(workDir, "base.xhtml")
+	xhtmlFile.withWriter("UTF-8") { out2 ->
+		tidy.parse(htmlFile.toURI().toURL().newInputStream([readTimeout: 10000]), out2); // run tidy, providing an input and output stream
+	}
+	
+	println "remove entities and doctype"
+	String text = xhtmlFile.getText("UTF-8")
+	text = text.replaceAll("&nbsp;", " ")
+	text = text.replaceAll("xmlns=\"http://www.w3.org/1999/xhtml\"", " ")
+	text = text.replaceAll("""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">""", "")
+	outfile.withWriter("UTF-8") { writer ->
+		writer.write(text);
+	}
+}
+println "done"
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/frantext/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/frantext/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/frantext/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Frantext import module (uses the BFM import module)</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/frantext/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/frantext/frantextLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/frantext/frantextLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/frantext/frantextLoader.groovy	(revision 728)
@@ -0,0 +1,212 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+//
+//
+//
+//
+// $LastChangedDate: 2012-02-13 11:42:24 +0100 (lun., 13 fÃ©vr. 2012) $
+// $LastChangedRevision: 2126 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.frantext;
+
+import javax.xml.stream.XMLStreamReader;
+import org.txm.importer.ApplyXsl2;
+import org.txm.importer.bfm.importer;
+import org.txm.importer.bfm.compiler;
+import org.txm.importer.bfm.pager;
+import org.txm.objects.*;
+import org.txm.*;
+import org.txm.utils.i18n.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.importer.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+import org.txm.utils.*;
+
+String userDir = System.getProperty("user.home");
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+def MONITOR;
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/TESTS/frantext/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+		//rootDir = userDir+"/xml/TESTS/alceste";  // directory which contains the source file
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+// BFM XPATH PARAMETERS
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(1, "READ XPATH PARAMETERS")
+File paramDeclarationFile = new File(srcDir, "import.properties");
+Properties metadataXPath = new Properties();
+if (paramDeclarationFile.exists() && paramDeclarationFile.canRead()) {
+	InputStreamReader input = new InputStreamReader(new FileInputStream(paramDeclarationFile) , "UTF-8");
+	metadataXPath.load(input);
+	input.close();
+
+	if (!metadataXPath.containsKey("titre"))
+		println "Warning: parameters property file does not contain the 'titre' metadata"
+	if (!metadataXPath.containsKey("forme"))
+		println "Warning: parameters property file does not contain the 'forme' metadata in param values. The default value is 'prose'"
+}
+else
+	println "No '$paramDeclarationFile' file found"
+
+// Apply XSL
+if (MONITOR != null) MONITOR.worked(5, "APPLYING XSL")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+File xslFile = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "xsl/txm-filter-teifrantext-teibfm.xsl") // force xsl
+
+if (!ApplyXsl2.processImportSources(xslFile, srcDir, new File(binDir, "xsl"))) {
+	println "Error: failed to apply xsl $xsl. Aborting import."
+	return; // error durring process
+}
+srcDir = new File(binDir, "xsl");
+
+// copy txm files
+println "-- VALIDATION - checking XML source files well-formedness"
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+List<File> srcfiles = srcDir.listFiles();
+for (File f : srcfiles) { // check XML format, and copy file into binDir
+	if (f.isHidden() || f.getName().equals("import.xml") || f.getName().equals("metadata.csv") || f.getName().endsWith(".properties"))
+		continue;
+	if (ValidateXml.test(f)) {
+		FileCopy.copy(f, new File(txmDir, f.getName()));
+	} else {
+		println "Won't process file "+f;
+	}
+}
+if (MONITOR != null) MONITOR.worked(5)
+
+if (txmDir.listFiles() == null) {
+	println "No txm file to process"
+	return;
+}
+
+if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- IMPORTER - Reading source files"
+def imp = new importer()
+if (!imp.run(srcDir, binDir, txmDir, basename, metadataXPath)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools - $model model"
+boolean annotate_status = true;
+if (annotate && !(new Annotate().run(binDir, txmDir, model+".par"))) {
+	println "Skipping Annotate process";
+	annotate_status = false;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+if (debug) c.setDebug();
+//c.setCwbPath("~/TXM/cwb/bin");
+c.setLang(lang);
+c.setAnnotationDone(annotate_status)
+if (!c.run(binDir, txmDir, corpusname, metadataXPath)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	println "-- EDITION"
+	if (MONITOR != null) MONITOR.worked(25, "EDITION")
+	
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+	files = c.getOrderedTxmFiles();
+	println("Building editions: "+files.size()+" files" );
+
+	for (File txmFile : files) {
+		print "."
+		String txtname = txmFile.getName();
+		int idx = txtname.lastIndexOf(".");
+		if(idx > 0) txtname = txtname.substring(0, idx);
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);//["'","(","[","{","Â«"];
+
+		Element text = params.addText(corpusElem, txtname, txmFile);
+
+		def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, corpusname, metadataXPath);
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/lasla/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/lasla/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/lasla/compiler.groovy	(revision 728)
@@ -0,0 +1,300 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2016-05-26 17:42:36 +0200 (jeu., 26 mai 2016) $
+// $LastChangedRevision: 3219 $
+// $LastChangedBy: mdecorde $ 
+//
+
+
+package org.txm.importer.lasla;
+
+import java.util.ArrayList;;
+
+import org.txm.importer.cwb.BuildCwbEncodeArgs;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+
+import javax.xml.stream.*;
+import java.net.URL;
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class compiler.
+ */
+class compiler 
+{
+	
+	/** The debug. */
+	private boolean debug= false;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The dir. */
+	private def dir;
+	
+	/** The output. */
+	private def output;
+	
+	/** The url. */
+	private def url;
+	
+	/** The anahash. */
+	private HashMap<String,String> anahash =new HashMap<String,String>() ;
+	
+	/** The text. */
+	String text="";
+	
+	/** The base. */
+	String base="";
+	
+	/** The project. */
+	String project="";
+	
+	/** The text attributes. */
+	String[] textAttributes = null;
+	
+	/** The cwb loc. */
+	String cwbLoc;
+	
+	/** The lang. */
+	private String lang ="fr";
+	
+	/**
+	 * initialize.
+	 *
+	 */
+	public compiler(){}
+	
+	/**
+	 * Instantiates a new compiler.
+	 *
+	 * @param url the url
+	 * @param text the text
+	 * @param base the base
+	 * @param project the project
+	 */
+	public compiler(URL url,String text,String base, String project)
+	{
+		this.text = text
+		this.base = base;
+		this.project = project;
+		this.textAttributes = textAttributes;
+		try {
+			this.url = url;
+			inputData = url.openStream();
+			
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.err.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * set the language of the corpus.
+	 *
+	 * @param lang the lang
+	 * @return the java.lang. object
+	 */
+	public setLang(String lang)
+	{
+		this.lang = lang;
+	}
+	
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the new cwb path
+	 */
+	public void setCwbPath(String path)
+	{
+		if(!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path;
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(String dirPathName, String fileName){
+		try {
+			File f = new File(dirPathName, fileName)
+			output = new OutputStreamWriter(new FileOutputStream(f,f.exists()) , "UTF-8");
+			return true;
+		} catch (Exception e) {
+			System.err.println(e);
+			
+			return false;
+		}
+	}
+	
+	/**
+	 * Go to text.
+	 */
+	private void GoToText()
+	{
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			if(event == XMLStreamConstants.END_ELEMENT)
+				if(parser.getLocalName().equals("teiHeader"))
+					return;
+		}
+	}
+	
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param basename the basename
+	 * @param textAttributes the text attributes
+	 * @return true, if successful
+	 */
+	public boolean run(File rootDirFile,String basename, String[] textAttributes) 
+	{
+		String rootDir =rootDirFile.getAbsolutePath();
+		
+		if(cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+		
+		if(!new File(cwbLoc).exists())
+		{
+			println ("CWB path error: "+cwbLoc)
+			return false;
+		}
+		if(!new File(rootDir).exists())
+		{
+			println ("binary directory does not exists: "+rootDir)
+			return false;
+		}
+
+		new File(rootDir,"/wtc/").deleteDir();
+		new File(rootDir,"/wtc/").mkdir();
+		new File(rootDir,"/data/").deleteDir();
+		new File(rootDir,"/data/").mkdir();
+		new File(rootDir,"registry/").mkdir();
+		
+		String textid="";
+		int counttext =0;
+		List<File> files = new File(rootDirFile,"txm").listFiles();
+		//1- Transform into WTC file
+		def builder = null;
+		for(File f : files)
+		{
+			counttext++;
+			if(!f.exists())
+			{
+				println("file "+f+ " does not exists")	
+			}
+			else
+			{	
+				wtcbuilder = new XMLTXM2WTC(f.toURL());
+				String txtname = f.getName().substring(0,f.getName().length()-4);
+				wtcbuilder.setTextInfo(txtname, basename, "project");
+
+				wtcbuilder.setBalisesToKeep(["text"]);
+				wtcbuilder.setSendToPAttributes([]);
+				wtcbuilder.setLang(lang);
+				if(!wtcbuilder.transformFile(new File(rootDir,"wtc/"+basename+".wtc")))
+				{
+					println("Failed to compile "+f)
+				}
+			}
+		}
+		
+		//2- Import into CWB
+		def outDir =rootDir;
+		def outDirTxm = rootDir;
+		
+		CwbEncode cwbEn = new CwbEncode();
+		cwbEn.setDebug(debug);
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		cwbMa.setDebug(debug);
+		String[] pAttributes = ["ref","s","sent","lemme","line","pos"];
+		
+		BuildCwbEncodeArgs argsgetter = new BuildCwbEncodeArgs();
+
+		ArrayList<String> wordstag = ["w"];
+		//argsgetter.process(new File(rootDir+"/txm",basename+".wtc"), wordstag);
+		
+		String[] sAttributes = ["txmcorpus:0+lang", "text:0+id+base+project"]
+		
+		try {
+			String regPath = outDirTxm + "/registry/"+basename.toLowerCase();
+			cwbEn.run(new File(cwbLoc,"cwb-encode").getAbsolutePath(), outDirTxm + "/data", outDir + "/wtc/"+basename+".wtc", regPath, pAttributes, sAttributes);
+			if (!new File(regPath).exists()) {
+				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			cwbMa.run(new File(cwbLoc,"cwb-makeall").getAbsolutePath(), basename.toUpperCase(), outDirTxm + "/registry");
+			
+		} catch (Exception ex) {System.out.println(ex); return false;}
+		
+		System.out.println("Done.") 
+		
+		return true;
+	}
+	
+	/**
+	 * Sets the debug.
+	 */
+	public void setDebug()
+	{
+		this.debug = true;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("~/xml/geo");
+		def c = new compiler();
+		c.setDebug();
+		c.setCwbPath("~/TXM/cwb/bin");
+		c.run(dir,"geo");
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/lasla/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/lasla/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/lasla/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Lasla import module - not yet finished</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/lasla/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/lasla/pager.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/lasla/pager.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/lasla/pager.groovy	(revision 728)
@@ -0,0 +1,377 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.lasla
+
+;
+
+import org.txm.importer.*;
+import org.xml.sax.Attributes;
+import org.txm.importer.filters.*;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+// TODO: Auto-generated Javadoc
+/** Build GEO corpus simple edition from a xml-tei. @author mdecorde */
+class pager {
+	List<String> NoSpaceBefore;
+	
+	/** The No space after. */
+	List<String> NoSpaceAfter;
+
+	/** The wordcount. */
+	int wordcount = 0;
+	
+	/** The pagecount. */
+	int pagecount = 0;
+	
+	/** The wordmax. */
+	int wordmax = 0;
+	
+	/** The basename. */
+	String basename = "";
+
+	/** The wordid. */
+	String wordid;
+	
+	/** The first word. */
+	boolean firstWord = true;
+	
+	/** The wordvalue. */
+	String wordvalue;
+	
+	/** The interpvalue. */
+	String interpvalue;
+	
+	/** The lastword. */
+	String lastword = " ";
+	
+	/** The wordtype. */
+	String wordtype;
+	
+	/** The flagform. */
+	boolean flagform = false;
+	
+	/** The flaginterp. */
+	boolean flaginterp = false;
+	
+	/** The url. */
+	private def url;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The writer. */
+	OutputStreamWriter writer;
+	
+	/** The multiwriter. */
+	OutputStreamWriter multiwriter = null;
+	
+	/** The infile. */
+	File infile;
+	
+	/** The outfile. */
+	File outfile;
+	
+	/** The pages. */
+	ArrayList<File> pages = new ArrayList<File>();
+	
+	/** The idxstart. */
+	ArrayList<String> idxstart = new ArrayList<String>();
+
+	/**
+	 * Instantiates a new pager.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param NoSpaceBefore the no space before
+	 * @param NoSpaceAfter the no space after
+	 * @param max the max
+	 * @param basename the basename
+	 */
+	pager(File infile, File outfile, List<String> NoSpaceBefore,
+			List<String> NoSpaceAfter, int max, String basename) {
+		this.basename = basename;
+		this.wordmax = max;
+		this.NoSpaceBefore = NoSpaceBefore;
+		this.NoSpaceAfter = NoSpaceAfter;
+		this.url = infile.toURI().toURL();
+		this.infile = infile;
+
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		createOutput(outfile);
+		process();
+	}
+
+	/**
+	 * Creates the next output.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean createNextOutput()
+	{
+		try {
+			if(multiwriter != null)
+			{
+				multiwriter.write("</body>");
+				multiwriter.write("</html>");
+				multiwriter.close();
+			}
+			pagecount++;
+			File f = new File(outfile.getParent()+"/multi/",outfile.getName().substring(0,outfile.getName().length()-5)+"_"+pagecount+".html");
+			pages.add(f);
+			idxstart.add(wordid)
+			multiwriter = new OutputStreamWriter(new FileOutputStream(f) , "UTF-8");
+			
+			multiwriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+			multiwriter.write("<html>");
+			multiwriter.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+			multiwriter.write("<head>");
+			multiwriter.write("<title>"+basename.toUpperCase()+" Edition - Page "+pagecount+"</title>");
+			multiwriter.write("</head>");
+			multiwriter.write("<body>");
+			
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile) {
+		try {
+			this.outfile = outfile;
+
+			writer = new OutputStreamWriter(new FileOutputStream(outfile),
+					"UTF-8");
+			createNextOutput();
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Gets the page files.
+	 *
+	 * @return the page files
+	 */
+	public ArrayList<File> getPageFiles() {
+		return pages;
+	}
+
+	/**
+	 * Gets the idx.
+	 *
+	 * @return the idx
+	 */
+	public ArrayList<String> getIdx() {
+		return idxstart;
+	}
+
+	/**
+	 * Process.
+	 */
+	void process()
+	{
+		String localname = "";
+		
+		writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+		writer.write("<html>");
+		writer.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+		writer.write("<head>");
+		writer.write("<title>"+basename.toUpperCase()+" edition</title>");
+		writer.write("</head>");
+		writer.write("<body>");
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			
+			
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{
+						case "head":
+							writer.write("<h2>\n")
+							multiwriter.write("<h2>\n")
+							break;
+						
+						case "lg":
+							writer.write("<p>\n")
+							multiwriter.write("<p>\n")
+							break;
+						
+						case "p":
+						case "q":
+							writer.write("<p>\n")
+							multiwriter.write("<p>\n")
+							break;
+							
+						case "lb":
+						case "br":
+						writer.write("<br/>\n")
+						multiwriter.write("<br/>\n")
+						break;
+						
+						case "w":
+							wordid=parser.getAttributeValue(null,"id");
+							if(firstWord)
+							{
+								firstWord=false;
+								this.idxstart.set(0,wordid);
+							}
+							wordcount++;
+							if(wordcount >= wordmax)
+							{
+								createNextOutput();
+								wordcount=0;
+							}
+							break;
+						
+						case "ana":
+							flaginterp=true;
+							interpvalue+=" "+parser.getAttributeValue(null,"type").substring(1)+":"
+							break;
+						
+						case "form":
+							wordvalue="";
+							interpvalue ="";
+							flagform=true;
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{
+						case "head":
+							writer.write("</h2>\n")
+							multiwriter.write("</h2>\n")
+							break;
+						
+						case "lg":
+							writer.write("</p>\n")
+							multiwriter.write("</p>\n")
+							break;
+						
+						case "lb":
+							writer.write("<br/>\n")
+							multiwriter.write("<br/>\n")
+							break;
+							
+						case "pb":
+							writer.write("<br/><br/>\n")
+							multiwriter.write("<br/><br/>\n")
+							break;
+						
+						case "p":
+						case "q":
+							writer.write("</p>\n")
+							multiwriter.write("</p>\n")
+							break;
+						
+						
+						case "form":
+							flagform = false
+						
+							break;
+						
+						case "ana":
+							flaginterp = false
+							break;
+						
+						case "w":
+							int l = lastword.length();
+							String endOfLastWord = "";
+							if(l > 0)
+								endOfLastWord = lastword.subSequence(l-1, l);
+							
+							if(interpvalue != null)
+								interpvalue = interpvalue.replace("&", "&amp;").replace("\"","&quot;").replace("<", "&lt;");
+							
+							if(NoSpaceBefore.contains(wordvalue) || 
+									NoSpaceAfter.contains(lastword) || 
+									wordvalue.startsWith("-") || 
+									NoSpaceAfter.contains(endOfLastWord))
+							{
+								writer.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+								multiwriter.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+							}
+							else
+							{
+								writer.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+								multiwriter.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+							}
+							writer.write(wordvalue.replace("<", "&lt;")+"</span>");
+							multiwriter.write(wordvalue.replace("<", "&lt;")+"</span>");
+							lastword=wordvalue;
+							break;
+					}
+					break;
+				
+				case XMLStreamConstants.CHARACTERS:
+					if(flagform)
+						if(parser.getText().length() > 0)
+							wordvalue+=(parser.getText().replace("&","&amp;").replace("<", "&lt;"));
+					if(flaginterp)
+						if(parser.getText().length() > 0)
+							interpvalue+=(parser.getText().replace("&","&amp;").replace("<", "&lt;"));
+					break;
+			}
+		}	
+		writer.write("</body>");
+		writer.write("</html>");
+		writer.close();
+		multiwriter.write("</body>");
+		multiwriter.write("</html>");
+		multiwriter.close();
+		inputData.close();
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/lasla/importer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/lasla/importer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/lasla/importer.groovy	(revision 728)
@@ -0,0 +1,168 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.lasla
+
+import javax.xml.stream.*
+
+import org.txm.*
+import org.txm.importer.*
+import org.txm.importer.filters.*
+import org.txm.objects.*
+import org.txm.scripts.*
+import org.txm.scripts.teitxm.*
+
+import filters.CutHeader.*
+import filters.FusionHeader.*
+import filters.TagSentences.*
+import filters.Tokeniser.*
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class importer.
+ */
+class importer {
+	
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param encoding the encoding
+	 * @param basename the basename
+	 * @return true, if successful
+	 */
+	public boolean run(File rootDirFile, String encoding, String basename)
+	{
+		String filename = rootDirFile.getName();
+		String rootDir = rootDirFile.getAbsolutePath()+"/"
+		
+		//cleaning
+		File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+		
+		binDir.deleteDir();
+		binDir.mkdir();
+		new File(binDir,"src").deleteDir();
+		new File(binDir,"src").mkdir();
+		new File(binDir,"txm").deleteDir();
+		new File(binDir,"txm").mkdir();
+		
+		ArrayList<String> milestones = new ArrayList<String>();//the tags who you want them to stay milestones
+		
+		//separates values and build simple xml
+		List<File> srcfiles = new File(rootDir).listFiles();
+		if(srcfiles == null)
+		{
+			println "No file to process"
+			return false;
+		}
+		//println "BYEBYE FORTRAN";
+		println("Converting to xml "+srcfiles.size()+ " files")
+		for(File f : srcfiles)
+		{
+			print "."
+			File outfile = new File(binDir,"src/"+f.getName()+".xml")
+			FortranColumns2XML builder = new FortranColumns2XML(f, outfile, encoding);
+			builder.setColumnIndexes([0, 3, 4, 8, 29, 55, 67],	[3, 4, 8, 28, 54, 66, 78]);
+			builder.setColumnsLinesNames(["ref","s","sent","lemme","word","line","pos"], "w", 4);
+			builder.setAddIds(true);
+			//builder.setLineCheck(3, "l");
+			if(!builder.process())
+			{
+				println "Failed to convert file: "+f
+			}
+		}
+		println ""
+		
+		rootDir = binDir.getAbsolutePath();
+		srcfiles = new File(rootDir, "src").listFiles();
+		//TRANSFORM INTO XML-TEI-TXM
+		println("Building xml-tei-txm "+srcfiles.size()+ " files")
+		for(File f : srcfiles)
+		{
+			print "."
+			//ArrayList<String> milestones = new ArrayList<String>();
+			
+			File file = f; 
+			String txmfile = f.getName();
+			def correspType = new HashMap<String,String>()
+			//["ref","s","sent","word","lemme","line","pos"]
+			correspType.put("ref","ref");
+			correspType.put("s","s");
+			correspType.put("sent","sent");
+			correspType.put("lemme","lemme")
+			correspType.put("line","line")
+			correspType.put("pos","pos");
+			correspType.put("form","form");
+			
+			def correspRef = new HashMap<String,String>()
+			correspRef.put("ref","lasla");
+			correspRef.put("s","lasla");
+			correspRef.put("sent","lasla");
+			correspRef.put("lemme","lasla")
+			correspRef.put("line","lasla")
+			correspRef.put("pos","lasla");
+			correspRef.put("form","lasla");
+			
+			//il faut lister les id de tous les respStmt
+			def respId = ["lasla"];
+			//fait la correspondance entre le respId et le rapport d'execution de l'outil
+			def applications = new HashMap<String, ArrayList<String>>();
+			applications.put("lasla", new ArrayList<String>());
+			applications.get("lasla").add("txm");//app ident
+			applications.get("lasla").add("0.6");//app version
+			applications.get("lasla").add(null);//app report file path
+			
+			//fait la correspondance entre le respId et les attributs type de la propriÃ©tÃ© ana du w txm
+					//pour construire les ref vers les taxonomies
+			def taxonomiesUtilisees = new HashMap<String,String[]>();
+			taxonomiesUtilisees.put("lasla",["LASLA"]);//,"lemma","lasla","grace"]);
+			
+			//associe un id d'item avec sa description et son URI
+			def itemsURI = new HashMap<String,HashMap<String,String>>();
+			itemsURI.put("LASLA",new HashMap<String,String>());
+			itemsURI.get("LASLA").put("tagset","http://bfm.ens-lsh.fr/IMG/xml/cattex2009.xml");
+			itemsURI.get("LASLA").put("website","http://bfm.ens-lsh.fr/article.php3?id_article=176");
+			
+			//informations de respStmt
+			//resps (respId <voir ci-dessus>, [description, person, date])
+			def resps = new HashMap<String,String[]>();
+			resps.put("lasla", ["initial tagging","lasla","2010-03-02",""])
+			//lance le traitement
+			String wordprefix = "w_";
+			def builder = new Xml2Ana(file);
+			builder.setCorrespondances(correspRef, correspType);
+			builder.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)
+			//builder.setAddTEIHeader();
+			if(!builder.process(new File(new File(rootDir,"txm"),txmfile)))
+			{
+				println "Failed to build xml-txm of file: "+f;
+			}
+		}
+		println ""
+		return true;
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/lasla/laslaLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/lasla/laslaLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/lasla/laslaLoader.groovy	(revision 728)
@@ -0,0 +1,165 @@
+/**
+ * Main.
+ *
+ * @param args the args
+ */
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.lasla;
+
+import java.io.File;
+import org.txm.importer.lasla.importer;
+import org.txm.importer.xml.compiler;
+import org.txm.importer.xml.pager_old;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.utils.i18n.*;
+
+// TODO: Auto-generated Javadoc
+/* (non-Javadoc)
+ * @see groovy.lang.Script#run()
+ */
+String userDir = System.getProperty("user.home");
+String rootDir;
+String lang;
+String encoding;
+String model;
+String basename;
+try{rootDir = rootDirBinding;lang=langBinding;encoding=encodingBinding;model=modelBinding;basename=basenameBinding;}
+catch(Exception)
+{	println "DEV MODE";//exception means we debug
+	if(!org.txm.Toolbox.isInitialized())
+	{
+		rootDir = userDir+"/xml/lasla/";
+		basename = "latin";
+		lang="fr";
+		encoding= "ISO-8859-1";
+		model="rgaqcj";//not used
+		Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
+		Toolbox.setParam(Toolbox.INSTALL_DIR,"/usr/lib/TXM");
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"),"TXM"));
+	}
+}
+
+//String basename = new File(rootDir).getName().toLowerCase()
+println "-- IMPORTER - Reading source files"
+def imp = new importer();
+if(!imp.run( new File(rootDir), encoding, basename))
+{
+	println "import process stopped";
+	return;
+}
+
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+File txmfiles = new File(binDir,"txm");
+files = txmfiles.listFiles()
+
+println "-- COMPILING - Building Search Engine indexes"
+
+def files = new File(binDir, "src").listFiles()
+File onesrcfile = null;
+if(files.size() > 0)
+	onesrcfile = files[0];
+if(onesrcfile == null)
+{
+	println "No XML file (extension '.xml') has been found in directory "+binDir
+	return;
+}
+
+def c = new compiler();
+c.setDebug();
+//c.setCwbPath("~/TXM/cwb/bin");
+c.setAnnotationSuccess(false)
+c.setLang(lang);
+if(!c.run(binDir, basename, null, files, null))
+{
+	println "import process stopped";
+	return;
+}
+
+//move registry file to cwb registry dir
+File registryfile = new File(binDir,"registry/"+basename);
+if(registryfile.exists())
+	FileCopy.copy(registryfile,new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "registry/"+basename))
+
+Workspace w = org.txm.Toolbox.workspace;
+Project p = w.getProject("default")
+p.removeBase(basename)
+Base b = p.addBase(basename);
+b.addDirectory(new File(binDir, "txm"));
+b.setAttribute("lang", lang)
+b.propagateAttribute("lang")
+
+println "-- EDITION - Building edition"
+new File(binDir,"HTML").deleteDir();
+new File(binDir,"HTML").mkdir();
+new File(binDir,"HTML/default").mkdir();
+List<File> filelist = new File(binDir,"txm").listFiles();
+def second = 0
+
+println "Paginating text: "
+for(String textname : b.getTextsID())
+{
+	Text text = b .getText(textname);
+	File srcfile = text.getSource();
+	File resultfile = new File(binDir, "HTML/"+srcfile.getName().substring(0,srcfile.getName().length()-4)+".html");
+	List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+		
+		if (second) { print(", ") }
+		if (second > 0 && (second % 5) == 0) println ""
+		print(srcfile.getName());
+		second++
+	
+	def ed = new pager_old(srcfile,resultfile, NoSpaceBefore, NoSpaceAfter,500,basename, "br");
+	
+	Edition editionweb = text.addEdition("default","html",resultfile);
+//	println("pages "+ed.getPageFiles())
+//	println("idx "+ed.getIdx())
+	for(int i = 0 ; i < ed.getPageFiles().size();i++)
+	{
+		File f = ed.getPageFiles().get(i);
+		String idx = ed.getIdx().get(i);
+		editionweb.addPage(f,idx);
+	}
+	
+//	Edition editionbp = text.addEdition("onepage","html",resultfile);
+//	editionbp.addPage(resultfile,ed.getIdx().get(0));
+}
+
+
+w.save()
+println "done"
+
+
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxmpara/ValidateXmlTXM.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxmpara/ValidateXmlTXM.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxmpara/ValidateXmlTXM.groovy	(revision 728)
@@ -0,0 +1,219 @@
+package org.txm.importer.xmltxmpara
+
+import javax.xml.stream.*;
+import java.net.URL;
+
+class ValidateXmlTXM {
+	
+	public static String XMLNS = "http://www.w3.org/XML/1998/namespace";
+	public static String TXMNS = "http://textometrie.org/1.0";
+	public static String TEINS = "http://www.tei-c.org/ns/1.0";
+	
+
+	boolean checkteiCorpus = false;
+	boolean checkTEI = true;
+	boolean checkAlignStruct = false;
+	boolean checkW = true;
+
+	boolean hasTeiCorpus = false;
+	boolean hasTeiCorpusID = false;
+	boolean hasTeiCorpusHeader = false;
+	boolean hasTeiCorpusHeaderAppDesc = false;
+	boolean hasTeiCorpusHeaderVersion = false;
+	int hasTei = 0;
+	int hasTeiID = 0;
+	boolean hasAlignStruct = false
+	String alignStruct = "";
+	boolean hasTXMW = false;
+
+	public boolean validate(File sourceDir)
+	{
+		boolean ret = true;
+		//get infos from import.xml if any
+		File alignxml = sourceDir.listFiles().find{it.getName() == "align.xml"}
+		if(alignxml != null)
+		{
+			infosFromImportXML(alignxml)
+			checkteiCorpus = true;
+			// checkAlignStruct = true;
+			// mainLang = ...
+			// corpusnames = ...
+			// alignStructs = 
+		}
+		
+		sourceDir.eachFileMatch(~/.+.xml/){f->
+
+			if (f.getName() != "import.xml" && f.getName() != "align.xml" && f.isFile())
+				ret = ret & validateXMLTXM(f);
+		}
+
+		return ret;
+	}
+	
+	HashMap<String, ArrayList<String>> links = [:];
+	protected boolean infosFromImportXML(File alignxml)
+	{
+		this.url = xmlfile.toURI().toURL();;
+		inputData = url.openStream();
+
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+		{
+			if(event == XMLStreamConstants.START_ELEMENT)
+			{
+				if(parser.getLocalName() == "link")
+				{
+					links.put(parser.getAttributeValue(null, "target"), 
+						[parser.getAttributeValue(null, "alignElement"), parser.getAttributeValue(null, "alignLevel")])
+					
+				}
+			}
+		}
+		parser.close();
+		println "get infos from $alignxml"
+		return true;
+	}
+	
+	private void printAttributes(def parser)
+	{
+		for(int i = 0 ; i < parser.getAttributeCount(); i++)
+		println( "$path "+parser.getAttributeLocalName(i)+
+		 " = "+ parser.getAttributeValue(i))
+	}
+	
+	def url;
+	def inputData;
+	def factory;
+	XMLStreamReader parser;
+	String path = ""
+	protected boolean validateXMLTXM(File xmlfile)
+	{
+		println "validate $xmlfile"
+		boolean inTeiCorpus = false;
+		boolean inTeiHeader = false;
+		boolean inMetadata = false;
+		boolean inTEI = false;
+		boolean inW = false;
+		boolean inForm = false;
+
+		try {
+			this.url = xmlfile.toURI().toURL();;
+			inputData = url.openStream();
+
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+			return false;
+		}catch (IOException ex) {
+			System.err.println("IOException while parsing ");
+			return false
+		}
+		String localname = ""
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+		{
+			if(event == XMLStreamConstants.START_ELEMENT)
+			{
+				localname = parser.getLocalName();
+				path += "/"+localname
+				switch (localname)
+				{
+					case "teiCorpus":
+						inTeiCorpus = true;
+						hasTeiCorpus = true;
+						//printAttributes(parser);
+						if(parser.getAttributeValue(XMLNS, "id") != null)
+							hasTeiCorpusID = true;
+						break;
+					case "teiHeader":
+						inTeiHeader = true;
+						if(inTeiCorpus)
+							hasTeiCorpusHeader = true;
+						break;
+					case "metadata":
+						inMetadata = true;
+						//printAttributes(parser);
+						if(parser.getAttributeValue(null, "name") == "version")
+							hasTeiCorpusHeaderVersion = true;
+						break;
+					case "TEI":
+						inTEI = true;
+						hasTei++;
+						if(parser.getAttributeValue(XMLNS, "id") != null)
+							hasTeiID++;
+						break;
+					case "w":
+						inW = true;
+						String id = parser.getAttributeValue(XMLNS, "id");
+						if(!(id != null && id.matches("w_.+_.+")))
+							hasTXMW = false;
+						break;
+					case "form":
+						inForm = true;
+						break;
+					case alignStruct:
+					if(parser.getAttributeValue(null, "align") == null)
+						hasAlignStruct = false;
+						break;
+				}
+			}
+			else if(event == XMLStreamConstants.END_ELEMENT)
+			{
+				localname = parser.getLocalName()
+				if(path.lastIndexOf("/") > 0)
+					path = path.substring(0, path.lastIndexOf("/"))
+				switch (localname)
+				{
+					case "teiCorpus":
+						inTeiCorpus = false;
+						break;
+					case "teiHeader":
+						inTeiHeader = false;
+						break;
+					case "metadata":
+						inMetadata = false;
+						break;
+					case "TEI":
+						inTEI = false;
+						break;
+					case "w":
+						inW = false;
+						break;
+					case "form":
+						inForm = false;
+						break;
+				}
+			}
+		}
+		parser.close();
+		
+		if(checkteiCorpus &
+			!(hasTeiCorpus & hasTeiCorpusID & hasTeiCorpusHeader & hasTeiCorpusHeaderVersion))
+		{	println "wrong <teiCorpus> format: $hasTeiCorpus & $hasTeiCorpusID & $hasTeiCorpusHeader & $hasTeiCorpusHeaderVersion"
+			return false;
+		}
+		
+		if(checkAlignStruct &
+			!hasAlignStruct)
+		{   println "wrong align structure format: $hasAlignStruct"
+			return false;
+		}
+		
+		if(checkTEI & !(hasTei == hasTeiID))
+		{	println "wrong <TEI> format: $hasTei == $hasTeiID"
+			return false;
+		}
+		
+		return true;
+	}
+	
+	public static void main(String[] args)
+	{
+		File srcdir = new File("/home/mdecorde/xml/xmltxmpara");
+		def checker = new ValidateXmlTXM();
+		println checker.validate(srcdir)
+	}
+}
+
+
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxmpara/xmltxmparaLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxmpara/xmltxmparaLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxmpara/xmltxmparaLoader.groovy	(revision 728)
@@ -0,0 +1,242 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+// $LastChangedDate: 2011-06-03 12:37:57 +0200 (Fri, 03 Jun 2011) $
+// $LastChangedRevision: 1867 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.xmltxmpara;
+
+import org.txm.importer.xmltxmpara.compiler;
+import org.txm.importer.xml.pager_old;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+import org.txm.importer.*;
+import org.txm.importer.cwb.CwbAlign;
+import org.txm.importer.cwb.PatchCwbRegistry;
+import org.w3c.dom.Element
+
+String userDir = System.getProperty("user.home");
+String rootDir;
+String lang;
+String encoding;
+String model;
+String basename;
+String xsl;
+
+try {rootDir = rootDirBinding;}
+catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	if (!org.txm.Toolbox.isInitialized()) {
+		rootDir = userDir+"/xml/qgraal";
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"),"TXM"));
+	}
+}
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+srcDir.getName());
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File srcParamFile = new File(rootDir, "import.xml");
+File paramFile = new File(binDir, "import.xml")
+if (!srcParamFile.exists()) {
+	println "Stop import: can't find params file: "+srcParamFile
+	return;
+}
+FileCopy.copy(srcParamFile, paramFile);
+if (!paramFile.exists()) {
+	println "Stop import: failed to copy param file: "+srcParamFile+" to "+paramFile
+	return;
+}
+BaseParameters params = new BaseParameters(paramFile);
+params.load();
+basename = params.name;
+
+File paraDir = new File(binDir, "paracorpus/");
+paraDir.deleteDir();
+paraDir.mkdir();
+
+// Apply XSL
+if (xsl != null && xsl.trim().length() > 0) {
+	if (!ApplyXsl2.processImportSources(new File(xsl, new File(rootDir), srcDir)))
+	return; // error durring process
+	srcDir = new File(binDir, "src");
+}
+
+//copy txm files
+List<File> srcfiles = srcDir.listFiles();
+for (File f : srcfiles) {// check XML format, and copy file into binDir
+	if (f.getName().equals("import.xml") || f.getName().equals("metadata.csv") || f.getName().endsWith(".properties"))
+	continue;
+	if (ValidateXml.test(f)) {
+		FileCopy.copy(f, new File(paraDir, f.getName()));
+	} else {
+		println "Won't process file "+f;
+	}
+}
+
+if (paraDir.listFiles() == null) {
+	println "No txm file to process"
+	return;
+}
+
+//contains the text files associated to a corpus
+println "Getting lang of each corpus and splitting corpus: "+params.corpora.keySet()
+for (String corpusname : params.corpora.keySet()) {
+	
+	lang = params.corpora.get(corpusname).getAttribute("lang");
+	encoding = params.corpora.get(corpusname).getAttribute("encoding");
+	model = lang
+	
+	print "."
+	println "split in"
+	File txmDir = new File(binDir,"txm/$corpusname");
+	txmDir.deleteDir();
+	txmDir.mkdirs();
+	
+	def corpusElem = params.corpora.get(corpusname)
+	String corpuslang = corpusElem.getAttribute("lang")
+	
+	println "split corpus $corpusname by TEI@id"
+	File f = new File(paraDir, corpusname+".xml")
+	if (!f.exists()) {
+		println "source file is missing: "+f;
+	}
+	def splitter = new SplitBy(f);
+	if (splitter.process(txmDir, "TEI", "id")) {
+		for (File textfile : splitter.getFiles()) {
+			params.addText(corpusElem, basename, textfile)
+		}
+	} else {
+		println "failed to split corpus "+corpusname;
+		return false;
+	}
+}
+
+println "-- COMPILING - Building Search Engine indexes"
+for (String corpusname : base.getCorpora().keySet()) {
+	println "Build corpus "+corpusname
+	def c = new compiler();
+	c.setDebug();
+	//c.setCwbPath("~/TXM/cwb/bin");
+	if (!c.run(corpusfiles.get(corpusname), binDir, corpusname, basename)) {
+		println "Compiler failed"
+		return;
+	}
+}
+
+println "-- ALIGN - aligning CQP corpus with each others"
+for (String alignement : parameters.getAlignements()) {
+	println "aligning..."+alignement
+		String alignStructure = parameters.getStructure(alignement);
+		String alignAttribute = "align";
+		
+		String regpath = new File(binDir,"registry").getAbsolutePath();
+		String cwbLoc;
+		if(cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+		
+		if (!new File(cwbLoc).exists()) {
+			println ("CWB path error: "+cwbLoc)
+			return false;
+		}
+		
+		println "aligned corpora: "+parameters.getTargets(alignement);
+		for (String corpusName : parameters.getTargets(alignement)) {
+			for (String targetName : parameters.getTargets(alignement)) {
+				if (corpusName != targetName) {
+					try {
+						println "build align index: "+corpusName+" with "+targetName
+						//./cwb-align -V seg_id -r ~/TXM/corpora/tmxtest/registry/ tmxen tmxfr seg
+						CwbAlign tt = new CwbAlign(cwbLoc);
+						tt.setV(alignStructure+"_"+alignAttribute);
+						tt.setr(regpath);
+						tt.cwbalign(corpusName, targetName, alignStructure);
+						
+						//patch registry
+						println " patch reg : "+new File(regpath, corpusName.toLowerCase())
+						if (PatchCwbRegistry.patchAlignment(new File(regpath, corpusName.toLowerCase()), targetName.toLowerCase()))
+						{
+							// ./cwb-align-encode -D -r ~/TXM/corpora/tmxtest/registry/ -v out.align
+							tt = new CwbAlign(cwbLoc);
+							tt.setD();
+							tt.setv();
+							tt.setr(regpath);
+							tt.cwbalignencode("out.align");
+						}
+					} catch (IOException e) {
+						org.txm.utils.logger.Log.printStackTrace(e);
+						return;
+					}
+				}
+			}
+		}
+
+}
+
+println "-- EDITION - Building edition"
+new File(binDir,"HTML").deleteDir();
+new File(binDir,"HTML").mkdir();
+new File(binDir,"HTML/default").mkdir();
+List<File> filelist = new File(binDir,"txm").listFiles();
+def second = 0
+
+println "Paginating text: "
+for(String textname : base.getTextsID())
+{
+	Text text = base.getText(textname);
+	File srcfile = text.getSource();
+	File resultfile = new File(binDir,"HTML/"+srcfile.getName().substring(0,srcfile.getName().length()-4)+".html");
+	lang = text.getAttribute("lang").toString();
+	List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+	List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+		
+	if (second) { print(", ") }
+	if (second > 0 && (second % 5) == 0) println ""
+	print(srcfile.getName());
+	second++
+	
+	def ed = new pager_old(srcfile,resultfile, NoSpaceBefore, NoSpaceAfter, 500, basename, "pb");
+	
+	Edition editionweb = text.addEdition("default", "html", resultfile);
+	for(int i = 0 ; i < ed.getPageFiles().size();i++)
+	{
+		File f = ed.getPageFiles().get(i);
+		String idx = ed.getIdx().get(i);
+		editionweb.addPage(f,idx);
+	}
+}
+
+DomUtils.print(params.root.getOwnerDocument())
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxmpara/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxmpara/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxmpara/compiler.groovy	(revision 728)
@@ -0,0 +1,511 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2011-06-03 12:37:57 +0200 (Fri, 03 Jun 2011) $
+// $LastChangedRevision: 1867 $
+// $LastChangedBy: mdecorde $ 
+//
+
+
+package org.txm.importer.xmltxmpara;
+
+import java.util.ArrayList;
+
+import org.txm.importer.cwb.BuildCwbEncodeArgs;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+
+import javax.xml.stream.*;
+import java.net.URL;
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class compiler.
+ */
+class compiler 
+{
+	
+	/** The debug. */
+	private boolean debug= false;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The dir. */
+	private def dir;
+	
+	/** The output. */
+	private Writer output;
+	
+	/** The url. */
+	private def url;
+	
+	/** The text. */
+	String text="";
+	
+	/** The base. */
+	String base="";
+	
+	/** The project. */
+	String project="";
+	
+	/** The text attributes. */
+	String[] textAttributes = null;
+	
+	/** The cwb loc. */
+	String cwbLoc;
+	
+	/** The lang. */
+	private String lang ="fr";
+	
+	/** The anatypes. */
+	private static ArrayList<String> anatypes;
+	
+	/** The s attribs. */
+	private static HashMap<String, List<String>> sAttribs;
+	
+	/**
+	 * initialize.
+	 *
+	 */
+	public compiler(){}
+	
+	/**
+	 * Instantiates a new compiler.
+	 *
+	 * @param url the url
+	 * @param text the text
+	 * @param base the base
+	 * @param project the project
+	 */
+	public compiler(URL url,String text,String base, String project)
+	{
+		this.text = text
+		this.base = base;
+		this.project = project;
+		this.textAttributes = textAttributes;
+		try {
+			this.url = url;
+			inputData = url.openStream();
+			
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.err.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * set the language of the corpus.
+	 *
+	 * @param lang the lang
+	 * @return the java.lang. object
+	 */
+	public setLang(String lang)
+	{
+		this.lang = lang;
+	}
+	
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the new cwb path
+	 */
+	public void setCwbPath(String path)
+	{
+		if(!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path;
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File f){
+		try {
+			output = new OutputStreamWriter(new FileOutputStream(f,f.exists()) , "UTF-8");
+			return true;
+		} catch (Exception e) {
+			System.err.println(e);
+			
+			return false;
+		}
+	}
+	
+	/**
+	 * Go to text.
+	 */
+	private void GoToText()
+	{
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			if(event == XMLStreamConstants.END_ELEMENT)
+				if(parser.getLocalName().equals("teiHeader"))
+					return;
+		}
+	}
+	
+	/**
+	 * Transfom file wtc.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	public boolean transfomFileWtc(File wtcfile)
+	{
+		createOutput(wtcfile);
+		String headvalue=""
+		String vAna = "";
+		String vForm = "";
+		String wordid= "";
+		String vHead = "";
+		
+		int p_id = 0;
+		int s_id = 0;
+		
+		boolean captureword = false;
+		boolean flagForm = false;
+		boolean flagAna = false;
+		boolean inW = false;
+		int wcounter = 1;
+		GoToText();
+		
+		try 
+		{
+			boolean stop = false;
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT && !stop; event = parser.next()) 
+			{
+				switch (event) 
+				{
+					case XMLStreamConstants.START_ELEMENT:
+					
+						
+						switch (parser.getLocalName()) 
+						{							
+							case "w":
+								inW = true;
+								wordid = parser.getAttributeValue(null, "id")
+								if(wordid == null)
+									wordid = "w_"+text+"_"+(wcounter++)
+							
+							vAna ="";
+							break;
+							
+							case "form":
+								String type = parser.getAttributeValue(null, "type");
+								if(type == null)
+								{
+									flagForm = true;
+								}
+								else if(type.equals("default"))
+								{
+									flagForm = true;
+								}
+								else
+								{
+									flagAna = true;
+									vAna += "\t";
+									if(!anatypes.contains(type))
+										anatypes << type;	
+								}
+							vForm = "";
+							break;
+							
+							case "ana":
+							flagAna = true;
+							vAna += "\t";
+							String type = parser.getAttributeValue(null, "type");
+
+								if(type != null)
+								{	
+									if(type.startsWith("#"))
+										type = type.substring(1)
+									if(!anatypes.contains(type))
+										anatypes << type;
+									break;
+								}
+							break;
+							
+							default:
+								if(!inW)
+								{
+									output.write("<"+parser.getLocalName().toLowerCase());
+									if(!sAttribs.containsKey(parser.getLocalName()))
+										sAttribs.put(parser.getLocalName().toLowerCase(), []);
+									
+									for( int i = 0 ; i < parser.getAttributeCount() ; i++)
+									{
+										String attrname = parser.getAttributeLocalName(i).toLowerCase();
+										String attrvalue = parser.getAttributeValue(i);
+										if(!(parser.getLocalName() == "text" && attrname == "id"))
+											output.write(" "+attrname+"=\""+attrvalue.replace("\"", "'")+"\"");
+										
+										if(!sAttribs.get(parser.getLocalName().toLowerCase()).contains(attrname))
+											sAttribs.get(parser.getLocalName().toLowerCase()).add(attrname)
+									}
+							
+									if(parser.getLocalName() == "text")
+									{ // add some infos
+										output.write(" id=\""+text+"\" base=\""+base+"\" project=\""+project+"\"");
+									}
+									output.write(">\n");
+								}
+							}
+						break;
+					
+					case XMLStreamConstants.END_ELEMENT:
+						
+						switch (parser.getLocalName()) 
+						{	
+							case "w":
+							output.write( vForm.replaceAll("&", "&amp;").replaceAll("<", "&lt;") +"\t"+wordid+vAna+"\n");
+							vAna = "";
+							vForm = "";
+							inW = false;
+							break;
+							
+							case "form":
+							flagForm = false;
+							flagAna = false;
+							break;
+							
+							case "ana":
+							flagAna = false;
+							break;
+							
+							default:
+								if(!inW)
+									output.write("</"+parser.getLocalName().toLowerCase()+">\n");
+								if(parser.getLocalName() == "text")
+									stop = true;
+						}
+						break;
+					
+					case XMLStreamConstants.CHARACTERS:
+						if(inW)
+						{
+						if(flagForm)
+							if(flagAna)
+								vAna += parser.getText().trim();
+							else
+								vForm += parser.getText().trim();
+						if(flagAna)
+							vAna += parser.getText().trim();
+						}
+						break;
+				}
+			}
+			
+			output.close();
+			parser.close();
+		}
+		catch (XMLStreamException ex) {
+			System.out.println(ex);
+			return false;
+		}
+		catch (IOException ex) {
+			System.out.println("IOException while parsing " + inputData);
+			return false;
+		}
+		return true;
+	}
+	
+	
+	
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param basename the basename
+	 * @param textAttributes the text attributes
+	 * @return true, if successful
+	 */
+	public boolean run(ArrayList<File> files, File binDir, String corpusname, String basename, String[] textAttributes) 
+	{
+		anatypes = new ArrayList<String>();// init only 1 time
+		sAttribs = new HashMap<String, List<String>>();// init only 1 time
+		String rootDir = binDir.getAbsolutePath();
+		
+		if(cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+		
+		if(!new File(cwbLoc).exists())
+		{
+			println ("CWB path error: "+cwbLoc)
+			return false;
+		}
+		if(!binDir.exists())
+		{
+			println ("binary directory does not exists: "+binDir)
+			return false;
+		}
+		
+		if(files == null || files.size() == 0)
+		{
+			println "Error: no file to process"
+			return false;
+		}
+				
+		String textid = "";
+		int counttext = 0;
+		File wtcdir = new File(binDir,"wtc");
+		File wtcfile = new File(wtcdir, corpusname.toLowerCase()+".wtc");
+		//0 set Lang
+		if(createOutput(wtcfile))
+		{
+			output.write("<txmcorpus lang=\""+lang+"\">\n");
+			output.close();
+		}
+		
+		//1- Transform into WTC file
+		def builder = null;
+		for (File f : files) {
+			counttext++;
+			if (!f.exists()) {
+				println("The file "+f+ " does not exists")	
+			} else {	
+				//println("process file "+f)
+				String txtname = f.getName().substring(0,f.getName().length()-4);
+				builder = new compiler(f.toURL(), txtname, basename, "default");
+				builder.setLang(lang);
+				if (!builder.transfomFileWtc(wtcfile))
+					return false;
+			}
+		}
+		
+		//end corpus
+		if(createOutput(wtcfile))
+		{
+			output.write("</txmcorpus>\n");
+			output.close();
+		}
+		
+		//2- Import into CWB
+		def outDir = rootDir;
+		def outDirTxm = rootDir;
+		
+		CwbEncode cwbEn = new CwbEncode();
+		cwbEn.setDebug(debug);
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		cwbMa.setDebug(debug);
+		List<String> pargs = ["id"];
+		for(String ana : anatypes)
+			pargs.add(ana);
+		
+		List<String> sargs = [];
+		//println "Found Sattributes "+this.sAttribs;
+		if (sAttribs.containsKey("text")) {
+			if (!sAttribs.get("text").contains("id"))
+				sAttribs.get("text").add("id");
+			if (!sAttribs.get("text").contains("base"))
+				sAttribs.get("text").add("base");
+			if (!sAttribs.get("text").contains("project"))
+				sAttribs.get("text").add("project");
+		} else {
+			sargs.add("text:0+id+base+project")
+		}
+		
+		if(sAttribs.containsKey("txmcorpus"))
+		{
+			if(!sAttribs.get("txmcorpus").contains("lang"))
+				sAttribs.get("txmcorpus").add("lang");
+		} else {
+			sargs.add("txmcorpus:0+lang")
+		}
+		
+		for(String tag : this.sAttribs.keySet())
+		{
+			String sAttr = tag;
+			if(sAttribs.get(tag).size() > 0)
+				sAttr += ":";
+			for(String attr : sAttribs.get(tag))
+				sAttr +="+"+attr;
+			sargs.add(sAttr)
+		}
+		
+		String[] sAttributes = sargs;
+		String[] pAttributes = pargs;
+		println "Corpus structural attributes: "+sAttributes;
+		println "Corpus lexical attributes: "+pAttributes;
+		try {
+			String regPath = outDirTxm + "/registry/"+corpusname.toLowerCase();
+			cwbEn.run(new File(cwbLoc,"cwb-encode").getAbsolutePath(),
+				outDirTxm + "/data/"+corpusname+"/", 
+				wtcfile.getAbsolutePath(), 
+				regPath, pAttributes, sAttributes);
+			if (!new File(regPath).exists()) {
+				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			cwbMa.run(new File(cwbLoc,"cwb-makeall").getAbsolutePath(), corpusname.toUpperCase(), outDirTxm + "/registry");
+			
+		} catch (Exception ex) {System.out.println(ex); return false;}
+		
+		System.out.println("Done.") 
+		
+		return true;
+	}
+	
+	/**
+	 * Sets the debug.
+	 */
+	public void setDebug()
+	{
+		this.debug = true;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("~/xml/geo");
+		def c = new compiler();
+		c.setDebug();
+		c.setCwbPath("~/TXM/cwb/bin");
+		c.run(dir,"geo");
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxmpara/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxmpara/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxmpara/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>XML-TXM import module specialized with aligned corpus</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xmltxmpara/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/perraultLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/perraultLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/perraultLoader.groovy	(revision 728)
@@ -0,0 +1,133 @@
+/**
+ * Main.
+ *
+ * @param args the args
+ */
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.perrault;
+
+import java.io.File;
+import org.txm.importer.perrault.importer;
+import org.txm.importer.perrault.compiler;
+import org.txm.importer.perrault.annotate;
+import org.txm.importer.perrault.pager;
+import org.txm.objects.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+
+// TODO: Auto-generated Javadoc
+/* (non-Javadoc)
+ * @see groovy.lang.Script#run()
+ */
+String userDir = System.getProperty("user.home");
+String rootDir;
+String lang;
+String encoding;
+String model;
+try{rootDir = rootDirBinding;lang=langBinding;encoding=encodingBinding;model=modelBinding;}
+catch(Exception)
+{	println "DEV MODE";//exception means we debug
+	if(!org.txm.Toolbox.isInitialized())
+	{
+		rootDir = userDir+"/xml/perrault/";
+		lang="fr";
+		encoding= "UTF-8"; // not used
+		model="fr";
+		Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File(userDir,"txminstall"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"txminstall/treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"txminstall/treetagger/models"));
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"),"TXM"));
+	}
+}
+
+String corpusSrc = "perrault.xml";
+
+println "-- IMPORTER - Reading source files"
+File[] files = [new File(rootDir,corpusSrc)];
+new importer().run(files);
+
+println "-- ANNOTATE - Running NLP tools"
+new Annotate().run(new File(rootDir), model+".par");//the files in ./txm
+
+println "-- COMPILING - Building Search Engine indexes"
+files = new File(rootDir,"txm/").listFiles();
+ArrayList<File> Lfiles = new ArrayList<File>();
+for(File f : files)
+	Lfiles.add f
+def c = new compiler()
+//c.setCwbPath("")// for developers
+c.setLang(lang);
+c.run(Lfiles);
+
+//move registry file to cwb registry dir
+File registryfile = new File(rootDir+"/registry","perrault");
+if(registryfile.exists())
+	org.txm.utils.FileCopy.copy(registryfile,new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"registry/perrault"))
+	
+
+Workspace w = org.txm.Toolbox.workspace;
+Project p = w.getProject("default")
+p.removeBase("perrault")
+Base b = p.addBase("perrault");
+b.addDirectory(new File(rootDir,"txm"));
+b.setAttribute("lang", lang)
+b.propagateAttribute("lang")
+
+println "-- EDITION"
+new File(rootDir+"/HTML/").deleteDir()
+new File(rootDir+"/HTML/").mkdir();
+new File(rootDir+"/HTML/default/").mkdir();
+files = new File(rootDir,"txm").listFiles();
+
+for(String textname : b.getTextsID())
+{
+	Text text = b .getText(textname);
+	File srcfile = text.getSource();
+	File resultfile = new File(rootDir+"/HTML",srcfile.getName().substring(0,srcfile.getName().length()-4)+".html");
+	List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+	List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+	println("Building edition  : "+srcfile+" to : "+resultfile );
+	
+	def ed = new pager(srcfile,resultfile, NoSpaceBefore, NoSpaceAfter,600);
+	Edition editionweb = text.addEdition("default","web",resultfile);
+	//println("pages "+ed.getPageFiles())
+	//println("idx "+ed.getIdx())
+	for(int i = 0 ; i < ed.getPageFiles().size();i++)
+	{
+		File f = ed.getPageFiles().get(i);
+		String idx = ed.getIdx().get(i);
+		editionweb.addPage(f,idx);
+	}
+	
+//	Edition editionbp = text.addEdition("bp","integral",resultfile);
+//	editionbp.addPage(resultfile,ed.getIdx().get(0));
+}
+
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/annotate.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/annotate.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/annotate.groovy	(revision 728)
@@ -0,0 +1,176 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-11-08 13:38:06 +0100 (Fri, 08 Nov 2013) $
+// $LastChangedRevision: 2569 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.perrault
+
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+import org.txm.Toolbox;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class annotate.
+ */
+class annotate {
+	
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 */
+	public static void run(File rootDirFile)
+	{
+		String rootDir = rootDirFile.getAbsolutePath()+"/";
+
+		//cleaning
+		new File(rootDir,"annotations").deleteDir();
+		new File(rootDir,"annotations").mkdir();
+		new File(rootDir,"treetagger").deleteDir();
+		new File(rootDir,"treetagger").mkdir();
+		
+		ArrayList<String> milestones = new ArrayList<String>();//the tags who you want them to stay milestones
+		milestones.add("tagUsage");
+		milestones.add("pb");
+		milestones.add("lb");
+		
+		List<File> files = new File(rootDir,"txm").listFiles()	
+		//BUILD TT FILE READY TO BE TAGGED
+		for(File f : files)
+		{
+			File srcfile = f;
+			File resultfile = new File(rootDir+"treetagger/",f.getName()+".tt");
+			new BuildTTSrc(srcfile.toURL()).process(resultfile)
+		}
+		
+		//APPLY TREETAGGER
+		files = new File(rootDir,"treetagger").listFiles()	
+		for(File f : files)
+		{
+			File modelfile = new File(Toolbox.getParam(Toolbox.TREETAGGER_MODELS_PATH),"/fr.par");
+			if(!modelfile.exists())
+			{
+				println "Skipping ANNOTATE: Incorrect modelfile path: "+modelfile;
+				return;
+			}
+			File infile = f
+			File outfile = new File(f.getParent(),f.getName()+"-out.tt");
+			println("3- APPLY TT on : "+infile+" with : "+modelfile +" >>  "+outfile);
+			
+			if(!new File(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists())
+			{
+				println("Path to TreeTagger is wrong "+Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
+				return;
+			}
+			TreeTagger tt = new TreeTagger(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/");
+			tt.settoken();
+			tt.setlemma();
+			tt.setquiet();
+			tt.setsgml();
+			tt.setnounknown();
+			tt.seteostag("<s>");
+			tt.treetagger( modelfile.getAbsolutePath(), infile.getAbsolutePath(), outfile.getAbsolutePath())
+			infile.delete();
+		}
+		
+		//BUILD STAND-OFF FILES
+		//contains txm:application/txm:commandLine
+		File reportFile = new File(rootDir,"NLPToolsParameters.xml");
+		
+		String respPerson = System.getProperty("user.name");
+		String respId = "txm";
+		String respDesc = "NLP annotation tool";
+		String respDate = "";
+		String respWhen = ""
+		
+		String appIdent = "TreeTagger";
+		String appVersion = "3.2";
+		
+		String distributor = "";
+		String publiStmt = """""";
+		String sourceStmt = """""";
+		
+		def types = ["pos","lemme"];
+		def typesTITLE = ["",""];
+		def typesDesc = ["",""];
+		def typesTAGSET = ["",""];
+		def typesWEB = ["",""];
+		String idform ="w_c_";
+		
+		files = new File(rootDir,"treetagger").listFiles()	
+		for(File f : files)
+		{
+			String target = f.getAbsolutePath();
+			File ttfile = f
+			File posfile = new File(rootDir+"annotations/",f.getName()+"-STOFF.xml");
+			
+			def encoding ="UTF-8";
+			def transfo = new CSV2W_ANA();
+			println("build w-interp "+ttfile.getName()+ ">>"+posfile.getName())
+			transfo.setAnnotationTypes( types, typesDesc, typesTAGSET, typesWEB, idform);
+			transfo.setResp(respId, respDesc,respDate, respPerson, respWhen);
+			transfo.setApp(appIdent, appVersion);
+			transfo.setTarget(target, reportFile);
+			transfo.setInfos(distributor,  publiStmt, sourceStmt);
+			transfo.process( ttfile, posfile, encoding );
+		}
+		
+		files = new File(rootDir,"annotations").listFiles();
+		List<File> txmfiles = new File(rootDir,"txm").listFiles();
+		files.sort();
+		txmfiles.sort();
+		for(int i = 0 ; i< files.size();i++)
+		{
+			File srcfile = txmfiles.get(i);
+			
+			File pos1file = files.get(i);
+			File temp = new File(rootDir,"temp"); 
+
+			println("5- inject annotation in file : "+srcfile+" with : "+pos1file );
+			
+			def builder = new org.txm.scripts.teitxm.AnnotationInjection(srcfile.toURL(), pos1file.toURL(), milestones);
+			builder.transfomFile(temp.getParent(),temp.getName());
+			
+			if (!(srcfile.delete() && temp.renameTo(srcfile))) println "Warning can't rename file "+temp+" to "+srcfile
+		}
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File rootDir = new File("~/xml/perrault/");
+		new annotate().run(rootDir);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/compiler.groovy	(revision 728)
@@ -0,0 +1,413 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.perrault
+
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+
+import javax.xml.stream.*;
+import java.net.URL;
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class compiler.
+ */
+class compiler 
+{
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The dir. */
+	private def dir;
+	
+	/** The output. */
+	private def output;
+	
+	/** The url. */
+	private def url;
+	
+	/** The anahash. */
+	private HashMap<String,String> anahash =new HashMap<String,String>() ;
+	
+	/** The text. */
+	String text="";
+	
+	/** The base. */
+	String base="";
+	
+	/** The project. */
+	String project="";
+	
+	/** The cwb loc. */
+	String cwbLoc;
+	
+	/** The lang. */
+	private String lang ="fr";
+	
+	/**
+	 * initialize.
+	 *
+	 */
+	public compiler(){}
+	
+	/**
+	 * Instantiates a new compiler.
+	 *
+	 * @param url the url
+	 * @param text the text
+	 * @param base the base
+	 * @param project the project
+	 */
+	public compiler(URL url,String text,String base, String project)
+	{
+		this.text = text
+		this.base = base;
+		this.project = project;
+		try {
+			this.url = url;
+			inputData = url.openStream();
+			
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * set the language of the corpus.
+	 *
+	 * @param lang the lang
+	 * @return the java.lang. object
+	 */
+	public setLang(String lang)
+	{
+		this.lang = lang;
+	}
+	
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the new cwb path
+	 */
+	public void setCwbPath(String path)
+	{
+		if(!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path;
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(String dirPathName, String fileName){
+		try {
+			File f = new File(dirPathName, fileName)
+			output = new OutputStreamWriter(new FileOutputStream(f,f.exists()) , "UTF-8");
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+	
+	/**
+	 * Go to text.
+	 */
+	private void GoToText()
+	{
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			if(event == XMLStreamConstants.END_ELEMENT)
+				if(parser.getLocalName().equals("teiHeader"))
+					return;
+		}
+	}
+	
+	/**
+	 * Transfom file wtc.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	public boolean transfomFileWtc(String dirPathName, String fileName)
+	{
+		createOutput(dirPathName, fileName);
+		
+		String headvalue=""
+		String vAna = "";
+		String vForm = "";
+		String wordid= "";
+		String vHead = "";
+		
+		int p_id = 0;
+		int q_id = 0;
+		int lg_id = 0;
+		int l_id = 0;
+		
+		boolean flaglg = false;
+		boolean flaghead = false;
+		boolean flagAuthor = false;
+		boolean flagDate = false;
+		boolean flagForm = false;
+		boolean flagAna = false;
+		
+		this.GoToText()
+		output.write("<txmcorpus lang=\""+lang+"\">\n"); 
+		try 
+		{
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+			{
+				switch (event) 
+				{
+					case XMLStreamConstants.START_ELEMENT:
+					switch (parser.getLocalName()) 
+					{
+						
+						case "head"://get attr lang
+							flaghead =true;
+							vHead="";
+						break;
+												
+						case "text":
+						output.write("<text id=\""+text+"\" base=\""+base+"\" project=\""+project+"\">\n");
+						break;
+						
+						case "p":
+						output.write("<"+parser.getLocalName()+" id=\""+text+"_p_"+(p_id++)+"\">\n");
+						break;
+						case "q":
+						output.write("<"+parser.getLocalName()+" id=\""+text+"_q_"+(q_id++)+"\">\n");
+						break;
+						case "l":
+							output.write("<"+parser.getLocalName()+" id=\""+text+"_l_"+(l_id++)+"\">\n");
+						break;
+						
+						case "lg":
+							flaglg = true;
+						break;
+						
+						case "s":
+						output.write( "<s>\n");
+						break;
+						
+						case "w":
+							for(int i = 0 ; i < parser.getAttributeCount(); i++)
+								if(parser.getAttributeLocalName(i).equals("id"))
+								{	
+									wordid = parser.getAttributeValue(i);
+								}
+						break;
+						case "form":
+						flagForm = true;
+						vForm = "";
+						vAna ="";
+						break;
+						
+						case "ana":
+						flagAna = true;
+						break;
+					}
+					break;
+					
+					case XMLStreamConstants.END_ELEMENT:
+					switch (parser.getLocalName()) 
+					{
+						case "head"://get attr lang
+						flaghead =false;
+						if(flaglg)
+							output.write("<moral id=\""+text+"_moral_"+(lg_id++)+"\" head=\""+vHead+"\">\n");
+						break;
+						
+						case "text":
+						output.write("</text>\n");
+						break;
+						
+						case "p":
+						case "q":
+						case "l":
+						output.write("</"+parser.getLocalName()+">\n");
+						break;
+						
+						case "lg":
+						output.write("</moral>\n");
+						flaglg = false;
+						break;
+						
+						case "s":
+						output.write( "</s>\n");
+						break;
+						
+						case "w":
+						if(!(flaghead && flaglg))
+							if(vAna != null)
+								output.write( vForm +vAna+"\t"+wordid+"\n");
+						vAna = "";
+						vForm = "";
+						break;
+						
+						case "form":
+						flagForm = false;
+						break;
+						
+						case "ana":
+						flagAna = false;
+						break;
+					}
+					break;
+					
+					case XMLStreamConstants.CHARACTERS:
+					if(flagForm)
+					vForm += parser.getText().trim();
+					if(flagAna)
+					vAna += "\t" +parser.getText().trim();
+					if(flaghead && flaglg)
+						vHead += parser.getText().trim();
+					break;
+				}
+			}
+			output.write("</txmcorpus>"); 
+			output.close();
+			parser.close();
+		}
+		catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}
+		catch (IOException ex) {
+			System.out.println("IOException while parsing " + inputData);
+		}
+		
+		return true;
+	}
+	
+	/**
+	 * Run.
+	 *
+	 * @param files the files
+	 * @return true, if successful
+	 */
+	public boolean run(List<File> files) 
+	{
+		String rootDir ="";
+		if(files.size() > 0)
+			rootDir = files.get(0).getParentFile().getParentFile().getAbsolutePath()+"/";//"~/xml/perrault/";
+		if(cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+		
+		if(!new File(cwbLoc).exists())
+		{
+			println ("CWB path error: "+cwbLoc)
+			return false;
+		}
+		if(!new File(rootDir).exists())
+		{
+			println ("binary directory does not exists: "+rootDir)
+			return false;
+		}
+		new File(rootDir+"wtc/","perrault.wtc").delete();//cleaning&preparing
+		new File(rootDir+"wtc/").deleteDir();
+		new File(rootDir+"wtc/").mkdir();
+		new File(rootDir+"registry/").mkdir();
+		
+		String textid="";
+		int counttext =0;
+		//1- Transform into WTC file
+		for(File f : files)
+		{
+			counttext++;
+			if(!f.exists())
+			{
+				println("file "+f+ " does not exists")	
+			}
+			else
+			{	
+				println("process file "+f)
+				String txtname = f.getName().substring(0,f.getName().length()-4);
+				def builder = new compiler(f.toURL(), txtname, "perrault", "default");
+				builder.setLang(lang);
+				builder.transfomFileWtc(rootDir+"wtc","perrault.wtc");
+			}
+		}
+		
+		//2- Import into CWB
+		def outDir =rootDir;
+		def outDirTxm = rootDir;
+		
+		CwbEncode cwbEn = new CwbEncode();
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		
+		String[] pAttributes = ["pos","lemme","id"];
+		//String[] pAttributes = ["id"];
+		String[] sAttributes = ["txmcorpus:0+lang","text:0+id+base+project","p:0+id","q:0+id","moral:0+head+id","l:0+id"];
+		
+		try
+		{
+			cwbEn.run(cwbLoc + "cwb-encode", outDirTxm + "data", outDir + "/wtc/"+"perrault.wtc", outDirTxm + "registry/"+"perrault",pAttributes, sAttributes);
+			cwbMa.run(cwbLoc + "cwb-makeall", "PERRAULT", outDirTxm + "registry");
+			
+		} catch (Exception ex) {System.out.println(ex); return false;}
+		
+		System.out.println("Done.") 
+		
+		return true;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("~/xml/perrault/txm/");
+		List<File> files = dir.listFiles();
+		new compiler().run(files);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Perault import module : teiCorpus</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/pager.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/pager.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/pager.groovy	(revision 728)
@@ -0,0 +1,366 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.perrault;
+
+import org.txm.importer.*;
+import org.xml.sax.Attributes;
+import org.txm.importer.filters.*;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+// TODO: Auto-generated Javadoc
+/** Build Discours corpus simple edition from a xml-tei. @author mdecorde */
+class pager {
+	List<String> NoSpaceBefore;
+	
+	/** The No space after. */
+	List<String> NoSpaceAfter;
+
+	/** The wordcount. */
+	int wordcount = 0;
+	
+	/** The pagecount. */
+	int pagecount = 0;
+	
+	/** The wordmax. */
+	int wordmax = 0;
+
+	/** The wordid. */
+	String wordid;
+	
+	/** The first word. */
+	boolean firstWord = true;
+	
+	/** The wordvalue. */
+	String wordvalue;
+	
+	/** The interpvalue. */
+	String interpvalue;
+	
+	/** The lastword. */
+	String lastword = " ";
+	
+	/** The wordtype. */
+	String wordtype;
+	
+	/** The flagform. */
+	boolean flagform = false;
+	
+	/** The flaginterp. */
+	boolean flaginterp = false;
+	
+	/** The url. */
+	private def url;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The writer. */
+	def writer;
+	
+	/** The multiwriter. */
+	def multiwriter = null;
+	
+	/** The infile. */
+	File infile;
+	
+	/** The outfile. */
+	File outfile;
+	
+	/** The pages. */
+	ArrayList<File> pages = new ArrayList<File>();
+	
+	/** The idxstart. */
+	ArrayList<String> idxstart = new ArrayList<String>();
+
+	/**
+	 * Instantiates a new pager.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param NoSpaceBefore the no space before
+	 * @param NoSpaceAfter the no space after
+	 * @param max the max
+	 */
+	pager(File infile, File outfile, List<String> NoSpaceBefore,
+			List<String> NoSpaceAfter, int max) {
+		this.wordmax = max;
+		this.NoSpaceBefore = NoSpaceBefore;
+		this.NoSpaceAfter = NoSpaceAfter;
+		this.url = infile.toURI().toURL();
+		this.infile = infile;
+
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		createOutput(outfile);
+		process();
+	}
+
+	/**
+	 * Creates the next output.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean createNextOutput()
+	{
+		try {
+			if(multiwriter != null)
+			{
+				multiwriter.write("</body>");
+				multiwriter.write("</html>");
+				multiwriter.close();
+			}
+			pagecount++;
+			File f = new File(outfile.getParent()+"/multi/",outfile.getName().substring(0,outfile.getName().length()-6)+"_"+pagecount+".html");
+			pages.add(f);
+			idxstart.add(wordid)
+			multiwriter = new OutputStreamWriter(new FileOutputStream(f) , "UTF-8");
+			
+			multiwriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+			multiwriter.write("<html>");
+			multiwriter.write("<head>");
+			multiwriter.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+			multiwriter.write("<title>Perrault Edition - Page "+pagecount+"</title>");
+			multiwriter.write("</head>");
+			multiwriter.write("<body>");
+			
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile) {
+		try {
+			this.outfile = outfile;
+
+			writer = new OutputStreamWriter(new FileOutputStream(outfile),
+					"UTF-8");
+			createNextOutput();
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Gets the page files.
+	 *
+	 * @return the page files
+	 */
+	public ArrayList<File> getPageFiles() {
+		return pages;
+	}
+
+	/**
+	 * Gets the idx.
+	 *
+	 * @return the idx
+	 */
+	public ArrayList<String> getIdx() {
+		return idxstart;
+	}
+
+	/**
+	 * Process.
+	 */
+	void process()
+	{
+		String localname = "";
+		
+		writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+		writer.write("<html>");
+		writer.write("<head>");
+		writer.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+		writer.write("<title>Perrault Edition</title>");
+		writer.write("</head>");
+		writer.write("<body>");
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			
+			
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{				
+						case "text":
+						XPathResult testG = new XPathResult(infile);
+						String title =testG.getXpathResponse("//tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[type='sub']","")
+						writer.write("<h1>"+title+"</h1>\n")
+						multiwriter.write("<h1>"+title+"</h1>\n")
+						break;
+						
+						case "head":
+						writer.write("<h2>\n")
+						multiwriter.write("<h2>\n")
+						break;
+						
+						case "lg":
+						writer.write("<p>\n")
+						multiwriter.write("<p>\n")
+						break;
+						
+						case "p":
+						case "q":
+						writer.write("<p>\n")
+						multiwriter.write("<p>\n")
+						break;
+						
+						case "w":
+						wordid=parser.getAttributeValue(null,"id");
+						if(firstWord)
+						{
+							firstWord=false;
+							this.idxstart.set(0,wordid);
+						}
+						wordcount++;
+						if(wordcount >= wordmax)
+						{
+							createNextOutput();
+							wordcount=0;
+						}
+						break;
+						
+						case "ana":
+						flaginterp=true;
+						interpvalue+=" "+parser.getAttributeValue(null,"type")+":"
+						break;
+						
+						case "form":
+						wordvalue="";
+						interpvalue ="";
+						flagform=true;
+						break;
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{				
+						case "head":
+						writer.write("</h2>\n")
+						multiwriter.write("</h2>\n")
+						break;
+						
+						case "lg":
+						writer.write("</p>\n")
+						multiwriter.write("</p>\n")
+						break;
+						
+						case "l":
+							writer.write("<br/>\n")
+							multiwriter.write("<br/>\n")
+							break;
+						
+						case "p":
+						case "q":
+						writer.write("</p>\n")
+						multiwriter.write("</p>\n")
+						break;
+						
+						case "form":
+						flagform = false
+						
+						break;
+						
+						case "ana":
+						flaginterp = false
+						break;
+						
+						case "w":
+							int l = lastword.length();
+							String endOfLastWord = "";
+							if(l > 0)
+								endOfLastWord = lastword.subSequence(l-1, l);
+							
+							if(interpvalue != null)
+								interpvalue = interpvalue.replace("\"","&quot;");
+							
+							if(NoSpaceBefore.contains(wordvalue) || 
+									NoSpaceAfter.contains(lastword) || 
+									wordvalue.startsWith("-") || 
+									NoSpaceAfter.contains(endOfLastWord))
+							{
+								writer.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+								multiwriter.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+							}
+							else
+							{
+								writer.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+								multiwriter.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+							}
+							writer.write(wordvalue.replace("<", "&lt;")+"</span>");
+							multiwriter.write(wordvalue.replace("<", "&lt;")+"</span>");
+							lastword=wordvalue;
+						break;
+						
+					}
+					break;
+				
+				case XMLStreamConstants.CHARACTERS:
+					if(flagform)
+						if(parser.getText().length() > 0)
+							wordvalue+=(parser.getText());
+					if(flaginterp)
+						if(parser.getText().length() > 0)
+							interpvalue+=(parser.getText());
+					break;
+			}
+		}	
+		writer.write("</body>");
+		writer.write("</html>");
+		writer.close();
+		multiwriter.write("</body>");
+		multiwriter.write("</html>");
+		multiwriter.close();
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/importer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/importer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/importer.groovy	(revision 728)
@@ -0,0 +1,243 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+
+package org.txm.importer.perrault
+
+import org.txm.importer.*;
+import org.txm.importer.filters.*;
+import org.txm.scripts.*;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+import javax.xml.stream.*;
+import java.net.URL;
+
+import filters.CutHeader.*;
+import filters.Tokeniser.*;
+import filters.FusionHeader.*;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class importer.
+ */
+class importer {
+	
+	/**
+	 * Split.
+	 *
+	 * @param file the file
+	 * @return the list
+	 */
+	public static List<File> split(File file)
+	{
+		File f  = file;
+		
+		println "split file "+f;
+		String rootDir = f.getParent()+"/";
+		String xslfile = rootDir+"/xsl/splitcorpus.xsl";
+		String outfile = rootDir+"split_temp.xml";
+		
+		//get the splited file name
+		//String outfilename = new XPathResult(f).getXpathResponse("//TEI/text/body/div/head","");
+		
+		ApplyXsl a = new ApplyXsl(xslfile);
+		//a.SetParam("xpathtag", "//TEI");//coupe //text
+		//a.SetParam("xpathfilename", "/body/div/head");//cherche a partir de //xpathtag
+		a.process(f.getPath(),outfile);
+		
+		new File(outfile).delete();
+		
+		List<File> files = new File(f.getParent(),"split").listFiles();
+	}
+	
+	/**
+	 * Run.
+	 *
+	 * @param srcfiles the srcfiles
+	 */
+	public static void run(File[] srcfiles)
+	{
+		List<File> files = null;
+		File fullfile;
+		String rootDir ="";
+		ArrayList<String> milestones = new ArrayList<String>();//the tags who you want them to stay milestones
+		milestones.add("tagUsage");
+		milestones.add("pb");
+		milestones.add("lb");
+		
+		for(File f : srcfiles)
+		{
+			files = importer.split(f);
+			rootDir = f.getParent()+"/"
+			fullfile = f;
+			new File(rootDir+"ptokenized").deleteDir();
+			new File(rootDir+"ptokenized").mkdir();
+			new File(rootDir+"tokenized").deleteDir();
+			new File(rootDir+"tokenized").mkdir();
+			new File(rootDir+"split").deleteDir();
+			new File(rootDir+"split").mkdir();
+			new File(rootDir+"txm").deleteDir();
+			new File(rootDir+"txm").mkdir();
+			
+			String xslfile = rootDir+"xsl/splitcorpus.xsl";
+			String infile = f.getPath();
+			String outfile = rootDir+"split_temp.xml";
+			
+			ApplyXsl a = new ApplyXsl(xslfile);
+			a.process(infile,outfile);
+			
+			new File(outfile).delete();
+		}
+		
+		//get header
+		String header =""
+		Reader reader = new FileReader(fullfile);
+		String cline = reader.readLine();
+		while(!cline.trim().contains("<text>"))
+		{
+			header += cline+"\n";
+			cline = reader.readLine();
+		}
+		
+		//put splited into tei file
+		for(File f : files)
+		{
+			File temp = new File(f.getParent(),"temp");
+			Writer writer = new OutputStreamWriter(new FileOutputStream(temp) , "UTF-8");
+			writer.write(header);
+			writer.write("""<text>\n<body>\n""")
+			f.eachLine{String line->
+				if(!line.startsWith("<?xml"))
+				writer.write(line+"\n");
+			}
+			
+			writer.write("""</body>\n</text>\n</TEI>""")
+			writer.close();
+			
+			if (!(f.delete() && temp.renameTo(f))) println "Warning can't rename file "+temp+" to "+f
+		}
+		
+		//PREPARE EACH SPLITED FILE TO BE TOKENIZED
+		println files
+		for(File f : files)
+		{
+			File srcfile = f;
+			File resultfile = new File(rootDir+"ptokenized",f.getName()+"-src.xml");
+			println("prepare tokenizer file : "+srcfile+" to : "+resultfile );
+			def builder = new OneTagPerLine(srcfile.toURL(), milestones);
+			builder.process(resultfile);
+		}
+		
+		//TOKENIZE FILES
+		files = new File(rootDir,"ptokenized").listFiles()	
+		for(File f : files)
+		{
+			Sequence S = new Sequence();
+			Filter F1 = new CutHeader();
+			Filter F6 = new Tokeniser(f);
+			Filter F11 = new FusionHeader();
+			S.add(F1);
+			S.add(F6);
+			S.add(F11);
+			File infile = new File(rootDir+"ptokenized",f.getName());
+			File xmlfile = new File(rootDir+"tokenized",f.getName()+"-out.xml");
+			File headerfile = new File(rootDir+"/ptokenized/",f.getName()+"header.xml");
+			println("Tokenizing "+xmlfile)
+			S.SetInFileAndOutFile(infile.getPath(), xmlfile.getPath());
+			S.setEncodages("UTF-8","UTF-8");
+			Object[] arguments1 = [headerfile.getAbsolutePath()];
+			F1.SetUsedParam(arguments1);
+			Object[] arguments2 = [headerfile.getAbsolutePath(),F1];
+			F11.SetUsedParam(arguments2);
+			S.proceed();
+
+			System.out.println("exits src tokenized : "+infile.exists());
+			S= null;
+			F1=null;
+			F6=null;
+			F11=null;
+			System.out.println("delete src tokenized : "+infile.delete());//remove the prepared file to clean
+			headerfile.delete();//remove the prepared file to clean
+		}
+
+		//TRANSFORM INTO XML-TEI-TXM
+		files = new File(rootDir,"tokenized").listFiles()	
+		for(File f : files)
+		{
+			//ArrayList<String> milestones = new ArrayList<String>();
+			println("Building xml-tei-txm "+f+ " >> "+f.getName()+"-TXM.xml")
+			File file = f; 
+			String txmfile = f.getName()+"-TXM.xml";
+			
+			def correspType = new HashMap<String,String>()
+			def correspRef = new HashMap<String,String>()
+			//il faut lister les id de tous les respStmt
+			def respId = [];
+			//fait la correspondance entre le respId et le rapport d'execution de l'outil
+			def applications = new HashMap<String,HashMap<String,String>>();	
+			//fait la correspondance entre le respId et les attributs type de la propriÃ©tÃ© ana du w txm
+					//pour construire les ref vers les taxonomies
+			def taxonomiesUtilisees = new HashMap<String,String[]>();
+			//associe un id d'item avec sa description et son URI
+			def itemsURI = new HashMap<String,HashMap<String,String>>();
+			//informations de respStmt
+			//resps (respId <voir ci-dessus>, [description, person, date])
+			def resps = new HashMap<String,String[]>();
+			//lance le traitement
+			String wordprefix = "w_c_";
+			def builder = new Xml2Ana(file);
+			builder.setCorrespondances(correspRef, correspType);
+			builder.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)
+			builder.transformFile(rootDir+"txm/",txmfile);
+		}
+		
+		//rename files correctly
+		files = new File(rootDir,"txm").listFiles();
+		for(File file : files)
+		{
+			String txmfile = file.getName();
+			txmfile = txmfile.tokenize(".").get(0);
+			txmfile = txmfile.substring(0, txmfile.length()-1);
+			txmfile += ".xml"
+			file.renameTo(new File(file.getParent(),txmfile));
+		}
+		
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File[] files = [new File("~/xml/perrault/perrault.xml")];
+		new importer().run(files);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/allimport.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/allimport.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/perrault/allimport.groovy	(revision 728)
@@ -0,0 +1,659 @@
+/**
+ * Main.
+ *
+ * @param args the args
+ */
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.perrault;
+
+import javax.xml.stream.*
+
+import org.txm.importer.*
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.filters.*
+import org.txm.scripts.*
+import org.txm.scripts.teitxm.*
+import org.txm.utils.treetagger.TreeTagger
+
+import filters.CutHeader.*
+import filters.FusionHeader.*
+import filters.Tokeniser.*
+
+// TODO: Auto-generated Javadoc
+/**
+ * Split.
+ *
+ * @param file the file
+ * @return the list
+ */
+public static List<File> split(File file)
+{
+	File f  = file;
+	
+	println "split file "+f;
+	String rootDir = f.getParent()+"/";
+	String xslfile = rootDir+"splitcorpus.xsl";
+	String outfile = rootDir+"split_temp.xml";
+	
+	//get the splited file name
+	//String outfilename = new XPathResult(f).getXpathResponse("//TEI/text/body/div/head","");
+	
+	ApplyXsl a = new ApplyXsl(xslfile);
+	//a.SetParam("xpathtag", "//TEI");//coupe //text
+	//a.SetParam("xpathfilename", "/body/div/head");//cherche a partir de //xpathtag
+	a.process(f.getPath(),outfile);
+	
+	new File(outfile).delete();
+	
+	List<File> files = new File(f.getParent(),"split").listFiles();
+}
+
+/**
+ * Run1.
+ *
+ * @param srcfiles the srcfiles
+ */
+public void run1(File[] srcfiles)
+{
+	List<File> files = null;
+	File fullfile;
+	String rootDir ="";
+	ArrayList<String> milestones = new ArrayList<String>();//the tags who you want them to stay milestones
+	milestones.add("tagUsage");
+	milestones.add("pb");
+	milestones.add("lb");
+	
+	for(File f : srcfiles)
+	{
+		files = split(f);
+		rootDir = f.getParent()+"/"
+		fullfile = f;
+		new File(rootDir+"tokenized").deleteDir();
+		new File(rootDir+"tokenized").mkdir();
+		new File(rootDir+"split").deleteDir();
+		new File(rootDir+"split").mkdir();
+		new File(rootDir+"txm").deleteDir();
+		new File(rootDir+"txm").mkdir();
+		
+		String xslfile = rootDir+"splitcorpus.xsl";
+		String infile = f.getPath();
+		String outfile = rootDir+"split_temp.xml";
+		
+		ApplyXsl a = new ApplyXsl(xslfile);
+		a.process(infile,outfile);
+		
+		new File(outfile).delete();
+	}
+	
+	//get header
+	String header =""
+	Reader reader = new FileReader(fullfile);
+	String cline = reader.readLine();
+	while(!cline.trim().contains("<text>"))
+	{
+		header += cline+"\n";
+		cline = reader.readLine();
+	}
+	
+	//put splited into tei file
+	for(File f : files)
+	{
+		File temp = new File(f.getParent(),"temp");
+		Writer writer = new FileWriter(temp)
+		writer.write(header);
+		writer.write("""<text>\n<body>\n""")
+		f.eachLine{String line->
+			if(!line.startsWith("<?xml"))
+				writer.write(line+"\n");
+		}
+		
+		writer.write("""</body>\n</text>\n</TEI>""")
+		writer.close();
+		
+		if (!(f.delete() && temp.renameTo(f))) println "Warning can't rename file "+temp+" to "+f
+	}
+	
+	//PREPARE EACH SPLITED FILE TO BE TOKENIZED
+	println files
+	for(File f : files)
+	{
+		File srcfile = f;
+		File resultfile = new File(rootDir+"tokenized",f.getName()+"-src.xml");
+		println("prepare tokenizer file : "+srcfile+" to : "+resultfile );
+		def builder = new OneTagPerLine(srcfile.toURL(), milestones);
+		builder.process(resultfile);
+	}
+	
+	//TOKENIZE FILES
+	//Manager<Filter> filterManager = new FilterManager(ActionHome);		
+	for(File f : files)
+	{
+		Sequence S = new Sequence();
+		Filter F1 = new CutHeader();
+		Filter F6 = new Tokeniser(f);
+		Filter F11 = new FusionHeader();
+		S.add(F1);
+		S.add(F6);
+		S.add(F11);
+		File infile = new File(rootDir+"tokenized",f.getName()+"-src.xml");
+		File xmlfile = new File(rootDir+"tokenized",f.getName()+"-out.xml");
+		File headerfile = new File(rootDir+"/tokenized/",f.getName()+"header.xml");
+		println("Tokenize "+xmlfile)
+		S.SetInFileAndOutFile(infile.getPath(), xmlfile.getPath());
+		S.setEncodages("UTF-8","UTF-8");
+		Object[] arguments1 = [headerfile.getAbsolutePath()];
+		F1.SetUsedParam(arguments1);
+		Object[] arguments2 = [headerfile.getAbsolutePath(),F1];
+		F11.SetUsedParam(arguments2);
+		S.proceed();
+		S.clean();
+		infile.delete();//remove the prepared file to clean
+		headerfile.delete();//remove the prepared file to clean
+	}
+	files = new File(rootDir,"tokenized").listFiles()	
+	
+	
+	//TRANSFORM INTO XML-TEI-TXM
+	for(File f : files)
+	{
+		//ArrayList<String> milestones = new ArrayList<String>();
+		println("build xml-tei-txm "+f+ " >> "+f.getName()+"-TXM.xml")
+		File file = f; 
+		String txmfile = f.getName()+"-TXM.xml";
+		
+		def correspType = new HashMap<String,String>()
+		def correspRef = new HashMap<String,String>()
+		//il faut lister les id de tous les respStmt
+		def respId = [];
+		//fait la correspondance entre le respId et le rapport d'execution de l'outil
+		def applications = new HashMap<String,HashMap<String,String>>();	
+		//fait la correspondance entre le respId et les attributs type de la propriÃ©tÃ© ana du w txm
+				//pour construire les ref vers les taxonomies
+		def taxonomiesUtilisees = new HashMap<String,String[]>();
+		//associe un id d'item avec sa description et son URI
+		def itemsURI = new HashMap<String,HashMap<String,String>>();
+		//informations de respStmt
+		//resps (respId <voir ci-dessus>, [description, person, date])
+		def resps = new HashMap<String,String[]>();
+		//lance le traitement
+		String wordprefix = "w_c_";
+		def builder = new Xml2Ana(file);
+		builder.setCorrespondances(correspRef, correspType);
+		builder.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)
+		builder.transformFile(rootDir+"txm/",txmfile);
+	}
+	
+	//rename files correctly
+	files = new File(rootDir,"txm").listFiles();
+	for(File file : files)
+	{
+		String txmfile = file.getName();
+		txmfile = txmfile.tokenize(".").get(0)+".xml"
+		file.renameTo(new File(file.getParent(),txmfile));
+	}
+	
+}
+
+/**
+ * Run2.
+ *
+ * @param rootDirFile the root dir file
+ */
+public void run2(File rootDirFile)
+{
+	String rootDir = rootDirFile.getAbsolutePath()+"/";
+	if(!new File(rootDir,"models").exists() || !new File(rootDir,"txm").exists())
+	{
+		println "no models dir or no txm dir, check rootDir "+rootDirFile;
+		return;
+	}
+	//cleaning
+	new File(rootDir,"annotations").deleteDir();
+	new File(rootDir,"annotations").mkdir();
+	new File(rootDir,"treetagger").deleteDir();
+	new File(rootDir,"treetagger").mkdir();
+	
+	ArrayList<String> milestones = new ArrayList<String>();//the tags who you want them to stay milestones
+	milestones.add("tagUsage");
+	milestones.add("pb");
+	milestones.add("lb");
+	
+	List<File> files = new File(rootDir,"txm").listFiles()	
+	//BUILD TT FILE READY TO BE TAGGED
+	for(File f : files)
+	{
+		File srcfile = f;
+		File resultfile = new File(rootDir+"treetagger/",f.getName()+".tt");
+		new BuildTTSrc(srcfile.toURL()).process(resultfile)
+	}
+	
+	//APPLY TREETAGGER
+	files = new File(rootDir,"treetagger").listFiles()	
+	for(File f : files)
+	{
+		File modelfile = new File(rootDir+"models/","fr.par");
+		File infile = f
+		File outfile = new File(f.getParent(),f.getName()+"-out.tt");
+		println("3- APPLY TT on : "+infile+" with : "+modelfile +" >>  "+outfile);
+		
+		TreeTagger tt = new TreeTagger(System.getProperty("user.home")+"/TXM/treetagger/bin/");
+		tt.settoken();
+		tt.setlemma();
+		tt.setquiet();
+		tt.setsgml();
+		tt.setnounknown();
+		tt.seteostag("<s>");
+		tt.treetagger( modelfile.getAbsolutePath(), infile.getAbsolutePath(), outfile.getAbsolutePath())
+		infile.delete();
+	}
+	
+	//BUILD STAND-OFF FILES
+	//contains txm:application/txm:commandLine
+	File reportFile = new File(rootDir,"NLPToolsParameters.xml");
+	
+	String respPerson = System.getProperty("user.name");
+	String respId = "txm";
+	String respDesc = "NLP annotation tool";
+	String respDate = "";
+	String respWhen = ""
+	
+	String appIdent = "TreeTagger";
+	String appVersion = "3.2";
+	
+	String distributor = "";
+	String publiStmt = """""";
+	String sourceStmt = """""";
+	
+	def types = ["pos","lemme"];
+	def typesTITLE = ["",""];
+	def typesDesc = ["",""];
+	def typesTAGSET = ["",""];
+	def typesWEB = ["",""];
+	String idform ="w_c_";
+	
+	files = new File(rootDir,"treetagger").listFiles()	
+	for(File f : files)
+	{
+		String target = f.getAbsolutePath();
+		File ttfile = f
+		File posfile = new File(rootDir+"annotations/",f.getName()+"-STOFF.xml");
+		
+		def encoding ="UTF-8";
+		def transfo = new CSV2W_ANA();
+		println("build w-interp "+ttfile.getName()+ ">>"+posfile.getName())
+		transfo.setAnnotationTypes( types, typesDesc, typesTAGSET, typesWEB, idform);
+		transfo.setResp(respId, respDesc,respDate, respPerson, respWhen);
+		transfo.setApp(appIdent, appVersion);
+		transfo.setTarget(target, reportFile);
+		transfo.setInfos(distributor,  publiStmt, sourceStmt);
+		transfo.process( ttfile, posfile, encoding );
+	}
+	
+	files = new File(rootDir,"annotations").listFiles();
+	List<File> txmfiles = new File(rootDir,"txm").listFiles();
+	for(int i = 0 ; i< files.size();i++)
+	{
+		File srcfile = txmfiles.get(i);
+		File pos1file = files.get(i);
+		File temp = new File(rootDir,"temp"); 
+		
+		println("5- inject annotation in file : "+srcfile+" with : "+pos1file );
+		
+		def builder = new org.txm.scripts.teitxm.AnnotationInjection(srcfile.toURL(), pos1file.toURL(), milestones);
+		builder.transfomFile(temp.getParent(),temp.getName());
+		
+		if (!(srcfile.delete() && temp.renameTo(srcfile))) println "Warning can't rename file "+temp+" to "+srcfile
+	}
+	
+}
+
+def inputData;
+def factory;
+XMLStreamReader parser;
+def dir;
+def output;
+def url;
+HashMap<String,String> anahash =new HashMap<String,String>() ;
+String text="";
+String base="";
+String project="";
+
+/**
+ * initialize.
+ *
+ * @param url the url
+ * @param text the text
+ * @param base the base
+ * @param project the project
+ */
+public void compil(URL url,String text,String base, String project)
+{
+	this.text = text
+	this.base = base;
+	this.project = project;
+	try {
+		this.url = url;
+		inputData = url.openStream();
+		
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+	} catch (XMLStreamException ex) {
+		System.out.println(ex);
+	}catch (IOException ex) {
+		System.out.println("IOException while parsing ");
+	}
+}
+
+/**
+ * Creates the output.
+ *
+ * @param dirPathName the dir path name
+ * @param fileName the file name
+ * @return true, if successful
+ */
+private boolean createOutput(String dirPathName, String fileName){
+	try {
+		File f = new File(dirPathName, fileName)
+		output = new java.io.FileWriter(f,f.exists())
+		return true;
+	} catch (Exception e) {
+		System.out.println(e.getLocalizedMessage());
+		return false;
+	}
+}
+
+/**
+ * clear anaHash variable, it is used to store ana tags values then print it when the end element </ana> is found.
+ */
+private void fillanaHash()
+{
+	anahash.clear();
+	for(String s : types)
+		anahash.put( s,"-" );
+}
+
+
+/**
+ * Go to text.
+ */
+private void GoToText()
+{
+	for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+	{
+		if(event == XMLStreamConstants.END_ELEMENT)
+			if(parser.getLocalName().equals("teiHeader"))
+				return;
+	}
+}
+
+/**
+ * Transfom file wtc.
+ *
+ * @param dirPathName the dir path name
+ * @param fileName the file name
+ * @return true, if successful
+ */
+public boolean transfomFileWtc(String dirPathName, String fileName)
+{
+	createOutput(dirPathName, fileName);
+	
+	String headvalue=""
+	String vAna = "";
+	String vForm = "";
+	String wordid= "";
+	String vHead = "";
+	
+	int p_id = 0;
+	int q_id = 0;
+	int lg_id = 0;
+	int l_id = 0;
+	
+	boolean flaglg = false;
+	boolean flaghead = false;
+	boolean flagAuthor = false;
+	boolean flagDate = false;
+	boolean flagForm = false;
+	boolean flagAna = false;
+	
+	this.GoToText()
+	
+	try 
+	{
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			switch (event) 
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					switch (parser.getLocalName()) 
+					{
+						
+						case "head"://get attr lang
+						flaghead =true;
+						vHead="";
+						break;
+						
+						case "text":
+						output.write("<text id=\""+text+"\" base=\""+base+"\" project=\""+project+"\">\n");
+						break;
+						
+						case "p":
+						output.write("<"+parser.getLocalName()+" id=\""+text+"_p_"+(p_id++)+"\">\n");
+						break;
+						case "q":
+						output.write("<"+parser.getLocalName()+" id=\""+text+"_q_"+(q_id++)+"\">\n");
+						break;
+						case "l":
+						output.write("<"+parser.getLocalName()+" id=\""+text+"_l_"+(l_id++)+"\">\n");
+						break;
+						
+						case "lg":
+						flaglg = true;
+						break;
+						
+						case "s":
+						output.write( "<s>\n");
+						break;
+						
+						case "w":
+						for(int i = 0 ; i < parser.getAttributeCount(); i++)
+							if(parser.getAttributeLocalName(i).equals("id"))
+							{	
+								wordid = parser.getAttributeValue(i);
+							}
+						break;
+						case "form":
+						flagForm = true;
+						vForm = "";
+						vAna ="";
+						break;
+						
+						case "ana":
+						flagAna = true;
+						break;
+					}
+					break;
+				
+				case XMLStreamConstants.END_ELEMENT:
+					switch (parser.getLocalName()) 
+					{
+						case "head"://get attr lang
+						flaghead =false;
+						if(flaglg)
+							output.write("<moral id=\""+text+"_moral_"+(lg_id++)+"\" head=\""+vHead+"\">\n");
+						break;
+						
+						case "text":
+						output.write("</text>\n");
+						break;
+						
+						case "p":
+						case "q":
+						case "l":
+						output.write("</"+parser.getLocalName()+">\n");
+						break;
+						
+						case "lg":
+						output.write("</moral>\n");
+						flaglg = false;
+						break;
+						
+						case "s":
+						output.write( "</s>\n");
+						break;
+						
+						case "w":
+						if(!(flaghead && flaglg))
+							if(vAna != null)
+								output.write( vForm +vAna+"\t"+wordid+"\n");
+						vAna = "";
+						vForm = "";
+						break;
+						
+						case "form":
+						flagForm = false;
+						break;
+						
+						case "ana":
+						flagAna = false;
+						break;
+					}
+					break;
+				
+				case XMLStreamConstants.CHARACTERS:
+					if(flagForm)
+						vForm += parser.getText().trim();
+					if(flagAna)
+						vAna += "\t" +parser.getText().trim();
+					if(flaghead && flaglg)
+						vHead += parser.getText().trim();
+					break;
+			}
+		}
+		output.close();
+		parser.close();
+	}
+	catch (XMLStreamException ex) {
+		System.out.println(ex);
+	}
+	catch (IOException ex) {
+		System.out.println("IOException while parsing " + inputData);
+	}
+	
+	return true;
+}
+
+/**
+ * Run3.
+ *
+ * @param files the files
+ * @return true, if successful
+ */
+public boolean run3(List<File> files) 
+{
+	String rootDir ="";
+	if(files.size() > 0)
+		rootDir = files.get(0).getParentFile().getParentFile().getAbsolutePath()+"/";//"~/xml/perrault/";
+	def cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+	
+	if(!new File(cwbLoc).exists())
+	{
+		println ("CWB path error: "+cwbLoc)
+		return false;
+	}
+	if(!new File(rootDir).exists())
+	{
+		println ("binary directory does not exists: "+rootDir)
+		return false;
+	}
+	new File(rootDir+"wtc/","perrault.wtc").delete();//cleaning&preparing
+	new File(rootDir+"wtc/").deleteDir();
+	new File(rootDir+"wtc/").mkdir();
+	new File(rootDir+"registry/").mkdir();
+	
+	String textid="";
+	int counttext =0;
+	//1- Transform into WTC file
+	for(File f : files)
+	{
+		counttext++;
+		if(!f.exists())
+		{
+			println("file "+f+ " does not exists")	
+		}
+		else
+		{	
+			println("process file "+f)
+			compil(f.toURL(),"text"+counttext,"perrault","default");
+			transfomFileWtc(rootDir+"wtc","perrault.wtc");
+		}
+	}
+	
+	//2- Import into CWB
+	def outDir =rootDir;
+	def outDirTxm = rootDir;
+	
+	CwbEncode cwbEn = new CwbEncode();
+	CwbMakeAll cwbMa = new CwbMakeAll();
+	
+	String[] pAttributes = ["id","pos","lemme"];
+	//String[] pAttributes = ["id"];
+	String[] sAttributes = ["text:0+id+base+project","p:0+id","q:0+id","moral:0+head+id","l:0+id"];
+	
+	try
+	{
+		cwbEn.run(cwbLoc + "cwb-encode", outDirTxm + "data/"+"PERRAULT", outDir + "/wtc/"+"perrault.wtc", outDirTxm + "registry/"+"perrault",pAttributes, sAttributes);
+		cwbMa.run(cwbLoc + "cwb-makeall", "PERRAULT", outDirTxm + "registry");
+		
+	} catch (Exception ex) {System.out.println(ex); return false;}
+	
+	System.out.println("Done.") 
+	
+	return true;
+}
+
+////FIN
+println "IMPORTER"
+File[] files = [new File("~/xml/perrault/perrault.xml")];
+run1(files);
+
+println "ANNOTATE"
+File rootDir = new File("~/xml/perrault/");
+run2(rootDir);
+
+println "COMPIL"
+File directory = new File("~/xml/perrault/txm/");
+files = directory.listFiles();
+ArrayList<File> Lfiles = new ArrayList<File>();
+for(File f : files)
+	Lfiles.add f
+run3(Lfiles);
+
+//move registry file to cwb registry dir
+File registryfile = new File("~/xml/perrault/txm/registry/perrault");
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/DocBookCleaner.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/DocBookCleaner.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/DocBookCleaner.groovy	(revision 728)
@@ -0,0 +1,15 @@
+package org.txm.importer
+
+import org.txm.sw.ChangeEncoding;
+
+File origDir = new File("/home/mdecorde/xml/temoignages2/")
+File outDir = new File("/home/mdecorde/xml/temoignages3/")
+
+File f = new File(origDir, ".xml")
+println f.getText("Windows-1252")
+//for (File f : origDir.listFiles()) {
+//	if (f.isHidden() || f.isDirectory()) continue;
+//	
+//	ChangeEncoding.processFile(f, "Windows-1252", "UTF-8")
+//	println f.getText("UTF-8")
+//}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/importer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/importer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/importer.groovy	(revision 728)
@@ -0,0 +1,225 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2017-12-13 14:23:35 +0100 (mer., 13 dÃ©c. 2017) $
+// $LastChangedRevision: 3485 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xml
+
+//import filters.TabulatedToXml.*;
+import java.io.File
+
+import javax.xml.stream.*
+
+import org.txm.*
+import org.txm.importer.*
+import org.txm.importer.filters.*
+import org.txm.objects.*
+import org.txm.scripts.*
+import org.txm.scripts.teitxm.*
+import org.txm.utils.FileCopy;
+
+import filters.CutHeader.*
+import filters.FusionHeader.*
+import filters.TagSentences.*
+import filters.Tokeniser.*
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class importer.
+ */
+class importer {
+
+	/** The validation. */
+	boolean validation;
+
+	/** The tokenize. */
+	boolean tokenize;
+
+	/** The sentence. */
+	boolean sentence = false;
+
+	/**
+	 * Do tokenize.
+	 *
+	 * @param b the b
+	 */
+	public void doTokenize(boolean b) { tokenize = b; }
+
+	/**
+	 * Do validation.
+	 *
+	 * @param b the b
+	 */
+	public void doValidation(boolean b) { validation = b; }
+
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param basename the basename
+	 * @return true, if successful
+	 */
+	public boolean run(File srcDir, File binDir, File txmDir, String basename, String ignoredElements, String lang)
+	{
+		new File(binDir,"tokenized").deleteDir();
+		new File(binDir,"tokenized").mkdir();
+
+		ArrayList<String> milestones = new ArrayList<String>();//the tags who you want them to stay milestones
+
+		//TEST EACH XML FILE IF VALID
+		List<File> srcfiles = txmDir.listFiles();
+		List<File> okfiles = []
+
+		println "Sources cleaning & validation";
+				def files = txmDir.listFiles()
+		for (File f : txmDir.listFiles()) { // clean directory
+			String name = f.getName()
+			if (f.isHidden() || !name.toLowerCase().endsWith(".xml")) {
+				if (!f.delete()) {
+					println "WARNING: could not clean $txmDir directory: TXM could not delete $f"
+					return false;
+				}
+			}
+		}
+		
+		files = txmDir.listFiles()
+		if (files == null || files.size() == 0) {
+			println "No XML file (*.xml) to process. Aborting"
+			return false;
+		}
+		files = files.sort()
+		for (File f : txmDir.listFiles()) {
+			if (!f.getName().toLowerCase().endsWith(".xml")) continue;
+			
+			if (!f.isHidden() && f.canRead() && !f.getName().endsWith(".properties") && !f.getName().startsWith("metadata") && !f.isDirectory()) {
+				print "."
+				if (!ValidateXml.test(f)) {
+					if (stopIfMalformed)
+						return;
+					else
+						continue;
+				} else {
+					if (!f.getName().equals("import.xml"))
+						okfiles.add(f);
+				}
+			}
+		}
+		println ""
+
+		okfiles.sort()
+		println "Files processed: "+okfiles
+		if (okfiles.size() == 0) {
+			println "No file. Check if the file extensions are '.xml'"
+			return false;
+		}
+		
+		// Fix surrogates
+		File srcDirectory = new File(binDir, "src")
+		srcDirectory.mkdir()
+		for (File f : okfiles) {
+			File outputFile = new File (srcDirectory, f.getName())
+			CleanFile.removeSurrogateFromXmlFile(f, outputFile);
+			//FileCopy.copy(f, outputFile)
+		}
+		okfiles = srcDirectory.listFiles()
+		okfiles.sort()
+		
+		//println "ptokenfiles "+ptokenfiles
+		//TOKENIZE FILES
+		List<File> tokenfiles;
+		if (tokenize || sentence) {
+			println "Tokenizing "+okfiles.size()+" files"
+			for (File f : okfiles) {
+				print "."
+				File infile = f;
+				File outfile = new File(binDir, "tokenized/"+f.getName());
+				SimpleTokenizerXml tokenizer = new SimpleTokenizerXml(infile, outfile, lang)
+				if (ignoredElements != null && ignoredElements.trim().length() > 0)
+					tokenizer.setOutSideTextTagsAndKeepContent(ignoredElements)
+				if (!tokenizer.process()) {
+					println("Failed to process "+f)
+					outfile.delete()
+				}
+			}
+			tokenfiles = new File(binDir, "tokenized").listFiles()
+			println ""
+		} else {
+			tokenfiles = okfiles;
+		}
+
+//		Change XML tag "text" to "textunit"
+//		for (File f : tokenfiles) {
+//			if (!RenameTag.rename(f, "text", "textunit")) {
+//				println "Failed to rename <text> tag to <textunit> in file "+f
+//				return false;
+//			}
+//		}
+		if (tokenfiles.size() == 0) {
+			return false;
+		}
+		//TRANSFORM INTO XML-TEI-TXM
+		println("Building XML-TXM ("+tokenfiles.size()+" files)")
+		for (File f : tokenfiles) {
+			//ArrayList<String> milestones = new ArrayList<String>();
+			print "."
+			File file = f;
+			String txmfile = f.getName();
+
+			def correspType = new HashMap<String,String>()
+			def correspRef = new HashMap<String,String>()
+			//il faut lister les id de tous les respStmt
+			def respId = [];
+			//fait la correspondance entre le respId et le rapport d'execution de l'outil
+			def applications = new HashMap<String,HashMap<String,String>>();
+			//fait la correspondance entre le respId et les attributs type de la propriÃ©tÃ© ana du w txm
+			//pour construire les ref vers les taxonomies
+			def taxonomiesUtilisees = new HashMap<String,String[]>();
+			//associe un id d'item avec sa description et son URI
+			def itemsURI = new HashMap<String,HashMap<String,String>>();
+			//informations de respStmt
+			//resps (respId <voir ci-dessus>, [description, person, date])
+			def resps = new HashMap<String,String[]>();
+			//lance le traitement
+			def builder = new Xml2Ana(file);
+			builder.setConvertAllAtrtibutes true;
+			builder.setCorrespondances(correspRef, correspType);
+			builder.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)
+			//builder.setAddTEIHeader();
+			if (!builder.process(new File(txmDir,txmfile))) {
+				println("Failed to process "+f);
+				new File(txmDir,txmfile).delete();
+			}
+		}
+		println ""
+		okfiles = txmDir.listFiles()
+		
+		return okfiles != null && okfiles.size() > 0;
+	}
+
+	boolean stopIfMalformed = false;
+	public void setStopIfMalformed(boolean b) {
+		stopIfMalformed = b;
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/xmlLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/xmlLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/xmlLoader.groovy	(revision 728)
@@ -0,0 +1,300 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2016-11-29 16:47:07 +0100 (mar., 29 nov. 2016) $
+// $LastChangedRevision: 3349 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xml;
+
+import javax.xml.stream.XMLStreamReader;
+
+import org.txm.sw.RemoveTag;
+import org.txm.importer.ApplyXsl2;
+import org.txm.importer.ValidateXml;
+import org.txm.importer.xml.importer;
+import org.txm.importer.xml.compiler;
+import org.txm.importer.xml.pager_old;
+import org.txm.objects.*;
+import org.txm.tokenizer.TokenizerClasses;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+import org.txm.metadatas.*;
+import javax.xml.stream.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/bvh/bugnames/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+
+		TokenizerClasses.loadFromNode(params.getTokenizerElement(params.getCorpusElement()));
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		//Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File("C:\\Program Files\\treetagger\\models"));//for Windows
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+String page_element = params.getPageElement("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir, "txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+File propertyFile = new File(rootDir, "import.properties")//default
+Properties props = new Properties();
+String[] metadatasToKeep;
+
+String textSortAttribute = null;
+boolean normalizeMetadata = false;
+String ignoredElements = null;
+boolean stopIfMalformed = false;
+
+println "Trying to read import properties file: "+propertyFile
+if (propertyFile.exists() && propertyFile.canRead()) {
+	InputStreamReader input = new InputStreamReader(new FileInputStream(propertyFile) , "UTF-8");
+	props.load(input);
+	input.close();
+	if(props.getProperty("sortmetadata") != null)
+		textSortAttribute = props.get("sortmetadata").toString();
+	if (props.getProperty("normalizemetadata") != null)
+		normalizeMetadata = Boolean.parseBoolean(props.get("normalizemetadata").toString());
+	if (props.getProperty("ignoredelements") != null)
+		ignoredElements = props.get("ignoredelements").toString();
+	if (props.getProperty("stopifmalformed") != null)
+		stopIfMalformed = Boolean.parseBoolean(props.get("stopifmalformed").toString());
+
+	println "import properties: "
+	println " sort metadata: "+textSortAttribute
+	println " normalize attributes: "+normalizeMetadata
+	println " ignored elements: "+ignoredElements
+	println " stop if a XML source is malformed: "+stopIfMalformed
+}
+
+File allmetadatasfile = new File(srcDir, "metadata.csv");
+
+// Apply XSL
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(1, "APPLYING XSL")
+if (xsl != null && xslParams != null && xsl.trim().length() > 0) {
+	if (ApplyXsl2.processImportSources(new File(xsl), srcDir, new File(binDir, "src"), xslParams))
+	// return; // error during process
+	srcDir = new File(binDir, "src");
+	println ""
+}
+
+// copy xml+dtd files
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+List<File> srcfiles = srcDir.listFiles();
+if (srcfiles != null)
+	for (int i = 0 ; i < srcfiles.size() ; i++) {// check XML format, and copy file into binDir
+		File f = srcfiles.get(i)
+		if (f.getName().equals("import.xml") || f.getName().equals("metadata.csv") || f.getName().endsWith(".properties")) {
+			srcfiles.remove(i);
+			i--;
+			continue;
+		}
+		if (ValidateXml.test(f)) {
+			FileCopy.copy(f, new File(txmDir, f.getName()));
+		} else {
+			println "Won't process file "+f;
+		}
+	}
+
+if (txmDir.listFiles() == null) {
+	println "No txm file to process"
+	return;
+}
+
+// filtering
+/*def xpaths = params.getExcludeXpaths()
+ if (xpaths != null) {
+ println "Filtering XML files with xpaths: $xpaths"
+ for (File infile : txmDir.listFiles()) {
+ print "."
+ if (!RemoveTag.xpath(infile, xpaths)) {
+ println "Failed to filter $infile"
+ return
+ }
+ }
+ println ""
+ }*/
+
+//get metadata values from CSV
+Metadatas metadatas; // text metadata
+
+println "Trying to read metadata from: "+allmetadatasfile
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (allmetadatasfile.exists()) {
+	println " Metadata file found: "+allmetadatasfile
+	File copy = new File(binDir, "metadata.csv")
+	if (!FileCopy.copy(allmetadatasfile, copy)) {
+		println "Error: could not create a copy of metadata file "+allmetadatasfile.getAbsoluteFile();
+		return;
+	}
+	metadatas = new Metadatas(copy, Toolbox.getParam(Toolbox.METADATA_ENCODING), Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR), Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
+} else {
+	println " No metadata file: "+allmetadatasfile
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(5, "IMPORTER")
+println "-- IMPORTER - Reading source files"
+def imp = new importer();
+imp.doValidation(true) // change this to not validate xml
+boolean skipDoTokenizeStep = params.getSkipTokenization()
+imp.doTokenize(!skipDoTokenizeStep) // change this, to not tokenize xml
+imp.setStopIfMalformed(stopIfMalformed);
+if (!imp.run( srcDir, binDir, txmDir, basename, ignoredElements, lang)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "INJECTING METADATA")
+if (metadatas != null) {
+	println("-- INJECTING METADATA - "+metadatas.getHeadersList()+" in texts of directory "+new File(binDir,"txm"))
+	for (File infile : txmDir.listFiles()) {
+		print "."
+		File outfile = File.createTempFile("temp", ".xml", infile.getParentFile());
+		if (!metadatas.injectMetadatasInXml(infile, outfile, "text", null)) {
+			outfile.delete();
+		} else {
+			if (!(infile.delete() && outfile.renameTo(infile))) println "Warning can't rename file "+outfile+" to "+infile
+			if (!infile.exists()) {
+				println "Error: could not replace $infile by $outfile"
+				return false;
+			}
+		}
+	}
+	println ""
+}
+List<File> files = txmDir.listFiles()
+if (files == null || files.size() == 0) {
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools"
+boolean annotationSuccess = false;
+if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
+	annotationSuccess = true;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+if(debug) c.setDebug();
+//c.setCwbPath("~/TXM/cwb/bin");
+c.setOptions(textSortAttribute, normalizeMetadata);
+c.setAnnotationSuccess(annotationSuccess)
+c.setLang(lang);
+if (!c.run(binDir, txmDir, corpusname, null, srcfiles, metadatas)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	println "-- EDITION - Building edition"
+	if (MONITOR != null) MONITOR.worked(25, "EDITION")
+	
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+	List<File> filelist = txmDir.listFiles();
+	Collections.sort(filelist);
+	def second = 0
+
+	println "Paginating texts: "+filelist
+
+	for (File txmFile : filelist) {
+		print "."
+		String txtname = txmFile.getName();
+		int i = txtname.lastIndexOf(".");
+		if (i > 0) txtname = txtname.substring(0, i);
+
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+		Element text = params.addText(corpusElem, txtname, txmFile);
+
+		def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, page_element);
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/compiler.groovy	(revision 728)
@@ -0,0 +1,733 @@
+
+
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2016-05-26 17:42:36 +0200 (jeu., 26 mai 2016) $
+// $LastChangedRevision: 3219 $
+// $LastChangedBy: mdecorde $
+//
+
+
+package org.txm.importer.xml;
+
+import java.util.ArrayList
+import java.util.Collections
+import org.txm.importer.cwb.BuildCwbEncodeArgs
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.*
+import org.txm.scripts.*
+import org.txm.scripts.teitxm.*
+import org.txm.utils.treetagger.TreeTagger
+
+import javax.xml.stream.*
+
+import java.net.URL
+import java.io.File
+import java.util.HashMap
+import java.util.List
+import java.util.HashMap
+import java.util.HashSet
+import org.txm.metadatas.*
+import org.txm.utils.FileCopy
+
+/**
+ * The "compiler" Class of the XML/w import module.
+ */
+class compiler {
+	
+	/** The debug. */
+	private boolean debug= false;
+
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The dir. */
+	private def dir;
+
+	/** The output. */
+	private def output;
+
+	/** The url. */
+	private def url;
+
+	/** The anatypes. */
+	private static anatypes = []
+	private static anavalues = [:]
+
+	/** The anahash. */
+	private HashMap<String, String> anahash = new HashMap<String, String>() ;
+
+	private static SAttributesListener sattrsListener;
+	private static HashMap<String, ArrayList<String>> structs;
+	private static HashMap<String, Integer> structsProf;
+
+	/** The text. */
+	String text="";
+
+	/** The base. */
+	String base="";
+
+	/** The project. */
+	String project="";
+
+	/** The text attributes. */
+	String[] textAttributes = null;
+
+	/** The cwb loc. */
+	String cwbLoc;
+
+	/** The lang. */
+	private String lang ="fr";
+
+	public static sortMetadata = null;
+	public static normalizeMetadata = false;
+
+	/**
+	 * initialize.
+	 *
+	 */
+	public compiler(){}
+
+	public void setOptions(String sortmetadata, boolean normalizemetadata)
+	{
+		sortMetadata = sortmetadata;
+		normalizeMetadata = normalizemetadata;
+	}
+
+	/**
+	 * Instantiates a new compiler.
+	 *
+	 * @param url the url
+	 * @param text the text
+	 * @param base the base
+	 * @param project the project
+	 */
+	public compiler(URL url, String text, String base, String project)
+	{
+		this.text = text
+		this.base = base;
+		this.project = project;
+		this.textAttributes = textAttributes;
+		try {
+			this.url = url;
+			inputData = url.openStream();
+
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+
+			if (sattrsListener == null)
+				sattrsListener = new SAttributesListener(parser);
+			else
+				sattrsListener.start(parser)
+
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.err.println("IOException while parsing ");
+		}
+	}
+
+	/**
+	 * set the language of the corpus.
+	 *
+	 * @param lang the lang
+	 * @return the java.lang. object
+	 */
+	public setLang(String lang)
+	{
+		this.lang = lang;
+	}
+
+	/** The annotation success. */
+	boolean annotationSuccess = false;
+
+	/**
+	 * Sets the annotation success.
+	 *
+	 * @param val the new annotation success
+	 */
+	public void setAnnotationSuccess(boolean val)
+	{
+		this.annotationSuccess = val;
+	}
+
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the new cwb path
+	 */
+	public void setCwbPath(String path)
+	{
+		if (!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path;
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File f){
+		try {
+			output = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(f,f.exists())) , "UTF-8");
+			return true;
+		} catch (Exception e) {
+			System.err.println(e);
+			return false;
+		}
+	}
+
+	/**
+	 * Go to text.
+	 */
+	private void GoToText()
+	{
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.END_ELEMENT)
+				if (parser.getLocalName().equals("teiHeader"))
+					return;
+		}
+	}
+
+	/**
+	 * Transfom file wtc.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	public boolean transfomFileWtc(File wtcFile, HashMap<String, String> textmetadata)
+	{
+		if (!createOutput(wtcFile))
+			return false;
+
+		String headvalue=""
+		String vAna = "";
+		String vForm = "";
+		String wordid= "";
+		String vHead = "";
+
+		int p_id = 0;
+		int s_id = 0;
+
+		def divs = []
+		def ncounts = [:] // contains the n values per tags with no attribute
+
+		boolean captureword = false;
+		boolean flagForm = false;
+		boolean flagAna = false;
+
+		String anatype = "";
+		String anavalue = "";
+		boolean stopAtFirstSort = true;
+		boolean foundtei = false;
+		boolean foundtext = false;
+		//output.write("<txmcorpus lang=\""+lang+"\">\n");
+		try {
+			String localname;
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+			{
+				switch (event) {
+					case XMLStreamConstants.START_ELEMENT:
+						localname = parser.getLocalName().toLowerCase();
+						if ("tei".equals(localname)) foundtei = true;
+						switch (localname) {
+							case "text":
+								sattrsListener.startElement(localname);
+								foundtext = true;
+								output.write("<text id=\""+text+"\" base=\""+base+"\"" + " project=\""+project+"\"");
+							//							for (String name : textmetadata.keySet())
+							//								output.write(" "+name+"=\""+textmetadata.get(name)+"\"")
+								for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+									String attrname = parser.getAttributeLocalName(i);
+									String attrvalue = parser.getAttributeValue(i)
+									if (normalizeMetadata)
+										attrvalue = attrvalue.toLowerCase();
+									if (attrname != "id")
+										output.write(" "+attrname.toLowerCase()+"=\""+attrvalue+"\"")
+								}
+								output.write(">\n");
+
+							//								if (textAttributes == null) {
+							//									textAttributes = new String[parser.getAttributeCount()];
+							//
+							//									for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+							//										textAttributes[i]=parser.getAttributeLocalName(i).toLowerCase();
+							//									}
+							//								}
+
+								break;
+
+
+							case "w":
+								for (int i = 0 ; i < parser.getAttributeCount(); i++) {
+									if (parser.getAttributeLocalName(i).equals("id")) {
+										wordid = parser.getAttributeValue(i);
+									}
+								}
+								anavalues = [:];
+								break;
+							case "form":
+								flagForm = true;
+								vForm = "";
+								vAna ="";
+								break;
+
+							case "ana":
+								flagAna = true;
+								anavalue = "";
+								for (int i = 0 ; i < parser.getAttributeCount(); i++)
+									if ("type".equals(parser.getAttributeLocalName(i))) {
+										anatype = parser.getAttributeValue(i).substring(1);//remove the #
+										break;
+									}
+								break;
+
+							default:
+//								if ("div" == localname ) {
+//									def type = localname;
+//									for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+//										String attrname = parser.getAttributeLocalName(i);
+//										if ("type".equals(attrname)) {
+//											type= parser.getAttributeValue(i)
+//										}
+//									}
+//									divs << type;
+//									localname = type
+//								}
+
+								if (foundtei && !foundtext) break;
+
+								sattrsListener.startElement(localname);
+								output.write("<"+localname);
+
+								for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+									String attrname = parser.getAttributeLocalName(i);
+									String attrvalue = parser.getAttributeValue(i)
+									if (normalizeMetadata)
+										attrvalue = attrvalue.toLowerCase();
+									output.write(" "+attrname.toLowerCase()+"=\""+attrvalue+"\"")
+								}
+								if (parser.getAttributeCount() == 0) { // add the n attribute
+									if (!ncounts.containsKey(localname)) ncounts.put(localname, 0);
+									int ncount = ncounts.get(localname);
+									ncounts.put(localname, ncount+1);
+									output.write(" n=\""+ncount+"\"")
+								}
+								output.write(">\n");
+						}
+						break;
+
+					case XMLStreamConstants.END_ELEMENT:
+						localname = parser.getLocalName().toLowerCase();
+						switch (localname) {
+							case "w":
+								for (String type : anatypes) {
+									def v = anavalues.get(type);
+									if (v != null) vAna +="\t"+v;
+									else vAna +="\t";
+								}
+								vForm = vForm.replaceAll("\n", "").replaceAll("&", "&amp;").replaceAll("<", "&lt;");
+								if (vAna != null) {
+									output.write(vForm+"\t"+wordid+vAna+"\n");
+								}
+								vAna = "";
+								vForm = "";
+								break;
+
+							case "tei":
+								break;
+							case "form":
+								flagForm = false;
+								break;
+							case "ana":
+								anavalues.put(anatype, anavalue)
+								flagAna = false;
+								break;
+							default:
+								if (foundtei && !foundtext) break;
+
+//								if ("div" == localname && divs.size() > 0) {
+//									localname = divs.pop()
+//								}
+
+								sattrsListener.endElement(localname);
+								output.write("</"+localname+">\n");
+						}
+						break;
+
+					case XMLStreamConstants.CHARACTERS:
+						if (flagForm)
+							vForm += parser.getText().trim();
+						if (flagAna) {
+							if (normalizeMetadata)
+								anavalue += parser.getText().trim().toLowerCase();
+							else
+								anavalue += parser.getText().trim();
+						}
+						break;
+				}
+			}
+			//output.write("</txmcorpus>");
+			output.close();
+			parser.close();
+		} catch (Exception ex) {
+			System.out.println("Exception while parsing " + inputData+" of Text "+text);
+			File xmlFile = null
+			File errorDir = null		
+			try {
+				xmlFile = new File(url.getFile())
+				errorDir = new File(wtcFile.getParentFile(), "compiler-error")
+				println "Warning: Moving $xmlFile to $errorDir"
+				errorDir.mkdir();
+				FileCopy.copy(xmlFile, new File(errorDir, xmlFile.getName()))
+			} catch(Exception eCopy) {
+				println "Error while moving "+url+" to "+errorDir
+			}
+			return false;
+		}
+		return true;
+	}
+
+	private void getAnaTypes(File xmlFile) {
+		inputData = xmlFile.toURI().toURL().openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		String ana = "ana"
+		HashSet<String> types = new HashSet<String>();
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) { // start elem
+				if (ana.equals(parser.getLocalName())) { // ana elem
+					for (int i = 0 ; i < parser.getAttributeCount(); i++) { // find @type
+						if ("type".equals(parser.getAttributeLocalName(i))) { // @type
+							types.add(parser.getAttributeValue(i).substring(1)); //remove the #
+							break;
+						}
+					}
+				}
+			}
+		}
+		parser.close()
+
+		for (String type : types)
+			if (!anatypes.contains(type))
+				anatypes << type
+	}
+
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param basename the basename
+	 * @param textAttributes the text attributes
+	 * @param srcfiles the srcfiles
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, File txmDir, String corpusname, String[] textAttributes, def srcfiles, Metadatas metadatas)
+	{
+		sattrsListener = null; // reset SAttribute Listener for each new import
+		String rootDir = binDir.getAbsolutePath();
+		anatypes = [] // reset
+		anavalues = [:] // reset
+		if (cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+
+		if (!new File(cwbLoc).exists()) {
+			println ("CWB path error: "+cwbLoc)
+			return false;
+		}
+		if (!binDir.exists()) {
+			println ("binary directory does not exists: "+binDir)
+			return false;
+		}
+
+		File wtcFile = new File(binDir, "wtc/"+corpusname+".wtc")
+		new File(binDir, "wtc").deleteDir()
+		new File(binDir, "wtc").mkdir()
+		new File(binDir, "data").deleteDir()
+		new File(binDir, "data").mkdir()
+		new File(binDir, "registry").mkdir()
+
+		String textid = ""
+		int counttext = 0
+		List<File> files = txmDir.listFiles()
+		//1- Transform into WTC file
+		def builder = null
+
+		//start corpus
+		if (createOutput(wtcFile)) {
+			output.write("<txmcorpus lang=\""+lang+"\">\n")
+			output.close()
+		}
+
+		// sort files
+		if (sortMetadata == null) {
+			Collections.sort(files)
+		} else {
+			HashMap<File, String> sortmetadatavalues = new HashMap<File, String>()
+			for (File f : files) {
+				String value = MetadataGetter.get(f,"text", sortMetadata)
+				sortmetadatavalues.put(f, value)
+			}
+			println "sort properties value: "+sortmetadatavalues
+			Collections.sort(files, new Comparator<File>() {
+				/**
+				 * Compare.
+				 *
+				 * @param o1 the o1
+				 * @param o2 the o2
+				 * @return the int
+				 */
+						public int compare(Object o1, Object o2) {
+							String v1 = sortmetadatavalues.get((File)o1)
+							String v2 = sortmetadatavalues.get((File)o2)
+							if (v1 == null || v2 == null) return 0;
+							return v1.compareTo(v2)
+						}
+					});
+		}
+
+		// get all anatypes
+		for (File f : files) {
+			getAnaTypes(f)
+		}
+
+		println("Compiling "+files.size()+" $files ")
+		for (File f : files) {
+			print "."
+			HashMap<String, String> textmetadata;
+			if (metadatas != null)
+				textmetadata = metadatas.getTextMetadata(f)
+			else
+				textmetadata = [:]
+
+			counttext++;
+			if (!f.exists()) {
+				println("file "+f+ " does not exists")
+			} else {
+				String txtname = f.getName().substring(0,f.getName().length()-4)
+				builder = new compiler(f.toURI().toURL(), txtname, corpusname, "default")
+				builder.setLang(lang);
+				if (!builder.transfomFileWtc(wtcFile, textmetadata)) {
+					println("Failed to compile "+f)
+				}
+			}
+		}
+
+		//end corpus
+		if (createOutput(wtcFile)) {
+			output.write("</txmcorpus>\n")
+			output.close()
+		}
+		println ""
+		//2- Import into CWB
+		def outDir = rootDir
+
+		CwbEncode cwbEn = new CwbEncode()
+		cwbEn.setDebug(debug)
+		CwbMakeAll cwbMa = new CwbMakeAll()
+		cwbMa.setDebug(debug)
+
+		List<String> pargs = []
+		pargs.add("id")
+		for (String ana : anatypes)
+			pargs.add(ana)
+
+		String[] pAttrs = pargs
+
+		structs = sattrsListener.getStructs()
+		structsProf = sattrsListener.getProfs()
+
+		if (debug) {
+			println structs
+			println structsProf
+		}
+		
+		List<String> sargs = new ArrayList<String>()
+		def tmpTextAttrs = []
+		for (String name : structs.keySet()) {
+			if (name == "text") {
+				for (String value : structs.get(name)) // append the attributes
+					tmpTextAttrs << value // added after
+				continue;
+			}
+			//if ( name == "q") continue; // added after
+			//if ( name == "foreign") continue; // added after
+			String concat = name+":"+structsProf.get(name); // append the depth
+			for (String attributeName : structs.get(name)) // append the attributes
+				concat += "+"+attributeName.toLowerCase();
+				
+			if (structs.get(name).size() == 0) {
+				concat += "+n";
+			} else {
+				if (!structs.get(name).contains("n"))
+					concat += "+n"
+			}
+				
+			if ((name == "p" || name == "body" || name == "back" || name == "front")
+				 && !concat.contains("+n+") && !concat.endsWith("+n"))
+				concat += "+n"
+				
+			sargs.add(concat)
+		}
+
+		String textSAttributes = "text:0+id+base+project";
+		for (String name : tmpTextAttrs) {
+			if (!("id".equals(name) || "base".equals(name) || "project".equals(name)))
+				textSAttributes += "+"+name.toLowerCase()
+		}
+		//		if (metadataXPath != null) {
+		//			for (String meta : metadataXPath.keySet()) // text property declarations from metadata.csv
+		//				textSAttributes+="+"+meta;
+		//		}
+		sargs.add(textSAttributes)
+		sargs.add("txmcorpus:0+lang")
+
+		sargs.sort()
+
+		String[] sAttributes = sargs
+		String[] pAttributes = pAttrs
+		println "P-attributes: "+pAttributes
+		println "S-attributes: "+sargs
+
+		//if(!annotationSuccess)
+		//pAttributes = ["id"];
+
+		//println "PATTRIBUTES : "+pargs;
+		/*
+		 ArrayList<String> wordstag = ["w"];
+		 println "Getting structural attributes..."
+		 BuildCwbEncodeArgs argsgetter = new BuildCwbEncodeArgs();
+		 HashMap<String, HashSet<String>> allStructures = new HashMap<String, HashSet<String>>();
+		 HashMap<String, Integer> allStructuresInclusion = new HashMap<String, Integer>();
+		 for (File srcfile: txmDir.listFiles()) {
+		 if (!(!srcfile.getName().endsWith(".csv") && srcfile.canRead() && !srcfile.isHidden() && !srcfile.isDirectory() && ValidateXml.test(srcfile)))
+		 continue;
+		 print "."
+		 argsgetter.process(srcfile, wordstag);
+		 for (String sattr : argsgetter.getSAttributes()) {
+		 int idx = sattr.indexOf(":");
+		 if(idx < 0 )
+		 continue;
+		 String name = sattr.substring(0, idx);
+		 if (!allStructures.containsKey(name)) {
+		 allStructures.put(name, new HashSet<String>());
+		 allStructuresInclusion.put(name, 0);
+		 }
+		 //println "sattr: "+name
+		 String attrs = sattr.substring(idx+1);
+		 String[] split = attrs.split("\\+");
+		 if (split.length > 0) {
+		 int start = 1;
+		 try {// test if first attr is a number
+		 int n = Integer.parseInt(split[0]);
+		 if (n > allStructuresInclusion.get(name))
+		 allStructuresInclusion.put(name, n);
+		 } catch(Exception e) {start = 0;}
+		 for (int i = start ; i < split.length ; i++)
+		 allStructures.get(name).add(split[i]);
+		 }
+		 }
+		 }
+		 // add structures+properties found in sources
+		 List<String> sargs = new ArrayList<String>();
+		 for (String name : allStructuresInclusion.keySet()) {
+		 String concat = name+":"+allStructuresInclusion.get(name);
+		 for (String value : allStructures.get(name))
+		 concat += "+"+value;
+		 if (name.equals("text")) {
+		 concat += "+base+project"
+		 if (!concat.contains("id"))
+		 concat += "+id";
+		 }
+		 sargs.add(concat);
+		 }*/
+
+		//		for (int i = 0 ; i < sargs.size() ; i++) {
+		//			if (sargs.get(i).startsWith("text:")) {
+		//				String str = sargs.get(i);
+		//				sargs.set(i, "text:"+str.substring(6));
+		//			}
+		//		}
+
+		//		String textSAttributes = "text:0+id+base+project";
+		//		if (metadatas != null) {
+		//			for (String meta : metadatas.getHeadersList()) // text property declarations from metadata.csv
+		//				textSAttributes+="+"+meta;
+		//		}
+		//sargs.add(textSAttributes)
+		//sargs.add("txmcorpus:0+lang")
+
+		//		String[] sAttributes = sargs;
+		//		System.out.println("\nCorpus structures: "+sAttributes);
+		//		System.out.println("corpus word properties: "+pAttributes);
+
+		try {
+			String regPath = outDir + "/registry/"+corpusname.toLowerCase();
+			cwbEn.run(new File(cwbLoc,"cwb-encode").getAbsolutePath(), 
+				outDir + "/data/$corpusname", 
+				outDir + "/wtc/"+corpusname+".wtc", 
+				regPath, pAttributes, sAttributes);
+			if (!new File(regPath).exists()) {
+				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			cwbMa.run(new File(cwbLoc,"cwb-makeall").getAbsolutePath(), corpusname, outDir + "/registry");
+		} catch (Exception ex) {System.out.println(ex); return false;}
+
+		return true;
+	}
+
+	/**
+	 * Sets the debug.
+	 */
+	public void setDebug()
+	{
+		this.debug = true;
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("~/xml/geo");
+		def c = new compiler();
+		c.setDebug();
+		c.setCwbPath("~/TXM/cwb/bin");
+		c.run(dir,"geo");
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>XML import module</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/pager_old.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/pager_old.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/pager_old.groovy	(revision 728)
@@ -0,0 +1,370 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xml;
+
+import org.txm.importer.*;
+import org.xml.sax.Attributes;
+import org.txm.importer.filters.*;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+// TODO: Auto-generated Javadoc
+/** Build a simple edition from a xml-tei. 
+ * @author mdecorde */
+class pager_old {
+	List<String> NoSpaceBefore;
+	//StaxStack staxStack;
+
+	/** The No space after. */
+	List<String> NoSpaceAfter;
+
+	/** The wordcount. */
+	int wordcount = 0;
+
+	/** The pagecount. */
+	int pagecount = 0;
+
+	/** The wordmax. */
+	int wordmax = 0;
+
+	/** The basename. */
+	String basename = "";
+	String txtname = "";
+	File outdir;
+
+	/** The wordid. */
+	String wordid;
+
+	/** The first word. */
+	boolean firstWord = true;
+
+	/** The wordvalue. */
+	String wordvalue;
+
+	/** The interpvalue. */
+	String interpvalue;
+
+	/** The lastword. */
+	String lastword = " ";
+
+	/** The wordtype. */
+	String wordtype;
+
+	/** The flagform. */
+	boolean flagform = false;
+
+	/** The flaginterp. */
+	boolean flaginterp = false;
+
+	/** The url. */
+	private def url;
+
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The writer. */
+	OutputStreamWriter writer;
+
+	/** The multiwriter. */
+	OutputStreamWriter multiwriter = null;
+
+	/** The infile. */
+	File infile;
+
+	/** The outfile. */
+	File outfile;
+
+	/** The pages. */
+	ArrayList<File> pages = new ArrayList<File>();
+
+	/** The idxstart. */
+	ArrayList<String> idxstart = new ArrayList<String>();
+	String editionPage;
+
+	/**
+	 * Instantiates a new pager.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param NoSpaceBefore the no space before
+	 * @param NoSpaceAfter the no space after
+	 * @param max the max
+	 * @param basename the basename
+	 */
+	pager_old(File infile, File outdir, String txtname, List<String> NoSpaceBefore,
+	List<String> NoSpaceAfter, int max, String basename, String editionPage) {
+		this.editionPage = editionPage;
+		this.basename = basename;
+		this.txtname = txtname;
+		this.outdir = outdir;
+		this.wordmax = max;
+		this.NoSpaceBefore = NoSpaceBefore;
+		this.NoSpaceAfter = NoSpaceAfter;
+		this.url = infile.toURI().toURL();
+		this.infile = infile;
+
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		//staxStack = new StaxStack(parser)
+		process();
+	}
+
+	private void closeMultiWriter()
+	{
+		if (multiwriter != null) {
+			//staxStack.closeStack(multiwriter);
+			if (firstWord) { // there was no words
+				this.idxstart.add("w_0")
+				multiwriter.write("<span id=\"w_0\"/>");
+			}
+			multiwriter.write("</body>");
+			multiwriter.write("</html>"); 
+			multiwriter.close();
+		}
+	}
+
+	/**
+	 * Creates the next output.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean createNextOutput()
+	{
+		wordcount = 0;
+		try {
+			closeMultiWriter();
+			File outfile = new File(outdir, txtname+"_"+(++pagecount)+".html")
+			pages.add(outfile);
+			firstWord = true; // waiting for next word
+
+			multiwriter = new OutputStreamWriter(new FileOutputStream(outfile) , "UTF-8");
+
+			multiwriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+			multiwriter.write("<html>");
+			multiwriter.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+			multiwriter.write("<head>");
+			multiwriter.write("<title>"+basename.toUpperCase()+" Edition - Page "+pagecount+"</title>");
+			multiwriter.write("</head>");
+			multiwriter.write("<body>");
+
+			//staxStack.openStack(multiwriter);
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput() {
+		try {
+			return createNextOutput();
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Gets the page files.
+	 *
+	 * @return the page files
+	 */
+	public ArrayList<File> getPageFiles() {
+		return pages;
+	}
+
+	/**
+	 * Gets the idx.
+	 *
+	 * @return the idx
+	 */
+	public ArrayList<String> getIdx() {
+		return idxstart;
+	}
+
+	/**
+	 * Process.
+	 */
+	void process() {
+		String localname = "";
+		createNextOutput();
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch (localname) {
+						case "text":
+							if (parser.getAttributeValue(null,"id") != null)
+								multiwriter.write("<h3>"+parser.getAttributeValue(null,"id")+"</h3>\n")
+							multiwriter.write("<table>\n");
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+								multiwriter.write("<tr>");
+								multiwriter.write("<td>"+parser.getAttributeLocalName(i)+": </td>");
+								multiwriter.write("<td>"+parser.getAttributeValue(i)+"</td>");
+								multiwriter.write("</tr>\n");
+							}
+							multiwriter.write("</table><br/>\n");
+							break;
+						case "head":
+							multiwriter.write("<h2>\n")
+							//staxStack.onStartElement("h2", null);
+							break;
+						case "graphic":
+							String url = parser.getAttributeValue(null, "url")
+						//println "URL: "+url
+							if (url != null) multiwriter.write("<div><img src=\"$url\"/></div>");
+							break;
+						case "lg":
+						case "p":
+						case "q":
+							String rend = parser.getAttributeValue(null, "rend")
+							if (rend == null) rend = "normal"
+							multiwriter.write("<p class=\"$rend\">\n")
+							//staxStack.onStartElement("p", null);
+							break;
+						//case "pb":
+						case editionPage:
+							createNextOutput();
+							wordcount=0;
+							if (parser.getAttributeValue(null,"n") != null) {
+								multiwriter.write("<p style=\"color:red\" align=\"center\">- "+parser.getAttributeValue(null,"n")+" -</p>\n")
+							}
+							break;
+						case "lb":
+						case "br":
+							multiwriter.write("<br/>\n")
+							break;
+						case "w":
+							wordid = parser.getAttributeValue(null,"id");
+
+							if (firstWord) {
+								firstWord = false;
+								this.idxstart.add(wordid);
+							}
+							wordcount++;
+							if (wordcount >= wordmax) {
+								createNextOutput();
+							}
+							break;
+
+						case "ana":
+							flaginterp=true;
+							interpvalue+=" "+parser.getAttributeValue(null,"type").substring(1)+":"
+							break;
+
+						case "form":
+							wordvalue="";
+							interpvalue ="";
+							flagform=true;
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+					switch (localname) {
+						case "head":
+							multiwriter.write("</h2>\n")
+							
+							break;
+						case "lg":
+						case "p":
+						case "q":
+							multiwriter.write("</p>\n")
+							
+							break;
+
+
+						case "form":
+							flagform = false
+							break;
+
+						case "ana":
+							flaginterp = false
+							break;
+
+						case "w":
+
+							int l = lastword.length();
+							String endOfLastWord = "";
+							if (l > 0)
+								endOfLastWord = lastword.subSequence(l-1, l);
+
+							if (interpvalue != null)
+								interpvalue = interpvalue.replace("&", "&amp;").replace("<", "&lt;").replace("\"","&quot;");
+
+							if (NoSpaceBefore.contains(wordvalue) ||
+							NoSpaceAfter.contains(lastword) ||
+							wordvalue.startsWith("-") ||
+							NoSpaceAfter.contains(endOfLastWord)) {
+								multiwriter.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+							} else {
+								multiwriter.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+							}
+						//writer.write(wordvalue.replace("&", "&amp;").replace("\"","&quot;").replace("<", "&lt;")+"</span>");
+							multiwriter.write(wordvalue.replace("&", "&amp;").replace("\"","&quot;").replace("<", "&lt;")+"</span>");
+							lastword=wordvalue;
+							break;
+					}
+					break;
+
+				case XMLStreamConstants.CHARACTERS:
+					if (flagform)
+						if (parser.getText().length() > 0)
+							wordvalue+=(parser.getText());
+					if (flaginterp)
+						if (parser.getText().length() > 0)
+							interpvalue+=(parser.getText());
+					break;
+			}
+		}
+		//writer.write("</body>");
+		//writer.write("</html>");
+		//writer.close();
+		closeMultiWriter();
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/pager.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/pager.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/xml/pager.groovy	(revision 728)
@@ -0,0 +1,444 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2017-12-13 14:23:35 +0100 (mer., 13 dÃ©c. 2017) $
+// $LastChangedRevision: 3485 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xml;
+
+import org.txm.importer.*;
+import org.xml.sax.Attributes;
+import org.txm.importer.filters.*;
+import org.txm.utils.FileCopy;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+
+import javax.xml.parsers.*
+import javax.xml.stream.*;
+
+import java.net.URL;
+
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+/** Build a simple edition from a xml-tei. 
+ * @author mdecorde */
+class pager {
+
+	List<String> NoSpaceBefore;
+
+	/** The No space after. */
+	List<String> NoSpaceAfter;
+
+	/** The wordcount. */
+	int wordcount = 0;
+
+	/** The pagecount. */
+	int pagecount = 0;
+
+	/** The wordmax. */
+	int wordmax = 0;
+
+	/** The basename. */
+	String basename = "";
+	String txtname = "";
+	File outdir;
+
+	/** The wordid. */
+	String wordid;
+
+	/** The first word. */
+	boolean firstWord = true;
+
+	/** The wordvalue. */
+	String wordvalue = "";
+
+	/** The interpvalue. */
+	String interpvalue = "";
+
+	/** The lastword. */
+	String lastword = " ";
+
+	/** The wordtype. */
+	String wordtype;
+
+	/** The flagform. */
+	boolean flagform = false;
+
+	/** The flaginterp. */
+	boolean flaginterp = false;
+
+	/** The url. */
+	private def url;
+
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The writer. */
+	OutputStreamWriter writer;
+
+	/** The pagedWriter. */
+	StaxStackWriter pagedWriter = null;
+
+	/** The infile. */
+	File infile;
+
+	/** The outfile. */
+	File outfile;
+
+	/** The pages. */
+	ArrayList<File> pages = new ArrayList<File>();
+
+	/** The idxstart. */
+	ArrayList<String> idxstart = new ArrayList<String>();
+	String paginationElement;
+
+	/**
+	 * Instantiates a new pager.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param NoSpaceBefore the no space before
+	 * @param NoSpaceAfter the no space after
+	 * @param max the max
+	 * @param basename the basename
+	 */
+	pager(File infile, File outdir, String txtname, List<String> NoSpaceBefore,
+	List<String> NoSpaceAfter, int max, String basename, String paginationElement) {
+		this.paginationElement = paginationElement;
+		this.basename = basename;
+		this.txtname = txtname;
+		this.outdir = outdir;
+		this.wordmax = max;
+		this.NoSpaceBefore = NoSpaceBefore;
+		this.NoSpaceAfter = NoSpaceAfter;
+		this.url = infile.toURI().toURL();
+		this.infile = infile;
+
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+
+		process();
+
+		// copy txm.css file near editions
+		try {
+			File txmDir = infile.getParentFile().getParentFile();
+			if (txmDir.exists() && txmDir.getName().equals("txm")) {
+				File binDir = txmDir.getParentFile();
+				File corporaDir = binDir.getParentFile();
+				if (binDir.exists() && corporaDir.getName().equals("corpora")) {
+					File htmlDir = new File(binDir, "HTML/"+basename.toUpperCase()+"/default")
+					File txmhomeDir = corporaDir.getParentFile()
+					File txmcss = new File(txmhomeDir, "css/txm.css")
+					if (htmlDir.exists() && txmcss.exists()) {
+						FileCopy.copy(txmcss, new File(htmlDir, "txm.css"))
+					}
+				}
+			}
+		} catch(Exception e) {
+			println "Failed to copy TXM default CSS: "+e.getLocalizedMessage();
+		}
+	}
+
+	private def closeMultiWriter()
+	{
+		if (pagedWriter != null) {
+			def tags = pagedWriter.getTagStack().clone();
+
+			if (firstWord) { // there was no words found
+				pagedWriter.writeCharacters("");
+				this.idxstart.add("w_0")
+				pagedWriter.write("<span id=\"w_0\"/>");
+			}
+			pagedWriter.writeEndElements();
+			pagedWriter.close();
+			return tags;
+		} else {
+			return [];
+		}
+	}
+
+	/**
+	 * Creates the next output.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean createNextOutput() {
+		wordcount = 0;
+		try {
+			def tags = closeMultiWriter();
+			for (int i = 0 ; i < tags.size() ; i++) {
+				String tag = tags[i]
+				if ("div" != tag) {
+					tags.remove(i--)
+				} else {
+					tags.remove(i--) // remove first "div"
+					break; // remove elements until first "div" tag
+				}
+			}
+			File outfile = new File(outdir, txtname+"_"+(++pagecount)+".html")
+			pages.add(outfile);
+			firstWord = true; // waiting for next word
+
+			pagedWriter = new StaxStackWriter(outfile, "UTF-8");
+
+			pagedWriter.writeStartDocument("UTF-8", "1.0")
+			pagedWriter.writeStartElement("html");
+			pagedWriter.writeEmptyElement("meta", ["http-equiv":"Content-Type", "content":"text/html","charset":"UTF-8"]);
+			pagedWriter.writeEmptyElement("link", ["rel":"stylesheet", "type":"text/css","href":"txm.css"]);
+			pagedWriter.writeEmptyElement("link", ["rel":"stylesheet", "type":"text/css","href":"${basename}.css"]);
+			pagedWriter.writeStartElement("head");
+			pagedWriter.writeStartElement("title")
+			pagedWriter.writeCharacters(basename.toUpperCase()+" Edition - Page "+pagecount)
+			pagedWriter.writeEndElement(); // </title>
+			pagedWriter.writeEndElement() // </head>
+			pagedWriter.writeStartElement("body") //<body>
+			pagedWriter.writeStartElement("div") //<div class="txmeditionpage">
+			pagedWriter.writeAttribute("class", "txmeditionpage")
+			
+			pagedWriter.writeStartElements(tags);
+			return true;
+		} catch (Exception e) {
+			System.out.println("Error: "+e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput() {
+		try {
+			return createNextOutput();
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Gets the page files.
+	 *
+	 * @return the page files
+	 */
+	public ArrayList<File> getPageFiles() {
+		return pages;
+	}
+
+	/**
+	 * Gets the idx.
+	 *
+	 * @return the idx
+	 */
+	public ArrayList<String> getIdx() {
+		return idxstart;
+	}
+
+	/**
+	 * Process.
+	 */
+	void process() {
+		boolean flagNote = false;
+		String noteContent = "";
+
+		String localname = "";
+		createNextOutput();
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+
+					if (localname == paginationElement) {
+						createNextOutput();
+						pagedWriter.write("\n");
+						if (parser.getAttributeValue(null,"n") != null) {
+							pagedWriter.writeElement("p", ["style":"color:red", "align":"center"], "- "+parser.getAttributeValue(null,"n")+" -")
+						}
+					}
+
+					switch (localname) {
+						case "text":
+							pagedWriter.write("\n");
+							if (parser.getAttributeValue(null,"id") != null)
+								pagedWriter.writeElement("h3", parser.getAttributeValue(null,"id"))
+							pagedWriter.writeStartElement("table");
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+								pagedWriter.writeStartElement("tr");
+								pagedWriter.writeElement("td", parser.getAttributeLocalName(i));
+								pagedWriter.writeElement("td", parser.getAttributeValue(i).toString());
+								pagedWriter.writeEndElement();
+							}
+							pagedWriter.writeEndElement() // table
+							pagedWriter.writeEmptyElement("br")
+							pagedWriter.writeCharacters("");
+							break;
+						case "note":
+							flagNote = true;
+							noteContent = ""
+							break;
+						case "a":
+							pagedWriter.writeStartElement("a")
+							pagedWriter.writeAttribute("href", parser.getAttributeValue(null,"href"));
+							String target = parser.getAttributeValue(null,"target");
+							if (target == null) target = "_blank";
+							pagedWriter.writeAttribute("target", target);
+							break;
+						case "head":
+							pagedWriter.write("\n");
+							pagedWriter.writeStartElement("h2")
+							break;
+						case "graphic":
+							pagedWriter.write("\n");
+							String url = parser.getAttributeValue(null, "url")
+							if (url != null) {
+								pagedWriter.writeStartElement("div")
+								pagedWriter.writeEmptyElement("img", ["src":url])
+								pagedWriter.writeEndElement() // div
+							}
+							break;
+						case "lg":
+						case "p":
+						case "q":
+							pagedWriter.write("\n");
+							String rend = parser.getAttributeValue(null, "rend")
+							if (rend == null) rend = "normal"
+							pagedWriter.writeStartElement("p",["class":rend])
+							break;
+						//case "pb":
+
+						case "lb":
+						case "br":
+							pagedWriter.writeEmptyElement("br")
+							break;
+						case "w":
+
+							wordid = parser.getAttributeValue(null,"id");
+
+							wordcount++;
+							if (wordcount >= wordmax) {
+								createNextOutput();
+							}
+
+							if (firstWord) {
+								firstWord = false;
+								this.idxstart.add(wordid);
+							}
+
+							break;
+						case "ana":
+							flaginterp=true;
+							interpvalue+=" "+parser.getAttributeValue(null,"type").substring(1)+":"
+							break;
+						case "form":
+							wordvalue="";
+							interpvalue ="";
+							flagform=true;
+							break;
+						//						default:
+						//							pagedWriter.writeStartElement(localname)
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+					switch (localname) {
+						case "head":
+							pagedWriter.writeEndElement() // </h2>
+							break;
+						case "note":
+							flagNote = false;
+							if (noteContent.length() > 0) {
+								pagedWriter.writeStartElement("span", ["style":"color:red;", "title":noteContent]);
+								pagedWriter.writeCharacters("[*]");
+								pagedWriter.writeEndElement() // </span>
+							}
+							break;
+						case "lg":
+						case "p":
+						case "q":
+							pagedWriter.writeEndElement() // </p>
+							break;
+						case "a":
+							pagedWriter.writeEndElement() // </a>
+							break;
+						case "form":
+							flagform = false
+							break;
+						case "ana":
+							flaginterp = false
+							break;
+						case "w":
+							int l = lastword.length();
+							String endOfLastWord = "";
+							if (l > 0)
+								endOfLastWord = lastword.subSequence(l-1, l);
+
+							if (interpvalue != null)
+								interpvalue = interpvalue;
+
+							if (NoSpaceBefore.contains(wordvalue) ||
+							NoSpaceAfter.contains(lastword) ||
+							wordvalue.startsWith("-") ||
+							NoSpaceAfter.contains(endOfLastWord)) {
+								pagedWriter.writeStartElement("span", ["title":interpvalue, "id":wordid]);
+							} else {
+								pagedWriter.writeCharacters(" ");
+								pagedWriter.writeStartElement("span", ["title":interpvalue, "id":wordid]);
+							}
+
+							pagedWriter.writeCharacters(wordvalue);
+							pagedWriter.writeEndElement();
+							lastword=wordvalue;
+							break;
+						//						default:
+						//							pagedWriter.writeEndElement()
+					}
+					break;
+				case XMLStreamConstants.CHARACTERS:
+					if (flagform && parser.getText().length() > 0) {
+						wordvalue+=(parser.getText());
+						if (flagNote == parser.getText().length() > 0)
+							noteContent += parser.getText().replace("\n", " ");
+					} else	if (flaginterp && parser.getText().length() > 0) {
+						interpvalue+=(parser.getText());
+					} else if (flagNote == parser.getText().length() > 0) {
+						noteContent += parser.getText().replace("\n", " ");
+					}
+					break;
+			}
+		}
+		closeMultiWriter();
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/pager.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/pager.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/pager.groovy	(revision 728)
@@ -0,0 +1,547 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+//
+//
+// $LastChangedDate: 2017-05-02 11:55:17 +0200 (mar., 02 mai 2017) $
+// $LastChangedRevision: 3436 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.bfm;
+
+import org.txm.importer.*;
+import org.xml.sax.Attributes;
+import org.txm.importer.filters.*;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Build BFM texts HTML edition from the TEI-TXM files. <br/>
+ * The result is similar to the one of the XSLT script made by Alexis Lavrentiev
+ * (BFM & ICAR3). <br/>
+ * 
+ * @author mdecorde
+ */
+class pager {
+	private List<String> NoSpaceBefore;
+
+	/** The No space after. */
+	private List<String> NoSpaceAfter;
+
+	/** The wordcount. */
+	private int wordcount = 0;
+
+	/** The pagecount. */
+	private int pagecount = 0;
+
+	/** The wordmax. */
+	private int wordmax = 0;
+
+	/** The wordid. */
+	private String wordid;
+
+	/** The first word. */
+	private boolean firstWord = true;
+
+	/** The wordvalue. */
+	private String wordvalue;
+
+	/** The interpvalue. */
+	private String interpvalue;
+
+	/** The lastword. */
+	private String lastword = " ";
+
+	/** The wordtype. */
+	private String wordtype;
+
+	/** The flagform. */
+	private boolean flagform = false;
+
+	/** The flaginterp. */
+	private boolean flaginterp = false;
+
+	/** The url. */
+	private URL url;
+
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The writer. */
+	private OutputStreamWriter writer;
+
+	/** The multiwriter. */
+	private OutputStreamWriter multiwriter = null;
+	StaxStackWriter pagedWriter = null;
+
+	/** The infile. */
+	private File infile;
+
+	/** The outfile. */
+	private File outfile;
+	private File outDir;
+
+	/** The pages. */
+	ArrayList<File> pages = new ArrayList<File>();
+
+	/** The idxstart. */
+	ArrayList<String> idxstart = new ArrayList<String>();
+
+	/** The titre id. */
+	private String titreId;
+
+	private String basename;
+	private String textname;
+
+	private def xpathProperties;
+
+	/**
+	 * Instantiates a new pager.
+	 *
+	 * @param infile the file to convert
+	 * @param outfile the result file
+	 * @param NoSpaceBefore the punctuation marks that don't have a space before
+	 * @param NoSpaceAfter the punctuation marks that don't have a space after
+	 * @param max the max number of word per page
+	 */
+	pager(File infile, File outDir, String textname, List<String> NoSpaceBefore,
+	List<String> NoSpaceAfter, int max, String basename, Properties xpathprops) {
+		this.wordmax = max;
+		this.NoSpaceBefore = NoSpaceBefore;
+		this.NoSpaceAfter = NoSpaceAfter;
+		this.basename = basename;
+		this.textname = textname;
+		this.outDir = outDir;
+		this.xpathProperties = xpathprops;
+		this.url = infile.toURI().toURL();
+		this.infile = infile;
+
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		process();
+	}
+
+	private def closeMultiWriter()
+	{
+		if (pagedWriter != null) {
+			def tags = pagedWriter.getTagStack().clone();
+
+			if (firstWord) { // there was no words
+				this.idxstart.add("w_0")
+				pagedWriter.write("<span id=\"w_0\"/>");
+			}
+			pagedWriter.writeEndElements();
+			pagedWriter.close();
+			return tags;
+		} else {
+			return [];
+		}
+	}
+
+	/**
+	 * Creates the next output.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean createNextOutput()
+	{
+		wordcount = 0;
+		try {
+			def tags = closeMultiWriter();
+			for (int i = 0 ; i < tags.size() ; i++) {
+				String tag = tags[i]
+				if ("body" != tag) {
+					tags.remove(i--)
+				} else {
+					tags.remove(i--) // remove "body"
+					break; // remove elements until "body tag
+				}
+			}
+			File outfile = new File(outDir, textname+"_"+(++pagecount)+".html")
+			pages.add(outfile);
+			firstWord = true; // waiting for next word
+
+			pagedWriter = new StaxStackWriter(outfile, "UTF-8");
+
+			pagedWriter.writeStartDocument("UTF-8", "1.0")
+			pagedWriter.writeStartElement("html")
+			pagedWriter.writeEmptyElement("meta", ["http-equiv":"Content-Type", "content":"text/html","charset":"UTF-8"]);
+			pagedWriter.writeStartElement("head")
+			pagedWriter.writeStartElement("title")
+			pagedWriter.writeCharacters(basename.toUpperCase()+" - "+textname+" - Edition - Page "+pagecount)
+			pagedWriter.writeEndElement() // </title>
+			pagedWriter.writeEndElement() // </head>
+			pagedWriter.writeStartElement("body") //<body>
+			pagedWriter.writeStartElements(tags);
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile) {
+		try {
+			return createNextOutput();
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Gets the page files.
+	 *
+	 * @return the pages create during the processing
+	 */
+	public ArrayList<File> getPageFiles() {
+		return pages;
+	}
+
+	/**
+	 * Gets the idx.
+	 *
+	 * @return the word's indexes
+	 */
+	public ArrayList<String> getIdx() {
+		return idxstart;
+	}
+
+	/**
+	 * process the infile.
+	 */
+	void process() {
+		String localname = "";
+
+		boolean closeTitre = false;
+		boolean closeAmen = false;
+
+		boolean flagchoice = false;
+		boolean flagcorr = false;
+		boolean flagsic = false;
+		boolean flagreg = false;
+		boolean flagexpan = false;
+		boolean flagorig = false;
+		boolean flagabbr = false;
+		boolean flagforeign = false;
+		int levelSupplied = 0;
+		boolean flagSurplus = false;
+		boolean flagDel = false;
+
+		// option for metadata from BFM TEI header
+		def mValues = [:];
+		def xpathprocessor = new XPathResult(infile)
+		for (String name : xpathProperties.keySet()) {
+			String value = xpathprocessor.getXpathResponse(xpathProperties.get(name), "N/A");
+			mValues.put(name, value.replace("\n", " "));
+		}
+		if (mValues.containsKey("forme") && !mValues.get("forme").equals("N/A")) {
+			if (mValues.get("forme").startsWith("#forme_")) {
+				mValues.put("forme", mValues.get("forme").substring(7));
+			} else if (mValues.get("forme").startsWith("#")) {
+				mValues.put("forme", mValues.get("forme").substring(1));
+			} else {
+				mValues.put("forme", mValues.get("forme"));
+			}
+		}
+		createNextOutput();
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+		{
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch (localname) {
+						case "text":
+							pagedWriter.writeStartElement("h1",
+							["align":"center", "style":"color:darkviolet;font-family:Times;font-weight:bold;font-style:italic;font-size=200%", "class":"text"])
+							pagedWriter.writeCharacters(mValues.get("titre"))
+							pagedWriter.writeEndElement(); // h1
+							pagedWriter.writeStartElement("p")
+							pagedWriter.writeEmptyElement("hr")
+							pagedWriter.writeCharacters("auteur : "+mValues.get("auteur"))
+							pagedWriter.writeEmptyElement("br");
+							pagedWriter.writeCharacters("date de composition : "+mValues.get("datecompolibre"));
+							pagedWriter.writeEmptyElement("br");
+							pagedWriter.writeCharacters("domaine : "+mValues.get("domaine"))
+							pagedWriter.writeEmptyElement("br");
+							pagedWriter.writeCharacters("genre : "+mValues.get("genre"))
+							pagedWriter.writeEmptyElement("br");
+							pagedWriter.writeCharacters("forme : "+mValues.get("forme"))
+							pagedWriter.writeEmptyElement("br");
+							pagedWriter.writeCharacters("dialecte : "+mValues.get("dialecte"))
+							pagedWriter.writeEmptyElement("br");
+							pagedWriter.writeEmptyElement("hr")
+							pagedWriter.writeEndElement(); // p
+							break;
+						case "head":
+							pagedWriter.writeStartElement("h2")
+							break;
+						case "lg":
+						case "p":
+							pagedWriter.writeStartElement("p")
+							break;
+						case "pb":
+							createNextOutput();
+							if (parser.getAttributeValue(null,"n") != null) {
+								pagedWriter.writeStartElement("p", ["style":"color:red", "align":"center"]);
+								pagedWriter.writeCharacters("- "+parser.getAttributeValue(null,"n")+" -")
+								pagedWriter.writeEndElement() // p
+							}
+							break;
+
+						case "ab":
+							if (parser.getAttributeValue(null,"n") != null) {
+								pagedWriter.writeStartElement("p", ["align":"center"]);
+								pagedWriter.writeCharacters(parser.getAttributeValue(null,"n"))
+								pagedWriter.writeEndElement() // p
+							}
+							break;
+						case "l":
+							pagedWriter.writeEmptyElement("br");
+							break;
+						case "div":
+							if (parser.getAttributeValue(null,"type") == "titre") {
+								pagedWriter.writeStartElement("h3")
+								closeTitre = true;
+							} else if (parser.getAttributeValue(null,"type") == "amen") {
+								pagedWriter.writeStartElement("h3")
+								closeAmen = true;
+							}
+							break;
+						case "w":
+							interpvalue = "";
+							for (int i = 0 ; i < parser.getAttributeCount(); i++) {
+								if (parser.getAttributeLocalName(i).equals("type")) {
+									interpvalue = " pos: "+parser.getAttributeValue(i);
+								}
+							}
+							wordid = parser.getAttributeValue(null, "id");
+
+							wordcount++;
+							if (wordcount >= wordmax) {
+								createNextOutput();
+							}
+							
+							if (firstWord) {
+								firstWord = false;
+								this.idxstart.add(wordid);
+							}
+							
+							break;
+
+						case "choice":
+							flagchoice = true;
+							break;
+						case "corr":
+							flagcorr = true;
+							break;
+						case "sic":
+							flagsic = true;
+							break;
+						case "reg":
+							flagreg = true;
+							break;
+						case "orig":
+							flagorig = true;
+							break;
+						case "foreign":
+							flagforeign = true;
+							break;
+						case "supplied":
+							levelSupplied = levelSupplied +1;
+							if(flagform)
+								wordvalue = wordvalue+"[";
+							break;
+
+						case "surplus":
+							flagSurplus = true;
+							pagedWriter.writeStartElement("span", ["class": "surplus", "style":"color:red;"])
+							break;
+
+						case "del":
+							flagDel = true;
+							pagedWriter.writeStartElement("span", ["class": "del", "style":"color:red;text-decoration:line-through;"])
+							break;
+
+						case "ana":
+							flaginterp=true;
+							interpvalue+=" "+parser.getAttributeValue(null,"type").substring(1)+":"
+							break;
+
+						case "form":
+							wordvalue="";
+							flagform=true;
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+					switch (localname) {
+						case "head":
+							pagedWriter.writeEndElement() // h2
+							break;
+
+						case "div":
+							if (closeTitre) {
+								pagedWriter.writeEndElement() // h3
+								closeTitre = false;
+							} else if(closeAmen) {
+								pagedWriter.writeEndElement() // h3
+								closeTitre = false;
+							}
+							break;
+
+						case "lb":
+							pagedWriter.writeEmptyElement("br")
+							break;
+						case "lg":
+						case "p":
+							pagedWriter.writeEndElement() // p
+							break;
+
+						case "choice":
+							flagchoice = false;
+							break;
+						case "corr":
+							flagcorr = false;
+							break;
+						case "sic":
+							flagsic = false;
+							break;
+						case "reg":
+							flagreg = false;
+							break;
+						case "orig":
+							flagorig = false;
+							break;
+						case "foreign":
+							flagforeign = false;
+							break;
+						case "supplied":
+							levelSupplied = levelSupplied -1;
+							if (flagform)
+								wordvalue = wordvalue+"]";
+							break;
+						case "surplus":
+							flagSurplus = false;
+							pagedWriter.writeCharacters(")")
+							pagedWriter.writeEndElement() // span
+							break;
+
+						case "del":
+							flagDel = false;
+							pagedWriter.writeEndElement() // span
+							break;
+
+						case "form":
+							flagform = false
+							break;
+
+						case "ana":
+							flaginterp = false
+							break;
+
+						case "w":
+							int l = lastword.length();
+							String color = "";
+							if (flagcorr)
+								color = "color: green;";
+							else if (flagreg)
+								color = "color: darkgreen;";
+							else if (flagforeign)
+								color = "color: darkred;";
+							else if (levelSupplied == 1)
+								color = "color: blue;";
+							else if (levelSupplied == 2)
+								color = "color: darkblue;";
+							if (!flagchoice || flagcorr || flagreg) {
+								String endOfLastWord = "";
+								if (l > 0)
+									endOfLastWord = lastword.subSequence(l-1, l);
+
+								if (NoSpaceBefore.contains(wordvalue) ||
+								NoSpaceAfter.contains(lastword) ||
+								wordvalue.startsWith("-") ||
+								NoSpaceAfter.contains(endOfLastWord))
+								{
+									//multiwriter.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\" "+color+">");
+								} else {
+									//multiwriter.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\" "+color+">");
+									pagedWriter.writeCharacters(" ")
+								}
+								
+								pagedWriter.writeStartElement("span", ["title":interpvalue, "id":wordid, "style":color]) // span
+								pagedWriter.writeCharacters(wordvalue) 
+								pagedWriter.writeEndElement() // span
+								lastword=wordvalue;
+							}
+							break;
+					}
+					break;
+
+				case XMLStreamConstants.CHARACTERS:
+					if (flagform && parser.getText().length() > 0)
+							wordvalue += (parser.getText());
+					if (flaginterp && parser.getText().length() > 0)
+							interpvalue += (parser.getText());
+					break;
+			}
+		}
+		closeMultiWriter();
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/BuildBiblio.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/BuildBiblio.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/BuildBiblio.groovy	(revision 728)
@@ -0,0 +1,193 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.importer.bfm;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.nio.charset.Charset;
+import org.txm.utils.*;
+
+import javax.xml.stream.*;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class BuildBiblio.
+ */
+class BuildBiblio {
+	
+	/**
+	 * Process.
+	 *
+	 * @param csvfile the csvfile
+	 * @param separator the separator
+	 * @param encoding the encoding
+	 * @param outputfile the outputfile
+	 * @param buildIndex the build index
+	 * @return true, if successful
+	 */
+	public static boolean process(File csvfile, String separator, String encoding, File outputfile, boolean buildIndex) {
+		if(!(csvfile.exists() && csvfile.canRead()))
+		{
+			println "csvfile does not exist"
+			return false;
+		}
+		
+		if(!outputfile.getParentFile().exists())
+		{
+			println "outpurfile's parent does not exist"
+			return false;
+		}
+		
+		CsvReader csvreader = new CsvReader(csvfile.getAbsolutePath(), separator.charAt(0), Charset.forName(encoding))
+		
+		XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		FileOutputStream output = new FileOutputStream(outputfile)
+		XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8");
+		
+		if(csvreader == null)
+		{
+			println "failed to build csvreader"
+			return false;
+		}
+		
+		writer.writeStartDocument("UTF-8","1.0");
+		writer.writeStartElement("html");
+		//header
+		writer.writeStartElement("head");
+		//writer.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+		writer.writeStartElement("meta");
+		writer.writeAttribute("http-equiv","Content-Type");
+		writer.writeAttribute("content","text/html");
+		writer.writeAttribute("charset","UTF-8");
+		writer.writeEndElement();//meta
+		writer.writeStartElement("title");
+		writer.writeCharacters("Fiches biblio BFM")
+		writer.writeEndElement();//title
+		writer.writeEndElement();//head
+		
+		//get titles
+		csvreader.readHeaders();
+		def titles = [];
+		for(String title : csvreader.getHeaders())
+		{
+			titles << title
+		}
+		
+		writer.writeStartElement("body");
+		
+		if(buildIndex)
+		{
+		writer.writeStartElement("ul");
+		while (csvreader.readRecord()){
+			
+			writer.writeStartElement("li");
+			writer.writeStartElement("a");
+			writer.writeAttribute("href", "#"+csvreader.get("id"))
+			writer.writeCharacters(csvreader.get("id"))
+			writer.writeEndElement();//a
+			writer.writeEndElement();//li			
+		}
+		writer.writeEndElement();//ul
+		}
+		
+		println "Metadata declared: "+titles
+		csvreader = new CsvReader(csvfile.getAbsolutePath(), separator.charAt(0), Charset.forName(encoding))
+		csvreader.readHeaders();
+		while (csvreader.readRecord()){
+			writer.writeStartElement("div");
+			writer.writeAttribute("class", "fiche");
+			
+			writer.writeStartElement("a")
+			writer.writeAttribute("name", csvreader.get("id"));
+			writer.writeEndElement();//a
+			
+			writer.writeStartElement("h1");
+			String auteur = csvreader.get("Auteur")
+			String titre = csvreader.get("Titre")
+			if(auteur != null && auteur != "anonyme")
+				writer.writeCharacters(auteur+", ")
+			writer.writeCharacters(titre);
+			writer.writeEndElement();//h1
+			
+			writer.writeStartElement("ul");
+			for (int i = 0 ; i < titles.size() ; i++) {
+				writer.writeStartElement("li");
+				writer.writeStartElement("b");
+				writer.writeCharacters(titles.get(i)+" : ")
+				writer.writeEndElement();
+				
+				writer.writeCharacters(csvreader.get(titles.get(i)))
+				writer.writeEndElement();//li
+			}
+			
+			writer.writeEndElement();//ul
+			writer.writeEndElement();//div
+		}
+		
+		writer.writeEndElement();//body
+		writer.close();
+		output.close()
+		return true;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File csvfile = new File("C:\\Documents and Settings\\alavrent\\Mes documents\\bfm - local\\Bases bibliographiques (copie)\\Fiches_biblio_TXM.txt")
+		File outputfile = new File("C:\\Documents and Settings\\alavrent\\Mes documents\\bfm - local\\Bases bibliographiques (copie)\\Fiches_biblio_TXM.html")
+		String separator = "\t"
+		String encoding = "cp1252"
+		
+		if(!BuildBiblio.process(csvfile, separator, encoding, outputfile, false))
+			println("Error.")
+		else
+			println "Success";
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/BuildBiblioFromHeaders.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/BuildBiblioFromHeaders.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/BuildBiblioFromHeaders.groovy	(revision 728)
@@ -0,0 +1,125 @@
+package org.txm.importer.bfm;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.nio.charset.Charset;
+import org.txm.utils.*;
+import org.txm.importer.*;
+
+import javax.xml.stream.*;
+import java.net.URL;
+	
+
+String xslfile = "G:\\Feuilles de style\\teiHeader2ficheBiblio.xsl";
+ApplyXsl a = new ApplyXsl(xslfile);
+
+File srcdirectory = new File("C:\\Documents and Settings\\alavrent\\TXM-SRC\\corptef")
+File outdirectory = new File("C:\\Documents and Settings\\alavrent\\TXM-SRC\\corptef-biblio")
+outdirectory.mkdir();
+assert(srcdirectory.exists())
+assert(outdirectory.exists())
+assert(srcdirectory.isDirectory())
+assert(srcdirectory.canRead())
+assert(srcdirectory.canExecute())
+
+List<File> files = srcdirectory.listFiles();
+
+files = files.findAll{item-> item.getName().endsWith(".xml")}
+
+long bigstart = System.currentTimeMillis()
+for(File infile : files)
+{
+	String outfile = outdirectory.getAbsolutePath()+"/"+infile.getName().substring(0,infile.getName().length()-4)+"-biblio.html";
+	if(infile.canRead())
+	{
+		long start = System.currentTimeMillis()
+		println "Process : "+infile.getName()
+		// String[] params = ["pbval1",1,"pbval2",2];
+		a.process(infile.getAbsolutePath(), outfile); // no parameters
+		// a.process( infile.getAbsolutePath(),outfile,params);
+		println "Done : "+(System.currentTimeMillis()-start)+"ms"
+	}
+}
+println "Total time : "+(System.currentTimeMillis()-bigstart)+"ms"
+/*
+class BuildBiblioFromHeaders {
+	
+	public static boolean process(File dir, File xslfile, File outputfile) {
+		if(!(xslfile.exists() && xslfile.canRead()))
+		{
+			println "xslfile does not exist"
+			return false;
+		}
+		
+		if(!outputfile.getParentFile().exists())
+		{
+			println "outputfile's parent does not exist"
+			return false;
+		}
+		
+		
+		
+		XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		FileOutputStream output = new FileOutputStream(outputfile)
+		XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8");
+		
+		
+		writer.writeStartDocument("UTF-8","1.0");
+		writer.writeStartElement("html");
+		//header
+		writer.writeStartElement("head");
+		//writer.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+		writer.writeStartElement("meta");
+		writer.writeAttribute("http-equiv","Content-Type");
+		writer.writeAttribute("content","text/html");
+		writer.writeAttribute("charset","UTF-8");
+		writer.writeEndElement();//meta
+		writer.writeStartElement("title");
+		writer.writeCharacters("Fiches biblio BFM")
+		writer.writeEndElement();//title
+		writer.writeEndElement();//head
+		
+		writer.writeStartElement("body");
+		
+		String rootDir = dir.getAbsolutePath()+"/";
+		
+		List<File> files = new File(rootDir,"").listFiles();//scan directory split
+		
+		for(File f : files) {
+			
+//			ApplyXsl a = new ApplyXsl(xslfile.getAbsolutePath());
+//			String[] args = ["outputDir",xxx];
+//			a.process(f.getAbsolutePath(), "./HTML",args);
+			
+			
+
+		}
+		
+		
+		writer.writeEndElement();//body
+		writer.close();
+		return true;
+	}
+	
+	
+	
+	public static void main(String[] args)
+	{
+	
+		String rootDir;
+		String htmloutdir;
+		File dir = new File(rootDir);
+		
+		rootDir = "C:\\Documents and Settings\\alavrent\\TXM-SRC\\corptef";
+		File xslfile = new File("G:\\Feuilles de style\\teiHeader2ficheBiblio.xsl")
+		File outputfile = new File("C:\\Documents and Settings\\alavrent\\Mes documents\\bfm - local\\Bases bibliographiques (copie)\\Fiches_biblio_TXM_test.html")
+
+		
+		if(!BuildBiblioFromHeaders.process(xslfile, outputfile, false))
+			println("Error.")
+		else
+			println "Success";
+	}
+}
+*/
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/importer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/importer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/importer.groovy	(revision 728)
@@ -0,0 +1,303 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2016-05-11 08:38:47 +0200 (mer., 11 mai 2016) $
+// $LastChangedRevision: 3211 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.bfm;
+
+import org.txm.importer.*;
+import org.txm.importer.filters.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.FileCopy;
+import org.txm.utils.treetagger.TreeTagger;
+
+import javax.xml.stream.*;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Properties;
+
+import org.txm.*;
+
+import filters.CutHeader.*;
+import filters.ReunitBrokenWords.*;
+import filters.Tokeniser.*;
+import filters.TagSentences.*;
+import filters.FusionHeader.*;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Convert TEI-BFM to TEI-TXM: <br/>
+ * 1- tokenize : manage BFM's &lt;choice> policy (see <a
+ * href="http://bfm.ens-lsh.fr">BFM website</a>).<br/>
+ * 2- launch XML2TEITXM.groovy with no annotation to import. <br/>
+ *
+ * @param dir contains the sources files
+ * @param basename the basename
+ * @return true, if successful
+ * @author mdecorde
+ */
+class importer {
+	
+	public boolean run(File srcDir, File binDir, File txmDir, String basename, Properties metadataXPath)
+	{
+		new File(binDir, "ptokenized").deleteDir();
+		new File(binDir, "ptokenized").mkdir();
+		new File(binDir, "tokenized").deleteDir();
+		new File(binDir, "tokenized").mkdir();
+		new File(binDir, "headers").deleteDir();
+		new File(binDir, "headers").mkdir();
+
+		ArrayList<String> milestones = new ArrayList<String>();
+		milestones.add("lb");
+		milestones.add("pb");
+		milestones.add("milestone");
+
+		List<File> files = txmDir.listFiles();
+		if (files == null || files.size() == 0) return false;
+
+		for (int i = 0 ; i < files.size() ; i++)
+			if (!(files.get(i).getName().endsWith(".xml"))
+			|| files.get(i).getName().equals("import.xml"))
+				files.remove(i--);
+
+		for (File f : files) {
+			//System.out.println("Get metadata from file $xpathfile");
+			HashMap<String, String> metadataValues = new HashMap<String, String>();
+			if (metadataXPath != null) {
+				def xpathprocessor = new XPathResult(f)
+				for (String name : metadataXPath.keySet()) {
+					String value = xpathprocessor.getXpathResponse(metadataXPath.get(name), "N/A");
+					value = value.trim().replace("\n", " ");
+					//println "xpath: "+metadataXPath.get(name)+" >> "+value.trim()
+					metadataValues.put(name, value);
+				}
+				xpathprocessor.close();
+			}
+			
+			//forme is mandatory !!!
+			String forme = "prose";
+			if (metadataValues.containsKey("forme")) {
+				String tmp = metadataValues.get("forme");
+				if (tmp.startsWith("#forme_"))
+					tmp = tmp.substring(7)
+				metadataValues.put("forme", tmp)
+				forme = metadataValues.get("forme");
+			}
+
+			if (metadataValues.containsKey("morphosynt")) {
+				//println "MORPHOSYNT: "+metadataValues.get("morphosynt");
+				if (metadataValues.get("morphosynt").equals("N/A"))
+					metadataValues.put("morphosynt","non vÃ©rifiÃ©");
+				else
+					metadataValues.put("morphosynt","vÃ©rifiÃ©");
+			}
+
+			String txtname = f.getName().substring(0, f.getName().length()-4);
+			String titreId = txtname;
+			if (metadataValues.containsKey("sigle")) {
+				titreId = metadataValues.get("sigle");
+			} else if (metadataValues.containsKey("idbfm")) {
+				titreId = metadataValues.get("idbfm");
+			}
+			metadataValues.put("sigle", titreId);
+			
+			// inject attributes in $f
+			AddAttributeInXml builder = new AddAttributeInXml(f, "text", metadataValues);
+			builder.onlyOneElement();
+			//println "INJECTING $metadataValues"
+			File outfile = new File(txmDir, "copy"+f.getName())
+			
+			if (!builder.process(outfile)) {
+				println "Error while injecting metadata in $f"
+				return false;
+			}
+			builder= null;
+			if (f.delete()) {
+				outfile.renameTo(f)
+			} else {
+				println "ERROR could not delete $f for metadatainjection"
+				return false
+			}
+		}
+
+		files = txmDir.listFiles();
+		if (files == null || files.size() == 0) return false;
+		
+		//return false; // TEMP TEMP TEMP
+		
+		//PREPARE EACH FILE TO BE TOKENIZED
+		println("preparing "+files.size()+" files for the tokenizer");
+
+		for (File f : files) {
+			if (f.isDirectory()) continue;
+			print "."//+f.getAbsolutePath()
+			File srcfile = f;
+			File resultfile = new File(binDir,"ptokenized/"+f.getName());
+
+			def builder2 = new OneTagPerLine(srcfile.toURI().toURL(), milestones);
+			if (!builder2.process(resultfile)) {
+				println "Failed to tokenize file: "+f;
+				resultfile.delete();
+			}
+		}
+		println ""
+
+		//TOKENIZE FILES
+		files = new File(binDir, "ptokenized").listFiles();//scan directory split
+		println("Tokenizing "+files.size()+" files")
+		for (File infile : files) {
+			print "."
+			try {
+				Sequence S = new Sequence();
+				Filter F1 = new CutHeader();
+				Filter F2 = new ReunitBrokenWords();
+				Filter F6 = new Tokeniser(infile);
+				Filter F7 = new TagSentences();
+				Filter F11 = new FusionHeader();
+				S.add(F1);
+				//S.add(F2);
+				S.add(F6);
+				//S.add(F7);
+				S.add(F11);
+
+				File xmlfile = new File(binDir,"tokenized/"+infile.getName());
+
+				S.SetInFileAndOutFile(infile.getAbsolutePath(), xmlfile.getAbsolutePath());
+				S.setEncodages("UTF-8","UTF-8");
+
+				Object[] arguments1 = [new File(binDir,"/headers/"+infile.getName()+"header.xml").getAbsolutePath()];
+				F1.SetUsedParam(arguments1);
+				Object[] arguments2 = [new File(binDir,"/headers/"+infile.getName()+"header.xml").getAbsolutePath(),F1];
+				F11.SetUsedParam(arguments2);
+
+				S.proceed();
+				S.clean();
+			} catch(Exception e) {
+				org.txm.utils.logger.Log.printStackTrace(e);
+				return false;
+			}
+		}
+		println ""
+
+
+		files = new File(binDir,"tokenized").listFiles()
+		println "Validating XML of "+files.size()+" files"
+		for (File f : files) {
+			print "."
+			if (!ValidateXml.test(f)) {
+				System.out.println("XML NOT VALID "+f);
+				new File(binDir, "tokenizerError").mkdir();
+				FileCopy.copy(f,new File(binDir, "tokenizerError/"+f.getName()));
+				f.delete();
+			}
+		}
+		println("");
+
+		//TRANSFORM INTO XML-TEI-TXM
+		files = new File(binDir, "tokenized").listFiles()
+		println("Building xml-tei-txm "+files.size()+ " files")
+		if (files.size() == 0) return false;
+		for (File file : files) {
+			print "."
+			String txmfile = file.getName();
+
+			def correspType = new HashMap<String,String>()
+			def correspRef = new HashMap<String,String>()
+
+			//il faut lister les id de tous les respStmt
+			def respId = [];
+			//fait la correspondance entre le respId et le rapport d'execution de l'outil
+			def applications = new HashMap<String,HashMap<String,String>>();
+			//fait la correspondance entre le respId et les attributs type de la propriÃ©tÃ© ana du w txm
+			//pour construire les ref vers les taxonomies
+			def taxonomiesUtilisees = new HashMap<String,String[]>();
+			//associe un id d'item avec sa description et son URI
+			def itemsURI = new HashMap<String,HashMap<String,String>>();
+			//informations de respStmt
+			//resps (respId <voir ci-dessus>, [description, person, date])
+			def resps = new HashMap<String,String[]>();
+
+			//lance le traitement
+			def builder3 = new Xml2Ana(file);
+			builder3.setCorrespondances(correspRef, correspType);
+			builder3.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)
+			if (!builder3.process(new File(txmDir,txmfile))) {
+				println "Failed to build xml-txm file from file: "+file;
+				return false;
+			}
+		}
+		println("")
+		return true;
+	}
+
+	/**
+	 * for test purpose.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+		long start = System.currentTimeMillis();
+		File dir = new File("/home/mdecorde/xml/qgraal")
+		File srcfile = new File(dir, "qgraal_cm-detoken.xml");
+		File resultfile = new File(dir,"QGRAALFRO-pt1.xml");
+		File xmlfile = new File(dir,"QGRAALFRO-t1.xml");
+
+		def builder2 = new OneTagPerLine(srcfile.toURI().toURL(), []);
+		if (!builder2.process(resultfile)) {
+			println "Failed to tokenize file: "+srcfile;
+			resultfile.delete();
+		}
+
+		try {
+			Sequence S = new Sequence();
+			Filter F1 = new CutHeader();
+			Filter F2 = new ReunitBrokenWords();
+			Filter F6 = new Tokeniser(resultfile);
+			Filter F7 = new TagSentences();
+			Filter F11 = new FusionHeader();
+			S.add(F1);
+			//S.add(F2);
+			S.add(F6);
+			//S.add(F7);
+			//S.add(F11);
+
+			S.SetInFileAndOutFile(resultfile.getAbsolutePath(), xmlfile.getAbsolutePath());
+			S.setEncodages("UTF-8","UTF-8");
+
+			Object[] arguments1 = [new File(dir,"header.xml").getAbsolutePath()];
+			F1.SetUsedParam(arguments1);
+			Object[] arguments2 = [new File(dir,"header.xml").getAbsolutePath(),F1];
+			F11.SetUsedParam(arguments2);
+
+			S.proceed();
+			S.clean();
+		} catch(Exception e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+		}
+		println "time: "+(System.currentTimeMillis()-start)/1000
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/compiler.groovy	(revision 728)
@@ -0,0 +1,996 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+//
+//
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.bfm
+
+import org.txm.Toolbox;
+import org.txm.importer.cwb.*
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+
+import javax.xml.stream.*;
+import java.net.URL;
+import java.io.File;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Produce WTC files from the TEI-TXM files. <br/>
+ * - Read texts metadata with XPath queries <br/>
+ * - Add the following word properties : sic, abbr, orig, lb and pb <br/>
+ * - Keep &lt;front>, &lt;body> and &lt;back> for each text <br/>
+ * - Text enclosed in &lt;q> is tokenized <br/>
+ * 
+ * @author mdecorde
+ *
+ */
+class compiler {
+	/** The debug. */
+	private boolean debug= false;
+
+	/** The annotate_status. */
+	private boolean annotate_status=true;
+
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The dir. */
+	private def dir;
+
+	/** The output. */
+	private def output;
+
+	/** The url. */
+	private def url;
+
+	/** The anahash. */
+	static boolean firstWord = true;
+	static private def anaTypes = [];
+	private HashMap<String,String> anahash = new HashMap<String,String>() ;
+
+	private static SAttributesListener sattrsListener;
+	private static HashMap<String,ArrayList<String>> structs;
+	private static HashMap<String, Integer> structsProf;
+
+	/** The text. */
+	private String text="";
+
+	/** The base. */
+	private String base="";
+
+	/** The project. */
+	private String project="";
+
+	/** The cwb loc. */
+	private String cwbLoc;
+
+	/** The lang. */
+	private String lang ="fr";
+
+	/**
+	 * contains the metadata xpath organize per name
+	 */
+	Properties metadataXPath;
+
+	/**
+	 * initialize.
+	 *
+	 */
+	public compiler(){
+		firstWord = true;
+		anaTypes = [];
+	}
+
+	/**
+	 * initialize the compiler.
+	 *
+	 * @param url the file to process
+	 * @param text the Texte's name
+	 * @param base the base's name
+	 * @param project the Project's name
+	 */
+	public compiler(URL url,String text,String base, String project, Properties metadataXPath)
+	{
+		this.metadataXPath = metadataXPath;
+		this.text = text
+		this.base = base;
+		this.project = project;
+		try {
+			this.url = url;
+			inputData = url.openStream();
+
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+			if (sattrsListener == null)
+				sattrsListener = new SAttributesListener(parser);
+			else
+				sattrsListener.start(parser)
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the path to cwb utils binaries
+	 */
+	public void setCwbPath(String path) {
+		if (!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path;
+	}
+
+	ArrayList<File> orderedFiles;
+	public ArrayList<File> getOrderedTxmFiles() {
+		return orderedFiles;
+	}
+
+	/**
+	 * Sets the lang.
+	 *
+	 * @param lang the new lang
+	 */
+	public void setLang(String lang)
+	{
+		this.lang = lang;
+	}
+
+	/**
+	 * Sets the annotation done.
+	 *
+	 * @param done the new annotation done
+	 */
+	public void setAnnotationDone(boolean done)
+	{
+		this.annotate_status = done;
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File f) {
+		try {
+			output = new OutputStreamWriter(new FileOutputStream(f,f.exists()) , "UTF-8");
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * Go to text.
+	 */
+	private void GoToText()
+	{
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.END_ELEMENT)
+				if (parser.getLocalName().equals("teiHeader"))
+					return;
+		}
+	}
+
+	/**
+	 * Increment.
+	 *
+	 * @param parser the parser
+	 * @param value the value
+	 * @return the java.lang. object
+	 */
+	private def increment(XMLStreamReader parser, int value)
+	{
+		String n=null;
+		for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+			//System.out.println("attr name "+parser.getAttributeLocalName(i));
+			if (parser.getAttributeLocalName(i) == "n") {
+				n = parser.getAttributeValue(i);
+				break;
+			}
+		}
+		//System.out.println("inc n "+n);
+		if (n != null)
+			try {
+				value = Integer.parseInt(n);
+				return value;
+			}
+			catch (Exception e) {return value+1;}
+
+		value = value+1;
+		return value;
+	}
+
+	/**
+	 * Transfom file wtc.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean transfomFileWtc(File wtcFile)
+	{
+		try {
+			if (!createOutput(wtcFile)) return false;
+
+			String headvalue = ""
+			String vAna = "";
+			String vForm = "";
+			String wordid = "";
+			String vHead = "";
+
+			Integer p_id = 0;
+			Integer s_id = 0;
+			Integer q_id = 0;
+			int sp_id = 0;
+			Integer body_id = 0;
+			Integer front_id = 0;
+			Integer back_id = 0;
+			Integer lb_id = 0;
+			Integer pb_id = 0;
+			Integer ab_id = 0;
+			int foreign_id = 0;
+			int name_id = 0;
+
+			boolean captureword = false;
+
+			String vExpan = "";
+			String vCorr = "";
+			String vReg = "";
+			String vOrig = "";
+			String vSic = "";
+			String vAbbr = "";
+			String givenpos = "";
+			String pb_n = "";
+			String foreign_lang = "";
+			String nameType = "";
+			String anaType;
+			//String abType = "";
+			
+			boolean foundtei=false, foundtext=false;
+
+			boolean flaglg = false;
+			int levelq = 0;
+			//boolean flagq = false;
+			boolean flaghead = false;
+			//Added:
+			boolean flagSp = false;
+			boolean flagAuthor = false;
+			boolean flagDate = false;
+			boolean flagWord = false;
+			boolean flagForm = false;
+			boolean flagAna = false;
+
+			boolean flagchoice = false;
+			boolean flagcorr = false;
+			boolean flagsic = false;
+			boolean flagreg = false;
+			boolean flagexpan = false;
+			boolean flagorig = false;
+			boolean flagabbr = false;
+			boolean flagfw = false;
+			//boolean flagSupplied = false;
+			int levelSupplied = 0;
+			//boolean flagSurplus = false;
+			boolean flagForeign = false;
+			//boolean flagName = false;
+
+			this.GoToText();
+			int missingId= 0
+			boolean USEVERSE = false; // switch default reference to verse references
+			String titreId; // the title to use in the reference
+			
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+				switch (event) {
+					case XMLStreamConstants.START_ELEMENT:
+
+						String localname = parser.getLocalName();
+						if (foundtext) sattrsListener.startElement(localname);
+						
+						switch (localname) {
+							case "TEI":
+								foundtei = true;
+								break;
+							case "text":
+								foundtext = true;
+								sattrsListener.startElement(localname);
+								output.write("<text id=\""+text+"\"")
+
+								for (int i = 0; i < parser.getAttributeCount() ; i++) {
+									String name = parser.getAttributeLocalName(i);
+									if ("id" == name || "base" == name || "project" == name) continue;
+									output.write(" "+name+"=\""+parser.getAttributeValue(i)+"\"");
+									
+									if (name == "forme") {
+										USEVERSE = (parser.getAttributeValue(i).contains("vers"))
+									} else if (name == "sigle") {
+										titreId = parser.getAttributeValue(i)
+									}
+								}
+								
+								output.write(" base=\""+base+"\" project=\""+project+"\">\n");
+								captureword=true;
+								break;
+
+							case "div":
+							//output.write("<div type=\""+parser.getAttributeValue(null,"type")+"\">\n");
+								String divType = "NA";
+								String divSubtype = "NA";
+								String divN = "NA";
+								String divId ="NA";
+								for(int i = 0 ; i < parser.getAttributeCount(); i++) {
+									if(parser.getAttributeLocalName(i) == "type") {
+										divType = parser.getAttributeValue(i);
+									} else if(parser.getAttributeLocalName(i) == "subtype") {
+										divSubtype = parser.getAttributeValue(i);
+									} else if(parser.getAttributeLocalName(i) == "n") {
+										divN = parser.getAttributeValue(i);
+									} else if(parser.getAttributeLocalName(i) == "id") {
+										divId = parser.getAttributeValue(i);
+										break;
+									}
+								}
+								output.write("<div type=\""+divType+"\" subtype=\""+divSubtype+"\" n=\""+divN+"\" id=\""+divId+"\">\n");
+								break;
+							case "p":
+								p_id = increment(parser, p_id);
+								output.write("<p n=\""+p_id+"\">\n");
+								break;
+							case "ab":
+								ab_id = increment(parser, ab_id)
+								output.write("<ab n=\""+(ab_id)+"\" type=\""+parser.getAttributeValue(null,"type")+"\" subtype=\""+parser.getAttributeValue(null,"subtype")+"\" rend=\""+parser.getAttributeValue(null,"rend")+"\">\n");
+								break;
+							case "q":
+								q_id = increment(parser, q_id)
+								output.write("<q n=\""+(q_id)+"\">\n");
+							//flagq=true;
+								levelq = levelq + 1;
+								break;
+							case "sp":
+								sp_id = increment(parser, sp_id)
+								output.write("<sp n=\""+(sp_id)+"\">\n");
+								flagSp = true;
+								break;
+							case "front":
+								front_id = increment(parser, front_id)
+								output.write("<front n=\""+front_id+"\">\n");
+								break;
+							case "body":
+								body_id= increment(parser, body_id)
+								output.write("<body n=\""+body_id+"\">\n");
+								break;
+							case "back":
+								back_id = increment(parser, back_id)
+								output.write("<back n=\""+back_id+"\">\n");
+								break;
+							case "lb":
+								lb_id = increment(parser, lb_id)
+								break;
+							case "pb":
+								pb_id = increment(parser, pb_id)
+								for (int i = 0 ; i < parser.getAttributeCount(); i++) {
+									if (parser.getAttributeLocalName(i) == "n") {
+										pb_n = parser.getAttributeValue(i);
+									}
+								}
+								break;
+							case "s":
+								s_id = increment(parser, s_id)
+								output.write("<s n=\""+s_id+"\">\n");
+								break;
+							case "choice":
+								flagchoice = true;
+								break;
+							case "corr":
+								flagcorr = true;
+								vCorr= "";
+								break;
+							case "reg":
+								flagreg = true;
+								vReg= "";
+								break;
+							case "expan":
+								flagexpan = true;
+								vExpan= "";
+								break;
+							case "orig":
+								flagreg = true;
+								vOrig= "";
+								break;
+							case "sic":
+								flagsic = true;
+								vSic= "";
+								break;
+							case "abbr":
+								flagreg = true;
+								vAbbr= "";
+								break;
+							case "foreign":
+								flagForeign = true;
+								for (int i = 0 ; i < parser.getAttributeCount(); i++) {
+									if (parser.getAttributeLocalName(i) == "lang") {
+										lang = parser.getAttributeValue(i);
+										break;
+									}
+								}
+
+								output.write("<foreign n=\""+(foreign_id++)+"\" lang=\""+lang+"\">\n");
+							//vForeign = "";
+								break;
+
+							case "name":
+							//flagName = true;
+								for(int i = 0 ; i < parser.getAttributeCount(); i++)
+									if(parser.getAttributeLocalName(i) == "type")
+								{
+									nameType = parser.getAttributeValue(i);
+									break;
+								}
+
+								output.write("<name n=\""+(name_id++)+"\" type=\""+nameType+"\">\n");
+								break;
+							case "supplied":
+							//flagSupplied = true;
+								levelSupplied = levelSupplied + 1;
+								break;
+
+							case "surplus":
+								flagfw = true;
+								break;
+
+							case "del":
+								flagfw = true;
+								break;
+
+							case "w":
+								givenpos = "";
+								wordid = "w_"+text+"_m"+missingId++
+								for (int i = 0 ; i < parser.getAttributeCount(); i++) {
+									if (parser.getAttributeLocalName(i) == "id") {
+										wordid = parser.getAttributeValue(i);
+									} else if (parser.getAttributeLocalName(i) == "type") {
+										givenpos = parser.getAttributeValue(i);
+									}
+								}
+								if (wordid.startsWith("w")) {
+									if (!wordid.startsWith("w_"))
+										wordid = "w_"+wordid.substring(1)
+								} else {
+									wordid = "w_"+wordid;
+								}
+
+								if (givenpos == null || givenpos == "")
+									givenpos = "NA";
+								vForm = "";
+								anahash.clear(); // remove previous word ana values
+								flagWord = true;
+								break;
+							case "form":
+								flagForm = true;
+								vForm = "";
+								break;
+
+							case "ana":
+								flagAna = true;
+								anaType = parser.getAttributeValue(null, "type")
+								anahash.put(anaType, "");
+								if (firstWord) {
+									anaTypes << anaType;
+								}
+								break;
+						}
+						break;
+
+					case XMLStreamConstants.END_ELEMENT:
+						String localname = parser.getLocalName();
+						if (foundtext) sattrsListener.endElement(localname);
+
+						switch (localname) {
+							case "div":
+								output.write("</div>\n");
+								break;
+							case "text":
+								output.write("</text>\n");
+								captureword=false;
+								break;
+							case "p":
+								output.write("</p>\n");
+								break;
+							case "s":
+								output.write("</s>\n");
+								break;
+							case "ab":
+								output.write("</ab>\n");
+								break;
+							case "q":
+								output.write("</q>\n");
+							//flagq= false;
+								levelq = levelq - 1;
+								break;
+							case "sp":
+								output.write("</sp>\n");
+								flagSp = false;
+								break;
+							case "front":
+								output.write("</front>\n");
+								break;
+							case "body":
+								output.write("</body>\n");
+								break;
+							case "back":
+								output.write("</back>\n");
+								break;
+
+							//							case "fw":
+							//							flagfw = false;
+							//							break;
+
+							case "choice":
+								if(vOrig == "")
+									vOrig="NA";
+								if(vSic == "")
+									vSic="NA";
+								if(vAbbr == "")
+									vAbbr="NA";
+
+								String ref;
+								if(USEVERSE)
+									ref = titreId+", p."+pb_n+", v."+lb_id;
+								else
+									ref = titreId+", p."+pb_n;
+
+								if (flagfw) {
+									// on est hors texte
+								} else {
+									String vFormToWrite = vForm;
+									if (vCorr != "") {
+										vFormToWrite = vCorr;
+									} else if(vReg != "") {
+										vFormToWrite = vReg;
+									} else if(vExpan != "") {
+										vFormToWrite = vExpan
+									}
+									firstWord = false;
+									output.write( vFormToWrite +"\t"+wordid+"\t"+levelq.toString().substring(0,1)+"\t"+flagSp.toString().substring(0,1)+"\t"+pb_n+"\t"+lb_id+"\t"+vOrig+
+											"\t"+vSic+"\t"+vAbbr+"\t"+ref+"\t"+givenpos+"\t"+levelSupplied.toString().substring(0,1)+"\t"+lang+"\t"+nameType);
+									for(String type : anaTypes) {
+										output.write("\t"+anahash.get(type));
+									}
+									output.write("\n")
+								}
+								flagchoice = false;
+								vCorr= "";
+								vSic= "";
+								break;
+							case "corr":
+								flagcorr = false;
+
+								break;
+							case "reg":
+								flagreg = false;
+								vReg = "";
+								break;
+							case "expan":
+								flagexpan = false;
+								vExpan= "";
+								break;
+							case "orig":
+								flagreg = false;
+								vOrig= "";
+								break;
+							case "sic":
+								flagsic = false;
+
+								break;
+							case "abbr":
+								flagreg = false;
+								vAbbr= "";
+								break;
+
+							case "foreign":
+								flagForeign = false;
+								lang = "";
+								output.write("</foreign>\n");
+								break;
+
+							case "name":
+							//flagName = false;
+								nameType = "";
+								output.write("</name>\n");
+								break;
+
+							case "supplied":
+							//flagSupplied = false;
+								levelSupplied = levelSupplied - 1;
+								break;
+
+							case "surplus":
+								flagfw = false;
+								break;
+
+							case "del":
+								flagfw = false;
+								break;
+
+							case "w":
+								if (captureword) {
+									if (flagchoice) {
+
+									} else if(flagfw) {
+
+									} else {
+										if (vOrig == "")
+											vOrig="NA";
+										if(vSic == "")
+											vSic="NA";
+										if(vAbbr == "")
+											vAbbr="NA";
+										if (nameType == "")
+											nameType = "NA";
+										if(lang == "")
+											lang="fr"
+
+										String ref;
+										if(USEVERSE)
+											ref = titreId+", p."+pb_n+", v."+lb_id;
+										else
+											ref = titreId+", p."+pb_n;
+
+										firstWord = false;
+										output.write(vForm.replaceAll("&", "&amp;").replaceAll("<", "&lt;") +"\t"+wordid+"\t"+levelq.toString().substring(0,1)+"\t"+flagSp.toString().substring(0,1)+"\t"+pb_n+"\t"+lb_id+"\t"+vOrig+"\t"+vSic+"\t"+vAbbr+"\t"+ref+"\t"+givenpos+"\t"+levelSupplied.toString().substring(0,1)+"\t"+lang+"\t"+nameType);
+										for(String type : anaTypes) {
+											output.write("\t"+anahash.get(type));
+										}
+										output.write("\n")
+									}
+
+									flagWord = false;
+								}
+								break;
+
+							case "form":
+								flagForm = false;
+								break;
+
+							case "ana":
+								flagAna = false;
+								anahash.put(anaType, vAna);
+								vAna = "";
+								break;
+						}
+						break; // end elem
+
+					case XMLStreamConstants.CHARACTERS:
+						if (flagAna) {
+							vAna += parser.getText().trim()
+						}
+
+						if (flagForm) {
+							vForm += parser.getText().trim();
+							if (flagchoice) {
+								if (flagsic) {
+									vSic += parser.getText().trim();
+								}
+								if (flagorig) {
+									vOrig += parser.getText().trim();
+								}
+								if (flagabbr) {
+									vAbbr += parser.getText().trim();
+								}
+								if (flagcorr) {
+									vCorr += parser.getText().trim();
+								}
+							}
+						}
+				}
+			}
+			//output.write("</txmcorpus>");
+			output.close();
+			parser.close();
+			inputData.close();
+		} catch (Exception ex) {
+			System.out.println("Exception while parsing " + inputData);
+			ex.printStackTrace();
+			return false;
+		}
+
+		return true;
+	}
+
+
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile contains the TEI-TXM files
+	 * @param basename the basename
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, File txmDir, String corpusname, Properties metadataXPath)
+	{
+		sattrsListener = null; // reset SAttribute Listener for each new import
+		this.metadataXPath = metadataXPath;
+		if (cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+
+		if (!new File(cwbLoc).exists()) {
+			println ("CWB path error: "+cwbLoc)
+			return false;
+		}
+		if (!txmDir.exists()) {
+			println ("binary directory does not exists: "+txmDir)
+			return false;
+		}
+
+		File wtcFile = new File(binDir, "wtc/${corpusname}.wtc");
+		new File(binDir, "/wtc/").deleteDir();
+		new File(binDir, "/wtc/").mkdir();
+		new File(binDir, "/data/${corpusname}").deleteDir();
+		new File(binDir, "/data/${corpusname}").mkdir();
+		new File(binDir, "registry/").mkdir();
+
+		String textid = "";
+		int counttext = 0;
+		List<File> files = txmDir.listFiles();
+		
+		// get text siecles to be able to sort with it
+		HashMap<File,Integer[]> filesiecle = new HashMap<File, Integer[]>()
+		for (File f : files) {
+			Integer[] date = new Integer[3];
+			date[0] = date[1] = date[2] = 0;
+			String xpath = "//tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo']/@when"
+			if (metadataXPath.containsKey("datecompo"))
+				xpath = metadataXPath.get("datecompo")
+			String datecompo = XPathResult.getXpathResponse(f, xpath);
+			if (datecompo != null) {
+				//println f.getName()+" > "+datecompo
+				String[] split = datecompo.split("-"); // yyyy-mm-dd
+				if (split.length == 3) {
+					date[0] = Integer.parseInt(split[0]);
+					date[1] = Integer.parseInt(split[1]);
+					date[2] = Integer.parseInt(split[2]);
+				}
+				else if (split.length == 1) { // yyyy
+					date[0] = Integer.parseInt(split[0]);
+					date[1] = 1;
+					date[2] = 1;
+				}				
+			}
+			filesiecle.put(f, date);
+		}
+		//println "date compos: "+filesiecle
+		Collections.sort(files); // Alpha order
+		Collections.sort(files, new Comparator<File>() { // Date order
+					@Override
+					public int compare(File o1, File o2) {
+						Integer[] date1 = filesiecle.get(o1);
+						Integer[] date2 = filesiecle.get(o2);
+						if (date1[0] < date2[0]) {
+							return -1;
+						} else if(date1[0] > date2[0]) {
+							return 1;
+						}
+
+						if (date1[1] < date2[1]) {
+							return -1;
+						} else if(date1[1] > date2[1]) {
+							return 1;
+						}
+
+						if (date1[2] < date2[2]) {
+							return -1;
+						} else if(date1[2] > date2[2]) {
+							return 1;
+						}
+
+						return 0;
+					}
+				});
+			
+		this.orderedFiles = files;
+		println("process "+files.size()+" files ")
+		//println("files: $files")
+		//write txmcorpus
+		if (!createOutput(wtcFile)) {
+			println "Error: could not write wtc file"
+			return false;
+		} else {
+			output.write("<txmcorpus lang=\""+lang+"\">\n");
+			output.close();
+		}
+		
+		//1- Transform into WTC file
+		for (File f : files) {
+			counttext++;
+			if (!f.exists()) {
+				println("file "+f+ " does not exists")
+			} else {
+				print "."
+				String txtname = f.getName().substring(0, f.getName().length()-4);
+				def builder = new compiler(f.toURI().toURL(), txtname, corpusname, "default", metadataXPath);
+				builder.setLang(lang)
+				if (!builder.transfomFileWtc(wtcFile)) {
+					println "Failed to compile "+f
+				}
+				builder.setAnnotationDone(this.annotate_status);
+			}
+		}
+
+		//close txmcorpus
+		if (!createOutput(wtcFile)) {
+			println "Error: could not write wtc file"
+			return false;
+		} else {
+			output.write("</txmcorpus>\n");
+			output.close();
+		}
+		println ""
+		
+		//2- Import into CWB
+		def outDir = binDir.getAbsolutePath();;
+		CwbEncode cwbEn = new CwbEncode();
+		cwbEn.setDebug(debug);
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		cwbMa.setDebug(debug);
+		
+		def pAttrs = ["id","q","sp","pb","lb","orig","sic","abbr","ref","pos","supplied","lang","nametype"];
+		for(String type : anaTypes)
+			pAttrs.add(type.substring(1)); // remove #
+
+		structs = sattrsListener.getStructs();
+		structsProf = sattrsListener.getProfs();
+		if (debug) {
+			println structs
+			println structsProf
+		}
+		// add structures+properties found in sources
+		List<String> sargs = new ArrayList<String>();
+		for (String name : structs.keySet()) {
+			if ( name == "text") continue; // added after
+			//if ( name == "q") continue; // added after
+			//if ( name == "foreign") continue; // added after
+			String concat = name+":"+structsProf.get(name); // append the depth
+			for (String value : structs.get(name)) // append the attributes
+				concat += "+"+value;
+			if ((name == "p" || name == "body" || name == "back" || name == "front") &&
+			!(concat.endsWith("+n") || concat.contains("+n+")))
+				concat += "+n"
+			sargs.add(concat);
+		}
+
+		String textSAttributes = "text:0+id+base+project";
+		if (metadataXPath != null) {
+			for (String meta : metadataXPath.keySet()) // text property declarations from metadata.csv
+				textSAttributes+="+"+meta;
+		}
+		if (!metadataXPath.keySet().contains("sigle"))
+			textSAttributes+="+sigle";
+			
+		sargs.add(textSAttributes)
+		sargs.add("txmcorpus:0+lang")
+		//sargs.add("q:0+n+lang")
+		for (int c = 0 ; c < sargs.size() ; c++) {
+			String sarg = sargs.get(c);
+			if (sarg.startsWith("q:")) {
+				if (! sarg.contains("+n")) sarg +="+n"
+				if (! sarg.contains("+lang")) sarg +="+lang"
+
+				sargs.set(c, sarg);
+			} else if(sarg.startsWith("foreign:")) {
+				if (! sarg.contains("+n")) sarg +="+n"
+				if (! sarg.contains("+lang")) sarg +="+lang"
+				sargs.set(c, sarg);
+			} else if(sarg.startsWith("ab:") || sarg.startsWith("sp:")) {
+				if (! sarg.contains("+n")) sarg +="+n"
+				if (! sarg.contains("+subtype")) sarg +="+subtype"
+				if (! sarg.contains("+rend")) sarg +="+rend"
+				sargs.set(c, sarg);
+			}  else if(sarg.startsWith("div:")) {
+				if (! sarg.contains("+n")) sarg +="+n"
+				if (! sarg.contains("+id")) sarg +="+id"
+				if (! sarg.contains("+type")) sarg +="+type"
+				if (! sarg.contains("+subtype")) sarg +="+subtype"
+				sargs.set(c, sarg);
+			} else if(sarg.startsWith("name:")) {
+				if (! sarg.contains("+n")) sarg +="+n"
+				if (! sarg.contains("+type")) sarg +="+type"
+				sargs.set(c, sarg);
+			}
+		}
+		sargs.sort();
+		
+		String[] sAttributes = sargs;
+		String[] pAttributes = pAttrs;
+		println "P-attributes: "+pAttributes
+		println "S-attributes: "+sargs
+
+		try {
+			String regPath = outDir + "/registry/"+corpusname.toLowerCase(); // CQP wants lower case registry files
+			cwbEn.run(new File(cwbLoc,"cwb-encode").getAbsolutePath(), outDir + "/data/${corpusname}", outDir + "/wtc/"+corpusname+".wtc", regPath,pAttributes, sAttributes);
+			if (!new File(regPath).exists()) {
+				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			cwbMa.run(new File(cwbLoc,"cwb-makeall").getAbsolutePath(), corpusname, outDir + "/registry");
+		} catch (Exception ex) {System.out.println(ex);return false;}
+
+		return true;
+	}
+
+	/**
+	 * show cwb utils messages.
+	 */
+	public void setDebug()
+	{
+		this.debug = true;
+	}
+
+	/**
+	 * test purpose.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("~/xml/bfm");
+		def c = new compiler();
+		c.setDebug();
+		c.setCwbPath("~/TXM/cwb/bin");
+		c.run(dir);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/package.html	(revision 728)
@@ -0,0 +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>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/bfmLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/bfmLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bfm/bfmLoader.groovy	(revision 728)
@@ -0,0 +1,218 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+//
+//
+// $LastChangedDate: 2016-03-01 10:10:58 +0100 (mar., 01 mars 2016) $
+// $LastChangedRevision: 3133 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.bfm;
+
+import javax.xml.stream.XMLStreamReader;
+import org.txm.importer.ApplyXsl2;
+import org.txm.importer.bfm.importer;
+import org.txm.importer.bfm.compiler;
+import org.txm.importer.bfm.pager;
+import org.txm.objects.*;
+import org.txm.*;
+import org.txm.utils.i18n.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.importer.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+import org.txm.utils.*;
+
+String userDir = System.getProperty("user.home");
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+def MONITOR;
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/bfm/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+		//rootDir = userDir+"/xml/TESTS/alceste";  // directory which contains the source file
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File("C:\\Program Files\\treetagger\\models"));//for Windows
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+// BFM XPATH PARAMETERS
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(1, "READ XPATH PARAMETERS")
+File paramDeclarationFile = new File(srcDir, "import.properties");
+Properties metadataXPath = new Properties();
+if (paramDeclarationFile.exists() && paramDeclarationFile.canRead()) {
+	InputStreamReader input = new InputStreamReader(new FileInputStream(paramDeclarationFile) , "UTF-8");
+	metadataXPath.load(input);
+	input.close();
+
+	if (!metadataXPath.containsKey("titre"))
+		println "Warning: parameters property file does not contain the 'titre' metadata"
+	if (!metadataXPath.containsKey("forme"))
+		println "Warning: parameters property file does not contain the 'forme' metadata in param values. The default value is 'prose'"
+}
+else
+	println "No '$paramDeclarationFile' file found"
+
+// Apply XSL
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(1, "APPLYING XSL")
+if (xsl != null && xslParams != null && xsl.trim().length() > 0) {
+	if (ApplyXsl2.processImportSources(new File(xsl), srcDir, new File(binDir, "src"), xslParams))
+	// return; // error during process
+	srcDir = new File(binDir, "src");
+	println ""
+}
+
+// copy txm files
+println "-- VALIDATION - checking XML source files well-formedness"
+List<File> srcfiles = srcDir.listFiles();
+for (File f : srcfiles) { // check XML format, and copy file into binDir
+	if (f.isHidden() || f.getName().equals("import.xml") || f.getName().equals("metadata.csv") || f.getName().endsWith(".properties"))
+		continue;
+	if (ValidateXml.test(f)) {
+		FileCopy.copy(f, new File(txmDir, f.getName()));
+	} else {
+		println "Won't process file "+f;
+	}
+}
+
+if (txmDir.listFiles() == null) {
+	println "No txm file to process"
+	return;
+}
+
+if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- IMPORTER - Reading source files"
+def imp = new importer()
+if (!imp.run(srcDir, binDir, txmDir, basename, metadataXPath)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools - $model model"
+boolean annotate_status = true;
+if (annotate && !(new Annotate().run(binDir, txmDir,model+".par"))) {
+	println "Skipping Annotate process";
+	annotate_status = false;
+}
+
+//if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+//if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+//println "-- ANNOTATE - Running NLP tools - fr model"
+//annotate_status = true;
+//if (annotate && !(new Annotate().run(binDir, txmDir,"fr.par"))) {
+//	println "Skipping Annotate process";
+//	annotate_status = false;
+//}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+if (debug) c.setDebug();
+//c.setCwbPath("~/TXM/cwb/bin");
+c.setLang(lang);
+c.setAnnotationDone(annotate_status)
+if (!c.run(binDir, txmDir, corpusname, metadataXPath)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	println "-- EDITION"
+	if (MONITOR != null) MONITOR.worked(25, "EDITION")
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+	files = c.getOrderedTxmFiles();
+
+	println("Building editions: "+files.size()+" files" );
+	for (File txmFile : files) {
+		print "."
+		String txtname = txmFile.getName();
+		int idx = txtname.lastIndexOf(".");
+		if(idx > 0) txtname = txtname.substring(0, idx);
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);//["'","(","[","{","Â«"];
+
+		Element text = params.addText(corpusElem, txtname, txmFile);
+
+		def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, corpusname, metadataXPath);
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/HTMLIndexer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/HTMLIndexer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/HTMLIndexer.groovy	(revision 728)
@@ -0,0 +1,167 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.importer
+
+import java.util.Collections;
+import java.io.File;
+import org.txm.utils.FileCopy;
+import org.txm.utils.*;
+import java.io.File;
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.io.File;
+import javax.xml.stream.*;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class HTMLIndexer.
+ */
+class HTMLIndexer {
+	
+	/** The idxprefix. */
+	static String idxprefix = "IDX-";
+	
+	/** The index. */
+	HashMap<String, ArrayList<String>> index = new HashMap<String, ArrayList<String>>();
+	
+	/**
+	 * Process html dir.
+	 *
+	 * @param htmlDirectory the html directory
+	 * @return true, if successful
+	 */
+	private boolean processHTMLDir(File htmlDirectory)
+	{
+		ArrayList<File> htmlfiles = DeleteDir.scanDirectory(htmlDirectory, true)
+		Collections.sort(htmlfiles);
+		
+		for(File htmlFile : htmlfiles)//get all indexes
+		{
+			if(htmlFile.getName().endsWith(".html"))
+				processHTMLFile(htmlFile);
+		}
+		
+		ArrayList<String> tokens = new ArrayList<String>(index.keySet());
+		Collections.sort(tokens);
+		
+		//fix doubles like Ã©tiquette&Ã©tiquettes
+		for(int i = 0 ; i < tokens.size() ; i++)
+		{
+			String t1 = tokens.get(i);
+			String t2 = tokens.get(i+1);
+			if(t1.equals(t2.substring(0, t2.length() -1)))
+			{
+				tokens.remove(i+1);
+				index.get(t1).addAll(index.get(t2));
+				//i--;
+			}
+		}
+		
+		tokens = new ArrayList<String>(index.keySet());
+		for(String token : tokens)
+		{
+			println("Token: "+token);
+			println(index.get(token));
+		}
+	}
+	
+	/**
+	 * Process html file.
+	 *
+	 * @param htmlFile the html file
+	 * @return true, if successful
+	 */
+	private boolean processHTMLFile(File htmlFile)
+	{
+		
+		
+		String lasttoken;
+		String page;
+		
+		try
+		{
+			URL url = htmlFile.toURI().toURL();
+			println "process html file "+url;
+			def inputData = url.openStream();
+			def factory = XMLInputFactory.newInstance();
+			//factory.setXMLResolver resolver
+			//factory.setProperty(factory.IS_VALIDATING, false)
+			factory.setProperty("javax.xml.stream.supportDTD", false);
+			factory.setProperty("javax.xml.stream.isReplacingEntityReferences", false);
+			
+			XMLStreamReader parser = factory.createXMLStreamReader(inputData);
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+			{
+				//println "parse"
+				switch (event) 
+				{
+					case XMLStreamConstants.START_ELEMENT:
+						//println "elem "+parser.getLocalName()
+						if(parser.getLocalName() == "div")
+							if(parser.getAttributeValue(null, "id") != null && parser.getAttributeValue(null, "id").startsWith("index-body"))
+								page = parser.getAttributeValue(null, "id")
+								
+						String id = parser.getAttributeValue(null, "id");
+						if(id != null && id.startsWith(idxprefix))
+						{
+							if(!index.containsKey(lasttoken))
+								index.put(lasttoken, new ArrayList<String>());
+							index.get(lasttoken).add(htmlFile.getName()+"#"+id)
+						}
+					
+						break;
+					
+					case XMLStreamConstants.CHARACTERS:
+						String text = parser.getText().trim();
+						if(text.length() > 0)
+						{
+							def texts = text.split(" ");
+							lasttoken = texts[texts.size()-1];
+							if(lasttoken.endsWith("."))
+								lasttoken = lasttoken.substring(0, lasttoken.length() -1)
+						}
+				}
+			}
+			
+		}
+		catch(Exception e){println("File "+htmlFile+"\n"+e); return false;}
+		return true;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File htmlDirectory = new File("/home/mdecorde/xml/html")
+		new HTMLIndexer().processHTMLDir(htmlDirectory);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/XPathResult.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/XPathResult.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/XPathResult.groovy	(revision 728)
@@ -0,0 +1,236 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-04-11 15:30:35 +0200 (mar., 11 avr. 2017) $
+// $LastChangedRevision: 3426 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+import org.txm.importer.graal.PersonalNamespaceContext;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+import org.w3c.dom.*;
+import org.xml.sax.SAXException;
+
+import javax.xml.bind.helpers.DefaultValidationEventHandler;
+import javax.xml.parsers.*;
+import javax.xml.xpath.*;
+import javax.xml.stream.*;
+import java.net.URL;
+import java.util.Iterator;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class XPathResult.
+ *
+ * @authors ayepdieu, mdecorde, vchabanis
+ * 
+ * return the id of a bfm tag <milestone/>
+ */
+public class XPathResult {
+	
+	/** The doc. */
+	Document doc;
+	XPath xpath;
+
+	/**
+	 * Instantiates a new x path result.
+	 *
+	 * @param file the file
+	 */
+	public XPathResult(File xmlfile) {
+		this(xmlfile, true)
+	}
+	
+	/**
+	 * Instantiates a new x path result.
+	 *
+	 * @param file the file
+	 */
+	public XPathResult(File xmlfile, boolean namespaceAware) {
+		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+		factory.setXIncludeAware(true);
+		factory.setNamespaceAware(namespaceAware); // never forget this!
+		
+		DocumentBuilder builder = factory.newDocumentBuilder();
+		doc = builder.parse(xmlfile);
+		
+		XPathFactory xfactory = XPathFactory.newInstance();
+		xpath = xfactory.newXPath();
+		xpath.setNamespaceContext(new PersonalNamespaceContext());
+	}
+	
+	public def getNodes(String query) {
+		def rnodes = [];
+		
+		XPathExpression expr = xpath.compile(query);
+		Object result = expr.evaluate(doc.getDocumentElement(), XPathConstants.NODESET);
+		
+		NodeList nodes = (NodeList) result;
+		for (int i = 0; i < nodes.getLength(); i++) {
+			rnodes.add(nodes.item(i));
+		}
+		return rnodes;
+	}
+	
+	public String getXpathResponse(String query) {
+		XPathExpression expr = xpath.compile(query);
+		Object result = expr.evaluate(doc.getDocumentElement(), XPathConstants.NODESET);
+		
+		NodeList nodes = (NodeList) result;
+		for (int i = 0; i < nodes.getLength(); i++) {
+			//println nodes.item(i)
+			return (nodes.item(i).getNodeValue());
+		}
+	}
+	
+	public ArrayList<String> getXpathResponses(String query) {
+		ArrayList<String> xresult = new ArrayList<String>();
+		XPathExpression expr = xpath.compile(query);
+		Object result = expr.evaluate(doc.getDocumentElement(), XPathConstants.NODESET);
+		
+		NodeList nodes = (NodeList) result;
+		for (int i = 0; i < nodes.getLength(); i++) {
+			//println nodes.item(i)
+			xresult.add((nodes.item(i).getNodeValue()));
+		}
+		return xresult
+	}
+	
+	public String getXpathResponse(String query, String devaultValue) {
+		String rez = getXpathResponse(query);
+		if (rez == null)
+			return devaultValue;
+		return rez;
+	}
+	
+	public void close() {
+		xpath = null;
+		doc = null;
+	}
+
+	/**
+
+	 * OBSOLETE VERSION FOR TXM return the node text content given a XPath
+
+	 * "//path.../.../@attr"
+	 * 
+	 * @param path
+	 * @param attr
+	 *            null or "" return the text of the tag targeted
+	 * @return
+	 */
+	/*
+	 * public String getXpathResponse(String path, String attr) throws
+	 * ParserConfigurationException, SAXException, IOException,
+	 * XPathExpressionException { String Query = path;
+	 * 
+	 * //println "XPath : "+Query; XPathFactory factory =
+	 * XPathFactory.newInstance(); XPath xpath = factory.newXPath();
+	 * xpath.setNamespaceContext(new PersonalNamespaceContext());
+	 * XPathExpression expr = xpath.compile(Query);
+	 * 
+	 * Object result = expr.evaluate(doc, XPathConstants.NODESET); // don't work
+	 * on windows NodeList nodes = (NodeList) result; //println
+	 * "result xpath : "+nodes.getLength(); for(int i = 0 ; i <
+	 * nodes.getLength() ; i++) { //println
+	 * "item : "+nodes.item(i).getLocalName(); if(attr != null &&
+	 * !attr.equals("")) return
+	 * nodes.item(i).getAttributes().getNamedItem(attr).getNodeValue(); else
+	 * return nodes.item(i).getTextContent();
+	 * 
+	 * } return ""; }
+	 */
+	
+	static public String getXpathResponse(File xmlfile, String query, String devaultValue) {
+		String rez = getXpathResponse(xmlfile, query);
+		if (rez == null)
+			return devaultValue;
+		return rez;
+	}
+	
+	static public String getXpathResponse(File xmlfile, String query, String devaultValue, boolean namespaceAware) {
+		String rez = getXpathResponse(xmlfile, query, namespaceAware);
+		if (rez == null)
+			return devaultValue;
+		return rez;
+	}
+
+	/**
+	 * Gets the xpath response.
+	 *
+	 * @param xmlfile the xmlfile
+	 * @param query the query
+	 * @return the xpath response
+	 */
+	static public String getXpathResponse(File xmlfile, String query) {
+		return getXpathResponse(xmlfile, query, true);
+	}
+	
+	/**
+	 * Gets the xpath response.
+	 *
+	 * @param xmlfile the xmlfile
+	 * @param query the query
+	 * @return the xpath response
+	 */
+	static public String getXpathResponse(File xmlfile, String query, boolean namespaceAware) {
+		XPathResult result = new XPathResult(xmlfile);
+		return result.getXpathResponse(query);
+//		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+//		factory.setNamespaceAware(namespaceAware); // never forget this!
+//		
+//		DocumentBuilder builder = factory.newDocumentBuilder();
+//		Document doc = builder.parse(xmlfile);
+//		
+//		XPathFactory xfactory = XPathFactory.newInstance();
+//		XPath xpath = xfactory.newXPath();
+//		xpath.setNamespaceContext(new PersonalNamespaceContext());
+//		
+//		XPathExpression expr = xpath.compile(query);
+//		Object result = expr.evaluate(doc, XPathConstants.NODESET);
+//		
+//		NodeList nodes = (NodeList) result;
+//		println "size: "+result.getLength()
+//		for (int i = 0; i < nodes.getLength(); i++) {
+//			return (nodes.item(i).getNodeValue());
+//		}
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+		println("main of XPathResult")
+		File xmlFile = new File("/home/mdecorde/TXM/corpora/superphenix/txm/SUPERPHENIX/CreysSuper_04_0175.xml")
+		String value = XPathResult.getXpathResponse(xmlFile, "TEI/text/@date");
+		println "value: $value"
+		//value = XPathResult.getXpathResponse(new File("/home/mdecorde/xml/bfm/strasb.xml"), "tei:TEI/tei:teiHeader/tei:revisionDesc/tei:change[contains(.,'Ã©tiquetage morpho')]");
+		//println "value: $value"
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/WriteIdAndNAttributesUltraGeneric.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/WriteIdAndNAttributesUltraGeneric.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/WriteIdAndNAttributesUltraGeneric.groovy	(revision 728)
@@ -0,0 +1,141 @@
+package org.txm.importer
+
+class WriteIdAndNAttributesUltraGeneric extends StaxIdentityParser {
+
+	String baseID = ""
+	def rules = [];
+
+	def idCounters = [:]
+	def nCounters = [:]
+	def parentIds = [:]
+	
+	def elements;
+	def elementShortNames
+	def elementParents
+	def elementResets
+	def elementSelection
+	public WriteIdAndNAttributesUltraGeneric(File xmlFile, def elements, def elementSelection, def elementShortNames, def elementParents, def elementResets) {
+		super(xmlFile)
+		
+		this.elements = elements;
+		this.elementSelection = elementSelection
+		this.elementShortNames = elementShortNames;
+		this.elementParents = elementParents
+		this.elementResets = elementResets
+		
+		this.baseID = xmlFile.getName();
+		if (baseID.indexOf(".") > 0) baseID = baseID.substring(0, baseID.indexOf("."))
+		
+		for (String element : elements) {
+			idCounters[element] = 1;
+			nCounters[element] = 1;
+			parentIds[element] = null;
+		}
+	}
+
+	/**
+	 * Special rule to add @corresp=#ref to its reference element to element which @attribute=@value
+	 */
+	public setReferenceRule(String element, String attribute, String value) {
+		this.rules << [element, attribute, value]
+	}
+	
+	protected void writeAttributes() {
+		if (!idCounters.containsKey(localname) ) {
+			super.writeAttributes();
+			return;
+		} 
+		println "write attributes $localname"
+		boolean idFound = false
+		boolean nFound = false
+		
+		
+		for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+			String name = parser.getAttributeLocalName(i);
+			String value = parser.getAttributeValue(i);
+			
+			println " at $name=$value"
+			
+			//String element_sign = [localname, name, value]
+			
+			if ("id" == name) {
+				if (value == null) {
+					value = getNextID()
+				} 
+				
+				parentIds[localname] = value
+			} else if ("n" == name) {
+				if (value == null) {
+					value = getNextN()
+				} else {
+					nCounters[localname] = Integer.parseInt(value)
+				}
+			}
+			
+			String attrPrefix = parser.getAttributePrefix(i);
+			if (attrPrefix != null && attrPrefix.length() > 0)
+				writer.writeAttribute(attrPrefix+":"+name, value);
+			else
+				writer.writeAttribute(name, value);
+		}
+		
+		if (!idFound) {
+			String value = getNextID()
+			writer.writeAttribute("id", value);
+			parentIds[localname] = value
+		}
+		if (!nFound) {
+			String value = getNextN()
+			writer.writeAttribute("n", value);
+		}
+		
+		
+		idCounters[localname]++
+	}
+	
+	protected void processStartElement() {
+		
+		if (idCounters.containsKey(localname)) {
+			println "Element: "+localname
+			for (String resetElement : elementResets[localname]) {
+				println "reset N: "+resetElement
+				nCounters[resetElement] = 1
+			}
+		}
+		
+		super.processStartElement();
+	}
+	
+	protected String getNextID() {
+		String value = elementShortNames[localname]
+		
+		String parent = elementParents[localname]
+		if (parent != null)
+			value += "_"+parentIds[parent]
+		else
+			value += "_"+baseID
+			
+		value += "-"+idCounters[localname]
+		
+		return value
+	}
+	
+	protected String getNextN() {
+		String value = Integer.toString(nCounters[localname])
+		nCounters[localname]++
+		return value
+	}
+	
+	public static void main(String[] args) {
+		File xmlFile = new File("/home/mdecorde/TEMP/idnmissing.xml")
+		File outFile = new File("/home/mdecorde/TEMP/idnmissing-fix.xml")
+		
+		WriteIdAndNAttributesUltraGeneric wiana = new WriteIdAndNAttributesUltraGeneric(xmlFile, 
+			["milestone", "pb", "cb", "lb"],
+			["milestone":"unit=surface", "pb":null, "cb":null, "lb":null],
+			["milestone":"surf", "pb":"page", "cb":"col", "lb":"line"], 
+			["milestone":null, "pb":null, "cb":"pb", "lb":"cb"],
+			["milestone":[], "pb":["cb", "lb"], "cb":[ "lb"], "lb":[]])
+		println wiana.process(outFile)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/compiler.groovy	(revision 728)
@@ -0,0 +1,684 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.tmx;
+
+import org.txm.importer.cwb.BuildAlignOut;
+import org.txm.importer.cwb.CwbAlign;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.cwb.PatchCwbRegistry;
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.logger.Log;
+import org.txm.utils.treetagger.TreeTagger;
+
+import javax.xml.stream.*;
+
+import java.net.URL;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class compiler.
+ */
+class compiler
+{
+	/** The debug. */
+	private boolean debug= false;
+
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The dir. */
+	private def dir;
+
+	/** The output. */
+	private def output;
+
+	/** The url. */
+	private def url;
+
+	/** The text. */
+	String text="";
+
+	/** The base. */
+	String base="";
+
+	/** The project. */
+	String project="";
+
+	/** The anahash. */
+	static boolean firstWord = true;
+	private def anaTypes = [];
+	public def getAnaTypes() { return anaTypes; }
+	private HashMap<String,String> anahash = new HashMap<String,String>() ;
+
+	private static SAttributesListener sattrsListener;
+	private static HashMap<String,ArrayList<String>> structs;
+	private static HashMap<String, Integer> structsProf;
+	def headerAttrs; // only for TMX
+
+	/** The tuprops. */
+	List<String> tuprops;
+
+	/** The cwb loc. */
+	String cwbLoc;
+
+	/** The corporanames. */
+	List<String> corporanames = new ArrayList<String>();
+
+	/** The align structure. */
+	String alignStructure;
+
+	/** The align attribute. */
+	String alignAttribute;
+
+	/** The do align. */
+	boolean doAlign = false;
+	public static HashMap<String, Integer> segs_id = [:]; // static so the id are uniques
+	public static int seg_id = 0;
+
+	/**
+	 * initialize.
+	 *
+	 */
+	public compiler(){}
+
+	/**
+	 * Instantiates a new compiler.
+	 *
+	 * @param url the url
+	 * @param text the text
+	 * @param base the base
+	 * @param project the project
+	 * @param tuprops the tuprops
+	 */
+	public compiler(URL url, String text, String base, String project, List<String> tuprops)
+	{
+		this.text = text
+		this.base = base;
+		this.project = project;
+		this.tuprops = tuprops;
+		try {
+			this.url = url;
+			inputData = url.openStream();
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+
+			if (sattrsListener == null)
+				sattrsListener = new SAttributesListener(parser);
+			else
+				sattrsListener.start(parser)
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.err.println("IOException while parsing ");
+		}
+	}
+
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the new cwb path
+	 */
+	public void setCwbPath(String path)
+	{
+		if(!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path;
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(String dirPathName, String fileName){
+		try {
+			File f = new File(dirPathName, fileName)
+			//We don't want to concatenate the wtc files
+			output = new OutputStreamWriter(new FileOutputStream(f, f.exists()) , "UTF-8");
+			return true;
+		} catch (Exception e) {
+			System.err.println(e);
+
+			return false;
+		}
+	}
+
+	/**
+	 * Go to text.
+	 */
+	private void GoToText()
+	{
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+		{
+			if(event == XMLStreamConstants.END_ELEMENT)
+				if(parser.getLocalName().equals("teiHeader"))
+					return;
+		}
+	}
+
+	/**
+	 * Transfom file wtc.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	public boolean transfomFileWtc(String dirPathName, String fileName)
+	{
+		createOutput(dirPathName, fileName);
+
+		GoToText();
+		firstWord = true;
+		String headvalue = ""
+		String vAna = "";
+		String vForm = "";
+		String wordid= "";
+		String vHead = "";
+
+		boolean captureword = false;
+		boolean flagForm = false;
+		boolean flagAna = false;
+
+		String anaType;
+		String tuRef;
+		try {
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+			{
+				switch (event) {
+					case XMLStreamConstants.START_ELEMENT:
+						sattrsListener.startElement(parser.getLocalName());
+						switch (parser.getLocalName()) {
+							case "header": // capture header attributes
+								headerAttrs = [:];
+								for ( int i = 0 ; i < parser.getAttributeCount() ; i++) {
+									headerAttrs[parser.getAttributeLocalName(i)] =  parser.getAttributeValue(i);
+								}
+								break;
+							case "text":
+								output.write("<text id=\""+text+"\" base=\""+base+"\"" +
+								" project=\""+project+"\"");
+								def textAttrs = [];
+								for ( int i = 0 ; i < parser.getAttributeCount() ; i++)
+								{
+									String attrname = parser.getAttributeLocalName(i);
+									String attrvalue = parser.getAttributeValue(i);
+									if(attrname != "id")
+										output.write(" "+attrname+"=\""+attrvalue+"\"")
+									textAttrs << attrname
+								}
+								if (headerAttrs != null)
+									for( String key : headerAttrs.keySet()) {
+										if (!textAttrs.contains(key))
+											output.write(" "+key+"=\""+headerAttrs[key]+"\"")
+									}
+								output.write(">\n");
+
+								break;
+
+							case "tu":
+								output.write("<tu");
+								for( String attrname : tuprops)
+								{
+									String attrvalue = parser.getAttributeValue(null, attrname);
+									attrname = attrname.toLowerCase();
+									if(attrvalue == null)
+										output.write(" "+attrname+"=\"N/A\"")
+									else
+										output.write(" "+attrname+"=\""+attrvalue+"\"")
+								}
+								tuRef = text;
+								for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+									output.write(" "+parser.getAttributeLocalName(i)+"=\""+parser.getAttributeValue(i)+"\"")
+									if (parser.getAttributeLocalName(i) == "ref")
+										tuRef = parser.getAttributeValue(i);
+								}
+								output.write(">\n");
+								break;
+							case "seg":
+								output.write("<seg")
+								for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+									output.write(" "+parser.getAttributeLocalName(i)+"=\""+parser.getAttributeValue(i)+"\"")
+								}
+								output.write(">\n")
+								break;
+
+							case "w":
+								for(int i = 0 ; i < parser.getAttributeCount(); i++)
+									if(parser.getAttributeLocalName(i).equals("id"))
+								{
+									wordid = parser.getAttributeValue(i);
+								}
+								break;
+							case "form":
+								flagForm = true;
+								vForm = "";
+								anahash.clear();
+								break;
+
+							case "ana":
+								flagAna = true;
+								anaType = parser.getAttributeValue(null, "type")
+								if (anaType.length() > 0) anaType = anaType.substring(1);
+								//println "anatype $anaType"
+								anahash.put(anaType, "");
+								if (firstWord) {
+									anaTypes << anaType;
+								}
+								break;
+						}
+						break;
+
+					case XMLStreamConstants.END_ELEMENT:
+						sattrsListener.endElement(parser.getLocalName());
+						switch (parser.getLocalName())
+						{
+							case "text":
+								output.write("</text>\n");
+								break;
+
+							case "tu":
+								output.write("</tu>\n")
+								break;
+							case "seg":
+								output.write("</seg>\n")
+								break;
+
+							case "w":
+								firstWord = false;
+								output.write( vForm.replaceAll("&", "&amp;").replaceAll("<", "&lt;")
+									 +"\t"+wordid+"\t"+tuRef);
+								for(String type : anaTypes) {
+									output.write("\t"+anahash.get(type));
+								}
+								output.write("\n")
+
+								vForm = "";
+								break;
+
+							case "form":
+								flagForm = false;
+								break;
+
+							case "ana":
+								anahash.put(anaType, vAna);
+								vAna = "";
+								flagAna = false;
+								break;
+						}
+						break;
+
+					case XMLStreamConstants.CHARACTERS:
+						if(flagForm)
+							vForm += parser.getText().trim();
+						if (flagAna) {
+							vAna += parser.getText().trim()
+						}
+						break;
+				}
+			}
+			output.close();
+			parser.close();
+		}
+		catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}
+		catch (IOException ex) {
+			System.out.println("IOException while parsing " + inputData);
+		}
+
+		return true;
+	}
+
+	/**
+	 * Sets the alignment.
+	 *
+	 * @param structure the structure
+	 * @param attribute the attribute
+	 */
+	public void setAlignment(String structure, String attribute)
+	{
+		doAlign = true;
+		this.alignStructure = structure;
+		this.alignAttribute = attribute;
+	}
+
+	/**
+	 * Gets the tu props.
+	 *
+	 * @param files the files
+	 * @return the tu props
+	 */
+	public List<String> getTuProps(List<File> files)
+	{
+		Set<String> tuprops = new HashSet<String>();
+		for (File f : files) {
+			def inputData = f.toURI().toURL().openStream();
+			def factory = XMLInputFactory.newInstance();
+			def parser = factory.createXMLStreamReader(inputData);
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+			{
+				switch (event) {
+					case XMLStreamConstants.START_ELEMENT:
+						switch (parser.getLocalName()) {
+							case "tu":
+							for ( int i = 0 ; i < parser.getAttributeCount() ; i++) {
+								tuprops.add(parser.getAttributeLocalName(i));
+							}
+							break;
+						}
+				}
+			}
+		}
+		return new ArrayList<String>(tuprops);
+	}
+
+	public static HashMap<String, String> langs;
+	public void setLangs(HashMap<String, String> langs)
+	{
+		this.langs = langs;
+	}
+
+	public static HashMap<Integer, ArrayList<String>> langGroups;
+	public void setLangGroups(HashMap<Integer, ArrayList<String>> groups)
+	{
+		this.langGroups = groups;
+	}
+	
+	public static HashMap<Integer, ArrayList<String>> corpusIDS;
+	public void setCorpusIDS(HashMap<Integer, ArrayList<String>> corpusIDS)
+	{
+		this.corpusIDS = corpusIDS;
+	}
+	
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param basename the basename
+	 * @param textAttributes the text attributes
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, File txmDir, String basename)
+	{
+		sattrsListener = null; // reset SAttribute Listener for each new import
+		String rootDir = binDir.getAbsolutePath();
+		seg_id=1;
+		if (cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+
+		if (!new File(cwbLoc).exists()) {
+			println ("CWB path error: "+cwbLoc)
+			return false;
+		}
+		if (!new File(rootDir).exists()) {
+			println ("binary directory does not exists: "+rootDir)
+			return false;
+		}
+
+		new File(binDir,"/wtc/").deleteDir();
+		new File(binDir,"/wtc/").mkdir();
+		new File(binDir,"/data/").deleteDir();
+		new File(binDir,"/data/").mkdir();
+		new File(binDir,"registry/").mkdir();
+
+		String textid="";
+		int counttext =0;
+		List<File> files = txmDir.listFiles();
+
+		//0- get all tu props
+		//List<String> tuprops = getTuProps(files);
+
+		if (corpusIDS == null || corpusIDS.size() == 0) {
+			corpusIDS = [:];
+			for (int group : langGroups.keySet()) {
+				String lang = langs.get(langGroups.get(group)[0]);
+				if (lang ==null) {
+					println "ERROR: no lang defined for group $group . Aborting."
+				}
+				corpusIDS[group] = (lang+group).toLowerCase();
+			}
+		}
+		println "Using corpus ID: $corpusIDS"
+		
+		String wtcName;
+		for (int group : langGroups.keySet()) {
+			String lang = langs.get(langGroups.get(group)[0]);
+			segs_id.put(group, 0);
+			wtcName = basename+"_"+corpusIDS.get(group);
+			createOutput(rootDir+"/wtc", "${wtcName}.wtc");
+			output.write("<txmcorpus id=\"${wtcName}\" lang=\"$lang\">\n")
+			output.close();
+
+			//create txmDirs
+			new File(rootDir, "txm/"+wtcName.toUpperCase()).mkdir();
+		}
+
+		//1- Transform into WTC file and build a corpus per file
+		Collections.sort(files);
+		def anaTypesPerWtc = [:];
+		def builder = null;
+		for (int group : langGroups.keySet()) {
+			//String lang = langs.get(langGroups.get(group)[0]);
+			wtcName = basename+"_"+corpusIDS.get(group);
+			def filenames = langGroups.get(group);
+			filenames.sort()
+			//println("Process group no $group of files "+filenames)
+			for (String filename : filenames) {
+				File f = new File(txmDir, filename);
+				print "."
+				if (!f.exists()) {
+					println("COMPILER: file "+f+ " does not exists -> stop")
+					return false;
+				}
+
+				filename = filename.substring(0, filename.length()-4);
+				String corpusname = (wtcName).toLowerCase();
+				counttext++;
+
+				String txtname = f.getName();
+				txtname = txtname.substring(0, txtname.lastIndexOf("_"));
+				seg_id = segs_id.get(group);
+				builder = new compiler(f.toURI().toURL(), txtname, basename, "default", tuprops);
+				builder.transfomFileWtc(rootDir+"/wtc",wtcName+".wtc");
+				anaTypesPerWtc[wtcName] = builder.getAnaTypes();
+				segs_id.put(group, seg_id);
+
+				// move xml-txm file
+				File txmCorpusDir = new File(rootDir, "txm/"+wtcName.toUpperCase())
+				f.renameTo(new File(txmCorpusDir, f.getName()));
+			}
+		}
+		println ""
+		
+		for (int group : langGroups.keySet()) {
+			//String lang = langs.get(langGroups.get(group)[0]);
+			createOutput(rootDir+"/wtc", basename+"_"+corpusIDS.get(group)+".wtc");
+			output.write("</txmcorpus>")
+			output.close();
+		}
+
+		if(builder == null) {
+			System.out.println("No TXM files to process Stop import");
+			return false;
+		}
+		//2- Import into CWB
+		def outDir = rootDir;
+		def outDirTxm = rootDir;
+
+		def wtcFiles = [:]
+		for (File wtcfile : new File(rootDir, "wtc").listFiles()) {
+			String corpusname = wtcfile.getName();
+			
+			corpusname = corpusname.substring(0, corpusname.length()-4);
+			def corpusAnaTypes = anaTypesPerWtc[corpusname];
+			
+			CwbEncode cwbEn = new CwbEncode();
+			cwbEn.setDebug(debug);
+			CwbMakeAll cwbMa = new CwbMakeAll();
+			cwbMa.setDebug(debug);
+
+			def pAttrs = ["id", "ref"];
+			for(String type : corpusAnaTypes) {
+				int i = 2;
+				while (pAttrs.contains(type))
+					type = type+(i++);
+				pAttrs.add(type);
+			}
+
+			structs = sattrsListener.getStructs();
+			structsProf = sattrsListener.getProfs();
+			// add structures+properties found in sources
+			List<String> sargs = new ArrayList<String>();
+
+			for (String name : structs.keySet()) {
+				if (name == "header") continue;
+				//if ( name == "text") continue; // added after
+				//if ( name == "q") continue; // added after
+				//if ( name == "foreign") continue; // added after
+				String concat = name+":"+structsProf.get(name); // append the depth
+				for (String value : structs.get(name)) // append the attributes
+					concat += "+"+value;
+				if ((name == "text") &&
+				!(concat.endsWith("+id") || concat.contains("+id+")))
+					concat += "+id"
+				if ((name == "text") &&
+				!(concat.endsWith("+base") || concat.contains("+base+")))
+					concat += "+base"
+				if ((name == "text") &&
+				!(concat.endsWith("+project") || concat.contains("+project+")))
+					concat += "+project"
+				sargs.add(concat);
+			}
+
+			sargs.add("txmcorpus:0+id+lang")
+			sargs.sort();
+
+			String[] sAttributes = sargs;
+			String[] pAttributes = pAttrs;
+			println "P-attributes: "+pAttrs
+			println "S-attributes: "+sargs
+
+			try {
+				wtcFiles[corpusname.toLowerCase()] = outDir + "/wtc/"+wtcfile.getName();
+				String regPath = outDirTxm + "/registry/"+corpusname.toLowerCase()
+				cwbEn.run(new File(cwbLoc,"cwb-encode").getAbsolutePath(), outDirTxm + "/data/"+corpusname.toUpperCase()+"/", outDir + "/wtc/"+wtcfile.getName(), regPath, pAttributes, sAttributes);
+				if (!new File(regPath).exists()) {
+					println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+					return false;
+				}
+				cwbMa.run(new File(cwbLoc,"cwb-makeall").getAbsolutePath(), corpusname.toUpperCase(), outDirTxm + "/registry");
+			} catch (Exception ex) {System.out.println(ex); return false;}
+		}
+
+		// 3- do alignement
+		if (doAlign) {
+			File registryDirectory = new File(rootDir,"registry");
+			def registryFiles = registryDirectory.listFiles();
+			for (File corpusName : registryFiles) {
+				for (File targetName : registryFiles) {
+					if (!corpusName.equals(targetName)) {
+						try {
+							PatchCwbRegistry.patchAlignment(new File(registryDirectory, corpusName.getName()), targetName.getName());
+							
+							File wtcFile1 = new File(wtcFiles[corpusName.getName()]);
+							File wtcFile2 = new File(wtcFiles[targetName.getName()]);
+							File alignOutFile = new File(outDir, "align.out");
+							
+							BuildAlignOut bao = new BuildAlignOut(wtcFile1, wtcFile2);
+							if (!bao.process(alignOutFile, "seg", "id")) {
+								println "Error while creating alignement file of $corpusName. Aborting."
+								return false;
+							}
+							
+							CwbAlign tt = new CwbAlign(cwbLoc);
+							// ./cwb-align-encode -D -r ~/TXM/corpora/tmxtest/registry/ -v out.align
+							tt = new CwbAlign(cwbLoc);
+							tt.setD();
+							tt.setv();
+							tt.setr(new File(rootDir,"registry").getAbsolutePath());
+							tt.cwbalignencode(alignOutFile.getAbsolutePath());
+						} catch (IOException e) {
+							Log.severe("Error while calling TreeTagger: "+e.getLocalizedMessage());
+							return false;
+						}
+					}
+				}
+			}
+		}
+
+		return true;
+	}
+
+	/**
+	 * Gets the corpora names.
+	 *
+	 * @return the corpora names
+	 */
+	public List<String> getCorporaNames()
+	{
+		return corporanames;
+	}
+
+	/**
+	 * Sets the debug.
+	 */
+	public void setDebug()
+	{
+		this.debug = true;
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("~/xml/geo");
+		def c = new compiler();
+		c.setDebug();
+		c.setCwbPath("~/TXM/cwb/bin");
+		c.run(dir,"geo");
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>TMX import module - not yet finished </p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/Tmx2XmlFiles.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/Tmx2XmlFiles.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/Tmx2XmlFiles.groovy	(revision 728)
@@ -0,0 +1,468 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2015-12-17 12:11:39 +0100 (jeu., 17 dÃ©c. 2015) $
+// $LastChangedRevision: 3087 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.tmx;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.stream.*;
+
+import org.txm.objects.Base;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+
+
+import java.net.URL;
+
+import org.txm.objects.*;
+// TODO: Auto-generated Javadoc
+
+/**
+ * Split a TMX file into N xml files, N the number of lang declared in the <tuv> tags.
+ *
+ * @author mdecorde
+ */
+class Tmx2XmlFiles {
+
+	/** The lang. */
+	String lang;
+
+	/** The type. */
+	String type;
+
+	/** The infile. */
+	File infile;
+
+	/** The outdir. */
+	File outdir;
+
+	/** The writers. */
+	ArrayList<XMLStreamWriter> writers;
+	def outputs;
+
+	/** The textslangs. */
+	HashMap<String, String> textslangs;
+	HashMap<Integer, ArrayList<String>> langGroups;
+	Set<String> langs;
+	def header = [:];
+
+	/**
+	 * Instantiates a new tmx2 xml files.
+	 *
+	 * @param base the base
+	 */
+	public Tmx2XmlFiles(HashMap<String, String> textslangs, HashMap<Integer, ArrayList<String>> langGroups)
+	{
+		this.textslangs = textslangs;
+		this.langGroups = langGroups;
+	}
+
+	/**
+	 * Gets the text langs.
+	 *
+	 * @return the langs of the TMX files
+	 */
+	public HashMap<String, String> getTextLangs()
+	{
+		return textslangs;
+	}
+
+	/**
+	 * Gets the original texts
+	 *
+	 * @return the langs of the TMX files
+	 */
+	public HashMap<String, String> getLangGroups()
+	{
+		return langGroups;
+	}
+	
+	def corpusIDS = [:];
+	int noCorpusID = 0;
+	public def getCorpusIDS() {
+		return corpusIDS;
+	}
+
+	int TOTALTUV = 0;
+	public def initWriters(File tmxFile) {
+		println "initialize writers for : $tmxFile"
+		def inputData = infile.toURI().toURL().openStream();
+		def inputfactory = XMLInputFactory.newInstance();
+		XMLStreamReader parser = inputfactory.createXMLStreamReader(inputData);
+
+		TOTALTUV = 0;
+		writers = new ArrayList<XMLStreamWriter>(); // one writer per text
+		outputs = []; // one writer per text
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+		{
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				if (parser.getLocalName() == "tuv") {
+
+					String lang = "fr";
+					for(int i = 0 ; i < parser.getAttributeCount() ; i++)
+						if (parser.getAttributeLocalName(i) == "lang")
+					{
+						lang = (parser.getAttributeValue(i)).toLowerCase()
+						break;
+					}
+
+					buildWriter(TOTALTUV, lang);
+					TOTALTUV++
+				}
+			} else if (event == XMLStreamConstants.END_ELEMENT) {
+				if (parser.getLocalName() == "tu") {
+					break; // stop at the end of the first </tu>
+				}
+			}
+		}
+
+		parser.close()
+		inputData.close();
+	}
+
+	String textname;
+	int noTuv = -1;
+	XMLOutputFactory factory = XMLOutputFactory.newInstance();
+	public def buildWriter(int no, String lang) {
+		//println "build Writer : $no $lang"
+		if (writers.size() <= no) {
+			File outfile = new File(outdir, textname+no+".xml");
+			textLangs.put(outfile.getName(), lang);
+			if (!langGroups.containsKey(no)) langGroups[no] = [];
+			langGroups.get(no).add(outfile.getName());
+
+			FileOutputStream output = new FileOutputStream(outfile)
+			def writer = factory.createXMLStreamWriter(output, "UTF-8")
+			writers.add(no, writer);
+			outputs.add(no, output);
+
+			writer.writeStartDocument("UTF-8","1.0");
+			writer.writeStartElement ("TEI");
+			writer.writeStartElement ("teiHeader");
+			writer.writeEndElement();
+		}
+		return writers.get(no);
+	}
+
+	XMLStreamReader parser;
+	int tuCounter = 0;
+	/**
+	 * start the processing.
+	 *
+	 * @param infile the infile
+	 * @param outdir the outdir
+	 */
+	public void run(File indir, File outdir)
+	{
+		boolean isTuv = false;
+		boolean isProp = false;
+		boolean isTu = false;
+		boolean flagHeader = false;
+		String propvalue;
+		String localname;
+
+		def tuvProps = [:];
+		def tuProps = [:];
+		def corpusTITLES = [];
+		def corpusSUBTITLES = [];
+		def corpusAUTHORS = [];
+		def corpusTRANSLATORS = [];
+		
+		def tuTitles = [];
+		boolean endOfTuProp = false;
+
+		for (File infile : indir.listFiles()) {
+			if (!infile.canRead() || infile.getName().startsWith("import") || infile.getName().endsWith(".css"))  {
+				println "skip file : "+infile;
+				continue;
+			}
+			this.infile = infile;
+			this.outdir = outdir;
+			outdir.mkdir(); // ensure the directory exists
+			// get the filename without ".xml"
+			textname = infile.getName().substring(0,infile.getName().length()-4)+"_";
+			initWriters(infile);
+
+			// create XML reader
+			def inputData = infile.toURI().toURL().openStream();
+			def inputfactory = XMLInputFactory.newInstance();
+			parser = inputfactory.createXMLStreamReader(inputData);
+			def headerProps = [:];
+			noTuv = -1;
+			//getWriter(noTuv);
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+			{
+				switch (event) {
+					case XMLStreamConstants.START_ELEMENT:
+						localname = parser.getLocalName();
+
+						if (localname == "tuv") {
+							noTuv++;
+							
+							if (endOfTuProp) {
+								endOfTuProp = false;
+								//println "localname: "+localname+" $tuTitles "//+parser.getLocation()
+								for(int i = 0 ; i < writers.size() && i < tuTitles.size() ; i++) {
+									writers.get(i).writeAttribute("title", tuTitles.get(i));
+								}
+							}
+							
+							this.writeStartElement("seg");
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) // get the lang attribute of the tuv
+								if (parser.getAttributeLocalName(i) == "lang")
+							{
+								lang = parser.getAttributeValue(i)
+								break;
+							}
+							
+							
+							
+							this.writeAttribute("id", "seg_$tuCounter");
+						} else if (localname == "seg") {
+							// do nothing :)
+						} else if (localname == "prop") {
+							type = null;
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) { // get the type attribute of the prop
+								if (parser.getAttributeLocalName(i) == "type") {
+									type = parser.getAttributeValue(i)
+									break;
+								}
+							}
+							if (type == null) {
+								println "ERROR NO PROP TYPE : "+parser.getLocation()
+							}
+							propvalue= "";
+							isProp= true;
+						} else if (localname == "header") {
+							flagHeader = true;
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) { // get the type attribute of the prop
+								headerProps[parser.getAttributeLocalName(i)] = parser.getAttributeValue(i)
+							}
+						} else {
+
+							if (endOfTuProp && localname == "note") {
+								//println "localname: note $tuTitles "
+								for (int i = 0 ; i < writers.size() ; i++) {
+									writers.get(i).writeAttribute("title", tuTitles.get(i));
+								}
+								endOfTuProp = false;
+							}
+							
+							if (localname == "tmx") continue;
+							if (localname == "tu") {
+								tuTitles = [];
+								isTu= true;
+								noTuv = -1;
+								endOfTuProp = true; // wait for the next start element that is not note or prop
+								tuCounter++;
+							}
+							if (localname == "body")
+								localname = "text"
+							this.writeStartElement(localname); // create text tag in each xml file
+
+							for (int i= 0 ; i < parser.getAttributeCount() ;i++) {
+								this.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+							}
+							if (localname == "text") {
+								println "add header : $headerProps"
+								//for(String key : headerProps.keySet())	this.writeAttribute(key, headerProps[key]);
+
+								for (int i = 0 ; i < writers.size() ; i++) {
+									if (corpusIDS.size() > i)
+										writers.get(i).writeAttribute("corpusid", corpusIDS[i]);
+									if (corpusTITLES.size() > i)
+										writers.get(i).writeAttribute("title", corpusTITLES.get(i));
+									if (corpusSUBTITLES.size() > i)
+										writers.get(i).writeAttribute("subtitle", corpusSUBTITLES.get(i));
+									if (corpusAUTHORS.size() > i)
+										writers.get(i).writeAttribute("author", corpusAUTHORS.get(i));
+									if (corpusTRANSLATORS.size() > i)
+										writers.get(i).writeAttribute("translator", corpusTRANSLATORS.get(i));
+								}
+							}
+						}
+						break;
+
+					case XMLStreamConstants.END_ELEMENT:
+						localname = parser.getLocalName();
+						switch (localname) {
+							case "tuv":
+								lang = null
+								this.writeEndElement();
+								break
+							case "seg":
+								break;
+							case "prop":
+								//println "flagHeader $flagHeader isTu $isTu type $type"
+								if (flagHeader) {
+									if (type == "corpusId") {
+										corpusIDS[noCorpusID++] = propvalue.toLowerCase();
+									} else if (type == "title") {
+										corpusTITLES << propvalue;
+									} else if (type == "subtitle") {
+										corpusSUBTITLES << propvalue;
+									} else if (type == "author") {
+										corpusAUTHORS << propvalue;
+									} else if (type == "translator") {
+										corpusTRANSLATORS << propvalue;
+									}
+								} else if (isTu && type == "tuTitle") {
+									tuTitles << propvalue
+								} else {
+									writeAttribute(type, propvalue); // transform all properties to attributes
+								}
+								isProp= false;
+								break;
+							case "tmx":
+								break;
+							case "tu":
+								isTu= false;
+								endOfTuProp = false;
+								noTuv = -1;
+								this.writeEndElement();
+							case "header":
+								flagHeader = false;
+								break;
+							default:
+								this.writeEndElement();
+								break;
+						}
+						break;
+
+					case XMLStreamConstants.CHARACTERS:
+						if (isProp) {
+							propvalue += parser.getText(); // get prop tag text
+						} else {
+							this.writeCharacters(parser.getText());
+						}
+						break;
+
+				}
+			}
+
+			this.writeEndElement(); // close TEI
+			parser.close();
+			inputData.close();
+
+			for (XMLStreamWriter writer : writers) { // close all xml file output streamS
+				writer.close();
+			}
+			for (def output : outputs) { // close all xml file output streamS
+				output.close();
+			}
+		}
+	}
+
+	/**
+	 * call writeEndElement in all outputstream
+	 * if lang field is set, write only in the stream of the file with the corresponding lang.
+	 */
+	private void writeEndElement()
+	{
+		if (noTuv == -1) {
+			for (def writer : writers) writer.writeEndElement();
+		} else
+			writers.get(noTuv).writeEndElement();
+	}
+
+	/**
+	 * call writeStartElement in all outputstream
+	 * if lang field is set, write only in the stream of the file with the corresponding lang.
+	 *
+	 * @param localname the localname
+	 */
+	private void writeStartElement(String localname)
+	{
+		if (noTuv == -1) {
+			for (def writer : writers) writer.writeStartElement(localname);
+		} else
+			writers.get(noTuv).writeStartElement(localname);
+	}
+
+	/**
+	 * call writeStartDocument in all outputstream
+	 * if lang field is set, write only in the stream of the file with the corresponding lang.
+	 *
+	 * @param text the text
+	 */
+	private void writeCharacters(String text)
+	{
+		//System.err.println "write chars elem : '"+text+"' >> "+lang
+		text = text.trim();
+		if (text.length() > 0) {
+			if (noTuv == -1) {
+				for (def writer : writers) writer.writeCharacters(text);
+			} else
+				writers.get(noTuv).writeCharacters(text);
+		}
+	}
+
+	/**
+	 * call writeAttribute in all outputstream
+	 * if lang field is set, write only in the stream of the file with the corresponding lang.
+	 *
+	 * @param name the name
+	 * @param value the value
+	 */
+	private void writeAttribute(String name, String value)
+	{
+		try {
+			if (noTuv == -1) {
+				for (def writer : writers) writer.writeAttribute(name, value);
+			} else
+				writers.get(noTuv).writeAttribute(name, value);
+		} catch (Exception e) { org.txm.utils.logger.Log.printStackTrace(e); System.err.println("ERROR: "+parser.getLocation());}
+	}
+
+	/**
+	 * Main.
+	 *
+	 * @param args the args
+	 */
+	static main(args)
+	{
+		File infile = new File(System.getProperty("user.home"),"xml/tmx/sample.tmx");
+		File outfile = new File(System.getProperty("user.home"),"TXM/corpora/tmx/");
+		new Tmx2XmlFiles().run(infile, outfile);
+		println "done"
+	}
+}
+
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/pager.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/pager.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/pager.groovy	(revision 728)
@@ -0,0 +1,451 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2012-06-01 17:47:31 +0200 (ven., 01 juin 2012) $
+// $LastChangedRevision: 2185 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.tmx;
+
+import org.txm.importer.*;
+import org.xml.sax.Attributes;
+import org.txm.importer.filters.*;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+// TODO: Auto-generated Javadoc
+/** Build GEO corpus simple edition from a xml-tei. @author mdecorde */
+class pager {
+	List<String> NoSpaceBefore;
+
+	/** The No space after. */
+	List<String> NoSpaceAfter;
+
+	/** The wordcount. */
+	int wordcount = 0;
+
+	/** The pagecount. */
+	int pagecount = 0;
+
+	/** The wordmax. */
+	int wordmax = 0;
+
+	/** The basename. */
+	String basename = "";
+	String txtname = "";
+	File outdir;
+
+	/** The wordid. */
+	String wordid;
+
+	/** The first word. */
+	boolean firstWord = true;
+
+	/** The wordvalue. */
+	String wordvalue;
+
+	/** The interpvalue. */
+	String interpvalue;
+
+	/** The lastword. */
+	String lastword = " ";
+
+	/** The wordtype. */
+	String wordtype;
+
+	/** The flagform. */
+	boolean flagform = false;
+
+	/** The flaginterp. */
+	boolean flaginterp = false;
+
+	/** The url. */
+	private def url;
+
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The writer. */
+	OutputStreamWriter writer;
+
+	/** The multiwriter. */
+	OutputStreamWriter multiwriter = null;
+
+	/** The infile. */
+	File infile;
+
+	/** The outfile. */
+	File outfile;
+
+	/** The pages. */
+	ArrayList<File> pages = new ArrayList<File>();
+
+	/** The idxstart. */
+	ArrayList<String> idxstart = new ArrayList<String>();
+	String editionPage;
+	ArrayList<Integer> splitTUs; // contains the tu ids used to split pages
+	boolean shouldSplit = false;
+	boolean useSplitTUs = false;
+	/**
+	 * Instantiates a new pager.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param NoSpaceBefore the no space before
+	 * @param NoSpaceAfter the no space after
+	 * @param max the max
+	 * @param basename the basename
+	 */
+	pager(File infile, File outdir, String txtname, List<String> NoSpaceBefore,
+	List<String> NoSpaceAfter, int max, String basename, String editionPage, ArrayList<Integer> splitTUs) {
+		this.editionPage = editionPage;
+		this.basename = basename;
+		this.txtname = txtname;
+		this.outdir = outdir;
+		this.wordmax = max;
+		this.NoSpaceBefore = NoSpaceBefore;
+		this.NoSpaceAfter = NoSpaceAfter;
+		this.url = infile.toURI().toURL();
+		this.infile = infile;
+		this.splitTUs = splitTUs;
+		//println "spliting pages with : "+splitTUs
+		useSplitTUs = splitTUs.size() > 0;
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		process();
+	}
+
+	private void closeMultiWriter()
+	{
+		if (multiwriter != null) {
+			if (firstWord) { // there was no words
+				this.idxstart.add("w_0")
+				multiwriter.write("<span id=\"w_0\"/>");
+			}
+			multiwriter.write("</div>\n")
+			multiwriter.write("</body>");
+			multiwriter.write("</html>");
+			multiwriter.close();
+		}
+	}
+
+	/**
+	 * Creates the next output.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean createNextOutput()
+	{
+		wordcount = 0;
+		shouldSplit = false;
+		try {
+			closeMultiWriter();
+			File outfile = new File(outdir, txtname+"_"+(++pagecount)+".html")
+			pages.add(outfile);
+			firstWord = true; // waiting for next word
+
+			multiwriter = new OutputStreamWriter(new FileOutputStream(outfile) , "UTF-8");
+
+			multiwriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+			multiwriter.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"   \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n")
+			multiwriter.write("<html>");
+			multiwriter.write("<head>");
+			multiwriter.write("<title>"+basename.toUpperCase()+" $txtname Edition - Page "+pagecount+"</title>");
+			multiwriter.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"tmx.css\"/>");
+			multiwriter.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\"/>");
+			multiwriter.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+			multiwriter.write("</head>");
+			multiwriter.write("<body>");
+			multiwriter.write("<div class=\"tmx\">\n")
+
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput() {
+		try {
+			return createNextOutput();
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Gets the page files.
+	 *
+	 * @return the page files
+	 */
+	public ArrayList<File> getPageFiles() {
+		return pages;
+	}
+
+	/**
+	 * Gets the idx.
+	 *
+	 * @return the idx
+	 */
+	public ArrayList<String> getIdx() {
+		return idxstart;
+	}
+
+	/**
+	 * Process.
+	 */
+	void process() {
+
+		String vNote = ""
+		String cssNote = "note"
+		boolean flagNote = false;
+		
+		String tuCSS = "tu"
+		
+		int tuCounter = 0;
+		String localname = "";
+		createNextOutput();
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch (localname) {
+						case "text":
+							boolean grey = "true"
+							String title = txtname;
+							String subtitle = "";
+							String author = "";
+							String translator = "";
+							String table = "";
+							table += ("<table>\n");
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+								String name = parser.getAttributeLocalName(i);
+								grey = !grey;
+								if (grey) table += ("<tr  style=\"background-color:lightgrey;\">");
+								else table += ("<tr>");
+								
+								table += ("<td>"+parser.getAttributeLocalName(i)+": </td>");
+								table += ("<td>"+parser.getAttributeValue(i)+"</td>");
+								table += ("</tr>\n");
+								
+								if (name == "title") title = parser.getAttributeValue(i);
+								else if (name == "subtitle") subtitle = parser.getAttributeValue(i);
+								else if (name == "author") author = parser.getAttributeValue(i);
+								else if (name == "translator") translator = parser.getAttributeValue(i);
+							}
+							multiwriter.write("<div class=\"header\">")
+							multiwriter.write("<span class=\"authorStyle\"> "+author+" </span>")
+							multiwriter.write("<span class=\"titleStyle\"> "+title+" </span>")
+							multiwriter.write("<span class=\"subtitleStyle\"> "+subtitle+" </span>")
+							if (translator.size() > 0)
+								multiwriter.write("<span class=\"translatorStyle\"> "+translator+" </span>")
+							multiwriter.write("</div>")
+//							multiwriter.write(table)
+//							multiwriter.write("</table><br/>\n");
+							break;
+						case "head":
+							multiwriter.write("<h2>\n")
+							break;
+						case "graphic":
+							String url = parser.getAttributeValue(null, "url")
+						//println "URL: "+url
+							if (url != null) multiwriter.write("<div><img src=\"$url\"/></div>");
+							break;
+						case "lg":
+						case "p":
+						case "q":
+							String rend = parser.getAttributeValue(null, "rend")
+							if (rend == null) rend = "normal"
+							multiwriter.write("<p class=\"$rend\">\n")
+							break;
+						//case "pb":
+						case editionPage:
+							createNextOutput();
+							wordcount=0;
+							if (parser.getAttributeValue(null,"n") != null) {
+								multiwriter.write("<p style=\"color:red\" align=\"center\">- "+parser.getAttributeValue(null,"n")+" -</p>\n")
+							}
+							break;
+						case "lb":
+						case "br":
+							multiwriter.write("<br/>\n")
+							break;
+						case "tu":
+							tuCounter++;
+							if (useSplitTUs) {
+								if (splitTUs.contains(tuCounter))
+									createNextOutput();
+							} else if (shouldSplit) {
+								createNextOutput();
+								this.splitTUs << tuCounter
+							}
+							String str = "";
+							String title;
+							tuCSS = "tu"
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+								str += " "+parser.getAttributeLocalName(i)+"="+parser.getAttributeValue(i)
+								if (parser.getAttributeLocalName(i).equals("cssClass")) {
+									tuCSS = parser.getAttributeValue(i)
+								} else if (parser.getAttributeLocalName(i).equals("title")) {
+									title = parser.getAttributeValue(i)
+								}
+							}
+							if (title != null) str = title;
+							multiwriter.write("<h5 class=\"${tuCSS}Title\">$str</h5>\n")
+							break;
+						case "note":
+						cssNote = "note"
+						for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+							if (parser.getAttributeLocalName(i) == "cssClass") {
+								cssNote = parser.getAttributeValue(i)
+								break
+							}
+						}
+							vNote = "";
+							flagNote = true;
+							break;
+						case "seg":
+						String css = "seg"
+							if (tuCSS != "tu") css = tuCSS;
+							multiwriter.write("<p class=\"${css}\">\n");
+							break;
+						case "w":
+							wordid = parser.getAttributeValue(null,"id");
+
+							wordcount++;
+							if (wordcount >= wordmax) {
+								//createNextOutput();
+								shouldSplit = true;
+								//println "should split: "+wordcount
+							}
+							
+							if (firstWord) {
+								firstWord = false;
+								this.idxstart.add(wordid);
+							}
+							
+							break;
+
+						case "ana":
+							flaginterp=true;
+							interpvalue+=" "+parser.getAttributeValue(null,"type").substring(1)+":"
+							break;
+
+						case "form":
+							wordvalue="";
+							interpvalue ="";
+							flagform=true;
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+					switch (localname) {
+						case "head":
+							multiwriter.write("</h2>\n")
+							break;
+						case "lg":
+						case "p":
+						case "q":
+							multiwriter.write("</p>\n")
+							break;
+
+						case "seg":
+							multiwriter.write("</p>\n");
+							break;
+						case "note":
+							flagNote = false;
+							multiwriter.write("<div class=\"${cssNote}\">${vNote}</div>")
+							break;
+
+						case "form":
+							flagform = false
+							break;
+						case "ana":
+							flaginterp = false
+							break;
+						case "w":
+
+							int l = lastword.length();
+							String endOfLastWord = "";
+							if (l > 0)
+								endOfLastWord = lastword.subSequence(l-1, l);
+
+							if (interpvalue != null)
+								interpvalue = interpvalue.replace("&", "&amp;").replace("<", "&lt;").replace("\"","&quot;");
+
+							if (NoSpaceBefore.contains(wordvalue) ||
+							NoSpaceAfter.contains(lastword) ||
+							wordvalue.startsWith("-") ||
+							NoSpaceAfter.contains(endOfLastWord)) {
+								multiwriter.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+							} else {
+								multiwriter.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+							}
+						//writer.write(wordvalue.replace("&", "&amp;").replace("\"","&quot;").replace("<", "&lt;")+"</span>");
+							multiwriter.write(wordvalue.replace("&", "&amp;").replace("\"","&quot;").replace("<", "&lt;")+"</span>");
+							lastword=wordvalue;
+							break;
+					}
+					break;
+
+				case XMLStreamConstants.CHARACTERS:
+					if (flagform)
+						if (parser.getText().length() > 0)
+							wordvalue+=(parser.getText());
+					if (flaginterp)
+						if (parser.getText().length() > 0)
+							interpvalue+=(parser.getText());
+					if (flagNote)
+						if (parser.getText().length() > 0)
+							vNote+=(parser.getText());
+					break;
+			}
+		}
+		//writer.write("</body>");
+		//writer.write("</html>");
+		//writer.close();
+		closeMultiWriter();
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/tmxLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/tmxLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/tmxLoader.groovy	(revision 728)
@@ -0,0 +1,194 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2015-08-31 13:45:22 +0200 (lun., 31 aoÃ»t 2015) $
+// $LastChangedRevision: 3028 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.tmx;
+import org.txm.searchengine.cqp.corpus.MainCorpus;
+
+import java.io.File;
+import org.txm.importer.tmx.importer;
+import org.txm.importer.tmx.compiler;
+import org.txm.importer.tmx.pager;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+def MONITOR;
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/tmx/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang;
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);;
+int wordsPerPage = params.getWordsPerPage("default")
+String page_element = params.getPageElement("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir, "txm");
+txmDir.deleteDir();
+txmDir.mkdirs();
+HashMap<String, String> textLangs = [:];
+def langGroups = [:];
+
+println "-- IMPORTER - Reading source files"
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "IMPORTER - Reading source files");
+def imp = new importer()
+imp.run(srcDir, binDir, txmDir, textLangs, langGroups);
+def corpusIDS = imp.getCorpusIDS()
+println "-- ANNOTATE - Running NLP tools"
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE - Running NLP tools");
+new Annotate().run(binDir, txmDir, textLangs);
+
+println "langs : "+textLangs
+println "texts : "+langGroups
+
+println "-- COMPILING - Building Search Engine indexes"
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "COMPILING - Building Search Engine indexes")
+def c = new compiler();
+if (debug) c.setDebug();
+c.setAlignment("seg","id");
+c.setLangs(textLangs);
+c.setCorpusIDS(corpusIDS);
+c.setLangGroups(langGroups);
+if (!c.run(binDir, txmDir, basename)) {
+	println "Compiler failed"
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+new File(binDir,"HTML").deleteDir();
+new File(binDir,"HTML").mkdirs();
+if (build_edition) {
+	
+	println "-- EDITION - Building edition"
+	if (MONITOR != null) MONITOR.worked(20, "EDITION - Building edition")
+	
+	List<File> filelist = new File(binDir,"txm").listFiles();
+	def second = 0
+
+	def splitTUsPerText = [:]
+
+	for (File txmCorpusDir : txmDir.listFiles()) {
+		def txmFiles = txmCorpusDir.listFiles();
+		txmFiles.sort() // same order
+		//println "paging txmFiles : "+txmFiles
+
+		File outdir = new File(binDir,"/HTML/"+txmCorpusDir.getName()+"/default/");
+		outdir.mkdirs();
+		//println "processing pages of corpus "+txmCorpusDir.getName()
+
+		Element paraCorpusElem = corpusElem.cloneNode(true);
+		paraCorpusElem.setAttribute("name", txmCorpusDir.getName());
+
+		for (File srcfile : txmFiles) {
+			print "."
+			String txtname = srcfile.getName();
+			int i = txtname.lastIndexOf("_");
+			if(i > 0) txtname = txtname.substring(0, i);
+
+			//println ""+srcfile.getName()+" -> "+splitTUsPerText[txtname]
+			def splitTUs = splitTUsPerText[txtname];
+			if (splitTUs == null) {
+				splitTUs = [];
+				splitTUsPerText[txtname] = splitTUs;
+			}
+
+			String l = textLangs.get(srcfile.getName())
+			if (l == null) l = "fr";
+			List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(l);
+			List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(l);
+
+			Element text = params.addText(paraCorpusElem, txtname, srcfile);
+
+			def ed = new pager(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, page_element,splitTUs);
+			Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+			for (i = 0 ; i < ed.getPageFiles().size();) {
+				File f = ed.getPageFiles().get(i);
+				String wordid = ed.getIdx().get(i);
+				params.addPage(edition, ""+(++i), wordid);
+			}
+		}
+
+		params.corporaElement.appendChild(paraCorpusElem);
+
+		File cssfile = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "css/tmx.css")
+		if (cssfile.exists()) {
+			FileCopy.copy(cssfile, new File(outdir, "tmx.css"));
+		}
+		File stylefile = new File(binDir, "style.css")
+		if (stylefile.exists()) {
+			FileCopy.copy(stylefile, new File(outdir, "style.css"));
+		}
+		println ""
+	}
+}
+params.corporaElement.removeChild(corpusElem);
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/importer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/importer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/tmx/importer.groovy	(revision 728)
@@ -0,0 +1,149 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2016-12-01 17:48:31 +0100 (jeu., 01 dÃ©c. 2016) $
+// $LastChangedRevision: 3351 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.tmx
+
+
+
+//import filters.TabulatedToXml.*;
+import org.txm.importer.*;
+import org.txm.importer.filters.*;
+import org.txm.scripts.*;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.FileCopy;
+//import org.txm.utils.treetagger.TreeTagger;
+import javax.xml.stream.*;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintStream;
+import java.net.URL;
+
+import filters.CutHeader.*;
+import filters.Tokeniser.*;
+import filters.FusionHeader.*;
+import filters.TagSentences.*;
+
+import org.txm.objects.*;
+import org.txm.*;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class importer.
+ */
+class importer {
+	static Tmx2XmlFiles converter;
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param base the base
+	 */
+	public static void run(File srcDir, File binDir, File txmDir, HashMap<String, String> langs, HashMap<String, String> originalTexts)
+	{
+		String filename = binDir.getName();
+		
+		new File(binDir, "ptokenized").deleteDir();
+		new File(binDir, "ptokenized").mkdir();
+		new File(binDir, "tokenized").deleteDir();
+		new File(binDir, "tokenized").mkdir();
+		new File(binDir, "split").deleteDir();
+		new File(binDir, "split").mkdir();
+
+		//build xml files
+		if(srcDir.listFiles() == null || srcDir.listFiles().size() == 0)
+			return;
+		//File tmxfile = rootDirFile.listFiles()[0]
+		converter = new Tmx2XmlFiles(langs, originalTexts) // fill langs and originalTexts dictionaries
+		converter.run(srcDir, new File(binDir, "split"));
+			
+		List<File> srcfiles = new File(binDir, "split").listFiles();
+		println("Tokenizing "+srcfiles.size()+" files")
+		for (File f : srcfiles) {
+			
+			String lang = langs.get(f.getName());
+						
+			print "."
+			File outfile = new File(binDir,"tokenized/"+f.getName());
+			SimpleTokenizerXml tokenizer = new SimpleTokenizerXml(f, outfile, lang)
+			tokenizer.setOutSideTextTagsAndKeepContent("note");
+			if (!tokenizer.process()) {
+				println("Failed to tokenize $f")
+				outfile.delete()
+			}
+		}
+		println ""
+		
+		// copy css file if any
+		File cssSrc = new File(srcDir, "style.css");
+		File cssBin = new File(binDir, "style.css");
+		if (cssSrc.exists()) {
+			FileCopy.copy(cssSrc, cssBin)
+		}
+		
+		//TRANSFORM INTO XML-TEI-TXM
+		List<File> tokenfiles = new File(binDir,"tokenized").listFiles()
+		println("Building xml-tei-txm ("+tokenfiles.size()+" files)")
+		for (File f : tokenfiles) {
+			print "."
+			String txmfile = f.getName();
+			
+			def correspType = new HashMap<String, String>()
+			def correspRef = new HashMap<String, String>()
+			//il faut lister les id de tous les respStmt
+			def respId = [];
+			//fait la correspondance entre le respId et le rapport d'execution de l'outil
+			def applications = new HashMap<String, HashMap<String,String>>();	
+			//fait la correspondance entre le respId et les attributs type de la propriÃ©tÃ© ana du w txm
+			//pour construire les ref vers les taxonomies
+			def taxonomiesUtilisees = new HashMap<String, String[]>();
+			//associe un id d'item avec sa description et son URI
+			def itemsURI = new HashMap<String, HashMap<String, String>>();
+			//informations de respStmt
+			//resps (respId <voir ci-dessus>, [description, person, date])
+			def resps = new HashMap<String, String[]>();
+			//lance le traitement
+			String wordprefix = "w_";
+			def builder = new Xml2Ana(f);
+			builder.setCorrespondances(correspRef, correspType);
+			builder.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)
+			//builder.setAddTEIHeader();
+			if (!builder.process(new File(txmDir, txmfile))) {
+				println("Failed to process file "+f)
+				new File(srcDir, txmfile).delete()
+			}
+		}
+		println ""
+	}
+	
+	public def getCorpusIDS() {
+		converter.getCorpusIDS()
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/HasElement.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/HasElement.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/HasElement.groovy	(revision 728)
@@ -0,0 +1,67 @@
+package org.txm.importer
+
+import javax.xml.stream.*;
+import java.net.URL;
+
+/**
+ * Check if a file contains a tag
+ * @author mdecorde
+ *
+ */
+class HasElement {
+
+	HashSet<String> localnames = new HashSet<String>();
+	File xmlfile;
+	XMLStreamReader parser;
+	HashMap<String, Boolean> elements = [:];
+
+	public HasElement(File xmlfile, String localname) {
+		localnames << localname;
+		this.xmlfile = xmlfile;
+		elements[localname] = false;
+
+		init();
+	}
+
+	private void init() {
+		try {
+			
+//			println "xmlfile: "+xmlfile
+//			println "xmlfile exists: "+xmlfile.exists()
+//			println "uri: "+ xmlfile.toURI()
+//			println "url: "+ xmlfile.toURI().toURL()
+//			
+			def inputData = xmlfile.toURI().toURL().openStream();
+			def inputFactory = XMLInputFactory.newInstance();
+			parser = inputFactory.createXMLStreamReader(inputData);
+		} catch (Exception ex) {
+			System.out.println("IOException while parsing: "+ex);
+			ex.printStackTrace();
+		}
+	}
+
+	public boolean process() {
+		if (parser == null) return false;
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				String localname = parser.getLocalName();
+				if (localnames.contains(localname)) {
+					parser.close();
+					return true;
+				}
+			}
+		}
+		parser.close();
+	}
+	
+	public static void main(String[] args) {
+		File dir = new File("/home/mdecorde/xml/lamoplat")
+		println dir.listFiles()
+		for (File xmlfile : dir.listFiles()) {
+			if (!xmlfile.getName().endsWith(".xml")) continue
+			//println xmlfile
+			println "$xmlfile: "+ new HasElement(xmlfile, "text").process();
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RemoveTag.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RemoveTag.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RemoveTag.groovy	(revision 728)
@@ -0,0 +1,120 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.importer;
+
+import javax.xml.parsers.*
+import javax.xml.transform.*
+import javax.xml.transform.dom.DOMSource
+import javax.xml.transform.stream.StreamResult
+import javax.xml.xpath.*
+
+import org.txm.metadatas.*
+import org.txm.utils.*
+import org.w3c.dom.Document
+import org.w3c.dom.Element
+
+/**
+ * Removes tags of XML file given a XPath. 
+ * @author mdecorde
+ *
+ */
+public class RemoveTag {
+	File outfile;
+	
+	/** The doc. */
+	Document doc;
+	
+	/**
+	 *
+	 * @param xmlfile the xmlfile
+	 * @param outfile the outfile
+	 * @param xpath the XPath
+	 */
+	public RemoveTag(File xmlfile, File outfile, String xpath)
+	{
+		this.outfile = outfile;
+		DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+		domFactory.setNamespaceAware(true); // never forget this!
+		domFactory.setXIncludeAware(true);
+		DocumentBuilder builder = domFactory.newDocumentBuilder();
+		doc = builder.parse(xmlfile);
+		
+		def expr = XPathFactory.newInstance().newXPath().compile(xpath);
+		def nodes = expr.evaluate(doc, XPathConstants.NODESET);
+		
+		if (nodes != null)
+		for(def node : nodes)
+		{
+			//println "Remove node "+node
+			Element elem = (Element)node;
+			elem.getParentNode().removeChild(node);
+		}
+		save()
+		doc = null
+	}
+	
+	/**
+	 * Save.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean save()
+	{
+		try {
+			// CrÃ©ation de la source DOM
+			Source source = new DOMSource(doc);
+			
+			// CrÃ©ation du fichier de sortie
+				Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8")); 
+			Result resultat = new StreamResult(writer);
+			
+			// Configuration du transformer
+			TransformerFactory fabrique = new net.sf.saxon.TransformerFactoryImpl();
+			Transformer transformer = fabrique.newTransformer();
+			transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+			transformer.setOutputProperty(OutputKeys.INDENT, "yes"); 
+			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); 
+			
+			// Transformation
+			transformer.transform(source, resultat);
+			writer.close();
+			return true;
+		} catch (Exception e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return false;
+		}
+	}
+	
+	public static void main(String[] args) {
+		RemoveTag rt = new RemoveTag(
+			new File("/home/mdecorde/TXM/corpora/graal/import.xml"),
+			new File("/home/mdecorde/TXM/corpora/graal/import-o.xml"),
+			"//edition[@name='courante']"
+			)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/factiva/FactivaMail2Alceste.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/factiva/FactivaMail2Alceste.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/factiva/FactivaMail2Alceste.groovy	(revision 728)
@@ -0,0 +1,153 @@
+package org.txm.importer.factiva
+/**
+ * 
+ * This is a Groovy port of the converter made by Pierre Ratinaud
+ * #Author: Pierre Ratinaud
+ * #Copyright (c) 2012 Pierre Ratinaud
+ * #Lisense: GNU/GPL
+ * 
+ * @author mdecorde
+ *
+ */
+class FactivaMail2Alceste {
+
+	def txtdir;
+	def fileout;
+	def encodage_in = 'UTF-8'
+	def encodage_out = 'UTF-8'
+
+	def metadata = ["BY":"Author",
+		"ART":"CaptionsDescriptionGraphics",
+		"CLM":"Column",
+		"CT":"Contact",
+		"CY":"Copyright",
+		"CX":"Correction",
+		"CR":"Credit",
+		"ED":"Edition",
+		"HD":"Headline",
+		"LA":"Language",
+		"PG":"Page",
+		"PD":"PublicationDate",
+		"ET":"PublicationTime",
+		"RBBCM":"ReutersCodes",
+		"SE":"Section",
+		"SC":"SourceCode",
+		"GC":"SourceGroupCode",
+		"NGC":"SourceGroupName",
+		"SN":"SourceName",
+		"TD":"TextFollowingLeadParagraphs",
+		"VOL":"Volume",
+		"WC":"WordCount"]
+
+	def starts = ["LP":"LeadParagraph"]
+
+	def ends = ["RF":"Reference",
+		"AN":"AccessionNumber",
+		"PUB":"PublisherName",
+		"RE":"RegionCodeDescriptor",
+		"IPC":"InformationProviderCodes",
+		"IN":"IndustryCodeDescriptor",
+		"CO":"CompanyCodeName",
+		"IPD":"InformationProviderDescriptors",
+		"NS":"SubjectCodeDescriptor",
+		"DJIC":"DowJonesCodes",
+		"DJID":"DowJonesDescriptors"]
+	
+	def ucis = []
+	def writeTextOK = false
+	def nextLineIsAnEndMetadataValue = false
+	def endsKey
+
+	FactivaMail2Alceste(File txtdir, File fileout, String encodage_in, String encodage_out) {
+		this.txtdir = txtdir;
+		this.fileout = fileout;
+		this.encodage_in = encodage_in;
+		this.encodage_out = encodage_out;
+	}
+
+	def toAttribute(String str) {
+		return str.replaceAll(' ','')
+//		.replaceAll('\'','').replaceAll(":", "").replaceAll("\\|", "").replaceAll("_","")
+//			 .replaceAll('Â´','').replaceAll('â€™','').replaceAll('-','').toLowerCase().replaceAll("/", "").replaceAll("\\.", "")
+//			 .replaceAll(" \"", "")
+	}
+	
+	def writeText(String str) {
+		if (writeTextOK) ucis[-1][1] += str+"\n";
+	}
+	
+	/**
+	 * parser de texte pour factiva
+	 * @return liste d'uci (= list header + corp)
+	 */
+	def parsetxt(txt) {
+		def lines = txt.split("\n") // met le texte dans une liste de lignes
+		def keepline = false
+		
+		for (String line : lines)  { //pour chaque ligne du texte...
+			if (line.length() == 0) continue;
+			
+			if (nextLineIsAnEndMetadataValue) {
+				//println "DATA: "+line
+				ucis[-1][0] += " *${endsKey}_"+toAttribute(line)
+				nextLineIsAnEndMetadataValue = false;
+			} else if (line.startsWith('---------------------------------------------------------------')) {// si la ligne commence avec...
+				ucis << ['****',''] // nouveau texte
+			} else {
+				int idxSpace = line.indexOf(" ")
+				if (0 <= idxSpace && idxSpace < 5) { // maybe a key
+					String head = line.substring(0, idxSpace)
+					String tail = line.substring(idxSpace+1)
+					String tail2;
+					int idxTab = tail.indexOf("\t");
+
+					if (metadata.containsKey(head)) {
+						if (idxTab == 0 && tail.length() > 0) {
+							ucis[-1][0] += " *${head}_"+toAttribute(tail.substring(1));
+						} else if (tail.length() > 0){
+							writeText(line)
+						}
+					} else if (ends.containsKey(head)) {
+						if (idxTab == 0) nextLineIsAnEndMetadataValue = true;
+						endsKey = head;
+						writeTextOK = false; // stop writing text
+					} else if (starts.containsKey(head)) {
+						writeTextOK = true; // start writing text
+					} else {
+						writeText(line)
+					}
+				} else {
+					writeText(line)
+				}
+			}
+		}
+		return ucis
+	}
+
+	def doparse() {
+		def files = txtdir.listFiles() // liste des fichiers dans txtdir
+		fileout.withWriter("UTF-8") { writer ->
+			for (File f : files) { // pour chaque fichier en entree...
+				if (f.isHidden() || !f.canRead() || !f.isFile() || f.getName() == "import.xml") {
+					continue;
+				}
+				println "parse file: $f"
+				for (def uci : parsetxt(f.getText("UTF-8"))) { // on rÃ©cupÃ¨re les lignes
+					writer.println uci[0] // header
+					writer.println uci[1] // corp
+				}
+			}
+		}
+		return true;
+	}
+
+	public static void main(String[] args) {
+		File  txtdir = new File("/home/mdecorde/xml/factivatxt/") // repertoire des textes
+		File fileout = new File("/home/mdecorde/xml/factivatxt/montagne-out.txt")
+		String encodage_in = "UTF-8"
+		String encodage_out = "UTF-8"
+		def converter = new FactivaMail2Alceste(txtdir, fileout, encodage_in, encodage_out);
+
+		println 'Done: '+converter.doparse()
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/factiva/factivaLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/factiva/factivaLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/factiva/factivaLoader.groovy	(revision 728)
@@ -0,0 +1,288 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2012-02-13 11:42:24 +0100 (lun., 13 fÃ©vr. 2012) $
+// $LastChangedRevision: 2126 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.factiva;
+
+import javax.xml.stream.XMLStreamReader;
+import org.txm.importer.ApplyXsl2;
+import org.txm.importer.Factiva2XmlTxm;
+import org.txm.importer.ValidateXml;
+import org.txm.importer.xml.importer;
+import org.txm.importer.xml.compiler;
+import org.txm.importer.xml.pager;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+import org.txm.metadatas.*;
+import javax.xml.stream.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true;
+	params = new BaseParameters(new File(userDir, "xml/TESTS/factiva/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+String page_element = params.getPageElement("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+File propertyFile = new File(rootDir, "import.properties")//default
+Properties props = new Properties();
+String[] metadatasToKeep;
+
+String textSortAttribute = null;
+String paginationElement = null;
+boolean normalizeMetadata = false;
+String ignoredElements = null;
+boolean stopIfMalformed = false;
+
+println "Trying to read import properties file: "+propertyFile
+if (propertyFile.exists() && propertyFile.canRead()) {
+	InputStreamReader input = new InputStreamReader(new FileInputStream(propertyFile) , "UTF-8");
+	props.load(input);
+	input.close();
+	if(props.getProperty("sortmetadata") != null)
+		textSortAttribute = props.get("sortmetadata").toString();
+	if(props.getProperty("editionpage") != null)
+		paginationElement = props.get("editionpage").toString();
+	if(props.getProperty("normalizemetadata") != null)
+		normalizeMetadata = Boolean.parseBoolean(props.get("normalizemetadata").toString());
+	if(props.getProperty("ignoredelements") != null)
+		ignoredElements = props.get("ignoredelements").toString();
+	if(props.getProperty("stopIfMalformed") != null)
+		stopIfMalformed = Boolean.parseBoolean(props.get("stopIfMalformed").toString());
+
+	println "import properties: "
+	println " sort metadata: "+textSortAttribute
+	println " edition page tag: "+paginationElement
+	println " normalize attributes: "+normalizeMetadata
+	println " ignored elements: "+ignoredElements
+	println " stop if a XML source is malformed: "+stopIfMalformed
+}
+
+File allmetadatasfile = new File(srcDir, "metadata.csv");
+
+// Apply Factiva2XMLTXM
+println "Factiva -> xml/w"
+File factivaOutDir = new File(binDir, "src")
+new Factiva2XmlTxm().run(srcDir, factivaOutDir.getAbsolutePath());
+if (factivaOutDir.listFiles() == null) {
+	println "Error: no file to process"
+	return;
+}
+srcDir = factivaOutDir;
+
+// Apply XSL
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(1, "APPLYING XSL")
+if (xsl != null && xslParams != null && xsl.trim().length() > 0) {
+	if (ApplyXsl2.processImportSources(new File(xsl), srcDir, new File(binDir, "src"), xslParams))
+	// return; // error during process
+	srcDir = new File(binDir, "src");
+	println ""
+}
+
+// copy txm files
+List<File> srcfiles = srcDir.listFiles();
+for (int i = 0 ; i < srcfiles.size() ; i++) {// check XML format, and copy file into binDir
+	File f = srcfiles.get(i)
+	if (f.getName().equals("import.xml") || f.getName().equals("metadata.csv") || f.getName().endsWith(".properties")) {
+		srcfiles.remove(i);
+		i--;
+		continue;
+	}
+	if (ValidateXml.test(f)) {
+		FileCopy.copy(f, new File(txmDir, f.getName()));
+	} else {
+		println "Won't process file "+f;
+	}
+}
+
+if (txmDir.listFiles() == null) {
+	println "No txm file to process"
+	return;
+}
+
+//get metadata values from CSV
+Metadatas metadatas; // text metadata
+println "Trying to read metadata from: "+allmetadatasfile
+if (allmetadatasfile.exists()) {
+	File copy = new File(binDir, "metadata.csv")
+	if (!FileCopy.copy(allmetadatasfile, copy)) {
+		println "Error: could not create a copy of metadata file "+allmetadatasfile.getAbsoluteFile();
+		return;
+	}
+	metadatas = new Metadatas(copy, Toolbox.getParam(Toolbox.METADATA_ENCODING), Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR), Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
+} else
+	println "no metadata file: "+allmetadatasfile
+
+if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- IMPORTER - Reading source files"
+def imp = new importer();
+imp.doValidation(true) // change this to not validate xml
+imp.doTokenize(true) // change this, to not tokenize xml
+imp.setStopIfMalformed(stopIfMalformed);
+if (!imp.run( srcDir, binDir, txmDir, basename, null, lang)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null) MONITOR.worked(20, "INJECTING METADATA")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- INJECTING METADATA - from csv file: "+allmetadatasfile
+if (metadatas != null) {
+	println("Injecting metadata: "+metadatas.getHeadersList()+" in texts of directory "+new File(binDir,"txm"))
+	for (File infile : txmDir.listFiles()) {
+		print "."
+		File outfile = File.createTempFile("temp", ".xml", infile.getParentFile());
+		if (!metadatas.injectMetadatasInXml(infile, outfile, "text", null)) {
+			outfile.delete();
+		} else {
+			if (!(infile.delete() && outfile.renameTo(infile))) println "Warning can't rename file "+outfile+" to "+infile
+			if (!infile.exists()) {
+				println "Error: could not replace $infile by $outfile"
+				return false;
+			}
+		}
+	}
+	println ""
+}
+
+List<File> files = txmDir.listFiles()
+if (files == null || files.size() == 0) {
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(10, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools"
+boolean annotationSuccess = false;
+if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
+	annotationSuccess = true;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+if(debug) c.setDebug();
+//c.setCwbPath("~/TXM/cwb/bin");
+c.setOptions(textSortAttribute, normalizeMetadata);
+c.setAnnotationSuccess(annotationSuccess)
+c.setLang(lang);
+if (!c.run(binDir, txmDir, corpusname, null, srcfiles, metadatas)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	println "-- EDITION - Building edition"
+	if (MONITOR != null) MONITOR.worked(20, "EDITION")
+	
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+	List<File> filelist = txmDir.listFiles();
+	Collections.sort(filelist);
+	def second = 0
+
+	println "Paginating texts: "
+
+	for (File txmFile : filelist) {
+		print "."
+		String txtname = txmFile.getName();
+		int i = txtname.lastIndexOf(".");
+		if(i > 0) txtname = txtname.substring(0, i);
+
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+		Element text = params.addText(corpusElem, txtname, txmFile);
+
+		def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, page_element);
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/factiva/factivamailLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/factiva/factivamailLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/factiva/factivamailLoader.groovy	(revision 728)
@@ -0,0 +1,159 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2012-07-20 17:33:42 +0200 (ven., 20 juil. 2012) $
+// $LastChangedRevision: 2221 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.factiva;
+
+import org.txm.importer.alceste.importer;
+import org.txm.importer.alceste.compiler;
+import org.txm.importer.xml.pager_old;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception) {
+	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/factivatxt/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+// TRANSFORM FACTIVA TO ALCESTE HERE
+File newSrcDir = new File(binDir, "src")
+newSrcDir.mkdir();
+File alcesteFile = new File(newSrcDir, srcDir.getName()+".txt");
+FactivaMail2Alceste converter = new FactivaMail2Alceste(srcDir, alcesteFile, "UTF-8", "UTF-8")
+if (!converter.doparse()) {
+	println "Failed to convert files in $srcDir to one Alceste file"
+	return false;
+}
+if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- IMPORTER - Reading source files"
+
+if (!(new importer().run(newSrcDir, binDir, txmDir, encoding, basename, lang))) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools"
+boolean annotationSuccess = false;
+if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
+	annotationSuccess = true;
+}
+
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+c.setAnnotationSuccess(annotationSuccess)
+if (debug) c.setDebug();
+c.setLang(lang);
+if (!c.run(binDir, txmDir, corpusname)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null) MONITOR.worked(20, "EDITION")
+println "-- EDITION - Building edition"
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+File outdir = new File(binDir,"/HTML/$corpusname/default/");
+outdir.mkdirs();
+List<File> filelist = txmDir.listFiles();
+Collections.sort(filelist);
+def second = 0
+
+println "Paginating texts: "
+for (File srcfile : filelist) {
+	print "."
+	String txtname = srcfile.getName();
+	int i = txtname.lastIndexOf(".");
+	if(i > 0) txtname = txtname.substring(0, i);
+	
+	List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+	List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+	Element text = params.addText(params.corpora.get(corpusname), txtname, srcfile);
+		
+	def ed = new pager_old(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, 500, basename, "pb");
+	Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+	
+	for (i = 0 ; i < ed.getPageFiles().size();) {
+		File f = ed.getPageFiles().get(i);
+		String wordid = ed.getIdx().get(i);
+		params.addPage(edition, ""+(++i), wordid);
+	}
+}
+
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/factiva/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/factiva/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/factiva/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Factiva XML and mail import modules</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/factiva/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/pager.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/pager.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/pager.groovy	(revision 728)
@@ -0,0 +1,374 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.bvh;
+
+import org.txm.importer.*;
+import org.xml.sax.Attributes;
+import org.txm.importer.filters.*;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Build BVH texts simple edition from the TEI-TXM files. <br/>
+ * The result is similar to the edition of the BVH site. <br/>
+ * Segment edition by page at &lt;pb> tags. <br/>
+ * 
+ * @author mdecorde
+ * 
+ */
+class pager {
+	private List<String> NoSpaceBefore;
+	
+	/** The No space after. */
+	private List<String> NoSpaceAfter;
+
+	/** The wordcount. */
+	private int wordcount = 0;
+	
+	/** The pagecount. */
+	private int pagecount = 0;
+	
+	/** The wordmax. */
+	private int wordmax = 0;
+
+	/** The wordid. */
+	private String wordid;
+	
+	/** The first word. */
+	private boolean firstWord = true;
+	
+	/** The wordvalue. */
+	private String wordvalue;
+	
+	/** The interpvalue. */
+	private String interpvalue;
+	
+	/** The lastword. */
+	private String lastword = " ";
+	
+	/** The wordtype. */
+	private String wordtype;
+	
+	/** The flagform. */
+	private boolean flagform = false;
+	
+	/** The flaginterp. */
+	private boolean flaginterp = false;
+	
+	/** The url. */
+	private def url;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The writer. */
+	private OutputStreamWriter writer;
+	
+	/** The multiwriter. */
+	private OutputStreamWriter multiwriter = null;
+	
+	/** The infile. */
+	private File infile;
+	
+	/** The outfile. */
+	private File outfile;
+	
+	/** The pages. */
+	private ArrayList<File> pages = new ArrayList<File>();
+	
+	/** The idxstart. */
+	private ArrayList<String> idxstart = new ArrayList<String>();
+
+	/**
+	 * Instantiates a new pager.
+	 *
+	 * @param infile the file to convert
+	 * @param outfile the result file
+	 * @param NoSpaceBefore the punctuation marks that don't have a space before
+	 * @param NoSpaceAfter the punctuation marks that don't have a space after
+	 * @param max the max number of word per page
+	 */
+	pager(File infile, File outfile, List<String> NoSpaceBefore,
+			List<String> NoSpaceAfter, int max) {
+		this.wordmax = max;
+		this.NoSpaceBefore = NoSpaceBefore;
+		this.NoSpaceAfter = NoSpaceAfter;
+		this.url = infile.toURI().toURL();
+		this.infile = infile;
+
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		createOutput(outfile);
+		process();
+	}
+
+	/**
+	 * Creates the next output.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean createNextOutput()
+	{
+		try {
+			if(multiwriter != null)
+			{
+				multiwriter.write("</body>");
+				multiwriter.write("</html>");
+				multiwriter.close();
+			}
+			pagecount++;
+			File f = new File(outfile.getParent()+"/multi/",outfile.getName().substring(0,outfile.getName().length()-5)+"_"+pagecount+".html");
+			pages.add(f);
+			idxstart.add(wordid)
+			multiwriter = new OutputStreamWriter(new FileOutputStream(f) , "UTF-8");
+			
+			multiwriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+			multiwriter.write("<html>");
+			multiwriter.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+			multiwriter.write("<head>");
+			multiwriter.write("<title>BVH Edition - Page "+pagecount+"</title>");
+			multiwriter.write("</head>");
+			multiwriter.write("<body>");
+			
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile) {
+		try {
+			this.outfile = outfile;
+
+			writer = new OutputStreamWriter(new FileOutputStream(outfile),
+					"UTF-8");
+			createNextOutput();
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Gets the page files.
+	 *
+	 * @return the geenrated edition page path
+	 */
+	public ArrayList<File> getPageFiles() {
+		return pages;
+	}
+
+	/**
+	 * Gets the idx.
+	 *
+	 * @return the id of the edition
+	 */
+	public ArrayList<String> getIdx() {
+		return idxstart;
+	}
+
+	/**
+	 * start processing.
+	 */
+	void process()
+	{
+		String localname = "";
+		
+		writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+		writer.write("<html>");
+		writer.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+		writer.write("<head>");
+		writer.write("<title>BVH edition</title>");
+		writer.write("</head>");
+		writer.write("<body>");
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			
+			
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{
+						case "head":
+							writer.write("<h2>\n")
+							multiwriter.write("<h2>\n")
+							break;
+						
+						case "lg":
+							writer.write("<p>\n")
+							multiwriter.write("<p>\n")
+							break;
+							
+						case "pb":
+							createNextOutput();
+						break;
+						
+						case "l":
+							writer.write("<br/>\n")
+							multiwriter.write("<br/>\n")
+							break;
+						
+						case "p":
+						case "q":
+							writer.write("<p>\n")
+							multiwriter.write("<p>\n")
+							break;
+						
+						case "w":
+							wordid=parser.getAttributeValue(null,"id");
+							if(firstWord)
+							{
+								firstWord=false;
+								this.idxstart.set(0,wordid);
+							}
+							wordcount++;
+							if(wordcount >= wordmax)
+							{
+								
+								wordcount=0;
+							}
+							break;
+						
+						case "ana":
+							flaginterp=true;
+							interpvalue+=" "+parser.getAttributeValue(null,"type").substring(1)+":"
+							break;
+						
+						case "form":
+							wordvalue="";
+							interpvalue ="";
+							flagform=true;
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{
+						case "head":
+							writer.write("</h2>\n")
+							multiwriter.write("</h2>\n")
+							break;
+						
+						case "lg":
+							writer.write("</p>\n")
+							multiwriter.write("</p>\n")
+							break;
+						
+						case "lb":
+							writer.write("<br/>\n")
+							multiwriter.write("<br/>\n")
+							break;
+												
+						case "p":
+						case "q":
+							writer.write("</p>\n")
+							multiwriter.write("</p>\n")
+							break;
+							
+						case "form":
+							flagform = false
+						
+							break;
+						
+						case "ana":
+							flaginterp = false
+							break;
+						
+						case "w":
+							int l = lastword.length();
+							String endOfLastWord = "";
+							if(l > 0)
+								endOfLastWord = lastword.subSequence(l-1, l);
+							
+							if(interpvalue != null)
+								interpvalue = interpvalue.replace("\"","&quot;");
+							
+							if(NoSpaceBefore.contains(wordvalue) || 
+									NoSpaceAfter.contains(lastword) || 
+									wordvalue.startsWith("-") || 
+									NoSpaceAfter.contains(endOfLastWord))
+							{
+								writer.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+								multiwriter.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+							}
+							else
+							{
+								writer.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+								multiwriter.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+							}
+							writer.write(wordvalue.replace("<", "&lt;")+"</span>");
+							multiwriter.write(wordvalue.replace("<", "&lt;")+"</span>");
+							lastword=wordvalue;
+							break;
+					}
+					break;
+				
+				case XMLStreamConstants.CHARACTERS:
+					if(flagform)
+						if(parser.getText().length() > 0)
+							wordvalue+=(parser.getText());
+					if(flaginterp)
+						if(parser.getText().length() > 0)
+							interpvalue+=(parser.getText());
+					break;
+			}
+		}	
+		writer.write("</body>");
+		writer.write("</html>");
+		writer.close();
+		multiwriter.write("</body>");
+		multiwriter.write("</html>");
+		multiwriter.close();
+		inputData.close();
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/importer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/importer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/importer.groovy	(revision 728)
@@ -0,0 +1,173 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.bvh
+
+import org.txm.importer.*;
+import org.txm.importer.filters.*;
+import org.txm.scripts.*;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+import javax.xml.stream.*;
+import java.io.File;
+import java.net.URL;
+
+import org.txm.*;
+
+import filters.CutHeader.*;
+import filters.Tokeniser.*;
+import filters.FusionHeader.*;
+import filters.TagSentences.TagSentences;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Convert TEI-BVH to TEI-TXM <br/>
+ * 1- tokenize<br/>
+ * 2- launch XML2TEITXM with no annotation import <br/>.
+ *
+ * @author mdecorde
+ */
+class importer {
+	
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile contains the source files
+	 */
+	public static void run(File rootDirFile, String basename)
+	{
+		
+		File fullfile;
+		String rootDir =rootDirFile.getAbsolutePath();
+		
+		ArrayList<String> milestones = new ArrayList<String>();//the tags who you want them to stay milestones
+		milestones.add("tagUsage");
+		milestones.add("pb");
+		milestones.add("lb");
+		
+		File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+		binDir.deleteDir();
+		binDir.mkdir();
+		new File(binDir,"ptokenized").deleteDir();
+		new File(binDir,"ptokenized").mkdir();
+		new File(binDir,"tokenized").deleteDir();
+		new File(binDir,"tokenized").mkdir();
+		new File(binDir,"txm").deleteDir();
+		new File(binDir,"txm").mkdir();
+		
+		//PREPARE EACH SPLITED FILE TO BE TOKENIZED
+		List<File> srcfiles = rootDirFile.listFiles();
+		println("Preparing Tokenizing "+srcfiles.size()+" files")
+		for(File f : srcfiles)
+		{
+			print "."
+			File srcfile = f;
+			File resultfile = new File(binDir,"ptokenized/"+f.getName());
+			//println("prepare tokenizer file : "+srcfile+" to : "+resultfile );
+			def builder = new OneTagPerLine(srcfile.toURL(), milestones);
+			builder.process(resultfile);
+		}
+		println ""
+		rootDir = binDir.getAbsolutePath();
+		
+		//TOKENIZE FILES
+		List<File> ptokenfiles = new File(rootDir,"ptokenized").listFiles()	
+		println("Tokenizing "+ptokenfiles.size()+" files")
+		for(File f : ptokenfiles)
+		{
+			print "."
+			Sequence S = new Sequence();
+			Filter F1 = new CutHeader();
+			Filter F6 = new Tokeniser(f);
+			Filter F7 = new TagSentences();
+			Filter F11 = new FusionHeader();
+			S.add(F1);
+			S.add(F6);
+			S.add(F7);
+			S.add(F11);
+			File infile = new File(rootDir+"/ptokenized",f.getName());
+			File xmlfile = new File(rootDir+"/tokenized",f.getName());
+			File headerfile = new File(rootDir+"/ptokenized/",f.getName()+"header.xml");
+			
+			S.SetInFileAndOutFile(infile.getPath(), xmlfile.getPath());
+			S.setEncodages("UTF-8","UTF-8");
+			Object[] arguments1 = [headerfile.getAbsolutePath()];
+			F1.SetUsedParam(arguments1);
+			Object[] arguments2 = [headerfile.getAbsolutePath(),F1];
+			F11.SetUsedParam(arguments2);
+			S.proceed();
+			
+			S.clean();
+			//headerfile.delete();//remove the prepared file to clean
+		}
+		println ""
+		
+		//TRANSFORM INTO XML-TEI-TXM
+		List<File> tokenfiles = new File(rootDir,"tokenized").listFiles()	
+		println("Building "+tokenfiles.size()+" xml-tei-txm files")
+		for(File f : tokenfiles)
+		{
+			print "."
+			File file = f; 
+			String txmfile = f.getName();
+			
+			def correspType = new HashMap<String,String>()
+			def correspRef = new HashMap<String,String>()
+			//il faut lister les id de tous les respStmt
+			def respId = [];
+			//fait la correspondance entre le respId et le rapport d'execution de l'outil
+			def applications = new HashMap<String,HashMap<String,String>>();	
+			//fait la correspondance entre le respId et les attributs type de la propriÃ©tÃ© ana du w txm
+					//pour construire les ref vers les taxonomies
+			def taxonomiesUtilisees = new HashMap<String,String[]>();
+			//associe un id d'item avec sa description et son URI
+			def itemsURI = new HashMap<String,HashMap<String,String>>();
+			//informations de respStmt
+			//resps (respId <voir ci-dessus>, [description, person, date])
+			def resps = new HashMap<String,String[]>();
+			//lance le traitement
+			String wordprefix = "w_";
+			def builder = new Xml2Ana(file);
+			builder.setCorrespondances(correspRef, correspType);
+			builder.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)
+			builder.process(new File(new File(rootDir,"txm"),txmfile));
+		}
+		println ""
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		new importer().run(new File("~/xml/bvh"));
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/bvhLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/bvhLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/bvhLoader.groovy	(revision 728)
@@ -0,0 +1,145 @@
+/**
+ * Main.
+ *
+ * @param args the args
+ */
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-09-16 14:31:48 +0200 (Mon, 16 Sep 2013) $
+// $LastChangedRevision: 2535 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.bvh;
+
+import java.io.File;
+import org.txm.importer.bvh.importer;
+import org.txm.importer.bvh.compiler;
+import org.txm.importer.bvh.annotate;
+import org.txm.importer.bvh.pager;
+import org.txm.objects.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Run.
+ *
+ * @return the java.lang. object
+ * @author mdecorde
+ */
+
+String userDir = System.getProperty("user.home");
+String lang;
+String encoding;
+String rootDir;
+String model;
+String basename;
+try{rootDir = rootDirBinding;lang=langBinding;encoding=encodingBinding;model=modelBinding;basename=basenameBinding}
+catch(Exception)
+{	println "DEV MODE";//exception means we debug
+	if(!org.txm.Toolbox.isInitialized())
+	{
+		rootDir = userDir+"/xml/bvh/";
+		lang="fr";
+		encoding= "UTF-8";// not used by bvh
+		model="rgaqcj"; //not used by bvh
+		basename="bvh"
+		Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File(userDir,"TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"),"TXM"));
+	}
+}
+
+println "IMPORTER"
+new importer().run(new File(rootDir), basename);
+
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+rootDir = binDir.getAbsolutePath();
+
+println "ANNOTATE - fr "
+new Annotate().run(new File(rootDir),"fr.par");//the files in ./txm
+
+println "ANNOTATE - afr"
+def secondannotator = new Annotate()
+secondannotator.run(new File(rootDir),"afr.par");//the files in ./txm
+
+println "--COMPILING"
+File dir = new File(rootDir);
+def c = new compiler();
+c.setDebug();
+//c.setCwbPath("~/TXM/cwb/bin");
+c.setLang(lang);
+if (!c.run(dir)) {
+	println "Compiler failed"
+	return;
+}
+
+//move registry file to cwb registry dir
+File registryfile = new File(rootDir+"/registry",basename);
+if(registryfile.exists())
+	org.txm.utils.FileCopy.copy(registryfile,new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"registry/"+basename))
+
+Workspace w = org.txm.Toolbox.workspace;
+Project p = w.getProject("default")
+p.removeBase(basename)
+Base b = p.addBase(basename);
+b.addDirectory(new File(rootDir,"txm"));
+b.setAttribute("lang", lang)
+b.propagateAttribute("lang")
+
+println "-- EDITION"
+new File(rootDir+"/HTML/").deleteDir()
+new File(rootDir+"/HTML/").mkdir();
+new File(rootDir+"/HTML/default/").mkdir();
+files = new File(rootDir,"txm").listFiles();
+
+for(Text text : b.getTexts())
+{
+	File srcfile = text.getSource();
+	File resultfile = new File(rootDir+"/HTML",srcfile.getName().substring(0,srcfile.getName().length()-4)+".html");
+	List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+	List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+	println("Building edition  : "+srcfile+" to : "+resultfile );
+	
+	def ed = new pager(srcfile,resultfile, NoSpaceBefore, NoSpaceAfter,600);
+	Edition editionweb = text.addEdition("default","html",resultfile);
+
+	for(int i = 0 ; i < ed.getPageFiles().size();i++)
+	{
+		File f = ed.getPageFiles().get(i);
+		String idx = ed.getIdx().get(i);
+		editionweb.addPage(f,idx);
+	}
+	
+//	Edition editionbp = text.addEdition("onepage","html",resultfile);
+//	editionbp.addPage(resultfile,ed.getIdx().get(0));
+}
+
+w.save();
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/annotate.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/annotate.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/annotate.groovy	(revision 728)
@@ -0,0 +1,181 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-11-08 13:38:06 +0100 (Fri, 08 Nov 2013) $
+// $LastChangedRevision: 2569 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.bvh
+
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+import org.txm.Toolbox;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Add treetagger annotations with a choosen model file<br/>
+ * If a word is unknowned the lemma will be set to the word's form <br/>
+ * Use the &lt;s> tags to build sentences boundaries <br/>.
+ *
+ * @author mdecorde
+ */
+class annotate {
+	/*
+	 * @param rootDirFile contains the TEI-TXM files
+	 * @param model the name of the model file to use
+	 * @param pos the name of the pos attribute added
+	 * @param lemme the name of the lemme attribute added
+	 */
+	
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param model the model
+	 * @param pos the pos
+	 * @param lemme the lemme
+	 */
+	public static void run(File rootDirFile,String model,String pos, String lemme)
+	{
+		String rootDir = rootDirFile.getAbsolutePath()+"/";
+		
+		//cleaning
+		new File(rootDir,"annotations").deleteDir();
+		new File(rootDir,"annotations").mkdir();
+		new File(rootDir,"treetagger").deleteDir();
+		new File(rootDir,"treetagger").mkdir();
+		new File(rootDir,"ptreetagger").deleteDir();
+		new File(rootDir,"ptreetagger").mkdir();
+		
+		ArrayList<String> milestones = new ArrayList<String>();//the tags who you want them to stay milestones
+		milestones.add("tagUsage");
+		milestones.add("pb");
+		milestones.add("lb");
+		
+		List<File> files = new File(rootDir,"txm").listFiles()	
+		//BUILD TT FILE READY TO BE TAGGED
+		for(File f : files)
+		{
+			File srcfile = f;
+			File resultfile = new File(rootDir+"ptreetagger/",f.getName()+".tt");
+			new BuildTTSrc(srcfile.toURL()).process(resultfile)
+		}
+		
+		//APPLY TREETAGGER
+		files = new File(rootDir,"ptreetagger").listFiles()	
+		for(File f : files)
+		{
+			File modelfile = new File(Toolbox.getParam(Toolbox.TREETAGGER_MODELS_PATH),"/afr.par");
+			File infile = f
+			File outfile = new File(rootDir+"/treetagger",f.getName());
+			println("3- APPLY TT on : "+infile+" with : "+modelfile +" >>  "+outfile);
+			
+			TreeTagger tt = new TreeTagger(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/");
+			tt.settoken();
+			tt.setlemma();
+			tt.setquiet();
+			tt.setsgml();
+			tt.setnounknown();
+			tt.seteostag("<s>");
+			tt.treetagger( modelfile.getAbsolutePath(), infile.getAbsolutePath(), outfile.getAbsolutePath())
+			//infile.delete();
+		}
+		
+		//BUILD STAND-OFF FILES
+		//contains txm:application/txm:commandLine
+		File reportFile = new File(rootDir,"NLPToolsParameters.xml");
+		
+		String respPerson = System.getProperty("user.name");
+		String respId = "txm";
+		String respDesc = "NLP annotation tool";
+		String respDate = "";
+		String respWhen = ""
+		
+		String appIdent = "TreeTagger";
+		String appVersion = "3.2";
+		
+		String distributor = "";
+		String publiStmt = """""";
+		String sourceStmt = """""";
+		
+		def types = [pos,lemme];
+		def typesTITLE = ["",""];
+		def typesDesc = ["",""];
+		def typesTAGSET = ["",""];
+		def typesWEB = ["",""];
+		String idform ="w_";
+		
+		files = new File(rootDir,"treetagger").listFiles()	
+		for(File f : files)
+		{
+			String target = f.getAbsolutePath();
+			File ttfile = f
+			File posfile = new File(rootDir+"annotations/",f.getName()+"STOFF.xml");
+			
+			def encoding ="UTF-8";
+			def transfo = new CSV2W_ANA();
+			println("build w-interp "+ttfile.getName()+ ">>"+posfile.getName())
+			transfo.setAnnotationTypes( types, typesDesc, typesTAGSET, typesWEB, idform);
+			transfo.setResp(respId, respDesc,respDate, respPerson, respWhen);
+			transfo.setApp(appIdent, appVersion);
+			transfo.setTarget(target, reportFile);
+			transfo.setInfos(distributor,  publiStmt, sourceStmt);
+			transfo.process( ttfile, posfile, encoding );
+		}
+		
+		files = new File(rootDir,"annotations").listFiles();
+		List<File> txmfiles = new File(rootDir,"txm").listFiles();
+		files.sort();
+		txmfiles.sort();
+		for(int i = 0 ; i< files.size();i++)
+		{
+			File srcfile = txmfiles.get(i);
+			File pos1file = files.get(i);
+			File temp = new File(rootDir,"temp"); 
+			
+			println("5- inject annotation in file : "+srcfile+" with : "+pos1file );
+			
+			def builder = new org.txm.scripts.teitxm.AnnotationInjection(srcfile.toURL(), pos1file.toURL(), milestones);
+			builder.transfomFile(temp.getParent(),temp.getName());
+			
+			if (!(srcfile.delete() && temp.renameTo(srcfile))) println "Warning can't rename file "+temp+" to "+srcfile
+		}
+		
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File rootDir = new File("~/xml/bvh/");
+		new annotate().run(rootDir,);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/compiler.groovy	(revision 728)
@@ -0,0 +1,642 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.bvh
+
+
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+
+import javax.xml.stream.*;
+import java.net.URL;
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Produce WTC files from TEI-TXM files. <br/>
+ * Add the following word properties : "frpos","frlemme","afrpos","afrlemme","id","page","line","orig","sic","abbr". <br/>
+ * 
+ * @author mdecorde
+ */
+class compiler 
+{
+	
+	/** The debug. */
+	private boolean debug= false;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The dir. */
+	private def dir;
+	
+	/** The output. */
+	private def output;
+	
+	/** The url. */
+	private def url;
+	
+	/** The anahash. */
+	private HashMap<String,String> anahash =new HashMap<String,String>() ;
+	
+	/** The text. */
+	String text="";
+	
+	/** The base. */
+	String base="";
+	
+	/** The project. */
+	String project="";
+	
+	/** The cwb loc. */
+	String cwbLoc;
+	
+	/** The lang. */
+	private String lang ="fr";
+	
+	/**
+	 * Instantiates a new compiler.
+	 */
+	public compiler(){}
+	
+	/**
+	 * initialize the compiler.
+	 *
+	 * @param url the fiel to read
+	 * @param text the Texte's name
+	 * @param base the Base's name
+	 * @param project the Project's name
+	 */
+	public compiler(URL url,String text,String base, String project)
+	{
+		this.text = text
+		this.base = base;
+		this.project = project;
+		try {
+			this.url = url;
+			inputData = url.openStream();
+			
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * set the language of the corpus.
+	 *
+	 * @param lang the lang
+	 * @return the java.lang. object
+	 */
+	public setLang(String lang)
+	{
+		this.lang = lang;
+	}
+	
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the path to cwb utils binaries
+	 */
+	public void setCwbPath(String path)
+	{
+		if(!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path;
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(String dirPathName, String fileName){
+		try {
+			File f = new File(dirPathName, fileName)
+			output = new OutputStreamWriter(new FileOutputStream(f,f.exists()) , "UTF-8");
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+	
+	/**
+	 * Go to text.
+	 */
+	private void GoToText()
+	{
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			if(event == XMLStreamConstants.END_ELEMENT)
+				if(parser.getLocalName().equals("teiHeader"))
+					return;
+		}
+	}
+	
+	/**
+	 * Transfom file wtc.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean transfomFileWtc(String dirPathName, String fileName)
+	{
+		createOutput(dirPathName, fileName);
+		
+		String headvalue=""
+		String vAna = "";
+		String vForm = "";
+		String wordid= "";
+		String vHead = "";
+		
+		String vExpan = "";
+		String vCorr = "";
+		String vReg = "";
+		String vOrig = "";
+		String vSic = "";
+		String vAbbr = "";
+		
+		String divtype = "";
+		
+		int p_id = 0;
+		int q_id = 0;
+		int lg_id = 0;
+		int l_id = 0;
+		int pb_id = 0;
+		int lb_id = 0;
+		int said_id = 0;
+		int foreign_id = 0;
+		int sp_id = 0;
+		int speaker_id = 0;
+		int stage_id = 0;
+		
+		boolean captureword = false;
+		boolean fwcapture = false;
+		boolean choicecapture = false;
+		boolean divcapture = false;
+		
+		boolean flagchoice = false;
+		boolean flagcorr = false;
+		boolean flagsic = false;
+		boolean flagreg = false;
+		boolean flagexpan = false;
+		boolean flagorig = false;
+		boolean flagabbr = false;
+		boolean flagfw = false;
+		
+		boolean flaglg = false;
+		boolean flaghead = false;
+		boolean flagAuthor = false;
+		boolean flagDate = false;
+		boolean flagForm = false;
+		boolean flagAna = false;
+		boolean
+		
+		this.GoToText()
+		output.write("<txmcorpus lang=\""+lang+"\">\n"); 
+		try 
+		{
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+			{
+				switch (event) 
+				{
+					case XMLStreamConstants.START_ELEMENT:
+						switch (parser.getLocalName()) 
+						{				
+							case "text":
+							captureword=true;
+							output.write("<text id=\""+text+"\" type=\""+parser.getAttributeValue(null,"type")+"\" base=\""+base+"\" project=\""+project+"\">\n");
+							break;
+							
+							case "div":
+								divtype = parser.getAttributeValue(null,"type")
+							switch(divtype)
+							{
+								case "toa":
+								case "toc":
+								break;
+								case null:
+								break;
+								default:
+								output.write("<div id=\""+parser.getAttributeValue(null,"n")+"\" type=\""+parser.getAttributeValue(null,"type")+"\">\n");		
+							}
+							
+							break;
+							
+							case "p":
+							output.write("<p id=\""+(p_id++)+"\">\n");
+							break;
+							
+							case "lg":
+							output.write("<lg id=\""+(lg_id++)+"\">\n");
+							break;
+							
+							case "l":
+							output.write("<l id=\""+(l_id++)+"\">\n");
+							break;
+							
+							case "q":
+							output.write("<q id=\""+(q_id++)+"\">\n");
+							break;
+							
+							case "said":
+							output.write("<said id=\""+(said_id++)+"\">\n");
+							break;
+							
+							case "foreign":
+							output.write("<foreign id=\""+(foreign_id++)+"\">\n");
+							break;
+							
+							case "stage":
+							output.write("<stage id=\""+(stage_id++)+"\">\n");
+							break;
+							
+							case "sp":
+							output.write("<sp id=\""+(sp_id++)+"\">\n");
+							break;
+							
+							case "speaker":
+							output.write("<speaker id=\""+(speaker_id++)+"\">\n");
+							break;
+							
+							case "fw":
+							flagfw = true;
+							break;
+							case "choice":
+							flagchoice = true;
+							break;
+							case "corr":
+							flagcorr = true;
+							vCorr= "";
+							break;
+							case "reg":
+							flagreg = true;
+							vReg= "";
+							break;
+							case "expan":
+							flagexpan = true;
+							vExpan= "";
+							break;
+							case "orig":
+							flagreg = true;
+							vOrig= "";
+							break;
+							case "sic":
+							flagsic = true;
+							vSic= "";
+							break;
+							case "abbr":
+							flagreg = true;
+							vAbbr= "";
+							break;
+							
+							case "w":
+							for(int i = 0 ; i < parser.getAttributeCount(); i++)
+								if(parser.getAttributeLocalName(i).equals("id"))
+								{	
+									wordid = parser.getAttributeValue(i);
+								}
+							break;
+							case "form":
+							flagForm = true;
+							vForm = "";
+							vAna ="";
+							break;
+							
+							case "ana":
+							flagAna = true;
+							break;
+						}
+						break;
+					
+					case XMLStreamConstants.END_ELEMENT:
+						switch (parser.getLocalName()) 
+						{	
+							case "body":
+							captureword=false;
+							break;
+							
+							case "text":
+							output.write("</text>\n");
+							break;
+							
+							case "div":
+							switch(divtype)
+							{
+								case "toa":
+								case "toc":
+								break;
+								default:
+									output.write("</div>\n");		
+							}
+							
+							break;
+							
+							case "p":
+							output.write("</p>\n");
+							break;
+							
+							case "q":
+							output.write("</q>\n");
+							break;
+							
+							case "said":
+							output.write("</said>\n");
+							break;
+							
+							case "foreign":
+							output.write("</foreign>\n");
+							break;
+							
+							case "lg":
+							output.write("</lg>\n");
+							break;
+							
+							case "pb":
+							pb_id++;
+							break;
+							
+							case "lb":
+								lb_id++;
+								break;
+							
+							case "l":
+							output.write("</l>\n");
+							break;
+							
+							case "stage":
+							output.write("</stage>\n");
+							break;
+							
+							case "sp":
+							output.write("</sp>\n");
+							break;
+							
+							case "speaker":
+							output.write("</speaker>\n");
+							break;
+							
+							
+							case "fw":
+							flagfw = false;
+							break;
+							case "choice":
+							flagchoice = false;
+							break;
+							case "corr":
+							flagcorr = false;
+							vCorr= "";
+							break;
+							case "reg":
+							flagreg = false;
+							vReg= "";
+							break;
+							case "expan":
+							flagexpan = false;
+							vExpan= "";
+							break;
+							case "orig":
+							flagreg = false;
+							vOrig= "";
+							break;
+							case "sic":
+							flagsic = false;
+							vSic= "";
+							break;
+							case "abbr":
+							flagreg = false;
+							vAbbr= "";
+							break;
+							
+							case "w":
+							if(vAna != null)
+								if(captureword)
+								{
+									if(flagchoice)
+									{
+										if(flagcorr)
+										{
+											output.write( vCorr +"\t"+vAna+wordid+"\t"+pb_id+"\t"+lb_id+"\t"+vOrig+"\t"+vSic+"\t"+vAbbr+"\n");
+										}
+										else if(flagreg)
+										{
+											output.write( vReg +"\t"+vAna+wordid+"\t"+pb_id+"\t"+lb_id+"\t"+vOrig+"\t"+vSic+"\t"+vAbbr+"\n");
+										}
+										else if(flagsic)
+										{
+											
+										}
+										else if(flagexpan)
+										{
+											output.write( vExpan +"\t"+vAna+wordid+"\t"+pb_id+"\t"+lb_id+"\t"+vOrig+"\t"+vSic+"\t"+vAbbr+"\n");
+										}	
+									}
+									else if(flagfw)
+									{
+										
+									}
+									else
+									{
+										output.write( vForm +"\t"+vAna+wordid+"\t"+pb_id+"\t"+lb_id+"\t"+vOrig+"\t"+vSic+"\t"+vAbbr+"\n");
+									}
+									
+								}
+							vAna = "";
+							vForm = "";
+							break;
+							
+							case "form":
+							flagForm = false;
+							break;
+							
+							case "ana":
+							vAna += "\t";
+							flagAna = false;
+							break;
+						}
+						break;
+					
+					case XMLStreamConstants.CHARACTERS:
+						if(flagForm)
+						{	
+							vForm += parser.getText().trim();
+						}
+						if(flagAna)
+						{
+							vAna += parser.getText().trim();
+						}
+						if(flagsic)
+						{
+							vSic += parser.getText().trim();
+						}
+						if(flagorig)
+						{
+							vOrig += parser.getText().trim();
+						}
+						if(flagabbr)
+						{
+							vAbbr += parser.getText().trim();
+						}
+						break;
+				}
+			}
+			output.write("</txmcorpus>"); 
+			output.close();
+			parser.close();
+			inputData.close();
+		}
+		catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}
+		catch (IOException ex) {
+			System.out.println("IOException while parsing " + inputData);
+		}
+		
+		return true;
+	}
+	
+	
+	/**
+	 * start processing.
+	 *
+	 * @param rootDirFile the directory containing the TEI-TXM files
+	 * @return true, if successful
+	 */
+	public boolean run(File rootDirFile) 
+	{
+		String rootDir =rootDirFile.getAbsolutePath();
+		
+		if(cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+		
+		if(!new File(cwbLoc).exists())
+		{
+			println ("CWB path error: "+cwbLoc)
+			return false;
+		}
+		if(!new File(rootDir).exists())
+		{
+			println ("binary directory does not exists: "+rootDir)
+			return false;
+		}
+		new File(rootDir+"/wtc/","bvh.wtc").delete();//cleaning&preparing
+		new File(rootDir,"/wtc/").deleteDir();
+		new File(rootDir,"/wtc/").mkdir();
+		new File(rootDir,"/data/").deleteDir();
+		new File(rootDir,"/data/").mkdir();
+		new File(rootDir,"registry/").mkdir();
+		
+		String textid="";
+		int counttext =0;
+		List<File> files = new File(rootDirFile,"txm").listFiles();
+		Collections.sort(files);
+		//1- Transform into WTC file
+		for(File f : files)
+		{
+			counttext++;
+			if(!f.exists())
+			{
+				println("file "+f+ " does not exists")	
+			}
+			else
+			{	
+				println("process file "+f)
+				String txtname = f.getName().substring(0,f.getName().length()-4);
+				def builder = new compiler(f.toURL(),txtname, "bvh", "default");
+				builder.setLang lang
+				builder.transfomFileWtc(rootDir+"/wtc","bvh.wtc");
+			}
+		}
+		
+		//2- Import into CWB
+		def outDir =rootDir;
+		def outDirTxm = rootDir;
+		
+		CwbEncode cwbEn = new CwbEncode();
+		cwbEn.setDebug(debug);
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		cwbMa.setDebug(debug);
+		String[] pAttributes = ["frpos","frlemme","afrpos","afrlemme","id","page","line","orig","sic","abbr"];
+		String[] sAttributes = ["txmcorpus:0+lang", "text:2+id+type+base+project","div:2+id+type","p:0+id","q:0+id","said:0+id","foreign:0+id","lg:0+id","l:0+id","sp:0+id","speaker:0+id","stage:0+id"];
+		try {
+			String regPath = outDirTxm + "/registry/"+"bvh"
+			cwbEn.run(new File(cwbLoc,"cwb-encode").getAbsolutePath(), outDirTxm + "/data", outDir + "/wtc/"+"bvh.wtc", regPath, pAttributes, sAttributes);
+			if (!new File(regPath).exists()) {
+				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			cwbMa.run(new File(cwbLoc,"cwb-makeall").getAbsolutePath(), "BVH", outDirTxm + "/registry");
+			
+		} catch (Exception ex) {System.out.println(ex); return false}
+		
+		System.out.println("Done.") 
+		
+		return true;
+	}
+	
+	/**
+	 * show cwb-encode and cwb-makeall messages.
+	 */
+	public void setDebug()
+	{
+		this.debug = true;
+	}
+	
+	/**
+	 * test purpose.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("~/xml/bvh");
+		def c = new compiler();
+		c.setDebug();
+		c.setCwbPath("~/TXM/cwb/bin");
+		c.run(dir);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/package.html	(revision 728)
@@ -0,0 +1,12 @@
+<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

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/bvh/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/Pager.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/Pager.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/Pager.groovy	(revision 728)
@@ -0,0 +1,152 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer
+import java.util.regex.Pattern
+// TODO: Auto-generated Javadoc
+
+/**
+ * The Class Pager.
+ */
+class Pager {
+	
+	//Prototype of generic pager
+	
+	//cut infos
+	
+	/** The cuttag. */
+	String cuttag = "w";// tag to cut, default <w>
+	
+	/** The cutattr. */
+	String cutattr;//attr of cuttag to test
+	
+	/** The cutvaluereg. */
+	Pattern cutvaluereg;// regex value
+	
+	/** The cutnumber. */
+	int cutnumber = 500;// number of cuttag before cutting, default 500 words
+	
+	//xpaths
+	
+	/** The xpaths. */
+	HashMap<String, String> xpaths = new HashMap<String, String>();
+	
+	//tag classes
+	
+	/** The ptags. */
+	public List<String> ptags = ["p", "lg", ];
+	
+	/** The linetags. */
+	public List<String> linetags = ["br", "lb", "l"];
+	
+	/** The dbllinetags. */
+	public List<String> dbllinetags = [];
+	
+	/** The commenttags. */
+	public List<String> commenttags = ["note"];
+	
+	/** The corrtags. */
+	public List<String> corrtags = ["corr"];
+	
+	/** The regtags. */
+	public List<String> regtags = ["reg"];
+	
+	/** The foreigntags. */
+	public List<String> foreigntags = ["foreign"];
+	
+	/**
+	 * Sets the cut infos.
+	 *
+	 * @param tag the tag
+	 * @param attr the attr
+	 * @param valuereg the valuereg
+	 * @param number the number
+	 */
+	public void setCutInfos(String tag, String attr, String valuereg, int number)
+	{
+		if(tag != null && tag.length() > 0)
+			cuttag = tag;
+		
+		try
+		{
+			Pattern p = Pattern.compile(valuereg);
+			cutvaluereg = p;
+		}
+		catch(Exception e){System.err.println("Pager: setCutInfos: Wrong regex syntax");}
+		
+		if(cutattr != null && cutattr.length() > 0)
+			cutattr = attr;
+		
+		if(cutnumber > 0)	
+			cutnumber = number;
+	}
+	
+	/**
+	 * Sets the x paths.
+	 *
+	 * @param xpaths the xpaths
+	 */
+	public void setXPaths(HashMap<String, String> xpaths)
+	{
+		if(xpaths != null)
+			this.xpaths = xpaths
+	}
+	
+	/**
+	 * Adds the x path.
+	 *
+	 * @param name the name
+	 * @param xpath the xpath
+	 */
+	public void addXPath(String name, String xpath)
+	{
+		if(xpath != null && name != null)
+			xpaths.put(name, xpath)
+	}
+	
+	/**
+	 * Run.
+	 *
+	 * @param infile the infile
+	 * @return true, if successful
+	 */
+	public boolean run(File infile)
+	{
+		
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		Pager p = new Pager()
+		p.setCutInfos("w","type", "{[|]@^[|`[{`]@^pon.*", 600);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/GetAttributeValue.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/GetAttributeValue.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/GetAttributeValue.groovy	(revision 728)
@@ -0,0 +1,47 @@
+package org.txm.importer
+
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.io.File;
+import javax.xml.stream.*;
+import java.net.URL;
+
+class GetAttributeValue {
+	public static String process(File xmlFile, String path, String attribute) {
+		String value = "N/A";
+		String currentpath = "";
+		boolean done = false;
+		
+		try {
+			URL url = xmlFile.toURI().toURL();
+			def inputData = url.openStream();
+			def factory = XMLInputFactory.newInstance();
+			XMLStreamReader parser = factory.createXMLStreamReader(inputData);
+			for (int event = parser.next(); !done && event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
+			{
+				switch (event) {
+					case XMLStreamConstants.START_ELEMENT:
+						currentpath += "/"+parser.getLocalName();// append the current tag to the current path
+						if (path == currentpath) {
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+								if (parser.getAttributeName(i) == attribute) {
+									value = parser.getAttributeValue(i)
+									done = true;
+									break;
+								}
+							}
+						}
+						
+						break;
+					case XMLStreamConstants.END_ELEMENT:
+						currentpath = currentpath.substring(0,currentpath.length() -1 - parser.getLocalName().length()) // remove tag from the path
+						break;
+					
+				}
+			}
+			
+		}
+		catch(Exception e){println("File "+xmlFile+"\n"+e); return "N/A";}
+		return value;
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/WExtract.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/WExtract.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/WExtract.groovy	(revision 728)
@@ -0,0 +1,334 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2015-12-17 12:11:39 +0100 (jeu., 17 dÃ©c. 2015) $
+// $LastChangedRevision: 3087 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import javax.xml.stream.*;
+import java.io.File;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Extract w tags from a tei file
+ * not finished.
+ *
+ * @author mdecorde
+ */
+class WExtract 
+{
+	
+	/**
+	 * Process.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param max the max
+	 * @return the java.lang. object
+	 */
+	public process(File infile, File outfile, int max)
+	{
+		println "Process "+infile.getName()+", keep $max words"
+		int count = this.countW(infile);
+		if(count < max)
+		{
+			println "can't extract $max words, the file "+infile.getName()+" contains only $count words"
+			return;
+		}
+		String ms = "#ms_K"
+		int tier = max/3;
+		int from1 = 0 
+		int to1 = tier;
+		int from2 = (count/2) - (tier/2);
+		int to2 =(count/2) + (tier/2);
+		int from3 = count -tier;
+		int to3= count-1;
+		boolean isSic = false;
+		boolean isW = false;
+		boolean isText = false;
+		boolean printW = true;
+		int wcount=0;
+		
+		println " count : "+count
+		println "  get from "+from1+" to "+to1
+		println "  get from "+from2+" to "+to2
+		println "  get from "+from3+" to "+to3
+		
+		
+		String localname;
+		String prefix;
+		InputStream inputData = infile.toURI().toURL().openStream();
+		XMLInputFactory inputfactory = XMLInputFactory.newInstance();
+		XMLStreamReader parser = inputfactory.createXMLStreamReader(inputData);
+		XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		
+		FileOutputStream output = new FileOutputStream(outfile);
+		XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8");
+		
+		writer.writeStartDocument("utf-8", "1.0");
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			if(isText)
+			{
+				if((wcount >= from1 && wcount <= to1 )||
+				(wcount >= from2 && wcount <= to2) ||
+				(wcount >= from3 && wcount <= to3))
+					printW = true;
+				else
+					printW = false;
+			}
+			else
+				printW = true;
+			
+			switch (event) 
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					prefix = parser.getPrefix();
+				
+				/*
+				 if(localname == "supplied")
+				 if(parser.getAttributeValue(null,"source") != null)
+				 ms = parser.getAttributeValue(null,"source")
+				 if(localname == "sic")
+				 {
+				 isSic= true;
+				 }
+				 */
+					if(localname == "text")
+						isText = true;
+				
+					if(localname == "w")
+					{
+						isW= true;
+						wcount++;
+						
+						if(isText)
+						{
+							if((wcount >= from1 && wcount <= to1 )||
+							(wcount >= from2 && wcount <= to2) ||
+							(wcount >= from3 && wcount <= to3))
+								printW = true;
+							else
+								printW = false;
+						}
+						else
+							printW = true;
+					}
+				
+				/*if(!isSic)
+				 if(localname != "choice" && localname != "corr" && localname != "sic" && localname != "supplied" && localname != "seg")
+				 {*/
+					if(localname == "w")
+					{
+						if(printW)
+						{
+							if(prefix != null && prefix.length() > 0)
+								writer.writeStartElement(prefix+":"+localname);
+							else
+								writer.writeStartElement(localname);
+							
+							for(int i= 0 ; i < parser.getAttributeCount() ;i++ )
+							{
+								if(parser.getAttributePrefix(i)!= "")
+									writer.writeAttribute(parser.getAttributePrefix(i)+":"+parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+								else
+									writer.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+							}
+							//writer.writeAttribute("srcmf:src", ms);
+						}
+					}
+					else
+					{
+						if(prefix != null && prefix.length() > 0)
+							writer.writeStartElement(prefix+":"+localname);
+						else
+							writer.writeStartElement(localname);
+						
+						if(localname == "teiHeader")
+						{
+							writer.writeAttribute("xmlns:me", "http://www.menota.org/ns/1.0");
+							writer.writeAttribute("xmlns:bfm", "http://bfm.ens-lsh.fr/ns/1.0");
+							//writer.writeAttribute("xmlns:srcmf", "https://listes.cru.fr/wiki/srcmf/index");
+						}
+						
+						if(localname == "TEI")
+						{
+							writer.writeAttribute("xmlns","http://www.tei-c.org/ns/1.0");
+						}
+						
+						for(int i= 0 ; i < parser.getAttributeCount() ;i++ )
+						{
+							if(parser.getAttributePrefix(i)!= "")
+								writer.writeAttribute(parser.getAttributePrefix(i)+":"+parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+							else
+								writer.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+						}
+					}
+				//}
+					break;
+				
+				case XMLStreamConstants.END_ELEMENT:
+					localname =parser.getLocalName()
+				
+				/*if(localname == "sic")
+				 isSic= false;
+				 if(localname == "w")
+				 isW= false;
+				 if(localname == "supplied" && ms != "#ms_K")
+				 ms = "#ms_K";
+				 if(!isSic)
+				 if(localname != "choice" && localname != "corr" && localname != "sic" && localname != "supplied" && localname != "seg")
+				 {*/
+					if(localname == "w")
+					{
+						if(printW)
+						{
+							writer.writeEndElement();
+							writer.writeCharacters("\n");
+						}
+					}
+					else
+					{	
+						writer.writeEndElement();
+						writer.writeCharacters("\n");
+					}
+				//	}
+				
+					break;
+				
+				case XMLStreamConstants.CHARACTERS:
+				//if(!isSic)
+					if(isW)
+					{
+						if(printW)
+						{
+							writer.writeCharacters(parser.getText().trim());
+						}
+					}
+					else
+						writer.writeCharacters(parser.getText().trim());
+					break;
+			}
+		}
+		writer.flush();
+		writer.close();
+		output.close()
+		inputData.close();
+	}
+	
+	/**
+	 * Count w.
+	 *
+	 * @param infile the infile
+	 * @return the int
+	 */
+	public int countW(File infile)
+	{
+		InputStream inputData = infile.toURI().toURL().openStream();
+		XMLInputFactory inputfactory = XMLInputFactory.newInstance();
+		XMLStreamReader parser = inputfactory.createXMLStreamReader(inputData);
+		
+		int count = 0;
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			switch (event) 
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					if(parser.getLocalName() == "w")
+						count++;
+			}
+		}
+		inputData.close()
+		return count;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		String userDir = System.getProperty("user.home");
+		
+		File directory = new File(userDir+"/xml/extract/");
+		File outdir = new File(userDir+"/xml/extract/","results");
+		outdir.mkdir();
+		
+		File maxfile = new File(userDir+"/xml/extract/maxfile");
+		/*
+		 * maxfile format:
+		 * 
+		 * filename1.xml	45000
+		 * filename2.xml	22500
+		 * filename3.xml	45000
+		 */
+		HashMap<File, Integer> maxperfile = new HashMap<File, Integer>();
+		maxfile.eachLine{it->
+			String[] split = it.split("\t");
+			if(split.length == 2)
+			{
+				try
+				{
+				String filename = it.split("\t")[0];
+				int max = Integer.parseInt(it.split("\t")[1])
+				maxperfile.put(filename, max);
+				}catch(Exception e ){}
+			}
+		}
+		println maxperfile;
+		
+		def files = directory.listFiles();
+		for(File infile : files)
+		{
+			
+			if(maxperfile.containsKey(infile.getName()))
+			{
+				File outfile = new File(outdir, infile.getName());
+				int max= maxperfile.get(infile.getName());
+				new WExtract().process(infile, outfile, max)
+			}
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/NiceToXML.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/NiceToXML.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/NiceToXML.groovy	(revision 728)
@@ -0,0 +1,202 @@
+package org.txm.importer
+
+import javax.xml.stream.XMLStreamException
+import org.apache.tools.ant.types.resources.selectors.InstanceOf;
+import groovy.xml.*
+
+def root = new File("/home/mdecorde/xml/temoignagesnice/corpus Matrice - fichiers xmlisÃ©s/")
+File srcdir = new File(root, "orig");
+File outdir = new File(root, "tmp");
+File okdir = new File(root, "ok");
+File ok2dir = new File(root, "ok2");
+File temoignagedir = new File(root, "temoignages");
+ok2dir.deleteDir()
+ok2dir.mkdir()
+
+//rename title -> head
+for (def file : outdir.listFiles()) {
+	if (!file.getName().endsWith(".xml")) continue;
+	def doc = new XmlParser().parse(file);
+	
+	for (def note : doc.body.chapter.title) {
+		println note
+		note.name = "head"
+	}
+	
+	new File(ok2dir, file.getName()).withWriter("UTF-8") { writer ->
+		new XmlNodePrinter(new PrintWriter(writer)).print(doc)
+	}
+}
+
+/*
+// ADD chapter@title
+for (def file : outdir.listFiles()) {
+	if (!file.getName().endsWith(".xml")) continue;
+	def doc = new XmlParser().parse(file);
+	
+	for (def chapter : doc.body.chapter) {
+		for (def title : chapter.title) {
+			chapter.@title = title.text()
+			break;
+		}
+	}
+	
+	new File(ok2dir, file.getName()).withWriter("UTF-8") { writer ->
+		new XmlNodePrinter(new PrintWriter(writer)).print(doc)
+	}
+}
+*/
+//FIX figure and caption inclusions
+/*
+for (def file : outdir.listFiles()) {
+	if (!file.getName().endsWith(".xml")) continue;
+	def doc = new XmlParser().parse(file);
+	for (def note : doc.body."**".figure) {
+		note.name = "note"
+		//println "fig : $note"
+		//if ("Image :" == note.text()) {
+			def children = note.parent().children()
+			int i = children.indexOf(note)
+			//println i + " < "+children.size()
+			def nextChild = children[i+1]
+			if (nextChild != null && nextChild.name().toString() == "caption") {
+				println nextChild
+
+				note.value = "Images : "+note.text()// + " "+nextChild.text()
+				//println note
+
+				children.remove(i+1)
+				note.append(nextChild)
+			}
+		//}
+	}
+
+	new File(ok2dir, file.getName()).withWriter("UTF-8") { writer ->
+		new XmlNodePrinter(new PrintWriter(writer)).print(doc)
+	}
+}
+*/
+/*
+// DOCBOOK -> DOCBOOK TEXT ONLY
+for (def file : outdir.listFiles()) {
+	def doc = new XmlParser().parse(file);
+
+	def body = null
+	def bookinfo = null
+	def preface = null
+	for (def e : doc.body) body = e
+
+	for (def e : doc.bookinfo) {
+		doc.remove(e)
+	}
+	for (def e : doc.preface) {
+		doc.remove(e)
+	}
+	for (def e : doc.appendix) {
+		doc.remove(e)
+	}
+	for (def e : doc.chapter) {
+		doc.remove(e)
+	}
+
+	if (body == null) {
+		println "error text: "+file
+		continue
+	}
+
+	new File(ok2dir, file.getName()).withWriter("UTF-8") { writer ->
+		new XmlNodePrinter(new PrintWriter(writer)).print(doc)
+	}
+	//		writer.print XmlUtil.serialize(new StreamingMarkupBuilder().bind {
+	//			mkp.yield body
+	//		  })
+}
+*/
+//DOCBOOK to TEI
+/*
+ for (def file : outdir.listFiles()) {
+ def doc = new XmlParser().parse(file);
+ def body = null
+ //def bookinfo = null
+ for (def e : doc.body) body = e
+ //for (def e : doc.bookinfo) bookinfo = e
+ //println body.getClass()
+ if (body == null) {
+ println "error text: "+file
+ continue
+ }
+ //	bookinfo.name = "teiHeader"
+ body.name = "text"
+ def teins = new groovy.xml.Namespace("http://www.tei-c.org/ns/1.0",'tei')
+ //	for (def node : body."**") {
+ //		if (node instanceof String) continue
+ //		def name = node.name()
+ //		if (name instanceof String)
+ //			node.name = teins.get(name)
+ //		else 
+ //			node.name = teins.get(name.getLocalPart())
+ //	}
+ for (def figure : body."**".figure) {
+ figure.name = "note"
+ figure.value = "Image : " + figure.caption.text()
+ }
+ for (def chapter : body."**".chapter) {
+ chapter.name = "div"
+ chapter.@type = "chapter"
+ }
+ for (def caption : body."**".title) {
+ caption.name = "head"
+ }
+ for (def para : body."**".para) {
+ para.name = "p"
+ }
+ def newdoc = new Node(null, "TEI");
+ newdoc.@xmlns="http://www.tei-c.org/ns/1.0";
+ newdoc.append(new Node(null, "teiHeader"))
+ newdoc.append(body)
+ new File(okdir, file.getName()).withWriter("UTF-8") { writer ->
+ new XmlNodePrinter(new PrintWriter(writer)).print(newdoc)
+ }
+ //		writer.print XmlUtil.serialize(new StreamingMarkupBuilder().bind {
+ //			mkp.yield body
+ //		  })
+ }
+ */
+
+// remove TEI
+/*outdir.deleteDir()
+ outdir.mkdir()
+ def errors = []
+ for (def file : srcdir.listFiles()) {
+ if (file.isDirectory()) continue;
+ //new EncodingConverter(file, "Windows-1252", "UTF-8")
+ File outfile = new File(outdir, file.getName());
+ outfile.withWriter("UTF-8") { writer ->
+ file.eachLine("UTF-8") { line ->
+ if (line.trim() == "<TEI>") {
+ } else if (line.trim() == "</TEI>") {
+ writer.println("</book>")
+ } else if (line.trim() == "<book lang=\"fr\"/>") {
+ writer.println("<book lang=\"fr\">")
+ } else {
+ writer.println(line)
+ }
+ }		
+ }
+ try {
+ ValidateXml.testAndThrow(outfile);
+ } catch (XMLStreamException e) {
+ println file.getName() + " : "+ e.getMessage()
+ errors << file
+ if (e.getMessage().contains('Message: The element type "TEI" must be terminated by the matching end-tag "</TEI>"')) {
+ println "Delete line : "+e.location.lineNumber
+ }
+ println ""
+ }
+ }
+ */
+println "done"
+//if (errors.size() > 0)
+//	println ""+errors.size()+" errors : $errors"
+//String content = file.getText("Windows-1252")
+//println content
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/WExtractWithMode.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/WExtractWithMode.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/WExtractWithMode.groovy	(revision 728)
@@ -0,0 +1,376 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2011-10-19 17:50:26 +0200 (mer., 19 oct. 2011) $
+// $LastChangedRevision: 2038 $
+// $LastChangedBy: alavrentev $ 
+//
+package org.txm.importer
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import javax.xml.stream.*;
+import java.io.File;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Extract w tags from a tei file
+ * not finished.
+ *
+ * @author mdecorde
+ */
+class WExtractWithMode 
+{
+	
+	/**
+	 * Process.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param max the max
+	 * @return the java.lang. object
+	 */
+	public process(File infile, File outfile, String modemax)
+	{
+		println "Process "+infile.getName()+", keep $modemax words"
+		int count = this.countW(infile);
+		
+		int max = 0
+		String mode = ""
+		
+		try {
+		mode = modemax.split("/")[0]
+		max = Integer.parseInt(modemax.split("/")[1])		
+		}catch(Exception e ){}
+		
+		if(count < max)
+		{
+			println "can't extract $max words, the file "+infile.getName()+" contains only $count words"
+			return;
+		}
+		//String ms = "#ms_K"
+		int part = 0; 
+		if (mode == "3")
+		{
+			part = max/3		
+		}
+		else if (mode == "2")
+		{
+			part = max/2
+		}
+		else if (mode == "1a" || mode == "1m" || mode == "1z")
+		{
+			part = max
+		}
+		else
+		{
+			println "mode must be 1a, 1m, 1z, 2 or 3"
+			return
+		}
+		int from1 = 0 
+		int to1 = 0
+		if (mode != "1m" && mode != "1z")
+		{
+			to1 = part
+		}
+		int from2 = 0
+		int to2 = 0
+		if (mode == "3" || mode == "1m")
+		{
+			from2 = (count/2) - (part/2);
+			to2 =(count/2) + (part/2);			
+		}
+		int from3 = 0
+		int to3 = 0
+		if (mode != "1a" && mode != "1m")
+		{
+			from3 = count -part;
+			to3= count-1;			
+		}
+		boolean isSic = false;
+		boolean isW = false;
+		boolean isText = false;
+		boolean printW = true;
+		int wcount=0;
+		
+		println " count : "+count
+		println "  get from "+from1+" to "+to1
+		println "  get from "+from2+" to "+to2
+		println "  get from "+from3+" to "+to3
+		
+		
+		String localname;
+		String prefix;
+		InputStream inputData = infile.toURI().toURL().openStream();
+		XMLInputFactory inputfactory = XMLInputFactory.newInstance();
+		XMLStreamReader parser = inputfactory.createXMLStreamReader(inputData);
+		XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		
+		FileOutputStream output = new FileOutputStream(outfile)
+		XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8");
+		
+		writer.writeStartDocument("utf-8", "1.0");
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			if(isText)
+			{
+				if((wcount >= from1 && wcount <= to1 )||
+				(wcount >= from2 && wcount <= to2) ||
+				(wcount >= from3 && wcount <= to3))
+					printW = true;
+				else
+					printW = false;
+			}
+			else
+				printW = true;
+			
+			switch (event) 
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					prefix = parser.getPrefix();
+				
+				/*
+				 if(localname == "supplied")
+				 if(parser.getAttributeValue(null,"source") != null)
+				 ms = parser.getAttributeValue(null,"source")
+				 if(localname == "sic")
+				 {
+				 isSic= true;
+				 }
+				 */
+					if(localname == "text")
+						isText = true;
+				
+					if(localname == "w")
+					{
+						isW= true;
+						wcount++;
+						
+						if(isText)
+						{
+							if((wcount >= from1 && wcount <= to1 )||
+							(wcount >= from2 && wcount <= to2) ||
+							(wcount >= from3 && wcount <= to3))
+								printW = true;
+							else
+								printW = false;
+						}
+						else
+							printW = true;
+					}
+				
+				/*if(!isSic)
+				 if(localname != "choice" && localname != "corr" && localname != "sic" && localname != "supplied" && localname != "seg")
+				 {*/
+					if(localname == "w")
+					{
+						if(printW)
+						{
+							if(prefix != null && prefix.length() > 0)
+								writer.writeStartElement(prefix+":"+localname);
+							else
+								writer.writeStartElement(localname);
+							
+							for(int i= 0 ; i < parser.getAttributeCount() ;i++ )
+							{
+								if(parser.getAttributePrefix(i)!= "")
+									writer.writeAttribute(parser.getAttributePrefix(i)+":"+parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+								else
+									writer.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+							}
+							//writer.writeAttribute("srcmf:src", ms);
+						}
+					}
+					else
+					{
+						if(prefix != null && prefix.length() > 0)
+							writer.writeStartElement(prefix+":"+localname);
+						else
+							writer.writeStartElement(localname);
+						
+						if(localname == "teiHeader")
+						{
+							writer.writeAttribute("xmlns:me", "http://www.menota.org/ns/1.0");
+							writer.writeAttribute("xmlns:bfm", "http://bfm.ens-lsh.fr/ns/1.0");
+							//writer.writeAttribute("xmlns:srcmf", "https://listes.cru.fr/wiki/srcmf/index");
+						}
+						
+						if(localname == "TEI")
+						{
+							writer.writeAttribute("xmlns","http://www.tei-c.org/ns/1.0");
+						}
+						
+						for(int i= 0 ; i < parser.getAttributeCount() ;i++ )
+						{
+							if(parser.getAttributePrefix(i)!= "")
+								writer.writeAttribute(parser.getAttributePrefix(i)+":"+parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+							else
+								writer.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+						}
+					}
+				//}
+					break;
+				
+				case XMLStreamConstants.END_ELEMENT:
+					localname =parser.getLocalName()
+				
+				/*if(localname == "sic")
+				 isSic= false;
+				 if(localname == "w")
+				 isW= false;
+				 if(localname == "supplied" && ms != "#ms_K")
+				 ms = "#ms_K";
+				 if(!isSic)
+				 if(localname != "choice" && localname != "corr" && localname != "sic" && localname != "supplied" && localname != "seg")
+				 {*/
+					if(localname == "w")
+					{
+						if(printW)
+						{
+							writer.writeEndElement();
+							writer.writeCharacters("\n");
+						}
+					}
+					else
+					{	
+						writer.writeEndElement();
+						writer.writeCharacters("\n");
+					}
+				//	}
+				
+					break;
+				
+				case XMLStreamConstants.CHARACTERS:
+				//if(!isSic)
+					if(isW)
+					{
+						if(printW)
+						{
+							writer.writeCharacters(parser.getText().trim());
+						}
+					}
+					else
+						writer.writeCharacters(parser.getText().trim());
+					break;
+			}
+		}
+		writer.flush();
+		writer.close();
+		output.close()
+		inputData.close();
+	}
+	
+	/**
+	 * Count w.
+	 *
+	 * @param infile the infile
+	 * @return the int
+	 */
+	public int countW(File infile)
+	{
+		InputStream inputData = infile.toURI().toURL().openStream();
+		XMLInputFactory inputfactory = XMLInputFactory.newInstance();
+		XMLStreamReader parser = inputfactory.createXMLStreamReader(inputData);
+		
+		int count = 0;
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			switch (event) 
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					if(parser.getLocalName() == "w")
+						count++;
+			}
+		}
+		inputData.close()
+		return count;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		String userDir = System.getProperty("user.home");
+		
+		File directory = new File(userDir+"/xml/extract/");
+		File outdir = new File(userDir+"/xml/extract/","results");
+		outdir.mkdir();
+		
+		File maxfilemode = new File(userDir+"/xml/extract/maxfilemode");
+		/*
+		 * maxfilemode format:
+		 * 
+		 * filename1.xml	3	45000
+		 * filename2.xml	1a	15000
+		 * filename3.xml	1m	15000
+		 * filename4.xml	1z	15000
+		 * filename5.xml	2	22500
+		 */
+		HashMap<File, String> maxperfile = new HashMap<File, String>();
+		maxfilemode.eachLine{it->
+			String[] split = it.split("\t");
+			if(split.length == 3)
+			{
+				try
+				{
+				String filename = it.split("\t")[0];
+				String modemax = it.split("\t")[1]+"/"+it.split("\t")[2]
+				maxperfile.put(filename, modemax);
+				}catch(Exception e ){}
+			}
+		}
+		println maxperfile;
+		
+		def files = directory.listFiles();
+		for(File infile : files)
+		{
+			
+			if(maxperfile.containsKey(infile.getName()))
+			{
+				File outfile = new File(outdir, infile.getName());
+				String modemax = maxperfile.get(infile.getName());
+				new WExtractWithMode().process(infile, outfile, modemax)
+			}
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/XMLText2TXTCSV.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/XMLText2TXTCSV.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/XMLText2TXTCSV.groovy	(revision 728)
@@ -0,0 +1,32 @@
+package org.txm.importer
+
+File dir = new File("/home/mdecorde/xml/voeux/split_xml")
+File outdir = new File("/home/mdecorde/xml/voeux/split_txtcsv")
+println "1) xml -> txt + write metadata.csv"
+outdir.deleteDir()
+outdir.mkdir()
+File metadatafile = new File(outdir, "metadata.csv")
+String csvString = ""
+
+def files = dir.listFiles()
+files.sort()
+for(File f : files)
+{
+	File outfile = new File(outdir, f.getName()+".txt");
+	String text = f.getText("UTF-8");
+	String texttag = text.find("<text id.*>")
+//	println texttag
+//	texttag = texttag.replaceAll('<text id="([^"]+)"', '<text id="$1.txt"')
+//	println "> "+texttag
+	text = text.replaceAll("<text.*>", "").replace("</text>", "");
+	outfile.withWriter("UTF-8"){writer -> writer.write(text) }
+	csvString += texttag.replace("<text id=","").replace(" loc=", ",").replace(" annee=", ",").replace("\">", "\"")+"\n"
+}
+
+println "2) write metadata.csv"
+metadatafile.withWriter("UTF-8"){csvwriter -> 
+	csvwriter.write("\"id\",\"loc\",\"annee\"\n");
+	csvwriter.write(csvString)}
+
+println "3) rename Voeux_*"
+outdir.eachFileMatch(~/Voeux_.*/) {file-> file.renameTo(new File(outdir, file.getName().substring(6, 10)+".txt")) }
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/discours/discoursLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/discours/discoursLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/discours/discoursLoader.groovy	(revision 728)
@@ -0,0 +1,153 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2014-11-20 11:30:43 +0100 (jeu., 20 nov. 2014) $
+// $LastChangedRevision: 2904 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.discours;
+
+import org.txm.importer.discours.compiler;
+import org.txm.importer.xml.pager;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.utils.i18n.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true;
+	params = new BaseParameters(new File(userDir, "xml/discours/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- IMPORTER - Reading source files"
+def imp = new importer();
+if (!imp.run(srcDir, binDir, txmDir, encoding, basename)) {
+	println "import process stopped";
+	return;
+}
+
+println "-- ANNOTATE - Running NLP tools"
+println "No annotation to do"
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println("-- COMPILING - Building Search Engine indexes")
+List<File> files = txmDir.listFiles();
+def c = new compiler()
+if (debug) c.setDebug();
+// no annotation
+c.setLang(lang);
+if (!c.run(files, binDir, txmDir, corpusname)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	println "-- EDITION - Building edition"
+	if (MONITOR != null) MONITOR.worked(20, "EDITION")
+	
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+	List<File> filelist = txmDir.listFiles();
+	Collections.sort(filelist);
+
+	println "Paginating texts: "
+
+	for (File srcfile : filelist) {
+		print "."
+		String txtname = srcfile.getName();
+		int i = txtname.lastIndexOf(".");
+		if(i > 0) txtname = txtname.substring(0, i);
+
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+		Element text = params.addText(params.corpora.get(corpusname), txtname, srcfile);
+
+		def ed = new pager(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, "pb");
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/discours/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/discours/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/discours/compiler.groovy	(revision 728)
@@ -0,0 +1,302 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2016-05-26 17:42:36 +0200 (jeu., 26 mai 2016) $
+// $LastChangedRevision: 3219 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.discours
+
+import org.txm.importer.cwb.BuildCwbEncodeArgsFromTEITXM;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+
+import javax.xml.stream.*;
+import java.net.URL;
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class compiler.
+ */
+class compiler {
+
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The dir. */
+	private def dir;
+
+	/** The output. */
+	private def output;
+
+	/** The url. */
+	private def url;
+
+	/** The anahash. */
+	private HashMap<String,String> anahash = new HashMap<String,String>() ;
+
+	/** The text. */
+	String text="";
+
+	/** The base. */
+	String base="";
+
+	/** The project. */
+	String project="";
+
+	/** The cwb loc. */
+	String cwbLoc;
+
+	/** The lang. */
+	private String lang ="fr";
+
+	/** The text attributes. */
+	static String textAttributes = "";
+
+	/**
+	 * initialize.
+	 *
+	 */
+
+	public compiler(){
+	}
+
+	/**
+	 * Instantiates a new compiler.
+	 *
+	 * @param url the url
+	 * @param text the text
+	 * @param base the base
+	 * @param project the project
+	 */
+	public compiler(URL url,String text,String base, String project) {
+		this.text = text
+		this.base = base;
+		this.project = project;
+		try {
+			this.url = url;
+			inputData = url.openStream();
+
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.err.println("IOException while parsing ");
+		}
+	}
+
+	/**
+	 * set the language of the corpus.
+	 *
+	 * @param lang the lang
+	 * @return the java.lang. object
+	 */
+	public setLang(String lang)
+	{
+		this.lang = lang;
+	}
+
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the new cwb path
+	 */
+	public void setCwbPath(String path) {
+		if(!new File(path).exists())
+			System.err.println("Wrong CWB directory path: "+path)
+		cwbLoc = path;
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param f the f
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File f){
+		try {
+			output = new OutputStreamWriter(new FileOutputStream(f,f.exists()) , "UTF-8");
+			return true;
+		} catch (Exception e) {
+			System.err.println(e);
+			return false;
+		}
+	}
+
+	/**
+	 * Go to text.
+	 */
+	private void GoToText() {
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if(event == XMLStreamConstants.END_ELEMENT)
+				if(parser.getLocalName().equals("teiHeader"))
+					return;
+		}
+	}
+
+	/** The debug. */
+	boolean debug = false;
+
+	/**
+	 * Sets the debug.
+	 */
+	public void setDebug()
+	{
+		debug = true;
+	}
+
+	/**
+	 * Run.
+	 *
+	 * @param files the files
+	 * @param basename the basename
+	 * @return true, if successful
+	 */
+	public boolean run(List<File> files, File binDir, File txmDir, String corpusname) {
+		String binDirPath = binDir.getAbsolutePath()+"/";
+
+		if(cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+
+		if(!new File(cwbLoc).exists() || !binDir.exists())
+		{
+			println ("Wrong CWB directory path: "+cwbLoc+" , or Wrong corpus source path:"+binDirPath)
+			return false;
+		}
+		File wtcFile = new File(binDir,"wtc/${corpusname}.wtc");
+		new File(binDir, "wtc.").deleteDir();
+		new File(binDir, "wtc").mkdirs();
+		new File(binDir, "data/$corpusname").deleteDir();
+		new File(binDir, "data/$corpusname").mkdir();
+		new File(binDir, "registry").deleteDir();
+		new File(binDir, "registry").mkdir();
+
+		//start corpus
+		if (createOutput(wtcFile)) {
+			output.write("<txmcorpus lang=\""+lang+"\">\n");
+			output.close();
+		}
+
+		def second = 0
+		//1- Transform into WTC file
+
+		Collections.sort(files);
+		XMLTXM2WTC wtcbuilder = null;
+		for (File f : files) {
+			if (second) { print(", ") }
+			if (second > 0 && (second % 5) == 0) println ""
+			print(f.getName().replaceFirst("\\.xml", ""));
+			second++
+
+			wtcbuilder = new XMLTXM2WTC(f.toURI().toURL());
+			String txtname = f.getName().substring(0,f.getName().length()-4);
+			wtcbuilder.setTextInfo(txtname, corpusname, "project");
+
+			wtcbuilder.setBalisesToKeep(["text","p","s"]);
+			wtcbuilder.setSendToPAttributes(["s":["id"], "p":["id"]]);
+			wtcbuilder.setLang(lang);
+			if (!wtcbuilder.transformFile(wtcFile)) {
+				println("Failed to compile "+f)
+			}
+
+		}
+
+		//end corpus
+		if (createOutput(wtcFile)) {
+			output.write("</txmcorpus>\n");
+			output.close();
+		}
+
+		if (wtcbuilder == null) {
+			println "there was no files to process: "+files
+			return false;
+		}
+
+		//2- Import into CWB
+		def outDir = binDirPath;
+
+		CwbEncode cwbEn = new CwbEncode();
+		CwbMakeAll cwbMa = new CwbMakeAll();
+
+		List<String> pAttributesList = wtcbuilder.getpAttributs();
+		List<String> sAttributesList = wtcbuilder.getsAttributs();
+		println "pAttrs : "+pAttributesList
+		println "sAttrs : "+sAttributesList
+		String[] pAttributes = pAttributesList.toArray(new String[pAttributesList.size()])
+		String[] sAttributes = sAttributesList.toArray(new String[sAttributesList.size()])
+
+		try {
+			//println "Indexing "+compiler.textAttributes
+			cwbEn.setDebug(debug);
+			String regPath = outDir + "registry/"+corpusname.toLowerCase()
+			cwbEn.run(
+					cwbLoc + "cwb-encode",
+					outDir + "data/$corpusname",
+					outDir + "/wtc/"+corpusname+".wtc",
+					regPath,
+					pAttributes,
+					sAttributes);
+			if (!new File(regPath).exists()) {
+				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			//println "Binding all indexes"
+			cwbMa.setDebug(debug);
+			cwbMa.run(cwbLoc + "cwb-makeall", corpusname, outDir + "registry");
+
+		} catch (Exception ex) { System.err.println(ex); return false;}
+
+		return true;
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+		File dir = new File(System.getProperty("user.home"),"xml/discours/txm/");
+		List<File> files = dir.listFiles();
+		def c = new compiler()
+		c.setCwbLoc(System.getProperty("user.home")+"/TXM/cwb/bin/")
+		if (!c.run(files,"discours")) {
+			println "Compiler failed"
+			return;
+		}
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/discours/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/discours/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/discours/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Discours import module : CNR + CSV</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/discours/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/discours/importer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/discours/importer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/discours/importer.groovy	(revision 728)
@@ -0,0 +1,283 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2017-12-13 14:23:35 +0100 (mer., 13 dÃ©c. 2017) $
+// $LastChangedRevision: 3485 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.discours
+
+//import filters.TabulatedToXml.*;
+import org.txm.importer.*;
+import org.txm.importer.filters.*;
+import org.txm.scripts.*;
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.metadatas.Metadatas
+import org.txm.scripts.teitxm.*;
+
+import javax.xml.stream.*;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.txm.*;
+import org.txm.utils.*;
+import org.txm.utils.i18n.DetectBOM;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class importer.
+ */
+class importer {
+
+	/**
+	 * Run.
+	 *
+	 * @param dir the dir
+	 * @param encoding the encoding
+	 * @param basename the basename
+	 * @return true, if successful
+	 */
+	public boolean run(File srcDir, File binDir, File txmDir, String encoding, String basename)
+	{
+		String rootDir = srcDir.getAbsolutePath()+"/"
+		// scanning directory brut/*.cnr
+		String extension = "cnr";
+		File[] list = srcDir.listFiles();
+		
+		if (list == null || list.length == 0) return false;
+
+		LinkedList filelist = new LinkedList();
+		for (File cnr : list) {
+			if (cnr.getName().endsWith("."+extension)) {
+				filelist.add(cnr.getName());
+			}
+		}
+		Collections.sort(filelist);
+
+		// get the headers
+		def csvfile = new File(srcDir, "metadata.csv");
+		Metadatas metadatas; // text metadata
+		
+		println "Trying to read metadata from: "+csvfile
+		if (csvfile.exists()) {
+			File copy = new File(binDir, "metadata.csv")
+			if (!FileCopy.copy(csvfile, copy)) {
+				println "Error: could not create a copy of metadata file "+csvfile.getAbsoluteFile();
+				return;
+			}
+			metadatas = new Metadatas(copy, Toolbox.getParam(Toolbox.METADATA_ENCODING), Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR), Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
+		} else {
+			println "No metadata file: "+csvfile
+			println "Aborting"
+			return false;
+		}
+		
+		// build each xml file from cnr
+		def attrs = ["para", "sent", "form", "lem", "pos", "func"];
+		int formid = 2;
+		String separator = "\t";
+
+		String encodingAll = null;
+		if (encoding == "??") {
+			encodingAll = new CharsetDetector(srcDir).getEncoding();
+			println "Guessed encoding: $encodingAll"
+		}
+
+		print "Converting CNR to XML:"
+		def second = 0
+		for (String id : metadatas.keySet()) // loop on text nodes
+		{
+			int sentence=-1, paragraph=-1, idword=0;
+			String lastopenlocalname= "", localname = "";
+			int para = -1, sent = -1;
+			
+			// = textnode.attribute("id")
+			ArrayList<org.txm.metadatas.Entry> metas = metadatas.get(id);
+			
+			String filename = id +".cnr";
+			File srcfile = new File(srcDir, filename);
+			if (!srcfile.exists()) {
+				println "Can't find CNR file : "+filename
+				continue
+			}
+			File teifile = new File(txmDir, id+".xml");
+			//println("||"+srcfile+">>"+teifile.getAbsolutePath());
+			OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(teifile), "UTF-8");
+
+//			if (second) { print(", ") }
+//			if ((second % 5) == 0) println ""
+//			print(filename.replaceFirst("\\.cnr", ""));
+//			second++
+
+			// HEADER
+			writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+			writer.write("<TEI xmlns=\"http://www.tei-c.org/ns/1.0\" xmlns:txm=\"http://textometrie.org/1.0\">\n");
+			writer.write("<teiHeader type=\"text\">\n");
+			writer.write("<fileDesc>\n");
+			writer.write("<titleStmt>\n");
+			writer.write("<title>"+id+"</title>\n");
+			writer.write("<respStmt>\n");
+			writer.write("<resp id=\"cordial\">initial tagging</resp>")
+			writer.write("</respStmt>\n");
+			writer.write("</titleStmt>\n");
+			writer.write("</fileDesc>\n");
+			writer.write("<encodingDesc>\n");
+			writer.write("<classDecl>\n");
+			writer.write("<taxonomy id=\"pos\"><bibl type=\"tagset\"/></taxonomy>\n")
+			writer.write("<taxonomy id=\"func\"><bibl type=\"tagset\"/></taxonomy>\n")
+			writer.write("<taxonomy id=\"lemma\"><bibl type=\"tagset\"/></taxonomy>\n")
+			writer.write("</classDecl>\n");
+			writer.write("</encodingDesc>\n");
+			writer.write("</teiHeader>\n");
+			writer.write("<text ")
+			for (org.txm.metadatas.Entry metadata : metas) {
+				String name = metadata.getId()
+				String value = metadata.getValue()
+				if (name != "id")
+					writer.write(" "+name+"=\""+value.replace("&", "&amp;").replace("<", "&lt;").replace("\"", "&quot;")+"\"");	
+			}
+			writer.write(" id=\""+id.replace("&", "&amp;").replace("<", "&lt;").replace("\"", "&quot;")+"\"");
+			writer.write(">\n");
+
+			//def content = srcfile.getText(encoding)
+			String tmpEncoding = encoding;
+			if (encodingAll != null) {
+				tmpEncoding = encodingAll
+				if (srcfile.length() > CharsetDetector.MINIMALSIZE) {
+					tmpEncoding = new CharsetDetector(srcfile).getEncoding();
+					//println "file encoding: $tmpEncoding"	
+				}
+			}
+			def input = new FileInputStream(srcfile)
+			def reader = new BufferedReader(new InputStreamReader(input , tmpEncoding));
+			DetectBOM bomdetector = new DetectBOM(srcfile);
+			for (int ibom = 0 ; ibom < bomdetector.getBOMSize() ; ibom++) input.read()
+
+			// BODY
+			String line = reader.readLine();
+			int nline = 0;
+			def errors = [];
+			while (line != null) {
+				line = CleanFile.cleanAllButTabs(line); // remove ctrl and surrogate chars
+				
+				nline++;
+				String[] fields = line.split(separator);
+				if (fields.size() == attrs.size()) {
+					idword++;
+					
+					String paraV = fields[0].replaceAll("\\p{C}", "")
+					String sentV = fields[1].replaceAll("\\p{C}", "")
+					String formV = fields[2].replaceAll("\\p{C}", "").replace("&","&amp;").replace("<","&lt;");
+					String lemV = fields[3].replaceAll("\\p{C}", "").replace("&","&amp;").replace("<","&lt;");
+					String posV = fields[4].replaceAll("\\p{C}", "").replace("&","&amp;").replace("<","&lt;");
+					String funcV = fields[5].replaceAll("\\p{C}", "").replace("&","&amp;").replace("<","&lt;");
+					
+					try {
+						para = Integer.parseInt(paraV);
+					} catch(Exception e){}
+					if (para != paragraph) {
+						if (paragraph != -1) {
+							if (sentence != -1) {
+								writer.write("</s>\n")
+								sentence = -1;
+							}
+							writer.write("</p>\n")
+						}
+						writer.write("<p id=\"p_${para}\">\n");
+						paragraph = para;
+					}
+					
+					try {
+						sent = Integer.parseInt(sentV);
+					} catch(Exception e){}
+					if (sent != sentence) {
+						if (sentence != -1)
+							writer.write("</s>\n")
+						writer.write("<s id=\"s_${sent}\">\n");
+						sentence = sent;
+					}
+					
+					writer.write("<w id=\"w_${id}_${idword}\">\n");
+					writer.write(" <txm:form>$formV</txm:form>\n");
+					writer.write(" <txm:ana resp=\"#cordial\" type=\"#pos\">$posV</txm:ana>\n");
+					writer.write(" <txm:ana resp=\"#cordial\" type=\"#func\">$funcV</txm:ana>\n");
+					writer.write(" <txm:ana resp=\"#cordial\" type=\"#lemma\">$lemV</txm:ana>\n");
+					writer.write(" <txm:ana resp=\"#cordial\" type=\"#sent\">$sentV</txm:ana>\n");
+					writer.write(" <txm:ana resp=\"#cordial\" type=\"#para\">$paraV</txm:ana>\n");
+					writer.write(" <txm:ana resp=\"#txm\" type=\"#ref\">${id}, Â§${paraV}</txm:ana>\n");
+					writer.write("</w>\n");
+				} else {
+					//println "error : $nline : '$line' -> $fields"
+					if (line.length() > 0) errors << nline
+				}
+				line = reader.readLine();
+			}
+
+			// CLOSE
+			if(sentence != -1) { writer.write("</s>\n") }
+			if(paragraph != -1) { writer.write("</p>\n") }
+			paragraph=-1;
+			sentence=-1;
+			writer.write("</text>\n");
+			writer.write("</TEI>\n");
+			writer.close();
+			
+			if (errors.size() > 0) {
+				println "Errors in file $filename. Wrong number of columns at lines: "+errors
+			} else print "."
+		}
+		println ""
+		return true;
+	}
+
+	/**
+	 * Gets the metadata.
+	 *
+	 * @return the metadata
+	 */
+	public List<String> getMetadatas()
+	{
+		return metaDatas;
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File(System.getProperty("user.home"), "xml/discours/");
+		new importer().run(dir);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/wtc/wtcLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/wtc/wtcLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/wtc/wtcLoader.groovy	(revision 728)
@@ -0,0 +1,151 @@
+package org.txm.importer.wtc
+
+import org.txm.importer.cwb.BuildCwbEncodeArgs;
+import java.io.File;
+import java.util.ArrayList;
+
+import org.txm.objects.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.*;
+import org.txm.utils.i18n.*;
+import org.txm.metadatas.*;
+import org.txm.utils.FileCopy;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/wtc/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		//Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File("C:\\Program Files\\treetagger\\models"));//for Windows
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+// FAKE: will contains no XML-TXM files
+File txmDir = new File(binDir, "txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+// Will contains the edition files
+File htmlDir = new File(binDir, "HTML/$corpusname");
+htmlDir.deleteDir();
+htmlDir.mkdirs();
+
+// get the wtc file and the registry file
+File wtcFile;
+File registryFile;
+println "Looking for files to process..."
+for(File f : srcDir.listFiles()) {
+	if (f.isHidden()) continue;
+	if (f.isDirectory()) continue;
+	if (f.getName().endsWith(".wtc")) {
+		if (wtcFile == null) {
+			wtcFile = f;
+			println "Using WTC file : $wtcFile"
+		}
+	} else if (f.getName().endsWith(".xml")) {
+
+	} else if (!f.getName().contains(".")){ // its the registry file
+		if (registryFile == null) {
+			registryFile = f;
+			println "Using registry file : $f"
+		}
+	}
+}
+
+if (wtcFile == null) {
+	println "No WTC file in source directory: "+srcDir;
+	return false;
+}
+
+// get pAttributes an run cwb-encode + cwb-makeall
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler(wtcFile, registryFile)
+c.setDebug(debug)
+if (!c.run(binDir, corpusname)) {
+	println "Import stopped"
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+	
+	println "-- EDITION - Building edition"
+	if (MONITOR != null) MONITOR.worked(20, "EDITION - Building edition")
+
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+
+	print "."
+
+	List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+	List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+	File binWtcFile = new File(binDir,"wtc/"+corpusname+".wtc");
+	def ed = new pager(binWtcFile, outdir, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, registryFile !=null, c.pAttributesList);
+	def allIndexes = ed.getIdx();
+	def allPages = ed.getPageFiles();
+	for (String txtname : ed.getTextNames()) {
+		def txtIndexes = allIndexes[txtname];
+		def txtPages = allPages[txtname];
+
+		Element text = params.addText(params.corpora.get(corpusname), txtname, wtcFile);
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < txtPages.size();) {
+			File f = txtPages.get(i);
+			String wordid = txtIndexes.get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+println ""
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/wtc/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/wtc/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/wtc/compiler.groovy	(revision 728)
@@ -0,0 +1,218 @@
+
+
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2012-01-05 14:27:34 +0100 (jeu., 05 janv. 2012) $
+// $LastChangedRevision: 2096 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.wtc
+
+import org.txm.Toolbox;
+import org.txm.importer.cwb.*
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.FileCopy;
+import org.txm.utils.treetagger.TreeTagger;
+import java.util.ArrayList;
+import javax.xml.stream.*;
+import java.net.URL;
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class compiler.
+ */
+class compiler
+{
+	/** The debug. */
+	boolean debug = false;
+
+	/** The dir. */
+	private def dir;
+
+	/** The cwb loc. */
+	String cwbLoc;
+	File srcWTCFile, srcRegistryFile;
+
+	public def pAttributesList = [];
+	public def sAttributesList = [];
+
+	public compiler(File wtcFile, File registryFile) {
+		this.srcWTCFile = wtcFile;
+		this.srcRegistryFile = registryFile
+	}
+
+	/**
+	 * Sets the debug.
+	 *
+	 * @return the java.lang. object
+	 */
+	public setDebug()
+	{
+		debug =true;
+	}
+
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the new cwb path
+	 */
+	public void setCwbPath(String path)
+	{
+		if (!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path;
+	}
+
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param basename the basename
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, String corpusname)
+	{
+		if (cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+
+		if (!new File(cwbLoc).exists()) {
+			println ("CWB path error: "+cwbLoc)
+			return false;
+		}
+		if (!binDir.exists()) {
+			println ("binary directory does not exists: "+binDir)
+			return false;
+		}
+
+		if (!srcWTCFile.exists()) {
+			println "Error: cannot find the WTC file $srcWTCFile"
+			return false;
+		}
+
+		File wtcFile = new File(binDir,"wtc/"+corpusname+".wtc");
+		new File(binDir, "wtc").deleteDir();
+		new File(binDir, "wtc").mkdir();
+		new File(binDir, "data").deleteDir();
+		new File(binDir, "data").mkdir();
+		new File(binDir, "registry").mkdir();
+
+		FileCopy.copy(srcWTCFile, wtcFile);
+
+		//2- Import into CWB
+		def outDir = binDir.getAbsolutePath()+"/";
+
+		CwbEncode cwbEn = new CwbEncode();
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		cwbEn.setDebug(debug);
+		cwbMa.setDebug(debug);
+
+		String[] pAttributes;
+		String[] sAttributes;
+
+		if (srcRegistryFile == null) {
+			println "WARNING: No registry file found in source directory"
+			println "We'll search for positional attributes and structural attributes in the WTC file"
+
+			// s attributes
+			BuildCwbEncodeArgsFromWTC argsgetter = new BuildCwbEncodeArgsFromWTC(); // XML stream
+			argsgetter.process(wtcFile); //$NON-NLS-1$
+			sAttributesList = argsgetter.getSAttributes();
+
+			// p attributes
+			int nbAttr = -1;
+			File tmp = File.createTempFile("txm", ".wtc", wtcFile.getParentFile());
+			int wcounter = 1;
+			println "Adding the 'id' property to the WTC file and getting word properties number."
+			tmp.withWriter("UTF-8") { writer ->
+				wtcFile.eachLine("UTF-8") { line ->
+					if (!line.startsWith("<")) {
+						if (nbAttr == -1) nbAttr = line.split("\t").size();
+						writer.println(line+"\tw_"+(wcounter++))
+					} else {
+						writer.println(line)
+					}
+					writer.flush();
+				}
+			}
+			wtcFile.delete()
+			tmp.renameTo(wtcFile)
+
+			System.out.println("Found "+(nbAttr-1)+" word properties, $nbAttr with the 'id'");
+			for (int i = 1; i < nbAttr ; i++) {
+				pAttributesList << "p$i";
+			}
+			pAttributesList << "id"
+		} else {
+			ReadRegistryFile reader = new ReadRegistryFile(srcRegistryFile);
+			pAttributesList = reader.getPAttributes();
+			sAttributesList = reader.getSAttributes();
+			pAttributesList.remove(0) // remove word
+
+			if (!pAttributesList.contains("id")) {
+				System.out.println("Error: The registry file does not declare the 'id' word property");
+				return false;
+			}
+		}
+
+		pAttributes = pAttributesList; // cast to array
+		sAttributes = sAttributesList; // cast to array
+
+		println "pAttrs : "+Arrays.toString(pAttributes)
+		println "sAttrs : "+Arrays.toString(sAttributes)
+
+		try {
+			cwbEn.setDebug(debug);
+			cwbMa.setDebug(debug);
+			String regPath =outDir + "/registry/"+corpusname.toLowerCase()
+			cwbEn.run(cwbLoc + "cwb-encode", outDir + "/data/$corpusname", 
+					wtcFile.getAbsolutePath(),
+					regPath, pAttributes, sAttributes);
+			if (!new File(regPath).exists()) {
+				println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
+				return false;
+			}
+			cwbMa.run(cwbLoc + "cwb-makeall", corpusname, outDir + "/registry");
+			return true;
+		} catch (Exception ex) {System.out.println(ex); return false;}
+
+		return true;
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("~/xml/perrault/txm/");
+		List<File> files = dir.listFiles();
+		new compiler().run(files);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/wtc/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/wtc/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/wtc/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>CWB import module.</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/wtc/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/wtc/pager.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/wtc/pager.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/wtc/pager.groovy	(revision 728)
@@ -0,0 +1,354 @@
+package org.txm.importer.wtc;
+//Copyright Â© - ANR TextomÃ©trie - http://textometrie.ens-lyon.fr
+//
+//This file is part of the TXM platform.
+//
+//The TXM platform is free software: you can redistribute it and/or modif y
+//it under the terms of the GNU General Public License as published by
+//the Free Software Foundation, either version 3 of the License, or
+//(at your option) any later version.
+//
+//The TXM platform 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 General Public License for more details.
+//
+//You should have received a copy of the GNU General Public License
+//along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+//
+//
+//$LastChangedDate: 2012-06-01 17:47:31 +0200 (ven., 01 juin 2012) $
+//$LastChangedRevision: 2185 $
+//$LastChangedBy: mdecorde $
+//
+
+import org.txm.importer.*;
+import org.xml.sax.Attributes;
+import org.txm.importer.filters.*;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+/** Build WTC corpus simple edition from a WTC file. 
+ * 
+ * @author mdecorde
+ */
+class pager {
+	List<String> NoSpaceBefore;
+
+	/** The No space after. */
+	List<String> NoSpaceAfter;
+
+	/** The wordcount. */
+	int wordcount = 0;
+
+	/** The pagecount. */
+	int pagecount = 0;
+
+	/** The wordmax. */
+	int wordmax = 0;
+
+	/** The basename. */
+	String basename = "";
+	String txtname = "";
+	File outdir;
+
+	/** The wordid. */
+	String wordid;
+
+	/** The first word. */
+	boolean firstWord = true;
+
+	/** The wordvalue. */
+	String wordvalue;
+
+	/** The interpvalue. */
+	String interpvalue;
+
+	/** The lastword. */
+	String lastword = " ";
+
+	/** The wordtype. */
+	String wordtype;
+
+	/** The flagform. */
+	boolean flagform = false;
+
+	/** The flaginterp. */
+	boolean flaginterp = false;
+
+	/** The url. */
+	private def url;
+
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The writer. */
+	OutputStreamWriter writer;
+
+	/** The pagedWriter. */
+	OutputStreamWriter pagedWriter = null;
+
+	/** The wtcFile. */
+	File wtcFile;
+
+	/** The outfile. */
+	File outfile;
+
+	/** The pages. */
+	def pages = [:];
+
+	/** The idxstart. */
+	def idxstart = [:]
+	String editionPage;
+	ArrayList<Integer> splitTUs; // contains the tu ids used to split pages
+	boolean shouldSplit = false;
+	boolean useSplitTUs = false;
+	boolean hasWordId = false;
+	int noWordIdProperty = -1;
+	/**
+	 * Instantiates a new pager.
+	 *
+	 * @param wtcFile the wtcFile
+	 * @param outfile the outfile
+	 * @param NoSpaceBefore the no space before
+	 * @param NoSpaceAfter the no space after
+	 * @param max the max
+	 * @param basename the basename
+	 */
+	pager(File wtcFile, File outdir, List<String> NoSpaceBefore,
+	List<String> NoSpaceAfter, int max, String basename, boolean hasWordId, List pAttrs) {
+		this.editionPage = editionPage;
+		this.basename = basename;
+		this.txtname = "text1";
+		this.outdir = outdir;
+		this.wordmax = max;
+		this.NoSpaceBefore = NoSpaceBefore;
+		this.NoSpaceAfter = NoSpaceAfter;
+		this.wtcFile = wtcFile;
+		this.hasWordId = hasWordId;
+		if (hasWordId) {
+			noWordIdProperty = pAttrs.indexOf("id") + 1;
+			if (noWordIdProperty == 0)
+			hasWordId = false;
+		}
+		
+		process();
+	}
+
+	private void closeMultiWriter()
+	{
+		if (pagedWriter != null) {
+			if (firstWord) { // there was no words
+				this.idxstart[txtname] = ["w_0"]
+				pagedWriter.write("<span id=\"w_0\"/>");
+			}
+			pagedWriter.write("</p>\n")
+			pagedWriter.write("</body>");
+			pagedWriter.write("</html>");
+			pagedWriter.close();
+		}
+	}
+
+	/**
+	 * Creates the next output.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean createNextOutput()
+	{
+		wordcount = 0;
+		shouldSplit = false;
+		try {
+			closeMultiWriter();
+			File outfile = new File(outdir, txtname+"_"+(++pagecount)+".html")
+			//println "outfile: "+outfile
+			if (pages[txtname] == null) pages[txtname] = []
+			pages[txtname] << outfile;
+			firstWord = true; // waiting for next word
+
+			pagedWriter = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(outfile)) , "UTF-8");
+			pagedWriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+			pagedWriter.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"   \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n")
+			pagedWriter.write("<html>");
+			pagedWriter.write("<head>");
+			pagedWriter.write("<title>"+basename.toUpperCase()+" $txtname Edition - Page "+pagecount+"</title>");
+			pagedWriter.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"tmx.css\"/>");
+			pagedWriter.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\"/>");
+			pagedWriter.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>");
+			pagedWriter.write("</head>");
+			pagedWriter.write("<body>");
+
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput() {
+		try {
+			return createNextOutput();
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Gets the page files.
+	 *
+	 * @return the page files
+	 */
+	public def getPageFiles() {
+		return pages;
+	}
+
+	/**
+	 * Gets the idx.
+	 *
+	 * @return the idx
+	 */
+	public def getIdx() {
+		return idxstart;
+	}
+
+	def texts = []
+
+	/**
+	 * Process.
+	 */
+	void process() {
+
+		String localname = "";
+		String lastword= "";
+		createNextOutput();
+		int wcounter = 1;
+		int txtwcounter = 1;
+
+		BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(wtcFile) , "UTF-8"));
+		String line = reader.readLine();
+		int cline = 0;
+		while (line != null) {
+			pagedWriter.flush();
+			cline++;
+			//println "line: "+line
+			if (line.startsWith("<")) {
+				if (line.startsWith("<lb/") || line.startsWith("<br/") || line.startsWith("</p>") || 
+					line.startsWith("<lb>") || line.startsWith("<br>")) {
+					pagedWriter.write("<br/>");
+				} 
+				if (line.startsWith("<text>") || line.startsWith("<text ")) {
+					String tmp = line;
+					int idx = tmp.indexOf("id=\"");
+					if (idx > 0) {
+						tmp = tmp.substring(idx+4);
+						//println "tmp1: "+tmp
+						int idx2 = tmp.indexOf("\"");
+						//println "tmp2: "+tmp
+						if (idx2 > 0) {
+							tmp = tmp.substring(0, idx2);
+							txtname = tmp
+							texts << txtname;
+							pagecount = 0;
+							createNextOutput();
+						}
+					}
+				} else if (line.startsWith("<s>") || line.startsWith("<s ")) {
+					pagedWriter.write(line.replaceAll("<s", "<sent "));
+				} else if (line.startsWith("</s>")) {
+					pagedWriter.write("</sent>");
+				}  else if (line.startsWith("<pb/>") || line.startsWith("<pb>")) {
+					pagedWriter.write(line);
+					txtwcounter = 1;
+					createNextOutput();
+				} else {
+					pagedWriter.write(line);
+				}
+			} else { // word
+				if (txtwcounter > wordmax) {
+					txtwcounter = 1;
+					createNextOutput();
+				}
+				def split = line.split("\t");
+				if (split == null || split.size() == 0) {
+					// empty line
+				} else {
+					String wordid;
+					if (hasWordId) {
+						if (split.size() <= noWordIdProperty) { // +1 since line contains word
+							println "Error: line $cline"
+						} else {
+							wordid = split[noWordIdProperty];
+						}
+					} else {
+						wordid = "w_"+(wcounter++);
+					}
+					txtwcounter++;
+					String wordvalue = split[0];
+
+					if (firstWord) {
+						firstWord = false;
+						if (this.idxstart[txtname] == null) {
+							this.idxstart[txtname] = []
+						}
+						this.idxstart[txtname] << [wordid];
+					}
+
+					int l = lastword.length();
+					String endOfLastWord = "";
+					if (l > 0) {
+						endOfLastWord = lastword.subSequence(l-1, l);
+					}
+
+					String interpvalue = "";
+					if (split.size() > 1) {
+						interpvalue = split[1..split.size()-1].join(" ")
+						interpvalue = interpvalue.replace("&", "&amp;").replace("<", "&lt;").replace("\"","&quot;");
+					}
+
+
+					if (NoSpaceBefore.contains(wordvalue) ||
+					NoSpaceAfter.contains(lastword) ||
+					wordvalue.startsWith("-") ||
+					NoSpaceAfter.contains(endOfLastWord)) {
+						pagedWriter.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+					} else {
+						pagedWriter.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+					}
+
+					pagedWriter.write(wordvalue.replace("&", "&amp;").replace("\"","&quot;").replace("<", "&lt;")+"</span>\n");
+					pagedWriter.flush()
+					lastword = wordvalue;
+				}
+			}
+			line = reader.readLine();
+		}
+
+		closeMultiWriter();
+	}
+
+	def getTextNames() {
+		return texts;
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/Factiva2XmlTxm.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/Factiva2XmlTxm.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/Factiva2XmlTxm.groovy	(revision 728)
@@ -0,0 +1,261 @@
+/**
+ * Main.
+ *
+ * @param args the args
+ */
+// script de recherche de contenus entre balises dans un fichier xml
+
+/**
+ *  @author Daniel Marin, Florent BÃ©dÃ©carrats
+ *  @author Matthieu Decorde
+ *  @copyright 2011 Daniel Marin &  Florent BÃ©dÃ©carrats, for original Perl version
+ *  @copyright 2011 ENS de Lyon, for translation in Groovy
+ *  This software is licensed under the GNU GPL version 3.0 or later. 
+ */
+package org.txm.importer;
+
+public run(File rootDir, String rep_final ) {
+
+	// A RENSEIGNER #########################################
+	
+	def fich_xml = rootDir.listFiles().grep(~/.*\.xml/)
+	println "$rootDir : $fich_xml"
+
+	def ext = ".xml"
+	//def rep_final = rootDir.getAbsolutePath()+"/out" // le nom du rÃ©pertoire dans lequel on va crÃ©er les fichiers txm
+
+	List<String> Balises = ["<baseLanguage>","<date>","<sourceName>","<name>","<name>"] // balises XML Ã  dÃ©tecter
+	List<String> FinBalises = ["</baseLanguage>","</date>","</sourceName>","</name>","</name>"]
+
+	List<String> Sections = ["<ppsarticle>","<industry ","<region ","<headline>","<tailParagraphs>"] // Balises indiquant qu'Ã  'intÃ©rieur de la section se trouvent les infos (sur plusieurs lignes contrairement Ã  @Balises)
+	List<String> FinSections = ["</ppsarticle>","</industry>","</region>","</headline>","</tailParagraphs>"]
+
+	def Headline = [] // le tableau dans lequel on va stocker le contenu de <headline>
+	def TailPara = [] // le tableau dans lequel on va stocker le contenu de <tailParagraphs>
+
+	def NomsMeta = ["language=","date=","source=","subject=","country="] // les noms qui interviennent dans les mÃ©ta-donnÃ©es du fichier final
+	// FIN A RENSEIGNER #####################################
+
+	def TestMeta = [0,0,0,0,0] // Tableau qui indique si les mÃ©tadonnÃ©es sont disponibles dans le fichier
+	def MetaData = [] //le tableau des metadonnÃ©es
+	def metaData = "" // la chaine dans laquelle on va stocker les mÃ©tadonnÃ©es
+	String temp = ""
+	def fich_out = ">"
+	def nom_in = ""
+
+	def new_fich=0 // variable booleenne qui indique si on doit crÃ©er un nouveau txm
+	def industry=0 // variable booleenne qui indique qu'on est dans la section <industry> pour renseigner "subject"
+	def premIndustry=0 // variable booleenne qui indique qu'on a passÃ© le 1er <industry> pour renseigner "subject"
+	def region=0 // variable booleenne qui indique qu'on est dans la section <region> pour renseigner "country"
+	def premRegion=0 // variable booleenne qui indique qu'on a passÃ© le 1er <region> pour renseigner "country"
+	def copie=0 // variable booleenne qui indique si l'on doit copier le contenu de la ligne dans le fichier txm
+	def copieSec3=0 // variable qui indique si on est Ã  l'intÃ©rieur de la section 3
+	def copieSec4=0 // variable qui indique si on est Ã  l'intÃ©rieur de la section 4
+
+	def num_fich=0 // le numÃ©ro du fichier traitÃ©
+	def char_num_fich="" // pour numÃ©roter les fichiers fich_001 pour garder l'ordre alphabÃ©tique
+
+	def i = 1
+
+	println "CrÃ©ation du rÃ©pertoire dans lequel on va mettre les fichiers finaux txm"
+	if (new File(rep_final).exists()) {
+		println "Le rÃ©pertoire $rep_final existe"
+	}
+	else {
+		if (!new File(rep_final).mkdir()) {
+			println "Echec de la crÃ©ation du rÃ©pertoire: $rep_final"
+			return
+		}
+		if (!new File(rep_final).canWrite()) {
+			println "Le rÃ©pertoire '$rep_final' final est read-only"
+			return
+		}
+	}
+
+	FileWriter ECRITURE
+	for (File fich_in : fich_xml) {
+		if (fich_in.getName() == "import.xml") continue;
+		println "Validate $fich_in...";
+		if (!ValidateXml.test(fich_in)) {
+			println "skip $fich_in"
+			continue;
+		}
+		// open(LECTURE, fich_in) || die("erreur d'ouverture de $fich_in")
+		println "on parcourt l'ensemble de $fich_in"
+		def reader = new FileReader(fich_in)
+		String line = reader.readLine()
+		while (line != null)
+		{
+			// on stocke le contenu de la ligne (et on efface le retour chariot Ã  la fin)
+			temp = line
+			temp = temp.trim()
+			temp = (temp =~ /^\s+/).replaceAll("")
+			temp = (temp =~ /^\t/).replaceAll("")
+			temp = temp.replaceAll("</paragraph>", "</paragraph><br/>")
+
+			// On indique si on est dans la 1Ã¨re section de industry ou region pour prÃ©lever <name>
+			if ((temp =~ Sections[1]) && (premIndustry==0)){
+				industry=1
+				premIndustry=1
+			}
+			else if (temp =~ FinSections[1]){
+				industry=0
+			}
+
+			if ((temp =~ Sections[2]) && (premRegion==0)){
+				region = 1
+				premRegion = 1
+			}
+			else if (temp =~ FinSections[2]){
+				region = 0
+			}
+
+			// on regarde si la balise de crÃ©ation de nouveau fichier est prÃ©sente
+			if (temp =~ Sections[0]){
+				new_fich=1
+				num_fich = num_fich+1
+				nom_in = fich_in.getName()
+				nom_in = (nom_in =~ /$ext/).replaceAll("")
+				// Petit test pour numÃ©roter les fichiers en 001, 002 plutÃ´t que 1, 2 (ordre alphabÃ©tique)
+				if (num_fich < 10){
+					char_num_fich = "00"+num_fich
+				} else if (num_fich<100) {
+					char_num_fich = "0"+num_fich
+				} else {
+					char_num_fich = num_fich
+				}
+				fich_out = new File(rep_final, nom_in + "_" + char_num_fich + ext)
+				//open(ECRITURE,"> $fich_out") || die("erreur d'ouverture de $fich_out ! $! \n")
+				println("new file : "+fich_out)
+				if (ECRITURE != null) ECRITURE.close()
+				ECRITURE = new FileWriter(fich_out)
+			}
+
+			// Remplissage des mÃ©tadonnÃ©es : ####################################################
+			// Language
+			if (temp =~ Balises[0]){
+				temp = (temp =~ Balises[0]).replaceAll("")
+				temp = (temp =~ FinBalises[0]).replaceAll("")
+
+				MetaData[0]=temp
+				print " language trouve : "+MetaData[0]+" \n"
+				TestMeta[0]=1
+
+			}
+			// date
+			if (temp =~ Balises[1]) {
+				temp = (temp =~ Balises[1]).replaceAll("")
+				temp = (temp =~ FinBalises[1]).replaceAll("")
+				MetaData[1]=temp
+				print " date trouvee : "+MetaData[1]+" \n"
+				TestMeta[1]=1
+			}
+			// source
+			if (temp =~ Balises[2]){
+				temp = (temp =~ Balises[2]).replaceAll("")
+				temp = (temp =~ FinBalises[2]).replaceAll("")
+				MetaData[2]=temp
+				print " source trouvee : "+MetaData[2]+" \n"
+				TestMeta[2]=1
+			}
+			// subject (on doit Ãªtre dans la 1Ã¨re section <industry>)
+			if ((temp =~ Balises[3]) && (industry==1)){
+				temp = (temp =~ Balises[3]).replaceAll("")
+				temp = (temp =~ FinBalises[3]).replaceAll("")
+				MetaData[3]=temp
+				industry=0
+				print " Sujet trouve : "+MetaData[3]+" \n"
+				TestMeta[3]=1
+			}
+			// country
+			if ((temp =~ Balises[4]) && (region==1)){
+				temp = (temp =~ Balises[4]).replaceAll("")
+				temp = (temp =~ FinBalises[4]).replaceAll("")
+				MetaData[4]=temp
+				region=0
+				print " Pays trouve : "+MetaData[4]+" \n"
+				TestMeta[4]=1
+
+				// Toutes les mÃ©ta-donnÃ©es ont Ã©tÃ© trouvÃ©es, on assemble la chaÃ®ne
+				metaData = "<article "
+				for (i=0;i<(NomsMeta.size()+1);i++){
+					if (TestMeta[i]==1){
+						metaData = metaData+NomsMeta[i]+"\""+MetaData[i]+"\" "
+					}
+					else if (TestMeta[i]==0){
+						metaData = metaData +NomsMeta[i]+"\"\" "
+					}
+				}
+				metaData = "$metaData>\n"
+				print " metaData : $metaData \n"
+			}
+			// FIN Remplissage des mÃ©tadonnÃ©es : #################################################
+
+			// On copie ou pas si on est ou pas dans <headline> ou <tailParagraphs>
+			if (temp =~ Sections[3]){
+				copieSec3=1
+			}
+			if (temp =~ FinSections[3]){
+				Headline.add(temp)
+				copieSec3=0
+			}
+			if (temp =~ Sections[4]){
+				copieSec4=1
+			}
+			if (temp =~ FinSections[4]){
+				TailPara.add(temp)
+				copieSec4=0
+			}
+
+			if (copieSec3 == 1){
+				Headline.add(temp)
+			}
+			if (copieSec4 == 1){
+				TailPara.add(temp)
+			}
+
+			if (temp =~ FinSections[0]){
+				ECRITURE.write("$metaData\n")
+				for (i=0;i<(Headline.size());i++){
+					if (i==0 || i==Headline){
+						ECRITURE.write(Headline[i].toString()+"\n")
+					}
+					else{
+						ECRITURE.write("\t"+Headline[i]+"\n")
+					}
+				}
+				for (i=0;i<(TailPara.size());i++){
+					if (i==0 || i==TailPara){
+						ECRITURE.write(TailPara[i].toString()+"\n")
+					}
+					else{
+						ECRITURE.write("\t"+TailPara[i]+"\n")
+					}
+				}
+				ECRITURE.write("</article>")
+
+				new_fich=0
+				industry=0
+				region=0
+				premIndustry=0
+				premRegion=0
+				MetaData=[]
+				TestMeta=[0,0,0,0,0]
+				Headline=[]
+				TailPara=[]
+
+				ECRITURE.close()
+				print "fichier $char_num_fich traite.\n"
+			}
+			line = reader.readLine()
+		}
+		ECRITURE.close()
+		reader.close()
+		num_fich = 0
+	}
+}
+
+String userDir = System.getProperty("user.home");
+File rootDir = new File(userDir, "xml/factiva")
+File outdir = new File(rootDir, "out2")
+run(rootDir, outdir.getAbsolutePath());
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Shared tools for import modules</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/WordCounter.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/WordCounter.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/WordCounter.groovy	(revision 728)
@@ -0,0 +1,189 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2015-12-17 12:11:39 +0100 (jeu., 17 dÃ©c. 2015) $
+// $LastChangedRevision: 3087 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+import java.io.BufferedReader;
+import java.util.ArrayList;
+import javax.xml.parsers.SAXParserFactory
+import org.xml.sax.helpers.DefaultHandler
+import org.xml.sax.*
+import javax.xml.stream.*;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/** Count the focused tag and add id to it you must specify  : which tag are milestones the tag to count. */
+class WordCounter extends DefaultHandler {
+    String txt ;
+	
+	/** The focus. */
+	String focus;
+    
+    /** The counter. */
+    int counter = 0;
+    
+    /** The solotags. */
+    ArrayList<String> solotags;
+    
+    /** The writer. */
+    XMLStreamWriter writer;
+	
+	/**
+	 * The initializer do the work
+	 * The file infile is replaced by the result.
+	 *
+	 * @param infile the infile
+	 * @param focus the focus
+	 * @param txt the txt
+	 */
+    WordCounter(File infile, String focus, String txt)
+    {
+    	File outfile = new File(infile.getName()+"counter");
+		this.focus=focus;
+		this.txt = txt;
+		
+		FileInputStream input = new FileInputStream(infile);
+		
+        def handler = this;
+        def reader = SAXParserFactory.newInstance().newSAXParser();
+		
+        def output = new FileOutputStream(outfile);
+        XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		writer = factory.createXMLStreamWriter(output, "UTF-8");
+		writer.writeStartDocument("UTF-8", "1.0");
+		output.write("\n")
+		
+		//Reader inputStream = new InputStreamReader(new FileInputStream(infile) , "UTF-8");
+		//BufferedReader r= new BufferedReader(inputStream);
+		
+        reader.parse(input, handler);// process !!
+		
+        input.close();
+        writer.close();
+		output.close();
+        //r.close();
+        if (!(infile.delete() && outfile.renameTo(infile))) println "Warning can't rename file "+outfile+" to "+infile
+    }
+	
+	/**
+	 * process start tag.
+	 *
+	 * @param ns the ns
+	 * @param localName the localname of the current tag
+	 * @param qName the q name
+	 * @param atts the attributes of the current tag
+	 */
+    void startElement(String ns, String localName, String qName, Attributes atts) {
+    	
+    	writer.writeStartElement(qName)
+    	
+    	//writeAttrs
+        if(qName.matches(focus))
+        {
+        	counter++;
+        	writer.writeAttribute("n",""+counter)
+            writer.writeAttribute("xml:id",focus+txt+"_"+counter)
+            for(int i=0; i < atts.getLength();i++)
+            	if(atts.getQName(i) != "n" && atts.getQName(i) != "xml:id" && atts.getQName(i) != "id")
+                writer.writeAttribute(atts.getQName(i), atts.getValue(i));
+        }
+        else
+        {
+        	for(int i=0; i < atts.getLength();i++)
+                writer.writeAttribute(atts.getQName(i), atts.getValue(i));
+        }
+    }
+	
+	/**
+	 * write the CDATA, not finished.
+	 *
+	 * @param chars all the chars
+	 * @param offset where the text begin
+	 * @param length the length
+	 */
+    void characters(char[] chars, int offset, int length)
+    {
+    	writer.writeCharacters(chars, offset, length)
+    }
+	
+	/* (non-Javadoc)
+	 * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
+	 */
+    void endElement(String ns, String localName, String qName)
+    {
+       writer.writeEndElement();
+    }
+    
+    /**
+     * Find text id.
+     *
+     * @param infile the infile
+     * @param focus the focus
+     * @return the string
+     */
+    public static String findTextId(File infile, String focus)
+    {
+    	def inputData = infile.toURI().toURL().openStream();
+		def inputfactory = XMLInputFactory.newInstance();
+		XMLStreamReader parser = inputfactory.createXMLStreamReader(inputData);
+				
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			switch (event) 
+			{
+				case XMLStreamConstants.START_ELEMENT:
+					if(parser.getLocalName() == focus)
+					{
+						String sid = ""
+						for(int i = 0 ; i < parser.getAttributeCount() ; i++)
+							if(parser.getAttributeLocalName(i) == "id")
+							{
+								sid = parser.getAttributeValue(i); //xxx_000
+								sid = sid.substring(focus.length()); // on retire le nom du focus
+								sid = sid.split("_")[0];
+								break;
+							}
+						inputData.close();
+						parser.close();
+						return sid;
+					}
+			}
+		}
+    }
+    
+    /**
+     * The main method.
+     *
+     * @param args the arguments
+     */
+    static void main(String[] args)
+    {
+    	File infile = new File("~/xml/quote/processme-q.xml")
+        new WordCounter(infile, "s","01");
+    	new WordCounter(infile, "q","01");
+    }
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ApplyXsl.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ApplyXsl.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ApplyXsl.groovy	(revision 728)
@@ -0,0 +1,244 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+// 
+// 
+// 
+// $LastChangedDate: 2016-03-01 10:10:58 +0100 (mar., 01 mars 2016) $
+// $LastChangedRevision: 3133 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+/**
+ * @author mdecorde
+ */
+
+import java.io.File;
+import javax.xml.transform.Transformer
+import javax.xml.transform.TransformerFactory
+import javax.xml.transform.stream.StreamResult
+import javax.xml.transform.stream.StreamSource;
+
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import net.sf.saxon.*;
+import net.sf.saxon.s9api.*;
+
+// TODO: Auto-generated Javadoc
+/**
+ * apply a xsl file to a file : use process(File infile, File outfile, String[]
+ * args) to apply the xslt file loaded by the constructor args =
+ * ["name1","value1","name2",value2, ...]
+ * 
+ * @author mdecorde
+ */
+
+public class ApplyXsl {
+	
+//	/** The proc. */
+//	private Processor proc;
+//	
+//	/** The comp. */
+//	private XsltCompiler comp;
+//	
+//	/** The exp. */
+//	private XsltExecutable exp;
+//
+//	/** The source. */
+//	private XdmNode source;
+//	
+//	/** The out. */
+//	private Serializer out;
+//	
+//	/** The trans. */
+//	private XsltTransformer trans;
+
+	TransformerFactory tFactory;
+	Transformer transformer;
+	
+	/**
+	 * initialize with the xslt file.
+	 *
+	 * @param xsltfile the xsltfile
+	 */
+	public ApplyXsl(String xsltfile) {
+//		proc = new Processor(false);
+//		comp = proc.newXsltCompiler();
+//		exp = comp.compile(new StreamSource(new File(xsltfile)));
+		tFactory = new net.sf.saxon.TransformerFactoryImpl();
+		transformer = tFactory.newTransformer(new StreamSource(xsltfile));
+
+	}
+	
+	/**
+	 * initialize with the xslt file.
+	 *
+	 * @param xsltfile the xsltfile
+	 */
+	public ApplyXsl(File xsltfile) {
+//		proc = new Processor(false);
+//		comp = proc.newXsltCompiler();
+//		exp = comp.compile(new StreamSource(xsltfile));
+		tFactory = new net.sf.saxon.TransformerFactoryImpl();
+		transformer = tFactory.newTransformer(new StreamSource(xsltfile));
+	}
+
+	/**
+	 * Set in and out file.
+	 *
+	 * @param xmlinfile the xmlinfile
+	 * @param xmloutfile the xmloutfile
+	 * @return true, if successful
+	 */
+	private boolean SetInOutSource(String xmlinfile, String xmloutfile) {
+//		if (proc == null || exp == null || comp == null)
+//			return false;
+//
+//		source = proc.newDocumentBuilder().build(
+//				new StreamSource(new File(xmlinfile)));
+//		out = new Serializer();
+//		out.setOutputFile(new File(xmloutfile));
+//
+//		trans = exp.load();
+//		transformer.set.setInitialContextNode(source);
+//		transformer.setDestination(out);
+		return true;
+	}
+
+	/**
+	 * Set a xslt param.
+	 *
+	 * @param name the name
+	 * @param value the value
+	 * @return true, if successful
+	 */
+	public boolean SetParam(String name, Object value) {
+//		if (trans != null)
+//			trans.setParameter(new QName(name), new XdmAtomicValue("" + value));
+//		else
+//			return false;
+		return true;
+	}
+
+	/**
+	 * Force java to clean memory after processing a xslt. If not we might catch
+	 * a JavaHeapspace Exception
+	 * 
+	 */
+	private void cleanMemory() {
+//		source = null;
+//		trans = null;
+//		out = null;
+	}
+
+	/**
+	 * Process files with xslt args.
+	 *
+	 * @param xmlinfile file to be processed
+	 * @param xmloutfile output file
+	 * @param args xslt args ["arg1","arg1value","arg2","arg2value"...]
+	 * @return true, if successful
+	 */
+
+	public boolean process(String xmlinfile, String xmloutfile, String[] args) {
+		if (!this.SetInOutSource(xmlinfile, xmloutfile))
+			return false;
+		for (int i = 0; i < args.length; i = i + 2)// set params
+		{
+			if (!this.SetParam(args[i], args[i + 1]))
+				return false;
+		}
+
+		transformer.transform(new StreamSource(xmlinfile), new StreamResult(new BufferedOutputStream(new FileOutputStream(xmloutfile))));
+		cleanMemory(); // save memory
+		// System.out.println("Done");
+		return true;
+	}
+
+	/**
+	 * Process files without xslt args.
+	 *
+	 * @param xmlinfile the xmlinfile
+	 * @param xmloutfile the xmloutfile
+	 * @return true, if successful
+	 */
+	public boolean process(String xmlinfile, String xmloutfile) {
+		if (!this.SetInOutSource(xmlinfile, xmloutfile))
+			return false;
+
+		transformer.transform(new StreamSource(xmlinfile), new StreamResult(new BufferedOutputStream(new FileOutputStream(xmloutfile))));
+		cleanMemory();
+		// System.out.println("Done");
+		return true;
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		String xslfile = "pathtoxslfile";
+		ApplyXsl a = new ApplyXsl(xslfile);
+		
+		File srcdirectory = new File("pathtodirectorytoprocess")
+		assert(srcdirectory.exists())
+		assert(srcdirectory.isDirectory())
+		assert(srcdirectory.canRead())
+		assert(srcdirectory.canExecute())
+		
+		List<File> files = srcdirectory.listFiles();
+		
+		files = files.findAll{item-> item.getName().endsWith(".xml")}
+		
+		long bigstart = System.currentTimeMillis()
+		for(File infile : files)
+		{
+			String outfile = infile.getAbsolutePath()+".out"
+			if(infile.canRead())
+			{
+				long start = System.currentTimeMillis()
+				println "Process : "+infile.getName()
+				// String[] params = ["pbval1",1,"pbval2",2];
+				// a.process(infile.getAbsolutePath(),outfile); // no parameters
+				// a.process( infile.getAbsolutePath(),outfile,params);
+				println "Done : "+(System.currentTimeMillis()-start)+"ms"
+			}
+		}
+		println "Total time : "+(System.currentTimeMillis()-bigstart)+"ms"
+	}
+}

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ApplyXsl.groovy
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/CopyXMLFiles.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/CopyXMLFiles.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/CopyXMLFiles.groovy	(revision 728)
@@ -0,0 +1,61 @@
+package org.txm.importer;
+
+import java.io.File;
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLResolver;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.events.DTD;
+import javax.xml.stream.events.EntityReference;
+import org.txm.utils.*
+
+public class CopyXMLFiles {
+	File xmlFile;
+	File outDir;
+	def dtdFiles = []
+	
+	public CopyXMLFiles(File xmlFile) {
+		this.xmlFile = xmlFile;
+	}
+	
+	public boolean copy(File outDir) {
+		XMLInputFactory factory;
+		XMLStreamReader parser;
+		InputStream inputData = xmlFile.toURI().toURL().openStream();
+		factory = XMLInputFactory.newInstance();
+		factory.setXMLResolver(new XMLResolver() {
+			@Override
+			public Object resolveEntity(String publicID, String systemID,
+					String baseURI, String namespace) throws XMLStreamException {
+				//println "Resolving $publicID $systemID $baseURI $namespace"
+				File srcFile = new File(xmlFile.getParentFile(), systemID);
+				dtdFiles << srcFile
+				return srcFile.toURI().toURL().openStream();
+			}
+		});
+	
+		parser = factory.createXMLStreamReader(inputData);
+		
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			
+		}
+		
+		dtdFiles << xmlFile
+		for (File dtd : dtdFiles) {
+			File cpy = new File(outDir, dtd.getName());
+			FileCopy.copy(dtd, cpy);
+		}
+		return outDir.listFiles().size() == dtdFiles.size();
+	}
+	
+	public static void main(def args) {
+		File xmlFile = new File("/home/mdecorde/TÃ©lÃ©chargements/Inscriptions1.xml")
+		File outDir = new File("/home/mdecorde/TÃ©lÃ©chargements/test")
+		outDir.mkdir()
+		CopyXMLFiles cdf = new CopyXMLFiles(xmlFile)
+		println cdf.copy(outDir)
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/package.html	(revision 728)
@@ -0,0 +1,90 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>IMPORT WORD-ODT</title>
+</head>
+<body>
+<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>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>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/>
+
+<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>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>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/>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/FixBreaksAndAutomaticStyles.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/FixBreaksAndAutomaticStyles.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/FixBreaksAndAutomaticStyles.groovy	(revision 728)
@@ -0,0 +1,120 @@
+package org.txm.importer.doc
+
+import org.txm.utils.IOUtils;
+import org.txm.utils.NameSpaceXmlNodePrinter
+import org.txm.utils.NameSpaceXmlNodePrinter.NamespaceContext
+
+import groovy.xml.QName
+import groovy.xml.StreamingMarkupBuilder
+
+class FixBreaksAndAutomaticStyles {
+
+	def nsText = new groovy.xml.Namespace("urn:oasis:names:tc:opendocument:xmlns:text:1.0", 'tei')
+	def sytleAt;
+	def pbAt;
+
+	FixBreaksAndAutomaticStyles() {
+
+	}
+	def befores
+	def afters
+	def parents
+
+	public boolean run(File xmlFile, def befores, def afters, def parents) {
+
+		sytleAt = nsText.get("rend")
+		pbAt = nsText.get("soft-page-break")
+
+
+		def parser = new XmlParser(false, true)
+		def root = parser.parse(xmlFile)
+
+		this.befores = befores
+		this.afters = afters
+		this.parents = parents
+		process(root, null)
+
+
+		//println root.children()
+		File tmp = new File(xmlFile.getParentFile(), "test.txt")
+		def writer = IOUtils.getWriter(tmp, "UTF-8")
+		writer.write('<?xml version="1.0" encoding="UTF-8"?>\n')
+		def printer = new NameSpaceXmlNodePrinter(new PrintWriter(writer))
+		//create namespace context
+		NamespaceContext namespaceContext = new NamespaceContext(printer);
+		namespaceContext.registerNamespacePrefix("office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0");
+		namespaceContext.registerNamespacePrefix("style", "urn:oasis:names:tc:opendocument:xmlns:style:1.0");
+		namespaceContext.registerNamespacePrefix("text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0");
+		namespaceContext.registerNamespacePrefix("table", "urn:oasis:names:tc:opendocument:xmlns:table:1.0");
+		namespaceContext.registerNamespacePrefix("draw", "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0");
+		namespaceContext.registerNamespacePrefix("fo", "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0");
+		namespaceContext.registerNamespacePrefix("xlink", "http://www.w3.org/1999/xlink");
+		namespaceContext.registerNamespacePrefix("dc", "http://purl.org/dc/elements/1.1/");
+		namespaceContext.registerNamespacePrefix("meta", "urn:oasis:names:tc:opendocument:xmlns:meta:1.0");
+		namespaceContext.registerNamespacePrefix("number", "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0");
+		namespaceContext.registerNamespacePrefix("svg", "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0");
+		namespaceContext.registerNamespacePrefix("chart", "urn:oasis:names:tc:opendocument:xmlns:chart:1.0");
+		namespaceContext.registerNamespacePrefix("dr3d", "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0");
+		namespaceContext.registerNamespacePrefix("math", "http://www.w3.org/1998/Math/MathML");
+		namespaceContext.registerNamespacePrefix("form", "urn:oasis:names:tc:opendocument:xmlns:form:1.0");
+		namespaceContext.registerNamespacePrefix("script", "urn:oasis:names:tc:opendocument:xmlns:script:1.0");
+		namespaceContext.registerNamespacePrefix("ooo", "http://openoffice.org/2004/office");
+		namespaceContext.registerNamespacePrefix("ooow", "http://openoffice.org/2004/writer");
+		namespaceContext.registerNamespacePrefix("oooc", "http://openoffice.org/2004/calc");
+		namespaceContext.registerNamespacePrefix("dom", "http://www.w3.org/2001/xml-events");
+		namespaceContext.registerNamespacePrefix("xforms", "http://www.w3.org/2002/xforms");
+		namespaceContext.registerNamespacePrefix("xsd", "http://www.w3.org/2001/XMLSchema");
+		namespaceContext.registerNamespacePrefix("xsi", "http://www.w3.org/2001/XMLSchema-instance");
+		namespaceContext.registerNamespacePrefix("rpt", "http://openoffice.org/2005/report");
+		namespaceContext.registerNamespacePrefix("of", "urn:oasis:names:tc:opendocument:xmlns:of:1.2");
+		namespaceContext.registerNamespacePrefix("xhtml", "http://www.w3.org/1999/xhtml");
+		namespaceContext.registerNamespacePrefix("grddl", "http://www.w3.org/2003/g/data-view#");
+		namespaceContext.registerNamespacePrefix("tableooo", "http://openoffice.org/2009/table");
+		namespaceContext.registerNamespacePrefix("field", "urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0");
+		namespaceContext.registerNamespacePrefix("formx", "urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0");
+		namespaceContext.registerNamespacePrefix("css3t", "http://www.w3.org/TR/css3-text/");
+
+		printer.setNamespaceAware(true);
+		printer.print(root, namespaceContext)
+		writer.close();
+
+		if (xmlFile.delete()) tmp.renameTo(xmlFile);
+		else println "FixBreaksAndAutomaticStyles: Error: could not replace "+xmlFile
+	}
+
+	public void process(def node, def parent) {
+		if (!(node instanceof groovy.util.Node)) return;
+
+		def list = new ArrayList(node.children())
+		for( def child : list) {
+			process(child, node)
+		}
+		String name = node.name().getLocalPart()
+		if ("p" == name || "div" == name) {
+			//println "P: "+node.attribute("rend")
+			String style = node.attribute("rend")
+			if (befores.contains(style)) {
+				def newChild = new Node(null, "pb")
+				newChild.parent = parent
+				def idx = parent.children().indexOf(node)
+				//println "b idx: $idx"
+				parent.children().add(idx, newChild)
+			} else if (afters.contains(style)) {
+				def newChild = new Node(null, "pb")
+				newChild.parent = parent
+				def idx = parent.children().indexOf(node)
+				//println "a idx: $idx"
+				parent.children().add(idx+1, newChild)
+			}
+			if (parents.containsKey(style)) {
+				//println "parent of "+style+ " = "+parents[style]
+				node.attributes()["rend"] = parents[style]
+			}
+		}
+	}
+
+	public static void main(String[] args) {
+		File xmlFile = new File("/home/mdecorde/xml/temoignages/content.xml")
+		new FixBreaksAndAutomaticStyles().run(xmlFile, ["P1", "P2"], ["P3"], ["P1": "Standard", "P2":"Standard", "P3":"Standard"])
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/docLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/docLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/docLoader.groovy	(revision 728)
@@ -0,0 +1,360 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2012-04-24 14:30:47 +0200 (mar., 24 avr. 2012) $
+// $LastChangedRevision: 2174 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.doc;
+
+import org.txm.importer.*;
+import javax.xml.stream.XMLStreamReader;
+import org.txm.importer.ApplyXsl2;
+import org.txm.importer.ValidateXml;
+import org.txm.importer.xml.importer;
+import org.txm.importer.xml.compiler;
+import org.txm.objects.*;
+import org.txm.tokenizer.TokenizerClasses;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+import org.txm.metadatas.*;
+import javax.xml.stream.*;
+import org.w3c.dom.Element;
+import org.txm.importer.DomUtils;
+import org.txm.sw.RemoveTag;
+import org.txm.doc.*;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/doc/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+		TokenizerClasses.loadFromNode(params.getTokenizerElement(params.getCorpusElement()));
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		//Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File("C:\\Program Files\\treetagger\\models"));//for Windows
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+int wordsPerPage = params.getWordsPerPage("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir, "txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+String textSortAttribute = null; // a property in metadata.csv file
+String paginationElement = "pb";
+boolean normalizeMetadata = true;
+
+File allmetadatasfile = new File(srcDir, "metadata.csv");
+
+if (txmDir.listFiles() == null) {
+	println "No file to process"
+	return;
+}
+
+def srcfiles = [];
+for (File f : srcDir.listFiles()) {
+	String name = f.getName().toLowerCase();
+	if (name.endsWith(".properties")) continue;
+	if (name.equals("import.xml")) continue;
+	if (name.endsWith(".csv")) continue;
+	if (f.isDirectory()) continue;
+	if (f.isHidden()) continue;
+	if (name.endsWith(".doc") || name.endsWith(".docx") || name.endsWith(".odt") || name.endsWith(".rtf")) {
+		srcfiles.add(f)
+	}
+}
+
+if (srcfiles.size() == null) {
+	println "No file to process"
+	return;
+}
+
+// convert to TEI
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "CREATING TEI FILES")
+println "-- CONVERTER - Converting source files"
+File xsldir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "xsl")
+if (!DocumentToTei.processFiles(srcfiles, txmDir, xsldir)) {
+	println "Abord import"
+	return;
+}
+println ""
+
+// move data folders and build css file
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "RETRIEVE STYLES")
+println "Retrieving data folders and style files"
+println txmDir.listFiles()
+File docfiles = new File(binDir, "docfiles");
+docfiles.mkdir()
+for (File infile : txmDir.listFiles()) {
+	if (infile.isDirectory()) {
+		File unzipDir = new File(docfiles, infile.getName())
+		infile.renameTo(unzipDir)
+
+		//println "zipdir "+unzipDir
+		StylesToCSS converter = new StylesToCSS(unzipDir);
+		if (!converter.process(new File(unzipDir, "style.css"))) {
+			println "WARNING: Failed to build css file of $unzipDir"
+		}
+		// and get the soft page breaks and styles parents
+		def parentStyles = converter.parentStyles;
+		def beforebreaks = converter.beforebreaks
+		def afterbreaks = converter.afterbreaks
+
+		//println "BEFORES: "+beforebreaks
+		//println "AFTERS: "+afterbreaks
+		//println "PARENTS: "+parentStyles
+
+		// se servir de Ã§a pour insÃ©rer <pb/> et remplacer styles automatiques
+		File xmlFile = new File(txmDir, unzipDir.getName().substring(6))
+		//println "PATCH : $xmlFile"
+		new FixBreaksAndAutomaticStyles().run(xmlFile, beforebreaks, afterbreaks, parentStyles)
+	}
+}
+
+// set new Root
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FIXING TEI")
+println "Setting new XML root element"
+for (File infile : txmDir.listFiles()) {
+	if (infile.isHidden() || infile.isDirectory() || infile.getName().startsWith(".")) continue;
+	print "."
+	if (!SetNewXmlDocumentRoot.process(infile, "//tei:text")) {
+		println "Failed to reset XML root $infile"
+		return
+	}
+}
+println ""
+
+// filtering
+println "Filtering XML files with xpaths: [//tei:term]"
+def xpaths = params.getExcludeXpaths()
+if (xpaths == null) xpaths = ["//tei:term"]
+else xpaths << "//tei:term"
+
+if (xpaths != null) {
+	println "Filtering XML files with xpaths: $xpaths"
+	for (File infile : txmDir.listFiles()) {
+		if (infile.isHidden() || infile.isDirectory() || infile.getName().startsWith(".")) continue;
+		print "."
+		if (!RemoveTag.xpath(infile, xpaths)) {
+			println "Failed to filter $infile"
+			return
+		}
+	}
+	println ""
+}
+
+//get metadata values from CSV
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "READ METADATA")
+Metadatas metadatas; // text metadata
+//println "Trying to read metadata from: "+allmetadatasfile
+if (allmetadatasfile.exists()) {
+	File copy = new File(binDir, "metadata.csv")
+	if (!FileCopy.copy(allmetadatasfile, copy)) {
+		println "Error: could not create a copy of the metadata.csv file "+allmetadatasfile.getAbsoluteFile();
+		return;
+	}
+	metadatas = new Metadatas(copy, Toolbox.getParam(Toolbox.METADATA_ENCODING), Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR), Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
+} else {
+	println "no $allmetadatasfile metadata file found."
+}
+
+for (File infile : txmDir.listFiles()) {
+	if (infile.isHidden()) infile.delete();
+	if (infile.getName().startsWith(".")) infile.delete();
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(5, "IMPORTER")
+println "-- IMPORTER - Reading source files"
+def imp = new importer();
+imp.doValidation(true) // change this to not validate xml
+imp.doTokenize(true) // change this, to not tokenize xml
+if (!imp.run(srcDir, binDir, txmDir, basename, "", lang)) {
+	println "import process stopped";
+	return;
+}
+
+if (metadatas != null) {
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	if (MONITOR != null) MONITOR.worked(20, "INJECTING METADATA")
+	println "-- INJECTING METADATA - from csv file: "+allmetadatasfile
+	
+	println("Injecting metadata: "+metadatas.getHeadersList()+" in texts of directory "+new File(binDir,"txm"))
+	for (File infile : txmDir.listFiles()) {
+		if (infile.isHidden() || infile.isDirectory() || infile.getName().startsWith(".")) continue;
+		print "."
+
+		File outfile = File.createTempFile("temp", ".xml", infile.getParentFile());
+		if (!metadatas.injectMetadatasInXml(infile, outfile, "text", null)) {
+			outfile.delete();
+		} else {
+			if (!(infile.delete() && outfile.renameTo(infile))) println "Warning can't rename file "+outfile+" to "+infile
+			if (!infile.exists()) {
+				println "Error: could not replace $infile by $outfile"
+				return false;
+			}
+		}
+	}
+	println ""
+}
+
+List<File> files = txmDir.listFiles()
+if (files == null || files.size() == 0) {
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools"
+boolean annotationSuccess = false;
+if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
+	annotationSuccess = true;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+if(debug) c.setDebug();
+//c.setCwbPath("~/TXM/cwb/bin");
+c.setOptions(textSortAttribute, normalizeMetadata);
+c.setAnnotationSuccess(annotationSuccess)
+c.setLang(lang);
+if (!c.run(binDir, txmDir, corpusname, null, srcfiles, metadatas)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	println "-- EDITION - Building edition"
+	if (MONITOR != null) MONITOR.worked(25, "EDITION")
+
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+	List<File> filelist = txmDir.listFiles();
+	Collections.sort(filelist);
+	def second = 0
+
+	println "Paginating texts: "
+
+	for (File txmFile : filelist) {
+		if (txmFile.isHidden() || txmFile.isDirectory() || txmFile.getName().startsWith(".")) continue;
+		print "."
+
+		String txtname = txmFile.getName();
+		int i = txtname.lastIndexOf(".");
+		if(i > 0) txtname = txtname.substring(0, i);
+
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+		Element text = params.addText(corpusElem, txtname, txmFile);
+
+		def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, "pb");
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+
+	for (File unzipDir : docfiles.listFiles()) {
+		File css = new File(unzipDir, "style.css")
+		String textname = unzipDir.getName();
+		textname = textname.substring(6, textname.lastIndexOf(".")) // remove "files-" and ".xml"
+		File newcss = new File(outdir, textname+".css")
+		css.renameTo(newcss)
+	}
+	File doc = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "css/doc.css")
+	doc_copy = new File(outdir, "doc.css")
+	FileCopy.copy(doc, doc_copy);
+
+
+	// copy images : images externaly linked must be added manually in the html/CORPUS/default directory
+	println "Copying internal images..."
+	for (File txmFile : filelist) {
+		if (txmFile.isHidden() || txmFile.isDirectory() || txmFile.getName().startsWith(".")) continue;
+		print "."
+		File picturesDirectory = new File(binDir, "docfiles/files-"+txmFile.getName()+"/Pictures")
+		println picturesDirectory
+		if (picturesDirectory.exists()) {
+			File picturesDirectory_copy = new File(outdir, "Pictures")
+			FileCopy.copyFiles(picturesDirectory, picturesDirectory_copy)
+			if (!picturesDirectory_copy.exists()) {
+				println "Failed to copy $picturesDirectory to $picturesDirectory_copy"
+			}
+		}
+	}
+	println ""
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/pager.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/pager.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/pager.groovy	(revision 728)
@@ -0,0 +1,474 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2012-04-24 14:30:47 +0200 (mar., 24 avr. 2012) $
+// $LastChangedRevision: 2174 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.doc;
+
+import org.txm.importer.*;
+import org.xml.sax.Attributes;
+import org.txm.importer.filters.*;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.stream.*;
+import java.net.URL;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+// TODO: Auto-generated Javadoc
+/** 
+ * Build edition from xml-tei-odt
+ * @author mdecorde
+ * 
+ */
+class pager {
+	List<String> NoSpaceBefore;
+
+	/** The No space after. */
+	List<String> NoSpaceAfter;
+
+	/** The wordcount. */
+	int wordcount = 0;
+
+	/** The pagecount. */
+	int pagecount = 0;
+
+	/** The wordmax. */
+	int wordmax = 0;
+
+	/** The basename. */
+	String basename = "";
+	String txtname = "";
+	File outdir;
+
+	/** The wordid. */
+	String wordid;
+
+	/** The first word. */
+	boolean firstWord = true;
+
+	/** The wordvalue. */
+	String wordvalue;
+
+	/** The interpvalue. */
+	String interpvalue;
+
+	/** The lastword. */
+	String lastword = " ";
+
+	/** The wordtype. */
+	String wordtype;
+
+	/** The flagform. */
+	boolean flagform = false;
+
+	/** The flaginterp. */
+	boolean flaginterp = false;
+
+	/** The url. */
+	private def url;
+
+	/** The input data. */
+	private def inputData;
+
+	/** The factory. */
+	private def factory;
+
+	/** The parser. */
+	private XMLStreamReader parser;
+
+	/** The writer. */
+	OutputStreamWriter writer;
+
+	/** The multiwriter. */
+	OutputStreamWriter multiwriter = null;
+	
+	/** The pagedWriter. */
+	StaxStackWriter pagedWriter = null;
+
+	/** The infile. */
+	File infile;
+
+	/** The outfile. */
+	File outfile;
+
+	/** The pages. */
+	ArrayList<File> pages = new ArrayList<File>();
+
+	/** The idxstart. */
+	ArrayList<String> idxstart = new ArrayList<String>();
+	String editionPage;
+
+	/**
+	 * Instantiates a new pager.
+	 *
+	 * @param infile the infile
+	 * @param outfile the outfile
+	 * @param NoSpaceBefore the no space before
+	 * @param NoSpaceAfter the no space after
+	 * @param max the max
+	 * @param basename the basename
+	 */
+	pager(File infile, File outdir, String txtname, List<String> NoSpaceBefore,
+	List<String> NoSpaceAfter, int max, String basename, String editionPage) {
+		this.editionPage = editionPage;
+		this.basename = basename;
+		this.txtname = txtname;
+		this.outdir = outdir;
+		this.wordmax = max;
+		this.NoSpaceBefore = NoSpaceBefore;
+		this.NoSpaceAfter = NoSpaceAfter;
+		this.url = infile.toURI().toURL();
+		this.infile = infile;
+
+		inputData = url.openStream();
+		factory = XMLInputFactory.newInstance();
+		parser = factory.createXMLStreamReader(inputData);
+		process();
+	}
+
+	private def closeMultiWriter()
+	{
+		if (pagedWriter != null) {
+			def tags = pagedWriter.getTagStack().clone();
+			if (firstWord) { // there was no words
+				this.idxstart.add("w_0")
+				pagedWriter.write("<span id=\"w_0\"/>");
+			}
+
+			pagedWriter.writeEndElements();
+			pagedWriter.close();
+			return tags;
+
+			//			pagedWriter.write("</body>");
+			//			pagedWriter.write("</html>");
+			//			pagedWriter.close();
+		} else {
+			return [];
+		}
+	}
+
+	/**
+	 * Creates the next output.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean createNextOutput()
+	{
+		wordcount = 0;
+		try {
+			def tags = closeMultiWriter()
+			for (int i = 0 ; i < tags.size() ; i++) {
+				String tag = tags[i]
+				if ("body" != tag) {
+					tags.remove(i--)
+				} else {
+					tags.remove(i--) // remove "body"
+					break; // remove elements until "body tag
+				}
+			}
+			File outfile = new File(outdir, txtname+"_"+(++pagecount)+".html")
+			pages.add(outfile)
+			firstWord = true // waiting for next word
+
+			pagedWriter = new StaxStackWriter(outfile , "UTF-8");
+			pagedWriter.writeStartDocument("UTF-8", "1.0")
+			pagedWriter.writeStartElement("html")
+			pagedWriter.writeEmptyElement("meta", ["http-equiv":"Content-Type", "content":"text/html","charset":"UTF-8"])
+			pagedWriter.writeStartElement("head")
+			pagedWriter.writeEmptyElement("link", ["rel":"stylesheet", "href":txtname+".css"])
+			pagedWriter.writeEmptyElement("link", ["rel":"stylesheet", "href":"doc.css"])
+			pagedWriter.writeStartElement("title")
+			pagedWriter.writeCharacters(basename.toUpperCase()+" Edition - Page "+pagecount)
+			pagedWriter.writeEndElement() // </title>
+			pagedWriter.writeEndElement() // </head>
+			pagedWriter.writeStartElement("body") //<body>
+			pagedWriter.writeStartElements(tags)
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput() {
+		try {
+			return createNextOutput();
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+
+	/**
+	 * Gets the page files.
+	 *
+	 * @return the page files
+	 */
+	public ArrayList<File> getPageFiles() {
+		return pages;
+	}
+
+	/**
+	 * Gets the idx.
+	 *
+	 * @return the idx
+	 */
+	public ArrayList<String> getIdx() {
+		return idxstart;
+	}
+
+	void gotoText() {
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event) {
+				case XMLStreamConstants.END_ELEMENT:
+					if(parser.getLocalName() == "teiHeader")
+						return;
+			}
+		}
+	}
+	/**
+	 * Process.
+	 */
+	void process() {
+		try {
+		String localname = "";
+		String figurerend = ""
+		boolean unordered = false;
+		createNextOutput();
+		
+		gotoText();
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			switch (event) {
+				case XMLStreamConstants.START_ELEMENT:
+					localname = parser.getLocalName();
+					
+					if (localname == editionPage) {
+						createNextOutput();
+						wordcount=0;
+						if (parser.getAttributeValue(null,"n") != null) {
+							pagedWriter.writeStartElement("p", ["style":"color:red", "align":"center"])
+							pagedWriter.writeCharacters("- "+parser.getAttributeValue(null,"n")+" -")
+							pagedWriter.writeEndElement() // p
+						}
+					}
+					
+					switch (localname) {
+						case "textunit":
+							if (parser.getAttributeValue(null,"id") != null) {
+								pagedWriter.writeStartElement("h3")
+								pagedWriter.writeCharacters(parser.getAttributeValue(null,"id"))
+								pagedWriter.writeEndElement() // h3
+							}
+							pagedWriter.writeStartElement("table")
+							for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+								pagedWriter.writeStartElement("tr")
+								pagedWriter.writeStartElement("td")
+								pagedWriter.writeCharacters(parser.getAttributeLocalName(i))
+								pagedWriter.writeEndElement() // td
+								pagedWriter.writeStartElement("td")
+								pagedWriter.writeCharacters(parser.getAttributeValue(i))
+								pagedWriter.writeEndElement() // td
+								pagedWriter.writeEndElement() // tr
+							}
+							pagedWriter.writeEndElement() // table
+							pagedWriter.writeEmptyElement("br")
+							break;
+						case "head":
+							String rend = parser.getAttributeValue(null, "rend")
+							if (rend == null) rend = "normal"
+							pagedWriter.writeStartElement("h2", ["class":rend])
+							break;
+						case "figure":
+							figurerend = parser.getAttributeValue(null, "rend")
+							break;
+						case "graphic":
+							String url = parser.getAttributeValue(null, "url")
+							if (url.startsWith("..//")) url = url.substring(4);
+							else if (url.startsWith("../")) url = url.substring(3);
+
+							if (url != null) { 
+								pagedWriter.writeStartElement("div")
+								pagedWriter.writeEmptyElement("img", ["class":figurerend, "src":url])
+								pagedWriter.writeEndElement() // div
+							}
+							figurerend = "";
+							break;
+						case "lg":
+						case "p":
+						case "q":
+							String rend = parser.getAttributeValue(null, "rend")
+							if (rend == null) rend = "normal"
+							pagedWriter.writeStartElement("p", ["class":rend])
+							break;
+						//case "pb":
+						case "table":
+							pagedWriter.writeStartElement("table", ["class":parser.getAttributeValue(null, "rend")])
+							break;
+						case "row":
+							pagedWriter.writeStartElement("tr")
+							break;
+						case "cell":
+							pagedWriter.writeStartElement("td")
+							break;
+						case "lb":
+						case "br":
+							pagedWriter.writeEmptyElement("br")
+							break;
+						case "w":
+							wordid = parser.getAttributeValue(null,"id");
+
+							if (firstWord) {
+								firstWord = false;
+								this.idxstart.add(wordid);
+							}
+							wordcount++;
+
+							break;
+						case "list":
+							String type = parser.getAttributeValue(null,"type");
+							if ("unordered" == type) {
+								unordered = true;
+								pagedWriter.writeStartElement("ul")
+							} else {
+								unordered = false
+								pagedWriter.writeStartElement("ol")
+							}
+							break
+						case "item":
+							pagedWriter.writeStartElement("li")
+							break;
+						case "hi":
+							pagedWriter.writeStartElement("b")
+							break;
+						case "emph":
+							pagedWriter.writeStartElement("i")
+							break;
+						case "ana":
+							flaginterp=true;
+							interpvalue+=" "+parser.getAttributeValue(null,"type").substring(1)+":"
+							break;
+
+						case "form":
+							wordvalue="";
+							interpvalue ="";
+							flagform=true;
+					}
+					break;
+				case XMLStreamConstants.END_ELEMENT:
+					localname = parser.getLocalName();
+					switch(localname)
+					{
+						case "head":
+							pagedWriter.writeEndElement(); // h2
+							break;
+						case "lg":
+						case "p":
+						case "q":
+							pagedWriter.writeEndElement(); // p
+							if (wordcount >= wordmax) {
+								createNextOutput();
+							}
+							break;
+						case "list":
+							pagedWriter.writeEndElement(); // ul or ol
+							break
+						case "item":
+							pagedWriter.writeEndElement(); // li
+							break;
+						case "hi":
+							pagedWriter.writeEndElement(); // b
+							break;
+						case "emph":
+							pagedWriter.writeEndElement(); // i
+							break;
+						case "table":
+							pagedWriter.writeEndElement(); // table
+							break;
+						case "row":
+							pagedWriter.writeEndElement(); // tr
+							break;
+						case "cell":
+							pagedWriter.writeEndElement(); // td
+							break;
+						case "form":
+							flagform = false
+							break;
+						case "ana":
+							flaginterp = false
+							break;
+						case "w":
+							int l = lastword.length();
+							String endOfLastWord = "";
+							if (l > 0)
+								endOfLastWord = lastword.subSequence(l-1, l);
+
+							if (interpvalue != null)
+								interpvalue = interpvalue;
+
+							if (NoSpaceBefore.contains(wordvalue) ||
+								NoSpaceAfter.contains(lastword) ||
+								wordvalue.startsWith("-") ||
+								NoSpaceAfter.contains(endOfLastWord))
+							{
+								// multiwriter.write("<span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+							} else {
+								// multiwriter.write(" <span title=\""+interpvalue+"\" id=\""+wordid+"\">");
+								pagedWriter.writeCharacters(" ");
+							}
+							pagedWriter.writeStartElement("span", ["title":interpvalue, "id":wordid]);
+							pagedWriter.writeCharacters(wordvalue);
+							pagedWriter.writeEndElement() // span
+							lastword=wordvalue;
+							break;
+					}
+					break;
+				case XMLStreamConstants.CHARACTERS:
+					if (flagform)
+						if (parser.getText().length() > 0)
+							wordvalue+=(parser.getText());
+					if (flaginterp)
+						if (parser.getText().length() > 0)
+							interpvalue+=(parser.getText());
+					break;
+			}
+		}
+		//writer.write("</body>");
+		//writer.write("</html>");
+		//writer.close();
+		closeMultiWriter();
+	} catch(Exception e) { org.txm.utils.logger.Log.printStackTrace(e); pagedWriter.close(); }
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/ODTMovePicturesFiles.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/ODTMovePicturesFiles.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/ODTMovePicturesFiles.groovy	(revision 728)
@@ -0,0 +1,15 @@
+package org.txm.importer.doc
+
+File dir = new File("/home/mdecorde/TXM/corpora/temoignages/docfiles/")
+File outdir = new File("/home/mdecorde/TXM/corpora/temoignages/HTML/TEMOIGNAGES/default/Pictures")
+outdir.deleteDir()
+outdir.mkdir()
+
+for(def subdir : dir.listFiles()) {
+	if (subdir.isDirectory()) {
+		File picturesDir = new File(subdir, "Pictures")	
+		for (def img : picturesDir.listFiles()) {
+			img.renameTo(new File(outdir, img.getName()))
+		}
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/StylesToCSS.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/StylesToCSS.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/doc/StylesToCSS.groovy	(revision 728)
@@ -0,0 +1,194 @@
+package org.txm.importer.doc
+
+class StylesToCSS {
+
+	File cssFile, styleFile, contentFile;
+	def rootStyles, rootContent;
+
+	def styles = [:]
+	def translatedStyles = [:]
+	
+	def beforebreaks = []
+	def afterbreaks = []
+	def parentStyles = [:]
+
+	public StylesToCSS(File unzipDir) {
+		this.styleFile= new File(unzipDir, "styles.xml");
+		this.contentFile= new File(unzipDir, "content.xml");
+		rootStyles = new XmlSlurper().parse(styleFile);
+		rootContent = new XmlSlurper().parse(contentFile);
+	}
+
+	public boolean process(File css) {
+		//println "StylesToCSS: "+css
+		this.cssFile = cssFile;
+		
+		//INDEXING STYLES BY ".NAME_FAMILY"
+		// for each style of styles.xml
+		for( def style : rootStyles.styles.style) {
+			String family = ""+style.@family;
+			String name = ""+style.@name
+			if ("paragraph".equals(family)) {
+				styles[name+"_"+family] = style
+			} else if ("text".equals(family)) {
+				if (!name.startsWith("WW8Num"))
+					styles[name+"_"+family] = style
+			} else if ("graphic".equals(family)) {
+				styles[name+"_"+family] = style
+			}
+		}
+		
+		// for each automatic style of content.xml
+		for( def style : rootContent['automatic-styles'].style) {
+			//println "style: "+style.@name
+			String family = ""+style.@family;
+			String name = ""+style.@name
+			String parent = ""+style['@parent-style-name'] // get parent style name
+			String breakpage = ""; // get soft page break
+			for (def pproperty : style['paragraph-properties']) {
+				//println " paragraph-properties: "+pproperty['@break-before']
+				//println " paragraph-properties: "+pproperty['@break-after']
+				if ("page" == pproperty['@break-before'].toString())
+					beforebreaks << name
+				else if ("page" == pproperty['@break-after'].toString())
+					afterbreaks << name
+			}
+			
+			parentStyles[name] = parent
+			
+			//println "auto $name $family"
+			if ("paragraph".equals(family)) {
+				styles[name+"_"+family] = style
+			} else if ("text".equals(family)) {
+				if (!name.startsWith("WW8Num"))
+					styles[name+"_"+family] = style
+			} else if ("graphic".equals(family)) {
+				styles[name+"_"+family] = style
+			}
+		}
+		
+		// for each default style of styles.xml
+		for( def style : rootStyles.styles['default-style']) {
+			String family = ""+style.@family;
+			String name = ""+style.@name
+			if ("paragraph".equals(family)) {
+				styles[name+"_"+family] = style
+			}
+		}
+		//println styles.keySet()
+		
+		//BUILDING CSS
+		// build styles.xml css
+		for( def style : rootStyles.styles.style) {
+			String name = ""+style.@name
+			if (!name.startsWith("WW8Num")) buildStyle(style);
+		}
+		
+		// for each default style of styles.xml
+		for( def style : rootStyles.styles['default-style']) {
+			String family = ""+style.@family;
+			String name = ""+style.@name
+			if ("paragraph".equals(family)) {
+				buildStyle(style)
+			}
+		}
+		
+		// build content.xml css
+		for( def style : rootContent['automatic-styles'].style) {
+			String name = ""+style.@name
+			if (!name.startsWith("WW8Num")) buildStyle(style);
+		}
+		
+		def writer = css.newPrintWriter("UTF-8")
+		def keys = new ArrayList<String>(translatedStyles.keySet());
+		keys.sort()
+		//println keys
+		for (String name : keys) {
+			if (name.equals("")) {
+				writer.println("body{\n")
+			} else {
+				writer.println(".$name{")
+			}
+			def props = translatedStyles[name]
+			for (def key : props.keySet())
+				writer.println(""+key+":"+props[key]+";")
+			writer.println("}\n")
+		}
+		writer.close()
+
+		return true;
+	}
+	
+	private void buildDefaultStyle(def style) {
+		
+	}
+
+	private void buildStyle (def style) {
+		
+		StringBuffer str = new StringBuffer();
+		String name = style.@name
+		//if (name.length() == 1) name = ".body"
+		if (translatedStyles.containsKey(name)) return
+		def props = [:];
+		
+		String family = ""+style.@family
+		String parentname = style['@parent-style-name']
+		if ( parentname != null && parentname.length() > 0) {
+			String fullparentname = parentname+"_"+family
+			//println "build parent: "+parentname+" for $name"
+			buildStyle(styles[fullparentname]); // build its parent if any
+			def parentprops = translatedStyles[parentname]
+			for (def key : parentprops.keySet())
+				props[key] = parentprops[key]
+		}
+
+		//writer.println(".$name {")
+		for (def property : style['paragraph-properties']) {
+			for (def attr : property.attributes()) {
+				//println attr.getClass()
+				switch (attr.getKey()) {
+					case "text-align": props[attr.getKey()] = attr.getValue(); break;
+					case "margin": props[attr.getKey()] = attr.getValue(); break;
+					case "margin-left": props[attr.getKey()] = attr.getValue(); break;
+					case "margin-right": props[attr.getKey()] = attr.getValue(); break;
+					case "margin-top": props[attr.getKey()] = attr.getValue(); break;
+					case "margin-bottom": props[attr.getKey()] = attr.getValue(); break;
+					case "padding": props[attr.getKey()] = attr.getValue(); break;
+					case "padding-left": props[attr.getKey()] = attr.getValue(); break;
+					case "padding-right": props[attr.getKey()] = attr.getValue(); break;
+					case "padding-top": props[attr.getKey()] = attr.getValue(); break;
+					case "padding-bottom": props[attr.getKey()] = attr.getValue(); break;
+					//case "writing-mode": println(attr); break;
+				}
+			}
+			break;
+		}
+
+		for (def property : style['text-properties']) {
+			//println property.attributes()
+			for (def attr : property.attributes()) {
+				switch (attr.getKey()) {
+					//case "fo:language": println(attr); break;
+					case "font-size": props[attr.getKey()] = attr.getValue(); break;
+					case "font-name": props["font-family"] = "\""+attr.getValue()+"\""; break;
+					case "font-style": props[attr.getKey()] = attr.getValue(); break;
+					case "font-weight": props[attr.getKey()] = attr.getValue(); break;
+					//case "text-position": str.append(""+attr+"\n"); break;
+					case "color": props[attr.getKey()] = attr.getValue(); break;
+				}
+			}
+			break;
+		}
+				
+		translatedStyles[name] = props;
+		//println "builded $name"
+	}
+
+	static main(args) {
+		File unzipDir = new File("/home/mdecorde/xml/txmrefman/TEI/files-Manuel de RÃ©fÃ©rence TXM 0.6_FR.odt.xml")
+		File cssFile = new File("/home/mdecorde/xml/txmrefman/TEI/files-Manuel de RÃ©fÃ©rence TXM 0.6_FR.odt.xml", "style.css")
+
+		StylesToCSS converter = new StylesToCSS(unzipDir);
+		println converter.process(cssFile);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ReunitShortLines.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ReunitShortLines.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/ReunitShortLines.groovy	(revision 728)
@@ -0,0 +1,93 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.importer
+
+import java.io.File;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ReunitShortLines.
+ */
+class ReunitShortLines {
+	
+	/**
+	 * Instantiates a new reunit short lines.
+	 *
+	 * @param file the file
+	 * @param maxsize the maxsize
+	 * @param encoding the encoding
+	 */
+	ReunitShortLines(File file, int maxsize, String encoding)
+	{
+		File temp = new File( file.getParentFile(), "reu.txt");
+		Reader input = new InputStreamReader(new FileInputStream(file) , encoding);
+		OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(temp) , encoding);
+		
+		String line = input.readLine();
+		boolean oklength = true;
+		boolean previousok = false;
+		while(line != null)
+		{
+			if(line.length() == 0)
+			{
+				writer.write("\n");
+				oklength = true;
+			}
+			else if(line.startsWith("**** "))
+			{
+				writer.write("\n"+line);
+				oklength = true;
+			}
+			else
+			{
+			previousok = oklength;
+			oklength = line.length() > maxsize;
+			
+			if(previousok && oklength)
+				writer.write("\n");
+			
+			writer.write(line);
+			
+			if(previousok && ! oklength)
+				writer.write("\n");
+			
+			}
+			line = input.readLine();
+		}
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		new ReunitShortLines(new File("/home/mdecorde/xml/voeux/Voeux.txt"), 30, "cp1252")
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/CleanFile.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/CleanFile.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/CleanFile.groovy	(revision 728)
@@ -0,0 +1,134 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+// 
+// 
+// 
+// $LastChangedDate: 2017-12-13 14:23:35 +0100 (mer., 13 dÃ©c. 2017) $
+// $LastChangedRevision: 3485 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer;
+
+import java.io.BufferedWriter;
+import java.io.File;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader
+
+import org.txm.utils.IOUtils;
+
+// TODO: Auto-generated Javadoc
+/**
+ * remove all ctrl char and replace \t by ' '.
+ *
+ * @param infile : the file to process
+ * @param encoding : the encoding of the file
+ */
+class CleanFile {
+	public CleanFile(File infile, String encoding){
+		Reader reader = new BufferedReader(new InputStreamReader(new FileInputStream(infile),encoding));
+		File outfile = File.createTempFile("filecleaner","123456", infile.getParentFile());
+		Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8"));
+		String line = reader.readLine();
+		while(line != null) {
+			writer.write(clean(line) +"\n")
+			line = reader.readLine();
+		}
+		writer.close();
+		reader.close();
+		
+		infile.delete(); // erase old file
+		outfile.renameTo(infile); // rename the copy
+	}
+
+	def static ctrl_reg = /[\p{Cntrl}&&[^\n\t]]/ // all ctrl but \n
+	def static surrogate = "[^\\p{P}&&[^\\u0001-\\uFFFF]]"
+	def static surrogate_reg = /$surrogate/
+	def static surrogate_punct = "[\\p{P}&&[^\\u0001-\\uFFFF]]"
+	def static surrogate_punct_reg = /$surrogate_punct/
+	def static SURROGATE = "_"
+	def static SURROGATE_PUNCT = "â˜’"
+	def static EMPTY = ""
+	def static SPACE = " "
+	def static TAB = "\t"
+	
+	/**
+	 * Remove ctrl and surrogates chars from a String.
+	 *
+	 * @param str the str
+	 * @return the cleaned string
+	 */
+	public static String cleanAllButTabs(String str) {
+		str = str.replaceAll(ctrl_reg, EMPTY); // remove all ctrl chars
+		str = str.replaceAll(surrogate_reg, SURROGATE); // replace all surrogate chars
+		str = str.replaceAll(surrogate_punct_reg, SURROGATE_PUNCT); // replace all surrogate punct chars
+		return str;
+	}
+	
+	/**
+	 * Remove ctrl and surrogates chars from a String.
+	 *
+	 * @param str the str
+	 * @return the cleaned string
+	 */
+	public static String clean(String str) {
+		str = str.replace(TAB, SPACE); // replace \t by ' '
+		str = str.replaceAll(ctrl_reg, EMPTY); // remove all ctrl chars
+		str = str.replaceAll(surrogate_reg, SURROGATE); // replace all surrogate chars
+		str = str.replaceAll(surrogate_punct_reg, SURROGATE_PUNCT); // replace all surrogate punct chars
+		return str;
+	}
+	
+	public static void removeSurrogateFromXmlFile(File file, File outputFile) {
+		XMLStreamReader xmlStreamReader = XMLInputFactory.newInstance().createXMLStreamReader( new FileReader( file ) );
+		String fileEncoding = xmlStreamReader.getEncoding();
+		String text = IOUtils.getText(file, fileEncoding)
+		text = CleanFile.clean(text);
+		IOUtils.write(outputFile, text)
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args){
+		File infile = new File("C:\\Documents and Settings\\H\\xml\\cleaner\\test.txt")		
+		String encoding = "CP1252";
+		new CleanFile(infile, encoding);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RGAQCJ/compiler.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RGAQCJ/compiler.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RGAQCJ/compiler.groovy	(revision 728)
@@ -0,0 +1,606 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.RGAQCJ
+
+
+
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+import org.txm.importer.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+
+import javax.xml.stream.*;
+import java.net.URL;
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class compiler.
+ */
+class compiler 
+{
+	
+	/** The debug. */
+	private boolean debug= false;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The dir. */
+	private def dir;
+	
+	/** The output. */
+	private def output;
+	
+	/** The url. */
+	private def url;
+	
+	/** The anahash. */
+	private HashMap<String,String> anahash =new HashMap<String,String>() ;
+	
+	/** The text. */
+	String text="";
+	
+	/** The base. */
+	String base="";
+	
+	/** The project. */
+	String project="";
+	
+	/** The cwb loc. */
+	String cwbLoc;
+	
+	/** The lang. */
+	private String lang ="fr";
+	
+	/**
+	 * initialize.
+	 *
+	 */
+	public compiler(){}
+	
+	/**
+	 * Instantiates a new compiler.
+	 *
+	 * @param url the url
+	 * @param text the text
+	 * @param base the base
+	 * @param project the project
+	 */
+	public compiler(URL url,String text,String base, String project)
+	{
+		this.text = text
+		this.base = base;
+		this.project = project;
+		try {
+			this.url = url;
+			inputData = url.openStream();
+			
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * set the language of the corpus.
+	 *
+	 * @param lang the lang
+	 * @return the java.lang. object
+	 */
+	public setLang(String lang)
+	{
+		this.lang = lang;
+	}
+	
+	/**
+	 * Sets the cwb path.
+	 *
+	 * @param path the new cwb path
+	 */
+	public void setCwbPath(String path)
+	{
+		if(!new File(path).exists())
+			System.err.println("CWB Path : "+path+" does not exists")
+		cwbLoc = path;
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(String dirPathName, String fileName){
+		try {
+			File f = new File(dirPathName, fileName)
+			output = new OutputStreamWriter(new FileOutputStream(f,f.exists()) , "UTF-8");
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+	
+	/**
+	 * Go to text.
+	 */
+	private void GoToText()
+	{
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+		{
+			if(event == XMLStreamConstants.END_ELEMENT)
+				if(parser.getLocalName().equals("teiHeader"))
+					return;
+		}
+	}
+	
+	/**
+	 * Transfom file wtc.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	public boolean transfomFileWtc(String dirPathName, String fileName)
+	{
+		createOutput(dirPathName, fileName);
+		
+		String headvalue=""
+		String vAna = "";
+		String vForm = "";
+		String wordid= "";
+		String vHead = "";
+		
+		int p_id = 0;
+		int q_id = 0;
+		int body_id = 0;
+		int front_id = 0;
+		int back_id = 0;
+		String lb_id = 0;
+		int lb_count = 0;
+		String pb_id = 0;
+		int pb_count = 0;
+		String ab_id = 0;
+		
+		boolean captureword = false;
+		
+		String vExpan = "";
+		String vCorr = "";
+		String vReg = "";
+		String vOrig = "";
+		String vSic = "";
+		String vAbbr = "";
+		
+		boolean flaglg = false;
+		boolean flaghead = false;
+		boolean flagAuthor = false;
+		boolean flagDate = false;
+		boolean flagWord = false;
+		boolean flagForm = false;
+		boolean flagAna = false;
+		
+		boolean flagchoice = false;
+		boolean flagcorr = false;
+		boolean flagsic = false;
+		boolean flagreg = false;
+		boolean flagexpan = false;
+		boolean flagorig = false;
+		boolean flagabbr = false;
+		boolean flagfw = false;
+		
+		File xpathfile = new File(url.getFile());
+		String titreId = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='reference']/text()");
+		String auteur = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:author/text()");
+		String datecompo = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo']/@when");
+		String ssiecle = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:date[@type='compo_sous_siecle']/@n");
+		String domaine = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:textDesc/tei:domain/@type");
+		String genre = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:textDesc/@n");
+		String forme = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:textClass/tei:catRef/@target[contains(.,'forme')]").substring(1);
+		String dialecte = XPathResult.getXpathResponse(xpathfile,"tei:TEI/tei:teiHeader/tei:profileDesc/tei:creation/tei:region[@type='dialecte_auteur']/text()");
+		
+		this.GoToText()
+		output.write("<txmcorpus lang=\""+lang+"\">\n"); 
+		try 
+		{
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+			{
+				switch (event) 
+				{
+					case XMLStreamConstants.START_ELEMENT:
+						switch (parser.getLocalName()) 
+						{						
+							case "text":
+							output.write("<text id=\""+text+"\"" +
+							" titre=\""+titreId+"\"" +
+							" auteur=\""+auteur+"\"" +
+							" datecompo=\""+datecompo+"\"" +
+							" ssiecle=\""+ssiecle+"\"" +
+							" domaine=\""+domaine+"\"" +
+							" genre=\""+genre+"\"" +
+							" forme=\""+forme+"\"" +
+							" dialecte=\""+dialecte+"\"" +
+							" base=\""+base+"\"" +
+							" project=\""+project+"\">\n");
+							captureword=true;
+							break;
+							
+							case "div":
+							//output.write("<div type=\""+parser.getAttributeValue(null,"type")+"\">\n");
+							break;
+							
+							case "p":
+							output.write("<p n=\""+(p_id++)+"\">\n");
+							break;
+							case "ab":
+							output.write("<ab n=\""+ab_id+++"\" rend=\""+parser.getAttributeValue(null,"rend")+"\">\n");
+							break;
+							case "q":
+							output.write("<q n=\""+(q_id++)+"\">\n");
+							break;
+							case "front":
+							output.write("<front n=\""+(front_id++)+"\">\n");
+							break;
+							case "body":
+							output.write("<body n=\""+(body_id++)+"\">\n");
+							break;
+							case "back":
+							output.write("<back n=\""+(back_id++)+"\">\n");
+							break;
+							case "lb":
+							String n = parser.getAttributeValue(null,"n")
+							if(n != null)
+								lb_id = n;
+							else
+								lb_id =""+lb_count++;
+							break;
+							case "pb":
+							String n = parser.getAttributeValue(null,"n");
+							if(n != null)
+								pb_id = n;
+							else
+								pb_id = ""+(pb_count++);
+							
+							break;
+							
+							case "choice":
+							flagchoice = true;
+							break;
+							case "corr":
+							flagcorr = true;
+							vCorr= "";
+							break;
+							case "reg":
+							flagreg = true;
+							vReg= "";
+							break;
+							case "expan":
+							flagexpan = true;
+							vExpan= "";
+							break;
+							case "orig":
+							flagreg = true;
+							vOrig= "";
+							break;
+							case "sic":
+							flagsic = true;
+							vSic= "";
+							break;
+							case "abbr":
+							flagreg = true;
+							vAbbr= "";
+							break;
+							
+							case "w":
+							for(int i = 0 ; i < parser.getAttributeCount(); i++)
+								if(parser.getAttributeLocalName(i).equals("id"))
+								{	
+									wordid = parser.getAttributeValue(i);
+									break;
+								}
+							vAna = "";
+							vForm = "";
+							flagWord = true;
+							break;
+							case "form":
+							flagForm = true;
+							vForm = "";
+							vAna ="";
+							break;
+							
+							case "ana":
+							flagAna = true;
+							break;
+						}
+						break;
+					
+					case XMLStreamConstants.END_ELEMENT:
+						switch (parser.getLocalName()) 
+						{	
+							case "div":
+							break;
+							
+							case "text":
+							output.write("</text>\n");
+							captureword=false;
+							break;
+							case "p":
+							output.write("</p>\n");
+							break;
+							case "ab":
+							output.write("</ab>\n");
+							break;
+							case "q":
+							output.write("</q>\n");
+							break;
+							case "front":
+							output.write("</front>\n");
+							break;
+							case "body":
+							output.write("</body>\n");
+							break;
+							case "back":
+							output.write("</back>\n");
+							break;
+							
+							case "fw":
+							flagfw = false;
+							break;
+							case "choice":
+								
+								if(vCorr != "")
+								{
+									//System.out.println(vCorr+" >> write corr "+vForm +"\t"+vAna+wordid+"\t"+pb_id+"\t"+lb_id+"\t"+vOrig+"\t"+vSic+"\t"+vAbbr)
+									output.write( vCorr +"\t"+vAna+wordid+"\t"+pb_id+"\t"+lb_id+"\t"+vOrig+"\t"+vSic+"\t"+vAbbr+"\n");
+								}
+								else if(vReg != "")
+								{
+									//System.out.println("write reg "+vForm)
+									output.write( vReg +"\t"+vAna+wordid+"\t"+pb_id+"\t"+lb_id+"\t"+vOrig+"\t"+vSic+"\t"+vAbbr+"\n");
+								}
+								else if(vExpan != "")
+								{
+									//System.out.println("write expan "+vForm)
+									output.write( vExpan +"\t"+vAna+wordid+"\t"+pb_id+"\t"+lb_id+"\t"+vOrig+"\t"+vSic+"\t"+vAbbr+"\n");
+								}	
+							flagchoice = false;
+							vCorr= "";
+							vSic= "";
+							break;
+							case "corr":
+							flagcorr = false;
+							
+							break;
+							case "reg":
+							flagreg = false;
+							vReg = "";
+							break;
+							case "expan":
+							flagexpan = false;
+							vExpan= "";
+							break;
+							case "orig":
+							flagreg = false;
+							vOrig= "";
+							break;
+							case "sic":
+							flagsic = false;
+							
+							break;
+							case "abbr":
+							flagreg = false;
+							vAbbr= "";
+							break;
+							
+							case "w":
+							if(vAna != null)
+								if(captureword)
+								{
+									if(flagchoice)
+									{
+										
+									}
+									else if(flagfw)
+									{
+										
+									}
+									else
+									{
+										output.write( vForm +"\t"+vAna+wordid+"\t"+pb_id+"\t"+lb_id+"\n");
+									}
+									
+								}
+
+							flagWord = false;
+							break;
+							
+							case "form":
+							flagForm = false;
+							break;
+							
+							case "ana":
+							vAna += "\t";
+							flagAna = false;
+							break;
+						}
+						break;
+					
+					case XMLStreamConstants.CHARACTERS:
+						if(flagAna)
+						{
+							vAna += parser.getText().trim();
+						}
+					
+						if(flagForm)
+						{
+							vForm += parser.getText().trim();
+							if(flagchoice)
+							{
+								if(flagsic)
+								{
+									vSic += parser.getText().trim();
+								}
+								if(flagorig)
+								{
+									vOrig += parser.getText().trim();
+								}
+								if(flagabbr)
+								{
+									vAbbr += parser.getText().trim();
+								}
+								if(flagcorr)
+								{
+									vCorr += parser.getText().trim();
+								}
+							}
+						}
+				}
+			}
+			output.write("</txmcorpus>"); 
+			output.close();
+			parser.close();
+		}
+		catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}
+		catch (IOException ex) {
+			System.out.println("IOException while parsing " + inputData);
+		}
+		
+		return true;
+	}
+	
+	
+	
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @return true, if successful
+	 */
+	public boolean run(File rootDirFile) 
+	{
+		String rootDir =rootDirFile.getAbsolutePath();
+		
+		if(cwbLoc == null)
+			cwbLoc = org.txm.Toolbox.getParam(org.txm.Toolbox.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
+		
+		if(!new File(cwbLoc).exists())
+		{
+			println ("CWB path error: "+cwbLoc)
+			return false;
+		}
+		if(!new File(rootDir).exists())
+		{
+			println ("binary directory does not exists: "+rootDir)
+			return false;
+		}
+		new File(rootDir+"/wtc/","bfm3tt.wtc").delete();//cleaning&preparing
+		new File(rootDir,"/wtc/").deleteDir();
+		new File(rootDir,"/wtc/").mkdir();
+		new File(rootDir,"/data/").deleteDir();
+		new File(rootDir,"/data/").mkdir();
+		new File(rootDir,"registry/").mkdir();
+		
+		String textid="";
+		int counttext =0;
+		List<File> files = new File(rootDirFile,"txm").listFiles();
+		//1- Transform into WTC file
+		for(File f : files)
+		{
+			counttext++;
+			if(!f.exists())
+			{
+				println("file "+f+ " does not exists")	
+			}
+			else
+			{	
+				println("process file "+f)
+				def builder = new compiler(f.toURL(),f.getName(),"bfm3tt","default");
+				builder.setLang(lang);
+				builder.transfomFileWtc(rootDir+"/wtc","bfm3tt.wtc");
+			}
+		}
+		
+		 //2- Import into CWB
+		 def outDir =rootDir;
+		 def outDirTxm = rootDir;
+		 CwbEncode cwbEn = new CwbEncode();
+		 cwbEn.setDebug(debug);
+		 CwbMakeAll cwbMa = new CwbMakeAll();
+		 cwbMa.setDebug(debug);
+		 String[] pAttributes = ["pos","id","pb","lb"];
+		 String[] sAttributes = ["txmcorpus:0+lang","text:0+id+titre+auteur+datecompo+ssiecle+domaine+genre+forme+dialecte+base+project","front:0+n","body:0+n","ab:0+n+rend","div:0+id+type","q:1+n","p:0+n","back:0+n"];
+		 try
+		 {
+		 cwbEn.run(new File(cwbLoc,"cwb-encode").getAbsolutePath(), outDirTxm + "/data", outDir + "/wtc/"+"bfm3tt.wtc", outDirTxm + "/registry/"+"bfm3tt",pAttributes, sAttributes);
+		 cwbMa.run(new File(cwbLoc,"cwb-makeall").getAbsolutePath(), "BFM3TT", outDirTxm + "/registry");
+		 } catch (Exception ex) {System.out.println(ex); return false;}
+		 
+		System.out.println("Done.") 
+		
+		return true;
+	}
+	
+	/**
+	 * Sets the debug.
+	 */
+	public void setDebug()
+	{
+		this.debug = true;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("~/xml/bfm3tt");
+		def c = new compiler();
+		c.setDebug();
+		c.setCwbPath("~/TXM/cwb/bin");
+		c.run(dir);
+	}
+}
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RGAQCJ/package.html
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RGAQCJ/package.html	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RGAQCJ/package.html	(revision 728)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>RGAQCJ import module - old</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RGAQCJ/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RGAQCJ/rgaqcjLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RGAQCJ/rgaqcjLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RGAQCJ/rgaqcjLoader.groovy	(revision 728)
@@ -0,0 +1,139 @@
+/**
+ * Main.
+ *
+ * @param args the args
+ */
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.RGAQCJ
+;
+
+import org.txm.importer.RGAQCJ.importer;
+import org.txm.importer.RGAQCJ.compiler;
+import org.txm.importer.bfm.pager;
+import org.txm.objects.*;
+import org.txm.utils.i18n.*;
+import org.txm.*;
+
+// TODO: Auto-generated Javadoc
+/* (non-Javadoc)
+ * @see groovy.lang.Script#run()
+ */
+String userDir = System.getProperty("user.home");
+String rootDir;
+String lang;
+String encoding;
+String model;
+try{rootDir = rootDirBinding;lang=langBinding;encoding=encodingBinding;model=modelBinding;}
+catch(Exception)
+{	println "DEV MODE";//exception means we debug
+	if(!org.txm.Toolbox.isInitialized())
+	{
+		rootDir = userDir+"/xml/weblex/";
+		lang="fr";
+		encoding= "UTF-8";
+		model="rgaqcj";// not used
+		Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File(userDir,"txminstall"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"txminstall/treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"txminstall/treetagger/models"));
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"),"TXM"));
+	}
+}
+
+File dir = new File(rootDir);
+String basename = dir.getName();
+
+println "-- IMPORTER - Reading source files"
+File paramfile = new File(userDir, "TXM/weblexloader.prefs")
+def imp = new importer()
+if(!imp.run(dir, paramfile, basename))
+{
+	println("Stop import process")
+	return;
+}
+
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+rootDir = binDir.getAbsolutePath();
+dir = new File(rootDir);
+
+println "No annotation to do"
+
+
+println "-- COMPILER - Building Search Engine indexes"
+def c = new compiler();
+c.setDebug();
+//c.setCwbPath("~/TXM/cwb/bin");
+c.setLang(lang);
+c.run(dir);
+
+
+//move registry file to cwb registry dir
+File registryfile = new File(rootDir+"/registry", basename);
+if(registryfile.exists())
+	FileCopy.copy(registryfile,new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "registry/"+basename))
+
+Workspace w = org.txm.Toolbox.workspace;
+Project p = w.getProject("default")
+p.removeBase(basename)
+Base b = p.addBase(basename);
+b.addDirectory(new File(rootDir, "txm"));
+b.setAttribute("lang", lang)
+b.propagateAttribute("lang")
+
+println "-- EDITION"
+new File(rootDir+"/HTML/").deleteDir()
+new File(rootDir+"/HTML/").mkdir();
+new File(rootDir+"/HTML/default/").mkdir();
+files = new File(rootDir,"txm").listFiles();
+println files
+for(String textname : b.getTextsID())
+{
+	Text text = b .getText(textname);
+	File srcfile = text.getSource();
+	File resultfile = new File(rootDir+"/HTML", srcfile.getName().substring(0, srcfile.getName().length()-4)+".html");
+	List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+	List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+	println("Building edition  : "+srcfile+" to : "+resultfile );
+	
+	def ed = new pager(srcfile, resultfile, NoSpaceBefore, NoSpaceAfter, 600);
+	//ed.writecorrespondancesFile(new File(rootDir,"edition_correspondances.txt"))
+	Edition editionweb = text.addEdition("default", "html", resultfile);
+
+	for(int i = 0 ; i < ed.getPageFiles().size();i++)
+	{
+		File f = ed.getPageFiles().get(i);
+		String idx = ed.getIdx().get(i);
+		editionweb.addPage(f, idx);
+	}
+	
+//	Edition editionbp = text.addEdition("onepage", "html", resultfile);
+//	editionbp.addPage(resultfile, ed.getIdx().get(0));
+}
+
+w.save();
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RGAQCJ/importer.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RGAQCJ/importer.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RGAQCJ/importer.groovy	(revision 728)
@@ -0,0 +1,266 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.RGAQCJ
+
+import org.txm.importer.*;
+import org.txm.importer.filters.*;
+import org.txm.scripts.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.treetagger.TreeTagger;
+import javax.xml.stream.*;
+import java.net.URL;
+import java.util.Properties;
+
+import filters.CutHeader.*;
+import filters.Tokeniser.*;
+import filters.FusionHeader.*;
+
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+
+import org.apache.commons.lang.StringUtils;
+import org.txm.*;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class importer.
+ */
+class importer {
+	
+	/** The tokenize. */
+	boolean tokenize = true;
+	
+	/**
+	 * Run.
+	 *
+	 * @param dir the dir
+	 * @param paramfile the paramfile
+	 * @param basename the basename
+	 * @return true, if successful
+	 */
+	public boolean run(File dir, File paramfile, String basename)
+	{
+		if(!paramfile.exists())
+		{
+			System.err.println("Parameter file does not exists: "+paramfile.getAbsolutePath());
+			return false;
+		}
+		Properties properties = new Properties();
+		BufferedReader input = new BufferedReader(new InputStreamReader(new FileInputStream(paramfile) , "UTF-8"));
+		String line = input.readLine();
+		while(line != null)
+		{
+			String[] split = line.split("="); //$NON-NLS-1$
+			if(split.length == 2)
+			{
+				properties.put(split[0], split[1]);
+			}
+			else if(split.length > 2)
+			{
+				String[] subsplit = new String[split.length -1 ]; 
+				System.arraycopy(split, 1, subsplit, 0, split.length-1);
+				properties.put(split[0], StringUtils.join(subsplit, "=")); //$NON-NLS-1$
+			}
+			line = input.readLine();
+		}
+		
+		if(!(properties.containsKey("nbP") && properties.containsKey("nbTaxo") && properties.containsKey("nbResp")))
+		{
+			System.err.println("Missing property: nbP or nbTaxo or nbResp");
+			return false;
+		}
+		int nbP = Integer.parseInt(properties.getProperty("nbP"));
+		int nbTaxo = Integer.parseInt(properties.getProperty("nbTaxo"));
+		int nbResp = Integer.parseInt(properties.getProperty("nbResp"));
+		
+		if(nbResp == 0)
+		{
+			System.err.println("No resp ");
+			return false;
+		}
+		String rootDir = dir.getAbsolutePath()+"/";
+		ArrayList<String> milestones = new ArrayList<String>();
+		
+		//where the binaries will be created
+		File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+		binDir.deleteDir();
+		binDir.mkdir();
+		
+		new File(binDir,"txm").deleteDir();
+		new File(binDir,"txm").mkdir();
+		
+		List<File> files = new File(rootDir,"").listFiles();
+		
+		//set working directory
+		rootDir = binDir.getAbsolutePath()+"/";
+		
+		//Set import parameters
+		def correspType = new HashMap<String,String>();
+		// correspType(attribut word wlx, attribut type de la propriÃ©tÃ© ana du w txm)
+		for(int p = 1 ; p <= nbP ; p++)
+		{
+			correspType.put("p"+p, properties.get(properties.get("P"+p+"_taxo")));
+		}
+		
+		def correspRef = new HashMap<String,String>()
+		// correspRef (attribut word wlx, attribut ref de la propriÃ©tÃ© ana du w txm. ref pointe vers l'identifiant du respStmt du TEIheader)
+		for(int p = 1 ; p <= nbP ; p++)
+		{
+			String taxo=properties.get("P"+p+"_taxo")
+			String resp=properties.get(taxo+"_resp")
+			correspRef.put("p"+p,properties.get(resp));
+		}
+		
+		//il faut lister les id de tous les respStmt
+		def respId = [];
+		for(int r = 1 ; r <= nbResp ; r++)
+			respId << properties.get("R"+r);
+		
+		//fait la correspondance entre le respId et le rapport d'execution de l'outil
+		
+		def applications = new HashMap<String,HashMap<String,String>>();	
+		//fait la correspondance entre le respId et les attributs type de la propriÃ©tÃ© ana du w txm
+		//pour construire les ref vers les taxonomies
+		for(int r = 1 ; r <= nbResp ; r++)
+		{
+			applications.put(properties.get("R"+r), new ArrayList<String>());
+			applications.get(properties.get("R"+r)).add(properties.get("R"+r+"_app_id"));//app ident
+			applications.get(properties.get("R"+r)).add(properties.get("R"+r+"_app_version"));//app version
+			applications.get(properties.get("R"+r)).add(properties.get("R"+r+"_app_reportfile"));//app report file path
+		}
+
+		
+		def taxonomiesUtilisees = new HashMap<String,String[]>();
+		//associe un id d'item avec sa description et son URI
+		for(int t = 1 ; t <= nbTaxo ; t++)
+		{
+			String resp_id = properties.get(properties.get("T"+t+"_resp"))
+			if(!taxonomiesUtilisees.containsKey(resp_id))
+				taxonomiesUtilisees.put(resp_id,[]);//,"lemma","lasla","grace"]);
+			taxonomiesUtilisees.get(resp_id) << properties.get("T"+t)
+		}
+		
+		def itemsURI = new HashMap<String,HashMap<String,String>>();
+		//informations de respStmt
+		//resps (respId <voir ci-dessus>, [description, person, date])
+		for(int t = 1 ; t <= nbTaxo ; t++)
+		{
+			String taxo = properties.get("T"+t);
+			itemsURI.put(taxo,new HashMap<String,String>());
+			itemsURI.get(taxo).put("tagset",properties.get("T"+t+"_tagset"));
+			itemsURI.get(taxo).put("website",properties.get("T"+t+"_web"));
+		}
+		def resps = new HashMap<String,String[]>();
+		for(int r = 1 ; r <= nbResp ; r++)
+		{
+			resps.put(properties.get("R"+r), [properties.get("R"+r+"_desc"),properties.get("R"+r+"_who"),properties.get("R"+r+"_when"),properties.get("R"+r+"_day")])
+		}
+		
+		println("Weblex import parameters : ")
+		println("resps id "+respId);
+		println("resps infos"+resps);
+		println("applications "+applications);
+		
+		println("correspType "+correspType)
+		println("correspRef "+correspRef)
+		
+		println("taxonomiesUtilisees "+taxonomiesUtilisees)
+		println("itemsURI "+itemsURI)
+				
+		//TRANSFORM INTO XML-TEI-TXM
+		for(File f : files)
+		{
+			//ArrayList<String> milestones = new ArrayList<String>();
+			File file = f; 
+			String txmfile = f.getName();
+			println("Building xml-tei-txm "+f+ " >> "+rootDir+"txm/"+txmfile)
+			
+			//lance le traitement
+			def builder3 = new Xml2Ana(file);
+			builder3.setCorrespondances(correspRef, correspType);
+			builder3.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)
+			builder3.transformFile(rootDir+"txm/",txmfile);
+		}
+		return true;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		File dir = new File("~/xml/bfm/")
+		new importer().run(dir);
+	}
+}
+
+/* PARAM FILE EXAMPLE
+nbP=3
+nbTaxo=2
+nbResp=2
+
+R1=init
+R1_desc=initial taggin
+R1_who=al
+R1_when=2010
+R1_day=Tue Mar  2 21:02:55 Paris, Madrid 2010
+R1_app_id=appR1
+R1_app_version=app1V
+R1_app_reportfile=
+
+R2=apinit
+R2_desc=second taggin
+R2_who=slh
+R2_when=2010
+R2_day=Tue Mar  2 21:02:55 Paris, Madrid 2010
+R2_app_id=appR2
+R2_app_version=app2V
+R2_app_reportfile=
+
+P1=truc1
+P1_taxo=T1
+
+P2=bidul2
+P2_taxo=T1
+
+P3=machin3
+P3_taxo=T2
+
+T1=CATTEX
+T1_web=www.google.fr
+T1_tagset=www.google.fr
+T1_resp=R1
+
+T2=TTFR
+T2_web=www.bing.fr
+T2_tagset=www.bing.fr
+T2_resp=R2 
+*/
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RGAQCJ/importRGAQCJ.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RGAQCJ/importRGAQCJ.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/samples/groovy/org/txm/importer/RGAQCJ/importRGAQCJ.groovy	(revision 728)
@@ -0,0 +1,424 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar., 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.RGAQCJ
+
+import org.txm.importer.cwb.CwbEncode
+import org.txm.importer.cwb.CwbMakeAll
+
+import javax.xml.stream.*;
+import java.net.URL;
+
+import org.txm.importer.filters.*;
+// TODO: Auto-generated Javadoc
+
+/**
+ * The Class BuildXmlRGAQCJ.
+ *
+ * @author mdecorde
+ * simple import in cwb of RGAQCJ
+ * structunits : initial, s, lb ...
+ * wordproperties : form, pos and n
+ */
+
+public class BuildXmlRGAQCJ
+{
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private def parser;
+	
+	/** The dir. */
+	private def dir;
+	
+	/** The output. */
+	private def output;
+	
+	/** The url. */
+	private def url;
+	
+	/** The anahash. */
+	private HashMap<String,String> anahash =new HashMap<String,String>() ;
+	
+	/** The types. */
+	private ArrayList<String> types;
+	
+	/** The current type. */
+	private String currentType;
+	
+	/** The cat ref. */
+	private String catRef="";
+	
+	/** The initial. */
+	private String initial;
+	
+	/**
+	 * initialize.
+	 *
+	 * @param url the url
+	 * @param initial the initial
+	 * @param types the types
+	 */
+	public BuildXmlRGAQCJ(URL url,String initial,ArrayList<String> types){
+		try {
+			this.url = url;
+			this.types = types;
+			this.initial = initial;
+			inputData = url.openStream();
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		}catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * clear anaHash variable, it is used to store ana tags values then print it when the end element </ana> is found.
+	 */
+	private void fillanaHash()
+	{
+		anahash.clear();
+		for(String s : types)
+			anahash.put( s,"-" );
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param dirPathName output directory
+	 * @param fileName output file name
+	 * @return true, if successful
+	 */
+	private boolean createOutput(String dirPathName, String fileName){
+		try {
+			dir = new File(dirPathName)
+			File f = new File(dir, fileName);
+			output = new OutputStreamWriter(new FileOutputStream(f,f.exists()) , "UTF-8");
+
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+	
+	/**
+	 * Checks if is body.
+	 *
+	 * @param name the name
+	 * @return true, if is body
+	 */
+	private static boolean isBody(String name) {
+		if (name.equals("body")) return true;
+	}
+	
+	/**
+	 * Find body.
+	 *
+	 * @return true, if successful
+	 */
+	private boolean findBody(){
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()){
+			if(event == XMLStreamConstants.START_ELEMENT){
+				if (parser.getLocalName() == "catRef"){
+					if(parser.getAttributeValue(null,"target") == "#forme_prose")
+						catRef = "prose";
+					else if(parser.getAttributeValue(null,"target") == "#forme_vers")
+						catRef = "vers";
+					else
+						catRef = "mixte";
+					//println("catRef : "+catRef);
+				}
+				if (isBody(parser.getLocalName())){
+					return true;
+				}
+			}
+		}
+		return false;
+	} 
+	
+	/**
+	 * Transfom file wtc.
+	 *
+	 * @param dirPathName the dir path name
+	 * @param fileName the file name
+	 * @return true, if successful
+	 */
+	public boolean transfomFileWtc(String dirPathName, String fileName)
+	{
+		if(findBody() && createOutput(dirPathName, fileName))
+		{
+			def idPb = "";
+			def idLb = "";
+			String idLinesuiv;
+			
+			boolean flagForm = false;
+			boolean flagAna = false;
+			String vAna = "";
+			String vWord = "";
+			String vForm = "";
+			
+			try 
+			{
+				File inputfile = new File(this.url.getFile());
+				output.write( "<text initiale=\""+initial+"\" forme=\""+catRef+"\">\n");
+				for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+				{
+					switch (event) 
+					{
+						case XMLStreamConstants.START_ELEMENT:
+						switch (parser.getLocalName()) 
+						{
+							case "p":
+								output.write "<p n=" + parser.getAttributeValue(null,"n") +">\n";
+								break;
+							
+							case "s":
+								output.write "<s n=" + parser.getAttributeValue(null,"n")+ "\">\n";
+								break;
+							
+							case "pb":
+								idLinesuiv = parser.getAttributeValue(null,"n");
+								idPb = idLinesuiv;
+								break;
+								
+							case "lb":
+								idLb = parser.getAttributeValue(null,"n");
+								break;
+							
+							case "w":
+								fillanaHash();
+								vWord ="";
+							break;
+							
+							case "form":
+								flagForm =true;
+								vForm ="";
+							break;
+							case "ana":
+								flagAna = true;
+								vAna ="";
+								
+								currentType = (parser.getAttributeValue(null,"ref"));
+								if(currentType != null)
+									currentType= currentType.substring(1)
+								else
+									flagAna = false;
+							break;
+						}
+						break;
+						
+						case XMLStreamConstants.END_ELEMENT:
+						switch (parser.getLocalName()) 
+						{
+							case "p":
+								output.write( "</p>\n");
+								break;
+							
+							case "s":
+								output.write( "</s>\n");
+								break;
+
+							case "w":
+								for(String type : types)
+									vWord+="\t"+anahash.get(type)
+								if(catRef.equals("vers"))
+									output.write( vWord+ "\t" +idLb+ "\n");
+								else
+									output.write( vWord+ "\t" +idPb+ "\n");
+								vWord= "";
+								break;
+							
+							case "form":
+								flagForm = false;
+								vWord +=vForm; 
+								break;
+								
+							case "ana":
+								if(flagAna)
+									anahash.put (currentType,vAna);
+								flagAna = false;
+								break;
+						}
+						break;
+						
+						case XMLStreamConstants.CHARACTERS:
+							if(flagForm){
+								vForm += parser.getText().trim();
+							}
+							if(flagAna){
+								vAna += parser.getText().trim();
+							}
+						break;
+					}
+				}
+				output.write( "</text>\n");
+				output.close();
+				parser.close();
+			}
+			catch (XMLStreamException ex) {
+				System.out.println(ex);
+			}
+			catch (IOException ex) {
+				System.out.println("IOException while parsing " + inputData);
+			}
+		}
+		return true;
+	}
+	
+	/**
+	 * Gets the anatypes.
+	 *
+	 * @param rootDir the root dir
+	 * @param xmltxmfiles the xmltxmfiles
+	 * @return the anatypes
+	 */
+	public static def getAnatypes(String rootDir, List<String> xmltxmfiles)
+	{
+		ArrayList<String> types = new ArrayList<String>()
+		for(int i=0; i < xmltxmfiles.size();i++)
+		{
+			//println("look in "+xmltxmfiles[i]);
+			URL url = new File(rootDir+"/anainline/", xmltxmfiles[i]).toURL();
+			def inputData = url.openStream();
+			def factory = XMLInputFactory.newInstance();
+			XMLStreamReader parser = factory.createXMLStreamReader(inputData);
+			
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
+				if(event == XMLStreamConstants.START_ELEMENT)
+					if(parser.getLocalName().equals("ana"))
+					{
+						String s = parser.getAttributeValue(null, "ref");
+						if(s != null)
+						{
+							s = s.substring(1, s.length());
+							if(!types.contains(s))
+							{
+								types.add(s);
+							}
+						}
+					}
+			
+			inputData=null;
+			factory=null
+			parser=null;
+		}
+		return types;		
+	}
+		
+	/**
+	 * Process.
+	 *
+	 * @param files the files
+	 * @param rootDir the root dir
+	 * @param cwbLoc the cwb loc
+	 */
+	public static void process(List<String> files, String rootDir,String cwbLoc) 
+	{
+		new File(rootDir+"wtc/").mkdir();
+		new File(rootDir+"registry/").mkdir();
+		//String[] files = ["roland-ana.xml","qgraal_cm-ana.xml","artu-ana.xml","qjm-ana.xml","commyn1-ana.xml","jehpar-ana.xml"];
+		//String rootDir = "~/xml/rgaqcj/";
+		ArrayList<String> types = BuildXmlRGAQCJ.getAnatypes(rootDir, files);
+		println(types);
+		
+		//1- Transform into WTC file
+		File f = new File(rootDir+"wtc/","RGAQCJ.wtc");
+		f.delete();
+		
+		def output = new OutputStreamWriter(new FileOutputStream(f) , "UTF-8");
+		output.write("<corpus name=\"RGAQCJ\">\n");
+		output.close();
+		
+		
+		def initiales = "RAQCJ";
+		for(int i=0; i < files.size();i++)
+		{
+			println("process file "+files[i])
+			String file = files[i]; 
+			def builder = new BuildXmlRGAQCJ(new File(rootDir+"/anainline/",file).toURL(),""+initiales.charAt(i),types);
+			builder.transfomFileWtc(rootDir+"wtc","RGAQCJ.wtc");
+		}
+		
+		output = new OutputStreamWriter(new FileOutputStream(f,true) , "UTF-8");
+		output.write("</corpus>\n");
+		output.close();
+
+		//2- Import into CWB
+		
+		//def cwbLoc ="~/Bureau/textometrie/CWB/cwb-3.0/utils/";//chemin vers executable cqp
+
+		def inDir = rootDir+"src/";
+		def outDir =rootDir;
+		def outDirTxm = rootDir;
+		
+		CwbEncode cwbEn = new CwbEncode();
+		CwbMakeAll cwbMa = new CwbMakeAll();
+		
+		types.add("line");
+		String[] pAttributes = types;
+		String[] sAttributes = ["corpus:0+name","text:0+initiale+forme", "s:0+n","p:0+n"];
+		
+		try
+		{
+			if (System.getProperty("os.name").contains("Windows"))
+			{
+				cwbEn.run(cwbLoc + "cwb-encode.exe", outDirTxm + "data/"+"RGAQCJ", outDir +"wtc/"+"RGAQCJ"+".wtc", outDirTxm + "registry/"+"rgaqcj",pAttributes, sAttributes);
+				cwbMa.run(cwbLoc + "cwb-makeall.exe", "RGAQCJ", outDirTxm + "registry");
+			}
+			else
+			{
+				cwbEn.run(cwbLoc + "cwb-encode", outDirTxm + "data/"+"RGAQCJ", outDir + "/wtc/"+"RGAQCJ.wtc", outDirTxm + "registry/"+"rgaqcj",pAttributes, sAttributes);
+				cwbMa.run(cwbLoc + "cwb-makeall", "RGAQCJ", outDirTxm + "registry");
+
+			}
+		} catch (Exception ex) {System.out.println(ex);}
+		System.out.println("Done.") 
+		
+		return
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args)
+	{
+		List<String> files = ["roland-ana.xml","qgraal_cm-ana.xml","artu-ana.xml","qjm-ana.xml","commyn1-ana.xml","jehpar-ana.xml"];
+		String rootDir = "~/xml/rgaqcj/";
+		def cwbLoc ="~/Bureau/textometrie/CWB/cwb-3.0/utils/";//chemin vers executable cqp
+		BuildXmlRGAQCJ.process( files,  rootDir, cwbLoc);
+	}
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/import/alcesteLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/import/alcesteLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/import/alcesteLoader.groovy	(revision 728)
@@ -0,0 +1,161 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2015-06-03 15:04:53 +0200 (mer., 03 juin 2015) $
+// $LastChangedRevision: 2984 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.alceste;
+
+import org.txm.importer.alceste.importer;
+import org.txm.importer.alceste.compiler;
+import org.txm.importer.xml.pager_old;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/TESTS/alceste2/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- IMPORTER - Reading source files"
+
+if (!(new importer().run(srcDir, binDir, txmDir, encoding, basename, lang))) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools"
+boolean annotationSuccess = false;
+if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
+	annotationSuccess = true;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+c.setAnnotationSuccess(annotationSuccess)
+if (debug) c.setDebug();
+c.setLang(lang);
+if (!c.run(binDir, txmDir, corpusname)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+	
+	if (MONITOR != null) MONITOR.worked(20, "EDITION")
+
+	println "-- EDITION - Building edition"
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+	List<File> filelist = txmDir.listFiles();
+	Collections.sort(filelist);
+	def second = 0
+
+	println "Paginating texts: "
+
+	for (File srcfile : filelist) {
+		print "."
+		String txtname = srcfile.getName();
+		int i = txtname.lastIndexOf(".");
+		if(i > 0) txtname = txtname.substring(0, i);
+
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+		Element text = params.addText(params.corpora.get(corpusname), txtname, srcfile);
+
+		def ed = new pager_old(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, "pb");
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/import/factivamailLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/import/factivamailLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/import/factivamailLoader.groovy	(revision 728)
@@ -0,0 +1,159 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform 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 General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2012-07-20 17:33:42 +0200 (ven., 20 juil. 2012) $
+// $LastChangedRevision: 2221 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.factiva;
+
+import org.txm.importer.alceste.importer;
+import org.txm.importer.alceste.compiler;
+import org.txm.importer.xml.pager_old;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception) {
+	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/factivatxt/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+// TRANSFORM FACTIVA TO ALCESTE HERE
+File newSrcDir = new File(binDir, "src")
+newSrcDir.mkdir();
+File alcesteFile = new File(newSrcDir, srcDir.getName()+".txt");
+FactivaMail2Alceste converter = new FactivaMail2Alceste(srcDir, alcesteFile, "UTF-8", "UTF-8")
+if (!converter.doparse()) {
+	println "Failed to convert files in $srcDir to one Alceste file"
+	return false;
+}
+if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- IMPORTER - Reading source files"
+
+if (!(new importer().run(newSrcDir, binDir, txmDir, encoding, basename, lang))) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools"
+boolean annotationSuccess = false;
+if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
+	annotationSuccess = true;
+}
+
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+c.setAnnotationSuccess(annotationSuccess)
+if (debug) c.setDebug();
+c.setLang(lang);
+if (!c.run(binDir, txmDir, corpusname)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null) MONITOR.worked(20, "EDITION")
+println "-- EDITION - Building edition"
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+File outdir = new File(binDir,"/HTML/$corpusname/default/");
+outdir.mkdirs();
+List<File> filelist = txmDir.listFiles();
+Collections.sort(filelist);
+def second = 0
+
+println "Paginating texts: "
+for (File srcfile : filelist) {
+	print "."
+	String txtname = srcfile.getName();
+	int i = txtname.lastIndexOf(".");
+	if(i > 0) txtname = txtname.substring(0, i);
+	
+	List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+	List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+	Element text = params.addText(params.corpora.get(corpusname), txtname, srcfile);
+		
+	def ed = new pager_old(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, 500, basename, "pb");
+	Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+	
+	for (i = 0 ; i < ed.getPageFiles().size();) {
+		File f = ed.getPageFiles().get(i);
+		String wordid = ed.getIdx().get(i);
+		params.addPage(edition, ""+(++i), wordid);
+	}
+}
+
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/import/xmlLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/import/xmlLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/import/xmlLoader.groovy	(revision 728)
@@ -0,0 +1,300 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2016-11-29 16:47:07 +0100 (mar., 29 nov. 2016) $
+// $LastChangedRevision: 3349 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xml;
+
+import javax.xml.stream.XMLStreamReader;
+
+import org.txm.sw.RemoveTag;
+import org.txm.importer.ApplyXsl2;
+import org.txm.importer.ValidateXml;
+import org.txm.importer.xml.importer;
+import org.txm.importer.xml.compiler;
+import org.txm.importer.xml.pager_old;
+import org.txm.objects.*;
+import org.txm.tokenizer.TokenizerClasses;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+import org.txm.metadatas.*;
+import javax.xml.stream.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/bvh/bugnames/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+
+		TokenizerClasses.loadFromNode(params.getTokenizerElement(params.getCorpusElement()));
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		//Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File("C:\\Program Files\\treetagger\\models"));//for Windows
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+String page_element = params.getPageElement("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir, "txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+File propertyFile = new File(rootDir, "import.properties")//default
+Properties props = new Properties();
+String[] metadatasToKeep;
+
+String textSortAttribute = null;
+boolean normalizeMetadata = false;
+String ignoredElements = null;
+boolean stopIfMalformed = false;
+
+println "Trying to read import properties file: "+propertyFile
+if (propertyFile.exists() && propertyFile.canRead()) {
+	InputStreamReader input = new InputStreamReader(new FileInputStream(propertyFile) , "UTF-8");
+	props.load(input);
+	input.close();
+	if(props.getProperty("sortmetadata") != null)
+		textSortAttribute = props.get("sortmetadata").toString();
+	if (props.getProperty("normalizemetadata") != null)
+		normalizeMetadata = Boolean.parseBoolean(props.get("normalizemetadata").toString());
+	if (props.getProperty("ignoredelements") != null)
+		ignoredElements = props.get("ignoredelements").toString();
+	if (props.getProperty("stopifmalformed") != null)
+		stopIfMalformed = Boolean.parseBoolean(props.get("stopifmalformed").toString());
+
+	println "import properties: "
+	println " sort metadata: "+textSortAttribute
+	println " normalize attributes: "+normalizeMetadata
+	println " ignored elements: "+ignoredElements
+	println " stop if a XML source is malformed: "+stopIfMalformed
+}
+
+File allmetadatasfile = new File(srcDir, "metadata.csv");
+
+// Apply XSL
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(1, "APPLYING XSL")
+if (xsl != null && xslParams != null && xsl.trim().length() > 0) {
+	if (ApplyXsl2.processImportSources(new File(xsl), srcDir, new File(binDir, "src"), xslParams))
+	// return; // error during process
+	srcDir = new File(binDir, "src");
+	println ""
+}
+
+// copy xml+dtd files
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+List<File> srcfiles = srcDir.listFiles();
+if (srcfiles != null)
+	for (int i = 0 ; i < srcfiles.size() ; i++) {// check XML format, and copy file into binDir
+		File f = srcfiles.get(i)
+		if (f.getName().equals("import.xml") || f.getName().equals("metadata.csv") || f.getName().endsWith(".properties")) {
+			srcfiles.remove(i);
+			i--;
+			continue;
+		}
+		if (ValidateXml.test(f)) {
+			FileCopy.copy(f, new File(txmDir, f.getName()));
+		} else {
+			println "Won't process file "+f;
+		}
+	}
+
+if (txmDir.listFiles() == null) {
+	println "No txm file to process"
+	return;
+}
+
+// filtering
+/*def xpaths = params.getExcludeXpaths()
+ if (xpaths != null) {
+ println "Filtering XML files with xpaths: $xpaths"
+ for (File infile : txmDir.listFiles()) {
+ print "."
+ if (!RemoveTag.xpath(infile, xpaths)) {
+ println "Failed to filter $infile"
+ return
+ }
+ }
+ println ""
+ }*/
+
+//get metadata values from CSV
+Metadatas metadatas; // text metadata
+
+println "Trying to read metadata from: "+allmetadatasfile
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (allmetadatasfile.exists()) {
+	println " Metadata file found: "+allmetadatasfile
+	File copy = new File(binDir, "metadata.csv")
+	if (!FileCopy.copy(allmetadatasfile, copy)) {
+		println "Error: could not create a copy of metadata file "+allmetadatasfile.getAbsoluteFile();
+		return;
+	}
+	metadatas = new Metadatas(copy, Toolbox.getParam(Toolbox.METADATA_ENCODING), Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR), Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
+} else {
+	println " No metadata file: "+allmetadatasfile
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(5, "IMPORTER")
+println "-- IMPORTER - Reading source files"
+def imp = new importer();
+imp.doValidation(true) // change this to not validate xml
+boolean skipDoTokenizeStep = params.getSkipTokenization()
+imp.doTokenize(!skipDoTokenizeStep) // change this, to not tokenize xml
+imp.setStopIfMalformed(stopIfMalformed);
+if (!imp.run( srcDir, binDir, txmDir, basename, ignoredElements, lang)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "INJECTING METADATA")
+if (metadatas != null) {
+	println("-- INJECTING METADATA - "+metadatas.getHeadersList()+" in texts of directory "+new File(binDir,"txm"))
+	for (File infile : txmDir.listFiles()) {
+		print "."
+		File outfile = File.createTempFile("temp", ".xml", infile.getParentFile());
+		if (!metadatas.injectMetadatasInXml(infile, outfile, "text", null)) {
+			outfile.delete();
+		} else {
+			if (!(infile.delete() && outfile.renameTo(infile))) println "Warning can't rename file "+outfile+" to "+infile
+			if (!infile.exists()) {
+				println "Error: could not replace $infile by $outfile"
+				return false;
+			}
+		}
+	}
+	println ""
+}
+List<File> files = txmDir.listFiles()
+if (files == null || files.size() == 0) {
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools"
+boolean annotationSuccess = false;
+if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
+	annotationSuccess = true;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+if(debug) c.setDebug();
+//c.setCwbPath("~/TXM/cwb/bin");
+c.setOptions(textSortAttribute, normalizeMetadata);
+c.setAnnotationSuccess(annotationSuccess)
+c.setLang(lang);
+if (!c.run(binDir, txmDir, corpusname, null, srcfiles, metadatas)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	println "-- EDITION - Building edition"
+	if (MONITOR != null) MONITOR.worked(25, "EDITION")
+	
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+	List<File> filelist = txmDir.listFiles();
+	Collections.sort(filelist);
+	def second = 0
+
+	println "Paginating texts: "+filelist
+
+	for (File txmFile : filelist) {
+		print "."
+		String txtname = txmFile.getName();
+		int i = txtname.lastIndexOf(".");
+		if (i > 0) txtname = txtname.substring(0, i);
+
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+		Element text = params.addText(corpusElem, txtname, txmFile);
+
+		def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, page_element);
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/import/hyperbaseLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/import/hyperbaseLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/import/hyperbaseLoader.groovy	(revision 728)
@@ -0,0 +1,161 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2015-06-03 15:04:53 +0200 (mer., 03 juin 2015) $
+// $LastChangedRevision: 2984 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.hyperbase;
+
+
+import org.txm.importer.hyperbase.importer;
+import org.txm.importer.hyperbase.compiler;
+import org.txm.importer.xml.pager;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/TESTS/hyperbase/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- IMPORTER - Reading source files"
+
+if (!(new importer().run(srcDir, binDir, txmDir, encoding, basename, lang))) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools"
+boolean annotationSuccess = false;
+if ((new Annotate().run(binDir, txmDir, model+".par"))) {
+	annotationSuccess = true
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+c.setAnnotationSuccess(annotationSuccess);
+if (debug) c.setDebug();
+c.setLang(lang);
+if (!c.run(binDir, txmDir, corpusname)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	println "-- EDITION - Building edition"
+	if (MONITOR != null) MONITOR.worked(20, "EDITION")
+	
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+	List<File> filelist = txmDir.listFiles();
+	Collections.sort(filelist);
+	def second = 0
+
+	println "Paginating texts: "
+
+	for (File srcfile : filelist) {
+		print "."
+		String txtname = srcfile.getName();
+		int i = txtname.lastIndexOf(".");
+		if(i > 0) txtname = txtname.substring(0, i);
+
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+		Element text = params.addText(params.corpora.get(corpusname), txtname, srcfile);
+
+		def ed = new pager(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, "pb");
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/import/bfmLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/import/bfmLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/import/bfmLoader.groovy	(revision 728)
@@ -0,0 +1,218 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+//
+//
+// $LastChangedDate: 2016-03-01 10:10:58 +0100 (mar., 01 mars 2016) $
+// $LastChangedRevision: 3133 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.bfm;
+
+import javax.xml.stream.XMLStreamReader;
+import org.txm.importer.ApplyXsl2;
+import org.txm.importer.bfm.importer;
+import org.txm.importer.bfm.compiler;
+import org.txm.importer.bfm.pager;
+import org.txm.objects.*;
+import org.txm.*;
+import org.txm.utils.i18n.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.importer.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+import org.txm.utils.*;
+
+String userDir = System.getProperty("user.home");
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+def MONITOR;
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/bfm/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+		//rootDir = userDir+"/xml/TESTS/alceste";  // directory which contains the source file
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File("C:\\Program Files\\treetagger\\models"));//for Windows
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+// BFM XPATH PARAMETERS
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(1, "READ XPATH PARAMETERS")
+File paramDeclarationFile = new File(srcDir, "import.properties");
+Properties metadataXPath = new Properties();
+if (paramDeclarationFile.exists() && paramDeclarationFile.canRead()) {
+	InputStreamReader input = new InputStreamReader(new FileInputStream(paramDeclarationFile) , "UTF-8");
+	metadataXPath.load(input);
+	input.close();
+
+	if (!metadataXPath.containsKey("titre"))
+		println "Warning: parameters property file does not contain the 'titre' metadata"
+	if (!metadataXPath.containsKey("forme"))
+		println "Warning: parameters property file does not contain the 'forme' metadata in param values. The default value is 'prose'"
+}
+else
+	println "No '$paramDeclarationFile' file found"
+
+// Apply XSL
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(1, "APPLYING XSL")
+if (xsl != null && xslParams != null && xsl.trim().length() > 0) {
+	if (ApplyXsl2.processImportSources(new File(xsl), srcDir, new File(binDir, "src"), xslParams))
+	// return; // error during process
+	srcDir = new File(binDir, "src");
+	println ""
+}
+
+// copy txm files
+println "-- VALIDATION - checking XML source files well-formedness"
+List<File> srcfiles = srcDir.listFiles();
+for (File f : srcfiles) { // check XML format, and copy file into binDir
+	if (f.isHidden() || f.getName().equals("import.xml") || f.getName().equals("metadata.csv") || f.getName().endsWith(".properties"))
+		continue;
+	if (ValidateXml.test(f)) {
+		FileCopy.copy(f, new File(txmDir, f.getName()));
+	} else {
+		println "Won't process file "+f;
+	}
+}
+
+if (txmDir.listFiles() == null) {
+	println "No txm file to process"
+	return;
+}
+
+if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- IMPORTER - Reading source files"
+def imp = new importer()
+if (!imp.run(srcDir, binDir, txmDir, basename, metadataXPath)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools - $model model"
+boolean annotate_status = true;
+if (annotate && !(new Annotate().run(binDir, txmDir,model+".par"))) {
+	println "Skipping Annotate process";
+	annotate_status = false;
+}
+
+//if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+//if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+//println "-- ANNOTATE - Running NLP tools - fr model"
+//annotate_status = true;
+//if (annotate && !(new Annotate().run(binDir, txmDir,"fr.par"))) {
+//	println "Skipping Annotate process";
+//	annotate_status = false;
+//}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+if (debug) c.setDebug();
+//c.setCwbPath("~/TXM/cwb/bin");
+c.setLang(lang);
+c.setAnnotationDone(annotate_status)
+if (!c.run(binDir, txmDir, corpusname, metadataXPath)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	println "-- EDITION"
+	if (MONITOR != null) MONITOR.worked(25, "EDITION")
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+	files = c.getOrderedTxmFiles();
+
+	println("Building editions: "+files.size()+" files" );
+	for (File txmFile : files) {
+		print "."
+		String txtname = txmFile.getName();
+		int idx = txtname.lastIndexOf(".");
+		if(idx > 0) txtname = txtname.substring(0, idx);
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);//["'","(","[","{","Â«"];
+
+		Element text = params.addText(corpusElem, txtname, txmFile);
+
+		def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, corpusname, metadataXPath);
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/import/docLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/import/docLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/import/docLoader.groovy	(revision 728)
@@ -0,0 +1,360 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2012-04-24 14:30:47 +0200 (mar., 24 avr. 2012) $
+// $LastChangedRevision: 2174 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.doc;
+
+import org.txm.importer.*;
+import javax.xml.stream.XMLStreamReader;
+import org.txm.importer.ApplyXsl2;
+import org.txm.importer.ValidateXml;
+import org.txm.importer.xml.importer;
+import org.txm.importer.xml.compiler;
+import org.txm.objects.*;
+import org.txm.tokenizer.TokenizerClasses;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+import org.txm.metadatas.*;
+import javax.xml.stream.*;
+import org.w3c.dom.Element;
+import org.txm.importer.DomUtils;
+import org.txm.sw.RemoveTag;
+import org.txm.doc.*;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/doc/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+		TokenizerClasses.loadFromNode(params.getTokenizerElement(params.getCorpusElement()));
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		//Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File("C:\\Program Files\\treetagger\\models"));//for Windows
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+int wordsPerPage = params.getWordsPerPage("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir, "txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+String textSortAttribute = null; // a property in metadata.csv file
+String paginationElement = "pb";
+boolean normalizeMetadata = true;
+
+File allmetadatasfile = new File(srcDir, "metadata.csv");
+
+if (txmDir.listFiles() == null) {
+	println "No file to process"
+	return;
+}
+
+def srcfiles = [];
+for (File f : srcDir.listFiles()) {
+	String name = f.getName().toLowerCase();
+	if (name.endsWith(".properties")) continue;
+	if (name.equals("import.xml")) continue;
+	if (name.endsWith(".csv")) continue;
+	if (f.isDirectory()) continue;
+	if (f.isHidden()) continue;
+	if (name.endsWith(".doc") || name.endsWith(".docx") || name.endsWith(".odt") || name.endsWith(".rtf")) {
+		srcfiles.add(f)
+	}
+}
+
+if (srcfiles.size() == null) {
+	println "No file to process"
+	return;
+}
+
+// convert to TEI
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "CREATING TEI FILES")
+println "-- CONVERTER - Converting source files"
+File xsldir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "xsl")
+if (!DocumentToTei.processFiles(srcfiles, txmDir, xsldir)) {
+	println "Abord import"
+	return;
+}
+println ""
+
+// move data folders and build css file
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "RETRIEVE STYLES")
+println "Retrieving data folders and style files"
+println txmDir.listFiles()
+File docfiles = new File(binDir, "docfiles");
+docfiles.mkdir()
+for (File infile : txmDir.listFiles()) {
+	if (infile.isDirectory()) {
+		File unzipDir = new File(docfiles, infile.getName())
+		infile.renameTo(unzipDir)
+
+		//println "zipdir "+unzipDir
+		StylesToCSS converter = new StylesToCSS(unzipDir);
+		if (!converter.process(new File(unzipDir, "style.css"))) {
+			println "WARNING: Failed to build css file of $unzipDir"
+		}
+		// and get the soft page breaks and styles parents
+		def parentStyles = converter.parentStyles;
+		def beforebreaks = converter.beforebreaks
+		def afterbreaks = converter.afterbreaks
+
+		//println "BEFORES: "+beforebreaks
+		//println "AFTERS: "+afterbreaks
+		//println "PARENTS: "+parentStyles
+
+		// se servir de Ã§a pour insÃ©rer <pb/> et remplacer styles automatiques
+		File xmlFile = new File(txmDir, unzipDir.getName().substring(6))
+		//println "PATCH : $xmlFile"
+		new FixBreaksAndAutomaticStyles().run(xmlFile, beforebreaks, afterbreaks, parentStyles)
+	}
+}
+
+// set new Root
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FIXING TEI")
+println "Setting new XML root element"
+for (File infile : txmDir.listFiles()) {
+	if (infile.isHidden() || infile.isDirectory() || infile.getName().startsWith(".")) continue;
+	print "."
+	if (!SetNewXmlDocumentRoot.process(infile, "//tei:text")) {
+		println "Failed to reset XML root $infile"
+		return
+	}
+}
+println ""
+
+// filtering
+println "Filtering XML files with xpaths: [//tei:term]"
+def xpaths = params.getExcludeXpaths()
+if (xpaths == null) xpaths = ["//tei:term"]
+else xpaths << "//tei:term"
+
+if (xpaths != null) {
+	println "Filtering XML files with xpaths: $xpaths"
+	for (File infile : txmDir.listFiles()) {
+		if (infile.isHidden() || infile.isDirectory() || infile.getName().startsWith(".")) continue;
+		print "."
+		if (!RemoveTag.xpath(infile, xpaths)) {
+			println "Failed to filter $infile"
+			return
+		}
+	}
+	println ""
+}
+
+//get metadata values from CSV
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "READ METADATA")
+Metadatas metadatas; // text metadata
+//println "Trying to read metadata from: "+allmetadatasfile
+if (allmetadatasfile.exists()) {
+	File copy = new File(binDir, "metadata.csv")
+	if (!FileCopy.copy(allmetadatasfile, copy)) {
+		println "Error: could not create a copy of the metadata.csv file "+allmetadatasfile.getAbsoluteFile();
+		return;
+	}
+	metadatas = new Metadatas(copy, Toolbox.getParam(Toolbox.METADATA_ENCODING), Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR), Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
+} else {
+	println "no $allmetadatasfile metadata file found."
+}
+
+for (File infile : txmDir.listFiles()) {
+	if (infile.isHidden()) infile.delete();
+	if (infile.getName().startsWith(".")) infile.delete();
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(5, "IMPORTER")
+println "-- IMPORTER - Reading source files"
+def imp = new importer();
+imp.doValidation(true) // change this to not validate xml
+imp.doTokenize(true) // change this, to not tokenize xml
+if (!imp.run(srcDir, binDir, txmDir, basename, "", lang)) {
+	println "import process stopped";
+	return;
+}
+
+if (metadatas != null) {
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	if (MONITOR != null) MONITOR.worked(20, "INJECTING METADATA")
+	println "-- INJECTING METADATA - from csv file: "+allmetadatasfile
+	
+	println("Injecting metadata: "+metadatas.getHeadersList()+" in texts of directory "+new File(binDir,"txm"))
+	for (File infile : txmDir.listFiles()) {
+		if (infile.isHidden() || infile.isDirectory() || infile.getName().startsWith(".")) continue;
+		print "."
+
+		File outfile = File.createTempFile("temp", ".xml", infile.getParentFile());
+		if (!metadatas.injectMetadatasInXml(infile, outfile, "text", null)) {
+			outfile.delete();
+		} else {
+			if (!(infile.delete() && outfile.renameTo(infile))) println "Warning can't rename file "+outfile+" to "+infile
+			if (!infile.exists()) {
+				println "Error: could not replace $infile by $outfile"
+				return false;
+			}
+		}
+	}
+	println ""
+}
+
+List<File> files = txmDir.listFiles()
+if (files == null || files.size() == 0) {
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools"
+boolean annotationSuccess = false;
+if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
+	annotationSuccess = true;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+if(debug) c.setDebug();
+//c.setCwbPath("~/TXM/cwb/bin");
+c.setOptions(textSortAttribute, normalizeMetadata);
+c.setAnnotationSuccess(annotationSuccess)
+c.setLang(lang);
+if (!c.run(binDir, txmDir, corpusname, null, srcfiles, metadatas)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	println "-- EDITION - Building edition"
+	if (MONITOR != null) MONITOR.worked(25, "EDITION")
+
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+	List<File> filelist = txmDir.listFiles();
+	Collections.sort(filelist);
+	def second = 0
+
+	println "Paginating texts: "
+
+	for (File txmFile : filelist) {
+		if (txmFile.isHidden() || txmFile.isDirectory() || txmFile.getName().startsWith(".")) continue;
+		print "."
+
+		String txtname = txmFile.getName();
+		int i = txtname.lastIndexOf(".");
+		if(i > 0) txtname = txtname.substring(0, i);
+
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+		Element text = params.addText(corpusElem, txtname, txmFile);
+
+		def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, "pb");
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+
+	for (File unzipDir : docfiles.listFiles()) {
+		File css = new File(unzipDir, "style.css")
+		String textname = unzipDir.getName();
+		textname = textname.substring(6, textname.lastIndexOf(".")) // remove "files-" and ".xml"
+		File newcss = new File(outdir, textname+".css")
+		css.renameTo(newcss)
+	}
+	File doc = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "css/doc.css")
+	doc_copy = new File(outdir, "doc.css")
+	FileCopy.copy(doc, doc_copy);
+
+
+	// copy images : images externaly linked must be added manually in the html/CORPUS/default directory
+	println "Copying internal images..."
+	for (File txmFile : filelist) {
+		if (txmFile.isHidden() || txmFile.isDirectory() || txmFile.getName().startsWith(".")) continue;
+		print "."
+		File picturesDirectory = new File(binDir, "docfiles/files-"+txmFile.getName()+"/Pictures")
+		println picturesDirectory
+		if (picturesDirectory.exists()) {
+			File picturesDirectory_copy = new File(outdir, "Pictures")
+			FileCopy.copyFiles(picturesDirectory, picturesDirectory_copy)
+			if (!picturesDirectory_copy.exists()) {
+				println "Failed to copy $picturesDirectory to $picturesDirectory_copy"
+			}
+		}
+	}
+	println ""
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/import/tmxLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/import/tmxLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/import/tmxLoader.groovy	(revision 728)
@@ -0,0 +1,194 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2015-08-31 13:45:22 +0200 (lun., 31 aoÃ»t 2015) $
+// $LastChangedRevision: 3028 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.tmx;
+import org.txm.searchengine.cqp.corpus.MainCorpus;
+
+import java.io.File;
+import org.txm.importer.tmx.importer;
+import org.txm.importer.tmx.compiler;
+import org.txm.importer.tmx.pager;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+def MONITOR;
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/tmx/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang;
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);;
+int wordsPerPage = params.getWordsPerPage("default")
+String page_element = params.getPageElement("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir, "txm");
+txmDir.deleteDir();
+txmDir.mkdirs();
+HashMap<String, String> textLangs = [:];
+def langGroups = [:];
+
+println "-- IMPORTER - Reading source files"
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "IMPORTER - Reading source files");
+def imp = new importer()
+imp.run(srcDir, binDir, txmDir, textLangs, langGroups);
+def corpusIDS = imp.getCorpusIDS()
+println "-- ANNOTATE - Running NLP tools"
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE - Running NLP tools");
+new Annotate().run(binDir, txmDir, textLangs);
+
+println "langs : "+textLangs
+println "texts : "+langGroups
+
+println "-- COMPILING - Building Search Engine indexes"
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "COMPILING - Building Search Engine indexes")
+def c = new compiler();
+if (debug) c.setDebug();
+c.setAlignment("seg","id");
+c.setLangs(textLangs);
+c.setCorpusIDS(corpusIDS);
+c.setLangGroups(langGroups);
+if (!c.run(binDir, txmDir, basename)) {
+	println "Compiler failed"
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+new File(binDir,"HTML").deleteDir();
+new File(binDir,"HTML").mkdirs();
+if (build_edition) {
+	
+	println "-- EDITION - Building edition"
+	if (MONITOR != null) MONITOR.worked(20, "EDITION - Building edition")
+	
+	List<File> filelist = new File(binDir,"txm").listFiles();
+	def second = 0
+
+	def splitTUsPerText = [:]
+
+	for (File txmCorpusDir : txmDir.listFiles()) {
+		def txmFiles = txmCorpusDir.listFiles();
+		txmFiles.sort() // same order
+		//println "paging txmFiles : "+txmFiles
+
+		File outdir = new File(binDir,"/HTML/"+txmCorpusDir.getName()+"/default/");
+		outdir.mkdirs();
+		//println "processing pages of corpus "+txmCorpusDir.getName()
+
+		Element paraCorpusElem = corpusElem.cloneNode(true);
+		paraCorpusElem.setAttribute("name", txmCorpusDir.getName());
+
+		for (File srcfile : txmFiles) {
+			print "."
+			String txtname = srcfile.getName();
+			int i = txtname.lastIndexOf("_");
+			if(i > 0) txtname = txtname.substring(0, i);
+
+			//println ""+srcfile.getName()+" -> "+splitTUsPerText[txtname]
+			def splitTUs = splitTUsPerText[txtname];
+			if (splitTUs == null) {
+				splitTUs = [];
+				splitTUsPerText[txtname] = splitTUs;
+			}
+
+			String l = textLangs.get(srcfile.getName())
+			if (l == null) l = "fr";
+			List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(l);
+			List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(l);
+
+			Element text = params.addText(paraCorpusElem, txtname, srcfile);
+
+			def ed = new pager(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, page_element,splitTUs);
+			Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+			for (i = 0 ; i < ed.getPageFiles().size();) {
+				File f = ed.getPageFiles().get(i);
+				String wordid = ed.getIdx().get(i);
+				params.addPage(edition, ""+(++i), wordid);
+			}
+		}
+
+		params.corporaElement.appendChild(paraCorpusElem);
+
+		File cssfile = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "css/tmx.css")
+		if (cssfile.exists()) {
+			FileCopy.copy(cssfile, new File(outdir, "tmx.css"));
+		}
+		File stylefile = new File(binDir, "style.css")
+		if (stylefile.exists()) {
+			FileCopy.copy(stylefile, new File(outdir, "style.css"));
+		}
+		println ""
+	}
+}
+params.corporaElement.removeChild(corpusElem);
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/import/xmltxmLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/import/xmltxmLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/import/xmltxmLoader.groovy	(revision 728)
@@ -0,0 +1,239 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+// $LastChangedDate: 2016-05-11 08:38:47 +0200 (mer., 11 mai 2016) $
+// $LastChangedRevision: 3211 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xmltxm
+
+import javax.xml.stream.*;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintStream;
+import java.net.URL;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+import java.io.File;
+import org.txm.importer.*;
+import org.txm.importer.xmltxm.compiler;
+import org.txm.importer.xml.pager;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.metadatas.*;
+import org.txm.utils.i18n.*;
+import org.w3c.dom.Element;
+
+String userDir = System.getProperty("user.home");
+boolean debug = false
+def MONITOR;
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/anapovoas/FOLLOWING TEST OF MATTHIEU/OUTPUT 2/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+String page_element = params.getPageElement("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+File allmetadatasfile = new File(srcDir, "metadata.csv");
+
+// Apply XSL
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(1, "APPLYING XSL")
+if (xsl != null && xslParams != null && xsl.trim().length() > 0) {
+	if (ApplyXsl2.processImportSources(new File(xsl), srcDir, new File(binDir, "src"), xslParams))
+	// return; // error during process
+	srcDir = new File(binDir, "src");
+	println ""
+}
+
+// copy txm files
+println "Copying XML-TXM files..."
+List<File> srcfiles = srcDir.listFiles();
+for (File f : srcfiles) {// check XML format, and copy file into binDir
+	if (f.isHidden() || f.getName().equals("import.xml") || f.getName().equals("metadata.csv") || f.getName().endsWith(".properties"))
+		continue;
+	if (ValidateXml.test(f)) {
+		FileCopy.copy(f, new File(txmDir, f.getName()));
+	} else {
+		println "Won't process file "+f;
+	}
+}
+
+def files = txmDir.listFiles();
+if (files == null || files.size() == 0) {
+	println "No txm file to process"
+	return;
+}
+
+////get metadata values from CSV
+//Metadatas metadatas; // text metadata
+//if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+//if (allmetadatasfile.exists()) {
+//	println "Trying to read metadata from: "+allmetadatasfile
+//	File copy = new File(binDir, "metadata.csv")
+//	if (!FileCopy.copy(allmetadatasfile, copy)) {
+//		println "Error: could not create a copy of metadata file "+allmetadatasfile.getAbsoluteFile();
+//		return;
+//	}
+//	metadatas = new Metadatas(copy, Toolbox.getParam(Toolbox.METADATA_ENCODING), Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR), Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
+//} else {
+//	println "no metadata file: "+allmetadatasfile
+//}
+//
+//if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+//if (MONITOR != null) MONITOR.worked(20, "INJECTING METADATA - from csv file: "+allmetadatasfile)
+//if (metadatas != null) {
+//	println("Injecting metadata: "+metadatas.getHeadersList()+" in texts of directory "+txmDir)
+//	for (File infile : files) {
+//		print "."
+//		File outfile = File.createTempFile("temp", ".xml", infile.getParentFile());
+//
+//		if (!metadatas.injectMetadatasInXml(infile, outfile, "text", null)) {
+//			outfile.delete();
+//		} else {
+//			if (!(infile.delete() && outfile.renameTo(infile))) println "Warning can't rename file "+outfile+" to "+infile
+//			if (!infile.exists()) {
+//				println "Error: could not replace $infile by $outfile"
+//				return false;
+//			}
+//		}
+//	}
+//	println ""
+//}
+
+//sorting files per metadata "date" with format
+def dates = [:]
+def useDates = false
+SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd.MM.yyyy");
+for (File infile : files) { // get dates
+	String str = GetAttributeValue.process(infile, "/TEI/text", "date")
+
+	if (str != "N/A") {
+		dates[infile] = simpleDateFormat.parse(str)
+		useDates = true
+	}
+}
+
+//sort
+if (useDates) {
+	files.sort() { f-> dates[f] }
+} else {
+	files.sort()
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+if (debug) c.setDebug();
+c.setLang(lang);
+if (!c.run(binDir, txmDir, basename, corpusname, Arrays.asList(files))) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	if (MONITOR != null) MONITOR.worked(20, "EDITION")
+	println "-- EDITION - Building edition"
+	
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+
+	def second = 0
+
+	println "Paginating text: "
+	for (File srcfile : files) {
+
+		String txtname = srcfile.getName();
+		int i = txtname.lastIndexOf(".");
+		if(i > 0) txtname = txtname.substring(0, i);
+
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+		Element text = params.addText(params.corpora.get(corpusname), txtname, srcfile);
+
+		if (second) { print(", ") }
+		if (second > 0 && (second++ % 5) == 0) println ""
+		print(".");
+
+		def ed = new pager(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, page_element);
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/import/discoursLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/import/discoursLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/import/discoursLoader.groovy	(revision 728)
@@ -0,0 +1,153 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2014-11-20 11:30:43 +0100 (jeu., 20 nov. 2014) $
+// $LastChangedRevision: 2904 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.discours;
+
+import org.txm.importer.discours.compiler;
+import org.txm.importer.xml.pager;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.utils.i18n.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true;
+	params = new BaseParameters(new File(userDir, "xml/discours/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- IMPORTER - Reading source files"
+def imp = new importer();
+if (!imp.run(srcDir, binDir, txmDir, encoding, basename)) {
+	println "import process stopped";
+	return;
+}
+
+println "-- ANNOTATE - Running NLP tools"
+println "No annotation to do"
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println("-- COMPILING - Building Search Engine indexes")
+List<File> files = txmDir.listFiles();
+def c = new compiler()
+if (debug) c.setDebug();
+// no annotation
+c.setLang(lang);
+if (!c.run(files, binDir, txmDir, corpusname)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	println "-- EDITION - Building edition"
+	if (MONITOR != null) MONITOR.worked(20, "EDITION")
+	
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+	List<File> filelist = txmDir.listFiles();
+	Collections.sort(filelist);
+
+	println "Paginating texts: "
+
+	for (File srcfile : filelist) {
+		print "."
+		String txtname = srcfile.getName();
+		int i = txtname.lastIndexOf(".");
+		if(i > 0) txtname = txtname.substring(0, i);
+
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+		Element text = params.addText(params.corpora.get(corpusname), txtname, srcfile);
+
+		def ed = new pager(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, "pb");
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/import/frantextLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/import/frantextLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/import/frantextLoader.groovy	(revision 728)
@@ -0,0 +1,212 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+//
+//
+//
+//
+// $LastChangedDate: 2012-02-13 11:42:24 +0100 (lun., 13 fÃ©vr. 2012) $
+// $LastChangedRevision: 2126 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.frantext;
+
+import javax.xml.stream.XMLStreamReader;
+import org.txm.importer.ApplyXsl2;
+import org.txm.importer.bfm.importer;
+import org.txm.importer.bfm.compiler;
+import org.txm.importer.bfm.pager;
+import org.txm.objects.*;
+import org.txm.*;
+import org.txm.utils.i18n.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.importer.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+import org.txm.utils.*;
+
+String userDir = System.getProperty("user.home");
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+def MONITOR;
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/TESTS/frantext/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+		//rootDir = userDir+"/xml/TESTS/alceste";  // directory which contains the source file
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+// BFM XPATH PARAMETERS
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(1, "READ XPATH PARAMETERS")
+File paramDeclarationFile = new File(srcDir, "import.properties");
+Properties metadataXPath = new Properties();
+if (paramDeclarationFile.exists() && paramDeclarationFile.canRead()) {
+	InputStreamReader input = new InputStreamReader(new FileInputStream(paramDeclarationFile) , "UTF-8");
+	metadataXPath.load(input);
+	input.close();
+
+	if (!metadataXPath.containsKey("titre"))
+		println "Warning: parameters property file does not contain the 'titre' metadata"
+	if (!metadataXPath.containsKey("forme"))
+		println "Warning: parameters property file does not contain the 'forme' metadata in param values. The default value is 'prose'"
+}
+else
+	println "No '$paramDeclarationFile' file found"
+
+// Apply XSL
+if (MONITOR != null) MONITOR.worked(5, "APPLYING XSL")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+File xslFile = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "xsl/txm-filter-teifrantext-teibfm.xsl") // force xsl
+
+if (!ApplyXsl2.processImportSources(xslFile, srcDir, new File(binDir, "xsl"))) {
+	println "Error: failed to apply xsl $xsl. Aborting import."
+	return; // error durring process
+}
+srcDir = new File(binDir, "xsl");
+
+// copy txm files
+println "-- VALIDATION - checking XML source files well-formedness"
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+List<File> srcfiles = srcDir.listFiles();
+for (File f : srcfiles) { // check XML format, and copy file into binDir
+	if (f.isHidden() || f.getName().equals("import.xml") || f.getName().equals("metadata.csv") || f.getName().endsWith(".properties"))
+		continue;
+	if (ValidateXml.test(f)) {
+		FileCopy.copy(f, new File(txmDir, f.getName()));
+	} else {
+		println "Won't process file "+f;
+	}
+}
+if (MONITOR != null) MONITOR.worked(5)
+
+if (txmDir.listFiles() == null) {
+	println "No txm file to process"
+	return;
+}
+
+if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- IMPORTER - Reading source files"
+def imp = new importer()
+if (!imp.run(srcDir, binDir, txmDir, basename, metadataXPath)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools - $model model"
+boolean annotate_status = true;
+if (annotate && !(new Annotate().run(binDir, txmDir, model+".par"))) {
+	println "Skipping Annotate process";
+	annotate_status = false;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+if (debug) c.setDebug();
+//c.setCwbPath("~/TXM/cwb/bin");
+c.setLang(lang);
+c.setAnnotationDone(annotate_status)
+if (!c.run(binDir, txmDir, corpusname, metadataXPath)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	println "-- EDITION"
+	if (MONITOR != null) MONITOR.worked(25, "EDITION")
+	
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+	files = c.getOrderedTxmFiles();
+	println("Building editions: "+files.size()+" files" );
+
+	for (File txmFile : files) {
+		print "."
+		String txtname = txmFile.getName();
+		int idx = txtname.lastIndexOf(".");
+		if(idx > 0) txtname = txtname.substring(0, idx);
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);//["'","(","[","{","Â«"];
+
+		Element text = params.addText(corpusElem, txtname, txmFile);
+
+		def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, corpusname, metadataXPath);
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/import/factivaLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/import/factivaLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/import/factivaLoader.groovy	(revision 728)
@@ -0,0 +1,288 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2012-02-13 11:42:24 +0100 (lun., 13 fÃ©vr. 2012) $
+// $LastChangedRevision: 2126 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.factiva;
+
+import javax.xml.stream.XMLStreamReader;
+import org.txm.importer.ApplyXsl2;
+import org.txm.importer.Factiva2XmlTxm;
+import org.txm.importer.ValidateXml;
+import org.txm.importer.xml.importer;
+import org.txm.importer.xml.compiler;
+import org.txm.importer.xml.pager;
+import org.txm.objects.*;
+import org.txm.utils.*;
+import org.txm.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.utils.i18n.*;
+import org.txm.metadatas.*;
+import javax.xml.stream.*;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true;
+	params = new BaseParameters(new File(userDir, "xml/TESTS/factiva/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+String page_element = params.getPageElement("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+File propertyFile = new File(rootDir, "import.properties")//default
+Properties props = new Properties();
+String[] metadatasToKeep;
+
+String textSortAttribute = null;
+String paginationElement = null;
+boolean normalizeMetadata = false;
+String ignoredElements = null;
+boolean stopIfMalformed = false;
+
+println "Trying to read import properties file: "+propertyFile
+if (propertyFile.exists() && propertyFile.canRead()) {
+	InputStreamReader input = new InputStreamReader(new FileInputStream(propertyFile) , "UTF-8");
+	props.load(input);
+	input.close();
+	if(props.getProperty("sortmetadata") != null)
+		textSortAttribute = props.get("sortmetadata").toString();
+	if(props.getProperty("editionpage") != null)
+		paginationElement = props.get("editionpage").toString();
+	if(props.getProperty("normalizemetadata") != null)
+		normalizeMetadata = Boolean.parseBoolean(props.get("normalizemetadata").toString());
+	if(props.getProperty("ignoredelements") != null)
+		ignoredElements = props.get("ignoredelements").toString();
+	if(props.getProperty("stopIfMalformed") != null)
+		stopIfMalformed = Boolean.parseBoolean(props.get("stopIfMalformed").toString());
+
+	println "import properties: "
+	println " sort metadata: "+textSortAttribute
+	println " edition page tag: "+paginationElement
+	println " normalize attributes: "+normalizeMetadata
+	println " ignored elements: "+ignoredElements
+	println " stop if a XML source is malformed: "+stopIfMalformed
+}
+
+File allmetadatasfile = new File(srcDir, "metadata.csv");
+
+// Apply Factiva2XMLTXM
+println "Factiva -> xml/w"
+File factivaOutDir = new File(binDir, "src")
+new Factiva2XmlTxm().run(srcDir, factivaOutDir.getAbsolutePath());
+if (factivaOutDir.listFiles() == null) {
+	println "Error: no file to process"
+	return;
+}
+srcDir = factivaOutDir;
+
+// Apply XSL
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(1, "APPLYING XSL")
+if (xsl != null && xslParams != null && xsl.trim().length() > 0) {
+	if (ApplyXsl2.processImportSources(new File(xsl), srcDir, new File(binDir, "src"), xslParams))
+	// return; // error during process
+	srcDir = new File(binDir, "src");
+	println ""
+}
+
+// copy txm files
+List<File> srcfiles = srcDir.listFiles();
+for (int i = 0 ; i < srcfiles.size() ; i++) {// check XML format, and copy file into binDir
+	File f = srcfiles.get(i)
+	if (f.getName().equals("import.xml") || f.getName().equals("metadata.csv") || f.getName().endsWith(".properties")) {
+		srcfiles.remove(i);
+		i--;
+		continue;
+	}
+	if (ValidateXml.test(f)) {
+		FileCopy.copy(f, new File(txmDir, f.getName()));
+	} else {
+		println "Won't process file "+f;
+	}
+}
+
+if (txmDir.listFiles() == null) {
+	println "No txm file to process"
+	return;
+}
+
+//get metadata values from CSV
+Metadatas metadatas; // text metadata
+println "Trying to read metadata from: "+allmetadatasfile
+if (allmetadatasfile.exists()) {
+	File copy = new File(binDir, "metadata.csv")
+	if (!FileCopy.copy(allmetadatasfile, copy)) {
+		println "Error: could not create a copy of metadata file "+allmetadatasfile.getAbsoluteFile();
+		return;
+	}
+	metadatas = new Metadatas(copy, Toolbox.getParam(Toolbox.METADATA_ENCODING), Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR), Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
+} else
+	println "no metadata file: "+allmetadatasfile
+
+if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- IMPORTER - Reading source files"
+def imp = new importer();
+imp.doValidation(true) // change this to not validate xml
+imp.doTokenize(true) // change this, to not tokenize xml
+imp.setStopIfMalformed(stopIfMalformed);
+if (!imp.run( srcDir, binDir, txmDir, basename, null, lang)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null) MONITOR.worked(20, "INJECTING METADATA")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- INJECTING METADATA - from csv file: "+allmetadatasfile
+if (metadatas != null) {
+	println("Injecting metadata: "+metadatas.getHeadersList()+" in texts of directory "+new File(binDir,"txm"))
+	for (File infile : txmDir.listFiles()) {
+		print "."
+		File outfile = File.createTempFile("temp", ".xml", infile.getParentFile());
+		if (!metadatas.injectMetadatasInXml(infile, outfile, "text", null)) {
+			outfile.delete();
+		} else {
+			if (!(infile.delete() && outfile.renameTo(infile))) println "Warning can't rename file "+outfile+" to "+infile
+			if (!infile.exists()) {
+				println "Error: could not replace $infile by $outfile"
+				return false;
+			}
+		}
+	}
+	println ""
+}
+
+List<File> files = txmDir.listFiles()
+if (files == null || files.size() == 0) {
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(10, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools"
+boolean annotationSuccess = false;
+if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
+	annotationSuccess = true;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+if(debug) c.setDebug();
+//c.setCwbPath("~/TXM/cwb/bin");
+c.setOptions(textSortAttribute, normalizeMetadata);
+c.setAnnotationSuccess(annotationSuccess)
+c.setLang(lang);
+if (!c.run(binDir, txmDir, corpusname, null, srcfiles, metadatas)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	println "-- EDITION - Building edition"
+	if (MONITOR != null) MONITOR.worked(20, "EDITION")
+	
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+	List<File> filelist = txmDir.listFiles();
+	Collections.sort(filelist);
+	def second = 0
+
+	println "Paginating texts: "
+
+	for (File txmFile : filelist) {
+		print "."
+		String txtname = txmFile.getName();
+		int i = txtname.lastIndexOf(".");
+		if(i > 0) txtname = txtname.substring(0, i);
+
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+		Element text = params.addText(corpusElem, txtname, txmFile);
+
+		def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, page_element);
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/import/wtcLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/import/wtcLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/import/wtcLoader.groovy	(revision 728)
@@ -0,0 +1,151 @@
+package org.txm.importer.wtc
+
+import org.txm.importer.cwb.BuildCwbEncodeArgs;
+import java.io.File;
+import java.util.ArrayList;
+
+import org.txm.objects.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.*;
+import org.txm.utils.i18n.*;
+import org.txm.metadatas.*;
+import org.txm.utils.FileCopy;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/wtc/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		//Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File("C:\\Program Files\\treetagger\\models"));//for Windows
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+// FAKE: will contains no XML-TXM files
+File txmDir = new File(binDir, "txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+// Will contains the edition files
+File htmlDir = new File(binDir, "HTML/$corpusname");
+htmlDir.deleteDir();
+htmlDir.mkdirs();
+
+// get the wtc file and the registry file
+File wtcFile;
+File registryFile;
+println "Looking for files to process..."
+for(File f : srcDir.listFiles()) {
+	if (f.isHidden()) continue;
+	if (f.isDirectory()) continue;
+	if (f.getName().endsWith(".wtc")) {
+		if (wtcFile == null) {
+			wtcFile = f;
+			println "Using WTC file : $wtcFile"
+		}
+	} else if (f.getName().endsWith(".xml")) {
+
+	} else if (!f.getName().contains(".")){ // its the registry file
+		if (registryFile == null) {
+			registryFile = f;
+			println "Using registry file : $f"
+		}
+	}
+}
+
+if (wtcFile == null) {
+	println "No WTC file in source directory: "+srcDir;
+	return false;
+}
+
+// get pAttributes an run cwb-encode + cwb-makeall
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler(wtcFile, registryFile)
+c.setDebug(debug)
+if (!c.run(binDir, corpusname)) {
+	println "Import stopped"
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+	
+	println "-- EDITION - Building edition"
+	if (MONITOR != null) MONITOR.worked(20, "EDITION - Building edition")
+
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
+
+	print "."
+
+	List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+	List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+	File binWtcFile = new File(binDir,"wtc/"+corpusname+".wtc");
+	def ed = new pager(binWtcFile, outdir, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, registryFile !=null, c.pAttributesList);
+	def allIndexes = ed.getIdx();
+	def allPages = ed.getPageFiles();
+	for (String txtname : ed.getTextNames()) {
+		def txtIndexes = allIndexes[txtname];
+		def txtPages = allPages[txtname];
+
+		Element text = params.addText(params.corpora.get(corpusname), txtname, wtcFile);
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < txtPages.size();) {
+			File f = txtPages.get(i);
+			String wordid = txtIndexes.get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+println ""
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/all/scripts/import/transcriberLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/import/transcriberLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/import/transcriberLoader.groovy	(revision 728)
@@ -0,0 +1,309 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.importer.transcriber;
+
+import java.io.File;
+import org.txm.scripts.teitxm.*;
+import org.txm.*;
+import org.txm.objects.*;
+import org.txm.utils.i18n.*;
+import org.txm.utils.*;
+import org.txm.importer.*;
+import org.txm.metadatas.*;
+import org.txm.utils.FileCopy;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+//PARAMETERS
+boolean removeInterviewer = false;//if true the transcription of speakers (en1 and enq2) defined in metadatas file will be ignored
+boolean includeComments = false;
+boolean ignoreTranscriberMetadata = false;
+int csvHeaderNumber = 1;
+int maxlines = 200;
+
+String userDir = System.getProperty("user.home");
+
+def MONITOR;
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/anapovoas/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, "\t");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+String page_element = params.getPageElement("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+//get metadata values from CSV
+Metadatas metadatas; // text metadata
+File allmetadatasfile = new File(srcDir, "metadata.csv");
+println "Trying to read metadatas values from: "+allmetadatasfile
+if (allmetadatasfile.exists()) {
+	File copy = new File(binDir, "metadata.csv")
+	if (!FileCopy.copy(allmetadatasfile, copy)) {
+		println "Error: could not create a copy of metadata file "+allmetadatasfile.getAbsoluteFile();
+		return;
+	}
+	metadatas = new Metadatas(copy, Toolbox.getParam(Toolbox.METADATA_ENCODING), Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR), Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
+}
+else
+	println "no metadata file: "+allmetadatasfile
+
+File propertyFile = new File(srcDir, "import.properties")//default
+Properties props = new Properties();
+String[] metadatasToKeep;
+if (propertyFile.exists() && propertyFile.canRead()) {
+	FileInputStream input = new FileInputStream(propertyFile);
+	props.load(input);
+	input.close();
+
+	if (props.getProperty("removeInterviewer") != null)
+		removeInterviewer = Boolean.parseBoolean(props.get("removeInterviewer").toString());
+	if (props.getProperty("ignoreTranscriberMetadata") != null)
+		ignoreTranscriberMetadata = Boolean.parseBoolean(props.get("ignoreTranscriberMetadata").toString());
+	if (props.getProperty("metadataList") != null)
+		metadatasToKeep = props.get("metadataList").toString().split("|");
+	if (props.getProperty("csvHeaderNumber") != null)
+		csvHeaderNumber = props.get("csvHeaderNumber").toString().split("|");
+	//if (props.getProperty("includeComments") != null)
+	//	includeComments = props.get("includeComments").toString();
+
+	println "import properties: "
+	println " removeInterviewer: "+removeInterviewer
+	println " ignoreTranscriberMetadata: "+ignoreTranscriberMetadata
+	println " metadataToKeep: "+metadatasToKeep
+	println " ignored csvHeaderSize: "+csvHeaderNumber
+	//println " includeComments: "+includeComments
+}
+
+// Apply XSL
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(1, "XSL")
+if (xsl != null && xsl.trim().length() > 0) {
+	if (ApplyXsl2.processImportSources(new File(xsl), srcDir, new File(binDir, "src")))
+		srcDir = new File(binDir, "src");
+	println ""
+}
+
+try {
+	// select only trs files
+	String ext = "trs";
+	ArrayList<File> trsfiles = srcDir.listFiles(); //find all trs files
+	if (trsfiles  == null) {
+		println ("No files in "+srcDir.getAbsolutePath())
+		return false;
+	}
+	for (int i = 0 ; i < trsfiles.size() ; i++) {
+		File f = trsfiles.get(i);
+		if (!f.getName().endsWith(ext) || !f.canRead() || f.isHidden()) {
+			trsfiles.remove(i)
+			i--;
+		}
+	}
+
+	if (trsfiles.size() == 0) {
+		println ("No transcription file (*.trs) found in "+srcDir.getAbsolutePath()+". Aborting.")
+		return false;
+	}
+
+	if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	println "-- IMPORTER"
+	def imp = new importer(trsfiles, binDir, txmDir, metadatas, lang) //put result in the txm folder of binDir
+	if (!imp.run()) {
+		println "Failed to prepare files - Aborting";
+		return;
+	}
+	if (MONITOR != null) MONITOR.worked(20)
+
+	println "-- Xml Validation"
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	for (File infile : txmDir.listFiles()) {
+		if (!ValidateXml.test(infile)) {
+			println "$infile : Validation failed";
+			infile.delete();
+		}
+	}
+
+	if (MONITOR != null) MONITOR.worked(5)
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	println "-- Remove interviewer: "+removeInterviewer
+	if (removeInterviewer) 	{
+		if (metadatas == null) {
+			println "Can't remove interviewer without a metadata.csv file defining who are the interviewers."
+		} else {
+			println "Removing some speakers in "+txmDir.listFiles().length+" file(s)"
+			for (File infile : txmDir.listFiles()) {
+				String filename = infile.getName();
+				int idx = filename.indexOf(".xml");
+				if (idx > 0)
+					filename = filename.substring(0, idx);
+
+				ArrayList<Pair<String, String>> metas = metadatas.get(filename)
+				//println "filename=$filename metas= $metas"
+				for (Pair p : metas) {
+					if (p.getFirst().startsWith("enq")) {
+						new RemoveSpeaker(infile, infile, p.getFirst())
+					}
+				}
+			}
+		}
+	}
+
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+	println "-- ANNOTATE - Running NLP tools"
+	boolean annotationSuccess = false;
+	if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
+		annotationSuccess = true;
+	}
+
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+	println "--COMPILING - Building Search Engine indexes"
+	trsfiles = txmDir.listFiles();
+
+	def comp = new compiler()
+	if(debug) comp.setDebug();
+	comp.removeInterviewers(removeInterviewer);
+	comp.setIgnoreTranscriberMetadata(ignoreTranscriberMetadata);
+	comp.setAnnotationSucces(annotationSuccess)
+	if (!comp.run(trsfiles, corpusname, "default", binDir)) {
+		println "Failed to compile files";
+		return;
+	}
+	
+	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+	
+	File htmlDir = new File(binDir,"HTML/$corpusname");
+	htmlDir.deleteDir()
+	htmlDir.mkdirs();
+	if (build_edition) {
+		
+		if (MONITOR != null) MONITOR.worked(20, "EDITION")
+		println "-- EDITION - Building editions"
+		
+		List<File> filelist = txmDir.listFiles();
+		Collections.sort(filelist);
+		def second = 0
+
+		println "Paginating texts: "
+		for (File txmFile : filelist) {
+			print "."
+			String txtname = txmFile.getName();
+			int i = txtname.lastIndexOf(".");
+			if(i > 0) txtname = txtname.substring(0, i);
+
+			List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+			List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+			Element text = params.addText(corpusElem, txtname, txmFile);
+
+			def ed = new pager(txmFile, htmlDir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, page_element, metadatas);
+			Element edition = params.addEdition(text, "default", htmlDir.getAbsolutePath(), "html");
+
+			for (i = 0 ; i < ed.getPageFiles().size();) {
+				File f = ed.getPageFiles().get(i);
+				String wordid = ed.getIdx().get(i);
+				params.addPage(edition, ""+(++i), wordid);
+			}
+
+			if (ed.getPageFiles().size() > 0) {
+				Element editionBD = params.addEdition(text, "onepage", htmlDir.getAbsolutePath(), "html");
+				params.addPage(editionBD, "1", ed.getIndexes().get(0));
+			}
+		}
+
+		//copy transcriber.css
+		File cssfile = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "css/transcriber.css")
+		if (cssfile.exists() && htmlDir.exists()) {
+			FileCopy.copy(cssfile, new File(htmlDir, "transcriber.css"));
+			FileCopy.copy(cssfile, new File(htmlDir, "onepage/transcriber.css"));
+			FileCopy.copy(cssfile, new File(htmlDir, "default/transcriber.css"));
+		}
+	}
+}
+catch (Exception e){org.txm.utils.logger.Log.printStackTrace(e);}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/scripts/import/txtLoader.groovy
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/scripts/import/txtLoader.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/scripts/import/txtLoader.groovy	(revision 728)
@@ -0,0 +1,198 @@
+// Copyright Â© 2010-2013 ENS de Lyon.
+// Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-ComtÃ©, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform 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 General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2017-04-11 15:30:35 +0200 (mar., 11 avr. 2017) $
+// $LastChangedRevision: 3426 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.txt;
+
+import org.txm.importer.txt.importer;
+import org.txm.importer.txt.compiler;
+import org.txm.importer.xml.pager;
+import org.txm.objects.*;
+import org.txm.scripts.teitxm.*;
+import org.txm.*;
+import org.txm.utils.i18n.*;
+import org.txm.metadatas.*;
+import org.txm.utils.FileCopy;
+import org.w3c.dom.Element
+import org.txm.importer.DomUtils;
+
+String userDir = System.getProperty("user.home");
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+def MONITOR;
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "TXM/clipboard/clipboard2/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:/Program Files/TXM"));
+		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH, new File("C:/Program Files/TreeTagger"));
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH, new File("C:/Users/mdecorde/TXM/treetagger"));
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(userDir, "TXM"));
+	}
+}
+if (params == null) { println "No parameters file. Aborting"; return;}
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+def xslParams = params.getXsltParams(corpusElem);
+int wordsPerPage = params.getWordsPerPage("default")
+boolean build_edition = params.getDoEdition("default")
+
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir, "txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+//get metadata values from CSV
+Metadatas metadatas; // text metadata
+File allmetadatasfile = new File(srcDir, "metadata.csv");
+
+if (allmetadatasfile.exists()) {
+	println "Trying to read metadata from: "+allmetadatasfile
+	File copy = new File(binDir, "metadata.csv")
+	if (!FileCopy.copy(allmetadatasfile, copy)) {
+		println "Error: could not create a copy of metadata file "+allmetadatasfile.getAbsoluteFile();
+		return;
+	}
+	metadatas = new Metadatas(copy, Toolbox.getParam(Toolbox.METADATA_ENCODING), Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR), Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
+} else {
+	println "No metadata file: "+allmetadatasfile
+}
+
+def suffixes = ["txt", "TXT"]
+println "-- IMPORTER - Reading source files with extension "+suffixes
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "IMPORTER - Reading source files with extension "+suffixes)
+if (!new importer().run(srcDir, binDir, txmDir,encoding, suffixes, basename, lang)) {
+	println "Import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "INJECTING METADATA - from csv file: "+allmetadatasfile)
+if (metadatas != null) {
+	println "-- INJECTING METADATA - from csv file: "+allmetadatasfile
+	println("Injecting metadata: "+metadatas.getHeadersList()+" in texts of directory "+txmDir)
+	for (File infile : txmDir.listFiles()) {
+		print "."
+		File outfile = File.createTempFile("temp", ".xml", infile.getParentFile());
+
+		if (!metadatas.injectMetadatasInXml(infile, outfile, "text", null)) {
+			outfile.delete();
+		} else {
+			if (!(infile.delete() && outfile.renameTo(infile))) println "Warning can't rename file "+outfile+" to "+infile
+			if (!infile.exists()) {
+				println "Error: could not replace $infile by $outfile"
+				return false;
+			}
+		}
+	}
+	println ""
+}
+
+println "-- ANNOTATE - Running NLP tools"
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE - Running NLP tools")
+boolean annotationSuccess = true;
+if (annotate && !new Annotate().run(binDir, txmDir, model+".par")) {
+	annotationSuccess = false;
+}
+
+println "-- COMPILING - Building Search Engine indexes"
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "COMPILING - Building Search Engine indexes")
+def c = new compiler(null, "", corpusname, "default");
+//c.setCwbPath(userDir+"/TXM/cwb/bin/")// for developers
+if (metadatas != null)
+	c.setMetadataAttributes(metadatas.getSattributes())
+c.setLang(lang);
+c.setAnnotationSuccess(annotationSuccess)
+if (debug) c.setDebug();
+if (!c.run(binDir, txmDir, corpusname)) {
+	println "Import process stopped";
+	return;
+}
+//println "basename :"+basename;
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+new File(binDir,"HTML/$corpusname").deleteDir();
+new File(binDir,"HTML/$corpusname").mkdirs();
+if (build_edition) {
+
+	println "-- EDITION - Building edition"
+	if (MONITOR != null) MONITOR.worked(20, "EDITION - Building edition")
+	
+	File outdir = new File(binDir, "HTML/$corpusname/default/");
+	outdir.mkdirs();
+	List<File> filelist = txmDir.listFiles();
+	Collections.sort(filelist);
+	def second = 0
+
+
+	for (File srcfile : filelist) {
+		print "."
+		String txtname = srcfile.getName();
+		int i = txtname.lastIndexOf(".");
+		if (i > 0) txtname = txtname.substring(0, i);
+
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);
+
+		Element text = params.addText(params.corpora.get(corpusname), txtname, srcfile);
+
+		def ed = new pager(srcfile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, null);
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
Index: tmp/trunk/org.txm.setups/shared/all/css/doc.css
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/css/doc.css	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/css/doc.css	(revision 728)
@@ -0,0 +1,40 @@
+body {
+	padding-top:25px;
+	padding-bottom:25px;
+	padding-right:10px;
+	padding-left:10px;
+	width:600px;
+}
+
+table {
+	border: medium solid black;
+	border-collapse: collapse;
+	width: 100%;
+}
+
+th {
+	font-family: monospace;
+	border: thin solid black;
+	padding: 5px;
+	background-color: #D0E3FA;
+	background-image: url(sky.jpg);
+}
+
+td {
+	font-family: sans-serif;
+	border: thin solid black;
+	width: 50%;
+	padding: 5px;
+	text-align: center;
+	background-color: #ffffff;
+}
+
+h2 {
+
+}
+
+img {
+	display: block;
+	margin: 0 auto; 
+	padding: 5px;
+}
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/css/doc.css
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/css/tmx.css
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/css/tmx.css	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/css/tmx.css	(revision 728)
@@ -0,0 +1,38 @@
+body
+{
+	padding-top:25px;
+	padding-bottom:25px;
+	padding-right:10px;
+	padding-left:10px;
+}
+
+table
+{
+margin-left: auto;
+margin-right: auto;
+margin-bottom: 50px;
+}
+
+td
+{
+padding: 5px;
+}
+
+.header {
+
+}
+
+.tuTitle
+{
+text-align: center;
+}
+
+.seg
+{
+	
+}
+
+.note
+{
+	color:red;
+}
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/css/tmx.css
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/css/txm.css
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/css/txm.css	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/css/txm.css	(revision 728)
@@ -0,0 +1,88 @@
+/*  
+   Copyright Â© 2017 ENS de Lyon, CNRS, University of Franche-ComtÃ©
+   Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
+   @author cbourdot
+   @author sheiden
+
+   TXM default CSS 06-2017
+
+*/
+
+.txmeditionpage {
+	background-color: #f8f7ee;
+	font-family: junicode, verdana;
+	font-size: 14px;
+	text-indent: none;
+	text-align: justify;
+	box-shadow: .3125em .3125em .625em 0 #888;
+	margin: 1.25em auto;
+	padding: 1.25em;
+	width: 400px;
+	min-height: 90%;
+}
+
+.txmeditionpb {
+	text-align: center;
+}
+
+.txmeditionpb::before {
+	content: "- ";
+}
+
+.txmeditionpb::after {
+	content: " -";
+}
+
+.txmlettrinep:first-letter {
+    float: left;
+    font-size: 6em;
+    line-height: 1;
+    margin-right: 0.2em;
+}
+
+a {
+	color:#802520;
+}
+
+h1 {
+	font-size: 20px;
+	font-variant: small-caps;
+	text-align: center;
+	color:#802520;
+}
+
+h2 {
+	font-size: 18px;
+	font-variant: small-caps;
+	text-align: center;
+	color:#802520;
+}
+
+h3 {
+	font-size: 16px;
+	font-variant: small-caps;
+	text-align: center;
+	color:#802520;
+}
+
+p {
+    	text-indent: 0.2cm;
+	text-align: justify;
+    	text-justify: inter-word;	
+  }
+
+img {
+    margin: 10px 10px 10px 10px;
+}
+
+td[rend="table-cell-align-right"] {
+	text-align: right;
+}
+
+td[rend="table-cell-align-left"] {
+	text-align: left;
+}
+
+td[rend="table-cell-align-center"] {
+	text-align: center;
+}
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/shared/all/css/txm.css
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/css/transcriber.css
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/css/transcriber.css	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/css/transcriber.css	(revision 728)
@@ -0,0 +1,58 @@
+body
+{
+	padding-top:25px;
+	padding-bottom:25px;
+	padding-right:10px;
+	padding-left:10px;
+}
+
+.comment
+{
+	font-style:italic;
+	font-weight:normal;
+}
+
+.turn
+{
+
+}
+
+.spk
+{
+	font-variant: small-caps ; 
+}
+
+.event
+{
+	font-style:italic;
+}
+
+b .event
+{
+	font-style:italic;
+	font-weight:normal;
+}
+
+
+.sync
+{
+	vertical-align: super; 
+	font-weight:normal;
+	font-size: 70%;
+}
+table
+{
+margin-left: auto;
+margin-right: auto;
+margin-bottom: 50px;
+}
+
+td
+{
+padding: 5px;
+}
+
+h2
+{
+text-align: center;
+}

Property changes on: tmp/trunk/org.txm.setups/shared/all/css/transcriber.css
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/license_agreement_fr.txt
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/license_agreement_fr.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/license_agreement_fr.txt	(revision 728)
@@ -0,0 +1,33 @@
+          TXM 0.8.0
+
+Copyright Â© 2010-2017 ENS de Lyon,University of Franche-ComtÃ©.
+Copyright Â© 2010-2013 ENS de Lyon.
+Copyright Â© 2007-2010 ENS de Lyon, CNRS, INRP, University of
+Lyon 2, University of Franche-ComtÃ©, University of Nice
+Sophia Antipolis, University of Paris 3.
+
+Le logiciel TXM est un logiciel libre ; vous pouvez le 
+redistribuer et/ou le modifier suivant les termes de la 
+Licence publique gÃ©nÃ©rale GNU telle que publiÃ©e par la Free 
+Software Foundation, soit la version 2 de cette License, soit
+une version ultÃ©rieure.
+
+Le logiciel TXM est distribuÃ© dans l'espoir qu'il sera utile,
+mais sans aucune garantie, y compris mais non de faÃ§on 
+limitative les garanties implicites de qualitÃ© marchande et 
+de convenance Ã  un usage particulier.
+
+Consultez la version 2 et la version 3 de la Licence publique
+gÃ©nÃ©rale GNU pour plus de dÃ©tails.
+
+Vous devriez avoir reÃ§u une copie de la Licence publique 
+gÃ©nÃ©rale GNU en accompagnement du logiciel TXM ; si ce n'est
+pas le cas, veuillez consulter la page 
+http://www.gnu.org/licenses.
+___________________________________________________________
+
+Pour continuer l'installation, vous devez accepter les
+conditions de la licence publique gÃ©nÃ©rale GNU version 2
+(GPL) http://www.gnu.org/licenses/gpl-2.0.html :
+ - cliquez sur "J'accepte" pour continuer l'installation
+ - cliquez sur "Je refuse" pour annuler l'installation

Property changes on: tmp/trunk/org.txm.setups/shared/all/license_agreement_fr.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/shared/all/LICENSE.TXT
===================================================================
--- tmp/trunk/org.txm.setups/shared/all/LICENSE.TXT	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/all/LICENSE.TXT	(revision 728)
@@ -0,0 +1,675 @@
+GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program 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 General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
Index: tmp/trunk/org.txm.setups/shared/all/schema/DELETEME
===================================================================
Index: tmp/trunk/org.txm.setups/shared/win/header.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/win/header.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/win/OpenAppDataDirectory.bat
===================================================================
--- tmp/trunk/org.txm.setups/shared/win/OpenAppDataDirectory.bat	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/win/OpenAppDataDirectory.bat	(revision 728)
@@ -0,0 +1 @@
+@start explorer "%appdata%"
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/win/uninstall.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/win/uninstall.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/win/StartDialog.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/win/StartDialog.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/shared/win/welcome.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/win/welcome.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/win/TXM.bat
===================================================================
--- tmp/trunk/org.txm.setups/shared/win/TXM.bat	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/win/TXM.bat	(revision 728)
@@ -0,0 +1,82 @@
+set installdir=%~dp0
+set DEBUG=0
+
+set USERHOME=%USERPROFILE%\
+
+IF NOT EXIST ROAMINGINSTALL GOTO ROAMINGINSTALLDONE
+echo "The 'roaming' install option is set."
+set USERHOME=%HOMEDRIVE%%HOMEPATH%\
+echo "USERHOME set to %USERHOME%"
+
+:ROAMINGINSTALLDONE
+
+IF NOT EXIST ASKUSERDIRECTORY GOTO ASKUSERDIRECTORYDONE
+echo "The 'ask user directory' install option is set."
+for /f "tokens=*" %%a in ('TXM\jre\bin\java -jar StartDialog.jar') do set USERHOME=%%a\
+echo "USERHOME set to %USERHOME%"
+
+:ASKUSERDIRECTORYDONE
+
+IF EXIST "%USERHOME%" GOTO USERHOMEOK
+echo "%USERHOME% does not exist. Aborting"
+msg * "TXM could not start using the USERHOME='%USERHOME%' directory."
+GOTO:EOF
+
+:USERHOMEOK
+
+set TXMHOME=%USERHOME%TXM\
+set DOTTXM=%TXMHOME%.txm\
+
+mkdir "%TXMHOME%" 
+
+mkdir "%DOTTXM%" 
+
+(
+echo "TXM: getting install date from %installdir%STAMP and %DOTTXM%STAMP files" 
+Fc "%installdir%STAMP" "%DOTTXM%STAMP" 
+) >"%TXMHOME%TXMOutputLogs.txt" 2>"%TXMHOME%TXMErrorLogs.txt" 
+
+IF errorlevel 1 (goto :install) else (goto :run)
+
+:install
+
+(
+echo "New TXM install: it's the first launch after the installation." 
+del "%temp%\org.txm.rcpapplication.prefs" 
+copy "%DOTTXM%configuration\.settings\org.txm.rcpapplication.prefs" "%temp%\org.txm.rcpapplication.prefs" 
+copy "%DOTTXM%.metadata\.plugins\org.eclipse.core.runtime\.settings\org.txm.rcpapplication.prefs" "%temp%\org.txm.rcpapplication.prefs" 
+copy "%DOTTXM%data\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.txm.rcpapplication.prefs" "%temp%\org.txm.rcpapplication.prefs" 
+
+rmdir "%DOTTXM%" /s /q
+IF errorlevel 1 (echo "TXM: failed to delete %DOTTXM% directory.")
+
+mkdir "%DOTTXM%" 
+IF errorlevel 1 (echo "TXM: failed to create %DOTTXM% directory.")
+
+copy "%installdir%TXM.ini" "%DOTTXM%TXM.ini" 
+IF errorlevel 1 (echo "TXM: failed to copy %DOTTXM%TXM.ini file")
+
+copy "%temp%\org.txm.rcpapplication.prefs" "%DOTTXM%org.txm.rcpapplication.prefs" 
+
+mkdir "%DOTTXM%user" 
+IF errorlevel 1 (echo "TXM: failed to create %DOTTXM%user directory.")
+
+mkdir "%DOTTXM%data" 
+IF errorlevel 1 (echo "TXM: failed to create %DOTTXM%data directory.")
+
+copy "%installdir%STAMP" "%DOTTXM%STAMP" 
+IF errorlevel 1 (echo "TXM: failed to copy %DOTTXM%STAMP file")
+
+) >"%TXMHOME%TXMOutputLogs.txt" 2>"%TXMHOME%TXMErrorLogs.txt" 
+
+:run
+
+(
+
+set _JAVA_OPTIONS=-Duser.home="%USERHOME%"
+
+echo running "%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" -data "%DOTTXM%data" -user "%DOTTXM%user" -install "%installdir%" 
+
+"%installdir%\TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" -data "%DOTTXM%data" -user "%DOTTXM%user" -install "%installdir%" 
+
+) >"%TXMHOME%TXMOutputLogs.txt" 2>"%TXMHOME%TXMErrorLogs.txt" 
Index: tmp/trunk/org.txm.setups/shared/win/install.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/win/install.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/win/txm.nsi
===================================================================
--- tmp/trunk/org.txm.setups/shared/win/txm.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/shared/win/txm.nsi	(revision 728)
@@ -0,0 +1,573 @@
+!include MUI2.nsh
+
+!include nsDialogs.nsh
+
+!include LogicLib.nsh
+
+
+
+;general
+
+Name "TXM 0.8.0"
+
+OutFile "TXM_0.8.0_Win64_installer.exe"
+
+InstallDir "$PROGRAMFILES64\TXM"
+
+RequestExecutionLevel admin
+
+
+
+;compression
+
+SetCompressor /FINAL /SOLID lzma
+
+SetCompressorDictSize 64
+
+
+
+;interface configuration
+
+!define MUI_HEADERIMAGE
+
+!define MUI_HEADERIMAGE_RIGHT
+
+!define MUI_HEADERIMAGE_BITMAP "header.bmp"
+
+!define MUI_HEADERIMAGE_UNBITMAP "header.bmp"
+
+!define MUI_ICON "install.ico"
+
+!define MUI_UNICON "uninstall.ico"
+
+!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp" ; optional
+
+
+
+;Welcome conf
+
+;!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp" ; optional
+
+!define MUI_WELCOMEPAGE_TITLE $(WelcomeTitleMessage)
+
+!define MUI_WELCOMEPAGE_TEXT $(WelcomeTextMessage)
+
+
+
+;Finish conf
+
+!define MUI_FINISHPAGE_TITLE $(FinishTitleMessage)
+
+!define MUI_FINISHPAGE_TEXT $(FinishTextMessage)
+
+
+
+;pages
+
+
+
+!insertmacro MUI_PAGE_WELCOME
+
+;!insertmacro MUI_PAGE_LICENSE "license_agreement.txt"  
+!insertmacro MUI_PAGE_DIRECTORY
+
+Page Custom MyCustomPage MyCustomLeave
+Var Dialog
+Var Checkbox1
+
+Var CheckState1 ; Stored globally so we remember the choice if the user presses the back button and goes back to our page
+Var Checkbox2
+
+Var CheckState2 ; Stored globally so we remember the choice if the user presses the back button and goes back to our page
+Function MyCustomPage
+	!insertmacro MUI_HEADER_TEXT $(AdvancedOptionsTitle) $(AdvancedOptionsSubTitle)
+
+	nsDialogs::Create 1018
+	Pop $Dialog
+
+	${If} $Dialog == error
+		Abort
+	${EndIf}
+
+	${NSD_CreateCheckBox} 0 0 100% 30% $(LocalInstallMessage)
+	Pop $Checkbox1
+	
+;	${NSD_Check} $Checkbox1
+
+	${NSD_CreateCheckBox} 0 30% 100% 30% $(AskUserDirMessage)
+	Pop $Checkbox2
+	
+;	${NSD_Check} $Checkbox2
+
+	nsDialogs::Show
+FunctionEnd
+
+Function MyCustomLeave
+  ${NSD_GetState} $Checkbox1 $CheckState1
+
+  ${If} $CheckState1 <> 0
+
+    file ROAMINGINSTALL
+
+  ${EndIf}
+
+  ${NSD_GetState} $Checkbox2 $CheckState2
+
+  ${If} $CheckState2 <> 0
+
+    file ASKUSERDIRECTORY
+
+  ${EndIf}
+FunctionEnd
+
+
+!insertmacro MUI_PAGE_INSTFILES
+
+!insertmacro MUI_UNPAGE_CONFIRM
+
+!insertmacro MUI_UNPAGE_INSTFILES
+
+!insertmacro MUI_PAGE_FINISH
+
+
+;Languages
+
+!insertmacro MUI_LANGUAGE "English"
+!insertmacro MUI_LANGUAGE "French"
+!insertmacro MUI_LANGUAGE "Russian"
+
+
+;Lang Strings ENGLISH
+LangString AdvancedOptionsTitle ${LANG_ENGLISH} "Advanced options"
+LangString AdvancedOptionsSubTitle ${LANG_ENGLISH} "Check these options only for specific Windows configurations"
+LangString LocalInstallMessage ${LANG_ENGLISH} "Do not use local user directory (check this option to use a roaming Windows account home directory)."
+
+LangString AskUserDirMessage ${LANG_ENGLISH} "Do not use the user directory to store the TXM working directory (check this option to store corpora on a USB stick or on a remote directory. In this case, the working directory path will be asked at each TXM launch)."
+
+LangString InfosTitleMessage ${LANG_ENGLISH} "For your information"
+
+LangString InfosTextMessage ${LANG_ENGLISH} "If TXM is already installed on this machine, it will first be removed by this installer (TXM corpora will NOT be removed).$\nClose the window to cancel installation.$\n$\nMinimum requirements: Windows 7 64bit"
+
+LangString WelcomeTitleMessage ${LANG_ENGLISH} "Welcome to TXM setup"
+
+LangString WelcomeTextMessage ${LANG_ENGLISH} "TXM is provided to you free of charge. In return, in the spirit of open-source software development, you are invited to participate in its improvement. To do this, you don't have to be a software developer, you can:$\n * send us your publications or course materials related to your use of TXM;$\n * suggest corrections or improvements;$\n * translate in your language the interface or documentation;$\n * Setup a research project involving TXM adaptation and use;$\n * etc.$\n$\n See the 'Contribute' page on the TXM users' wiki: https://groupes.renater.fr/wiki/txm-users/public/contribuer $\n$\n Don't hesitate to contact us for more information at 'textometrie AT groupes.renater DOT fr'."
+
+LangString FinishTitleMessage ${LANG_ENGLISH} "Installation done"
+
+LangString FinishTextMessage ${LANG_ENGLISH} "The installation is done. A 'TXM' entry has been added to the 'Start' menu.$\nIf you want to automatically tag and lemmatize your corpora with the TreeTagger software during import, you need to follow additional installation instructions given in the 'Help > Install TreeTagger' menu."
+
+LangString ErrorArch32Message ${LANG_ENGLISH} "This setup is for 32bit systems but your system seems to be 64bit. Please download and install the 64bit version of TXM for this machine. Continue to install anyway?"
+
+LangString ErrorArch64Message ${LANG_ENGLISH} "This setup is for 64bit systems but your system seems to be 32bit. Please download and install the 32bit version of TXM for this machine. Continue to install anyway?"
+
+LangString UninstallWindowsMessage ${LANG_ENGLISH} "TXM is already installed on this machine.$\n$\nClick `OK` to uninstall the previous version first (TXM corpora will NOT be removed).$\nOr click `Cancel` to abort this installation.$\nPlease ensure that no TXM is running during the installation process."
+
+
+;Lang Strings FRENCH
+LangString AdvancedOptionsTitle ${LANG_FRENCH} "Options avancï¿½es"
+LangString AdvancedOptionsSubTitle ${LANG_FRENCH} "Ne cocher ces options que pour des configurations Windows particuliï¿½res"
+LangString LocalInstallMessage ${LANG_FRENCH} "Ne pas utiliser le rï¿½pertoire utilisateur local (cocher cette option si vous souhaitez utiliser un rï¿½pertoire de connexion de compte itinï¿½rant)."
+
+LangString AskUserDirMessage ${LANG_FRENCH} "Ne pas utiliser le rï¿½pertoire utilisateur comme rï¿½pertoire de travail de TXM (cocher cette option pour stocker les corpus sur une clï¿½ USB ou sur un disque distant. Dans ce cas, le chemin du rï¿½pertoire de travail sera demandï¿½ ï¿½ chaque lancement de TXM)."
+
+LangString InfosTitleMessage ${LANG_FRENCH} "Pour votre information"
+
+LangString InfosTextMessage ${LANG_FRENCH} "Si TXM est dï¿½jï¿½ installï¿½ sur cette machine, cet installeur le supprimera pour commencer (les corpus existants ne seront pas supprimï¿½s). Pour annuler l'installation, vous pouvez fermer cette fenï¿½tre.$\n$\nConfiguration minimum: Windows Vista 64bit"
+
+LangString WelcomeTitleMessage ${LANG_FRENCH} "Bienvenue dans l'installeur de TXM"
+
+LangString WelcomeTextMessage ${LANG_FRENCH} "TXM vous est fourni gracieusement. En contre-partie, dans l'esprit du logiciel libre, vous ï¿½tes invitï¿½ ï¿½ participer ï¿½ son amï¿½lioration. Pour cela, vous n'ï¿½tes pas obligï¿½ d'ï¿½tre dï¿½veloppeur informatique, vous pouvez :$\n * transmettre vos publications ou supports de cours ;$\n * proposer des corrections ou amï¿½liorations ;$\n *  traduire l'interface ou la documentation ;$\n * monter un projet pour adapter TXM ï¿½ vos besoins ;$\n * etc.$\n$\n Voir la rubrique 'Contribuer' du wiki des utilisateurs de TXM : https://groupes.renater.fr/wiki/txm-users/public/contribuer $\n$\n N'hï¿½sitez pas ï¿½ nous contacter pour de plus amples informations : 'textometrie AT groupes.renater DOT fr'."
+
+LangString FinishTitleMessage ${LANG_FRENCH} "Installation terminï¿½e."
+
+LangString FinishTextMessage ${LANG_FRENCH} "L'installation s'est correctement terminï¿½e. Une entrï¿½e 'TXM' a ï¿½tï¿½ ajoutï¿½e au menu Dï¿½marrer.$\n$\nSi vous souhaitez ï¿½tiqueter et lemmatiser automatiquement vos corpus avec le logiciel TreeTagger lors de l'import, vous devez suivre les instructions d'installation supplï¿½mentaires fournies dans le menu 'Aide > Installer TreeTagger'."
+
+LangString ErrorArch32Message ${LANG_FRENCH} "La version de TXM que vous allez installer est pour un systï¿½me 32 bits, or votre systï¿½me semble ï¿½tre 64 bits. Il faudrait tï¿½lï¿½charger et installer la version 64 bits de TXM. Voulez-vous malgrï¿½ tout continuer cette installation ?"
+
+LangString ErrorArch64Message ${LANG_FRENCH} "La version de TXM que vous allez installer est pour un systï¿½me 64 bits, or votre systï¿½me semble ï¿½tre 32 bits. Il faudrait tï¿½lï¿½charger et installer la version 32 bits de TXM. Voulez-vous malgrï¿½ tout continuer cette installation ?"
+
+LangString UninstallWindowsMessage ${LANG_FRENCH} "TXM est dï¿½jï¿½ installï¿½ sur cette machine. Veuillez cliquer sur 'OK' pour dï¿½sinstaller cette version au prï¿½alable (les corpus seront conservï¿½s). Ou cliquez sur 'Annuler' pour interrompre l'installation. Merci de vous assurer que TXM n'est pas en cours d'exï¿½cution pendant l'installation."
+
+
+
+;END OF LANG MESSAGES
+
+
+
+Function .onInit
+
+	;!insertmacro MUI_LANGDLL_DISPLAY
+
+
+
+	setOutPath $INSTDIR
+
+
+
+		ReadRegStr $R0 HKLM \
+
+		"Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM" \
+
+		"UninstallString"
+
+		StrCmp $R0 "" done
+
+ 
+
+		MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
+
+		$(UninstallWindowsMessage) \
+
+		IDOK uninst
+
+		Abort
+
+
+
+	;Run the uninstaller
+
+	uninst:
+
+		ClearErrors
+
+		ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
+
+		IfErrors no_remove_uninstaller done
+
+		no_remove_uninstaller:
+
+	done:
+
+FunctionEnd
+
+
+
+Section "Copy files" SecFiles
+
+	#we install txm in INSTDIR
+
+	SetOutPath $INSTDIR
+
+	file /r plugins
+	file /r features
+	file /r configuration
+	file /r jre
+	file /r p2
+
+	file /r cwb
+
+	file /r doc
+
+	file /r schema
+
+	file /r scripts
+
+	file /r samples
+
+	file /r xsl
+
+	file /r css
+
+	file TXM.ico
+
+	file TXM.bat
+
+	file TXM.vbs
+	
+	file StartDialog.jar
+
+	file OpenStartUpLogsDirectory.bat
+
+	file IEShims.dll
+
+	file libcharset-1.dll
+
+	file libglib-2.0-0.dll
+
+	file libgnurx-0.dll
+
+	file libiconv-2.dll
+
+	file libintl-8.dll
+
+	file libpcre-1.dll
+
+	file pcre3.dll
+
+
+	# hide TXM.exe
+
+	SetFileAttributes "$INSTDIR/TXM.exe" HIDDEN
+
+	
+
+	# the users right on install dir to enable updates
+
+	AccessControl::GrantOnFile "$INSTDIR\TXM" "(S-1-5-32-545)" "FullAccess"
+
+	#we create the uninstaller
+
+	WriteUninstaller "$INSTDIR\uninstall.exe"
+
+
+	#we set the shortcuts
+
+	SetShellVarContext all
+
+	CreateDirectory "$SMPROGRAMS\TXM"
+
+	CreateShortCut "$SMPROGRAMS\TXM\TXM.lnk" "$INSTDIR\TXM.bat" "$INSTDIR\TXM.ico"
+
+	CreateShortCut "$SMPROGRAMS\TXM\uninstall.lnk" "$INSTDIR\uninstall.exe"
+
+	#CreateShortCut "$SMPROGRAMS\TXM\Manuel utilisateur FR.pdf.lnk" "$INSTDIR\doc\Manuel de TXM 0.7 FR.pdf"
+
+	#CreateShortCut "$SMPROGRAMS\TXM\User Manual EN.pdf.lnk" "$INSTDIR\doc\TXM 0.7 Manual EN.pdf"
+
+
+
+	; Store installation folder
+
+	WriteRegStr HKCU "Software\TXM" "" $INSTDIR
+
+	
+
+	#register the TXM uninstall to windows programs
+
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
+
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM" "DisplayName" "TXM - The Textometrie project builds the new generation of modular and open-source textometry platform and application. The scientific project web site is http://textometrie.ens-lsh.fr/?lang=en. "
+
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
+
+SectionEnd
+
+
+
+Function WriteToFile
+
+	Exch $0 ;file to write to
+
+	Exch
+
+	Exch $1 ;text to write
+
+	FileOpen $0 $0 a #open file
+
+	FileSeek $0 0 END #go to end
+
+	FileWrite $0 $1 #write to file
+
+	FileClose $0
+
+	Pop $1
+
+	Pop $0
+
+FunctionEnd
+
+
+
+### TimeStamp
+
+!ifndef TimeStamp
+
+    !define TimeStamp "!insertmacro _TimeStamp"
+
+    !macro _TimeStamp FormatedString
+
+        !ifdef __UNINSTALL__
+
+            Call un.__TimeStamp
+
+        !else
+
+            Call __TimeStamp
+
+        !endif
+
+        Pop ${FormatedString}
+
+    !macroend
+
+ 
+
+!macro __TimeStamp UN
+
+
+
+Function ${UN}__TimeStamp
+
+    ClearErrors
+
+    ## Store the needed Registers on the stack
+
+        Push $0 ; Stack $0
+
+        Push $1 ; Stack $1 $0
+
+        Push $2 ; Stack $2 $1 $0
+
+        Push $3 ; Stack $3 $2 $1 $0
+
+        Push $4 ; Stack $4 $3 $2 $1 $0
+
+        Push $5 ; Stack $5 $4 $3 $2 $1 $0
+
+        Push $6 ; Stack $6 $5 $4 $3 $2 $1 $0
+
+        Push $7 ; Stack $7 $6 $5 $4 $3 $2 $1 $0
+
+        ;Push $8 ; Stack $8 $7 $6 $5 $4 $3 $2 $1 $0
+
+ 
+
+    ## Call System API to get the current system Time
+
+        System::Alloc 16
+
+        Pop $0
+
+        System::Call 'kernel32::GetLocalTime(i) i(r0)'
+
+        System::Call '*$0(&i2, &i2, &i2, &i2, &i2, &i2, &i2, &i2)i (.r1, .r2, n, .r3, .r4, .r5, .r6, .r7)'
+
+        System::Free $0
+
+ 
+
+        IntFmt $2 "%02i" $2
+
+        IntFmt $3 "%02i" $3
+
+        IntFmt $4 "%02i" $4
+
+        IntFmt $5 "%02i" $5
+
+        IntFmt $6 "%02i" $6
+
+ 
+
+    ## Generate Timestamp
+
+        ;StrCpy $0 "YEAR=$1$\nMONTH=$2$\nDAY=$3$\nHOUR=$4$\nMINUITES=$5$\nSECONDS=$6$\nMS$7"
+
+        StrCpy $0 "$1$2$3$4$5$6.$7"
+
+ 
+
+    ## Restore the Registers and add Timestamp to the Stack
+
+        ;Pop $8  ; Stack $7 $6 $5 $4 $3 $2 $1 $0
+
+        Pop $7  ; Stack $6 $5 $4 $3 $2 $1 $0
+
+        Pop $6  ; Stack $5 $4 $3 $2 $1 $0
+
+        Pop $5  ; Stack $4 $3 $2 $1 $0
+
+        Pop $4  ; Stack $3 $2 $1 $0
+
+        Pop $3  ; Stack $2 $1 $0
+
+        Pop $2  ; Stack $1 $0
+
+        Pop $1  ; Stack $0
+
+        Exch $0 ; Stack ${TimeStamp}
+
+ 
+
+FunctionEnd
+
+!macroend
+
+!insertmacro __TimeStamp ""
+
+!insertmacro __TimeStamp "un."
+
+!endif
+
+###########
+
+
+
+Section "WriteInstallStamp" secStamp
+
+	${TimeStamp} $0
+
+	Push "$0"
+
+	Push "$INSTDIR\STAMP" ;file to write to 
+
+	Call WriteToFile
+
+SectionEnd
+
+
+
+Section "WriteInstallPrefs" secPrefs
+
+	#we set the default preferences
+
+	!define pathToCqp "$INSTDIR\cwb\bin\win32\cqpserver.exe"
+
+	!define pathToCqpLib "$INSTDIR\cwb\bin\"
+
+	!define pathToInit "$INSTDIR\cwb\cqpserver.init"
+
+	!define pathToR "$INSTDIR\R\bin\x64\Rterm.exe"
+
+	!define pathToTT "$PROGRAMFILES\treetagger"
+
+	!define pathToTTMod "$PROGRAMFILES\treetagger\models"
+
+
+
+	FileOpen $4 "$INSTDIR\install.prefs" a
+
+	FileSeek $4 0 END
+
+	FileWrite $4 "$\r$\ncqi_server_path_to_cqplib=${pathToCqpLib}"
+
+	FileWrite $4 "$\r$\ncqi_server_path_to_executable=${pathToCqp}"
+
+	FileWrite $4 "$\r$\ncqi_server_path_to_init_file=${pathToInit}"
+
+	FileWrite $4 "$\r$\nr_path_to_executable=${pathToR}"
+
+	FileWrite $4 "$\r$\ntreetagger_install_path=${pathToTT}"
+
+	FileWrite $4 "$\r$\ntreetagger_models_path=${pathToTTMod}"
+
+	FileClose $4 ; and close the file
+
+SectionEnd
+
+
+
+;UninstallText "This will uninstall TXM"
+
+
+
+;uninstaller section start
+
+Section "Uninstall"
+
+	# Delete installation key
+
+	DeleteRegKey /ifempty HKCU "Software\TXM"
+
+	# Delete uninstaller key
+
+	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TXM"
+
+	# we remove the software
+
+	RMDir /r $INSTDIR
+
+	# second, remove the link from the start menu
+
+	RMDir /r "$SMPROGRAMS\TXM\"
+
+SectionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/shared/win/TXM.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/win/TXM.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/win/ASKUSERDIRECTORY
===================================================================
Index: tmp/trunk/org.txm.setups/shared/win/uninstall.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/shared/win/uninstall.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/shared/win/ROAMINGINSTALL
===================================================================
Index: tmp/trunk/org.txm.setups/directoryCleaner.sh
===================================================================
--- tmp/trunk/org.txm.setups/directoryCleaner.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/directoryCleaner.sh	(revision 728)
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+if [ $1 ]
+then
+ find $1 -name ".svn" -exec rm -rfv {} + &&
+ find $1 -name "*~" -exec rm -rfv {} + 
+else
+ echo "need 1 arg : directory to clean"
+ exit 1
+fi

Property changes on: tmp/trunk/org.txm.setups/directoryCleaner.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/deleteTXMBuilds.sh
===================================================================
--- tmp/trunk/org.txm.setups/deleteTXMBuilds.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/deleteTXMBuilds.sh	(revision 728)
@@ -0,0 +1,13 @@
+#!/bin/bash
+ROOT=exportRCP
+VERSION=`cat VERSION`
+
+rm -rf $ROOT/linux.gtk.x86_64
+rm -rf $ROOT/macosx.cocoa.x86_64
+rm -rf $ROOT/win32.win32.x86_64
+rm -rf $ROOT/repository
+
+rm -rf "TXM_${VERSION}_Win64_installer"
+rm -rf "TXM_${VERSION}_Linux64_installer"
+rm -rf "TXM_${VERSION}_MacOSX_installer"
+

Property changes on: tmp/trunk/org.txm.setups/deleteTXMBuilds.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/MD2Mail.groovy
===================================================================
--- tmp/trunk/org.txm.setups/MD2Mail.groovy	(revision 0)
+++ tmp/trunk/org.txm.setups/MD2Mail.groovy	(revision 728)
@@ -0,0 +1,24 @@
+File mdFile = new File("annonces/mail.md/0.7.6_fr.md")
+File mailFile = new File("annonces/mail.txt/0.7.6_fr.txt")
+File readmeFile = new File("annonces/readme.md/0.7.6_fr.md")
+
+String text = mdFile.getText("UTF-8")
+mailFile.withWriter("UTF-8") { writer ->
+	text = text.replaceAll("\t", '  ')
+	text = text.replaceAll("\\* (.+\n)", ' - $1')
+	
+	text = text.replaceAll("\\[([^\\]]+)\\]\\([^\\)]+\\)", '$1')
+	text = text.replaceAll("([^\n]+)\n===\n", 'Bonjour Ã  tous,\n')
+	text = text.replaceAll("([^\n]+)\n---\n", '*$1*\n')
+	writer.print text
+}
+
+text = mdFile.getText("UTF-8")
+readmeFile.withWriter("UTF-8") { writer ->
+	text = text.replaceAll("\n===\n", '')
+	text = text.replaceAll("Nous avons le plai.+\n",'')
+	writer.print text
+}
+
+println 'fin'
+System.exit()
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/SetupMessages_fr.properties
===================================================================
--- tmp/trunk/org.txm.setups/SetupMessages_fr.properties	(revision 0)
+++ tmp/trunk/org.txm.setups/SetupMessages_fr.properties	(revision 728)
@@ -0,0 +1,28 @@
+# FR FR FR FR FR
+# Message pour lance le desinstalleur de TXM
+UninstallWindows=TXM est dÃ©jÃ  installÃ© sur cette machine. Veuillez cliquer sur "OK" pour dÃ©sinstaller cette version au prÃ©alable (les corpus seront conservÃ©s). Ou cliquez sur "Annuler" pour interrompre l'installation. Merci de vous assurer que TXM n'est pas en cours d'exÃ©cution pendant l'installation.
+
+# messages d'information sur la desinstallation automatique
+InfosTitle=Pour votre information
+InfosText=Si TXM est dÃ©jÃ  installÃ© sur cette machine, cet installeur le supprimera pour commencer (les corpus existants ne seront pas supprimÃ©s). Pour annuler l'installation, vous pouvez fermer cette fenÃªtre.
+
+# message pour Windows si l'architecture de l'OS et de TXM ne correspondent pas
+ErrorArch32=La version de TXM que vous allez installer est pour un systÃ¨me 32 bits, or votre systÃ¨me semble Ãªtre 64 bits. Il faudrait tÃ©lÃ©charger et installer la version 64 bits de TXM. Voulez-vous malgrÃ© tout continuer cette installation ?
+ErrorArch64=La version de TXM que vous allez installer est pour un systÃ¨me 64 bits, or votre systÃ¨me semble Ãªtre 32 bits. Il faudrait tÃ©lÃ©charger et installer la version 32 bits de TXM. Voulez-vous malgrÃ© tout continuer cette installation ?
+
+# Page d'accueil
+WelcomeTitle=Bienvenue dans l'installeur de TXM
+WelcomeText=TXM vous est fourni gracieusement. En contre-partie, dans l'esprit du logiciel libre, vous Ãªtes invitÃ© Ã  participer Ã  son amÃ©lioration. Pour cela, vous n'Ãªtes pas obligÃ© d'Ãªtre dÃ©veloppeur informatique, vous pouvez :\n * transmettre vos publications ou supports de cours ;\n * proposer des corrections ou amÃ©liorations ;\n * traduire l'interface ou la documentation ;\n * monter un projet pour adapter TXM Ã  vos besoins ;\n * etc.\n\n Voir la rubrique 'Contribuer' du wiki des utilisateurs de TXM : https://groupes.renater.fr/wiki/txm-users/public/contribuer \n\n N'hÃ©sitez pas Ã  nous contacter pour de plus amples informations : 'textometrie AT groupes.renater DOT fr'.
+
+# pas montrÃ© pour windows, puisque R est livrÃ© avec
+InstallRLibrariesTitle=Option - installer les packages R automatiquement : 'RSvgDevice', 'Rserve', 'rgl', 'factomineR' et 'textometrieR'.
+InstallRLibrariesText=Si vous ne sÃ©lectionnez pas cette option, merci d'installer ces packages avant d'utiliser TXM (pour plus de dÃ©tails, voir la page http://sourceforge.net/apps/mediawiki/txm/index.php?title=Build_the_toolbox_or_the_application#Install_R_yourself)
+
+# diffÃ©rent pour chaque OS puisque contient des dÃ©tails techniques
+FinishTitle=Installation terminÃ©e.
+FinishTextWindows=L'installation s'est correctement terminÃ©e. Une entrÃ©e 'TXM' a Ã©tÃ© ajoutÃ©e au menu DÃ©marrer.\n\nSi vous souhaitez Ã©tiqueter et lemmatiser automatiquement vos corpus avec le logiciel TreeTagger lors de l'import, veuillez lancer TXM puis suivre les instructions d'installation supplÃ©mentaires fournies dans le menu 'Aide > Installer TreeTagger'
+FinishTextLinux=L'installation s'est correctement terminÃ©e. Une entrÃ©e "TXM" a Ã©tÃ© ajoutÃ©e au tableau de bord. terminal
+FinishTextMac=TXM se lance par le fichier "TXM.app" situÃ© dans le dossier "Applications" / "TXM".
+
+#install TreeTagger
+InstallTreeTagger=Si vous souhaitez Ã©tiqueter et lemmatiser automatiquement vos corpus avec le logiciel TreeTagger lors de l'import, vous devez suivre les instructions d'installation supplÃ©mentaires fournies dans le menu "Aide > Installer TreeTagger".

Property changes on: tmp/trunk/org.txm.setups/SetupMessages_fr.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/modern.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/modern.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/colorful.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/colorful.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/grey.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/grey.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/classic-cross.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/classic-cross.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/simple.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/simple.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/red.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/red.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/grey-cross.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/grey-cross.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/simple-round.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/simple-round.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/red-round.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/red-round.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/simple-round2.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/simple-round2.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/big.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/big.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/classic.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Checks/classic.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/orange-uninstall.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/orange-uninstall.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/orange-nsis.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/orange-nsis.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/llama.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/llama.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/nullsoft.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/nullsoft.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/arrow.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/arrow.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/orange.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/orange.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/nsis.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/nsis.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/orange-uninstall-nsis.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/orange-uninstall-nsis.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/win.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Wizard/win.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/orange-r.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/orange-r.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/nsis-r.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/nsis-r.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/orange-uninstall-r-nsis.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/orange-uninstall-r-nsis.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/orange.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/orange.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/nsis.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/nsis.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/orange-uninstall-nsis.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/orange-uninstall-nsis.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/win.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/win.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/orange-uninstall-r.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/orange-uninstall-r.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/orange-uninstall.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/orange-uninstall.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/orange-r-nsis.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/orange-r-nsis.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/orange-nsis.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Header/orange-nsis.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/llama-grey.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/llama-grey.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-uninstall-full.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-uninstall-full.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-uninstall.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-uninstall.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/box-install.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/box-install.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/orange-uninstall-nsis.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/orange-uninstall-nsis.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/arrow-install.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/arrow-install.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/box-uninstall.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/box-uninstall.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/win-install.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/win-install.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/nsis1-install.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/nsis1-install.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/arrow-uninstall.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/arrow-uninstall.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/win-uninstall.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/win-uninstall.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/nsis1-uninstall.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/nsis1-uninstall.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/llama-blue.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/llama-blue.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-install-colorful.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-install-colorful.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-install-blue-full.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-install-blue-full.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-install-blue.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-install-blue.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-uninstall-colorful.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-uninstall-colorful.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/orange-install.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/orange-install.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-uninstall-blue.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-uninstall-blue.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/arrow2-install.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/arrow2-install.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-uninstall-blue-full.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-uninstall-blue-full.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/orange-uninstall.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/orange-uninstall.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/arrow2-uninstall.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/arrow2-uninstall.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/classic-install.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/classic-install.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/pixel-install.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/pixel-install.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-install.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-install.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-install-full.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/modern-install-full.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/classic-uninstall.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/classic-uninstall.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/pixel-uninstall.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/pixel-uninstall.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/orange-install-nsis.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Graphics/Icons/orange-install-nsis.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/UIs/default.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/UIs/default.exe
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/UIs/modern.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/UIs/modern.exe
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/UIs/modern_headerbmp.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/UIs/modern_headerbmp.exe
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/UIs/modern_smalldesc.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/UIs/modern_smalldesc.exe
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/UIs/modern_headerbmpr.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/UIs/modern_headerbmpr.exe
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/UIs/modern_nodesc.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/UIs/modern_nodesc.exe
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/UIs/sdbarker_tiny.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/UIs/sdbarker_tiny.exe
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/AccessControl.vcxproj
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/AccessControl.vcxproj	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/AccessControl.vcxproj	(revision 728)
@@ -0,0 +1,174 @@
+ï»¿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release Unicode|Win32">
+      <Configuration>Release Unicode</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{FA391322-C61F-4CC4-A421-432A0C3D5342}</ProjectGuid>
+    <RootNamespace>AccessControl</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseOfMfc>false</UseOfMfc>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)..\..\Plugins\</OutDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">$(SolutionDir)..\..\Unicode\Plugins\</OutDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">false</LinkIncremental>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">false</GenerateManifest>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)..\..\Plugins\</OutDir>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Midl>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>true</MkTypLibCompatible>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <TargetEnvironment>Win32</TargetEnvironment>
+      <TypeLibraryName>.\Debug/AccessControl.tlb</TypeLibraryName>
+      <HeaderFileName>
+      </HeaderFileName>
+    </Midl>
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>_WIN32_WINNT=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <PrecompiledHeaderOutputFile>.\Debug/AccessControl.pch</PrecompiledHeaderOutputFile>
+      <WarningLevel>Level3</WarningLevel>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0409</Culture>
+    </ResourceCompile>
+    <Link>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <TargetMachine>MachineX86</TargetMachine>
+      <AdditionalDependencies>nsis_ansi/pluginapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <IgnoreSpecificDefaultLibraries>libc.lib</IgnoreSpecificDefaultLibraries>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <Optimization>MinSpace</Optimization>
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+      <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
+      <OmitFramePointers>false</OmitFramePointers>
+      <PreprocessorDefinitions>_WIN32_WINNT=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <StringPooling>true</StringPooling>
+      <ExceptionHandling>Sync</ExceptionHandling>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <DisableLanguageExtensions>false</DisableLanguageExtensions>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <PrecompiledHeaderOutputFile>.\Release/AccessControl.pch</PrecompiledHeaderOutputFile>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>
+      </DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <AdditionalDependencies>advapi32.lib;nsis_ansi/pluginapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
+      <GenerateDebugInformation>false</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <EntryPointSymbol>DllMain</EntryPointSymbol>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">
+    <ClCompile>
+      <Optimization>MinSpace</Optimization>
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+      <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
+      <OmitFramePointers>false</OmitFramePointers>
+      <PreprocessorDefinitions>_WIN32_WINNT=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <StringPooling>true</StringPooling>
+      <ExceptionHandling>Sync</ExceptionHandling>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <DisableLanguageExtensions>false</DisableLanguageExtensions>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <PrecompiledHeaderOutputFile>.\Release/AccessControl.pch</PrecompiledHeaderOutputFile>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>
+      </DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <AdditionalDependencies>advapi32.lib;nsis_unicode/pluginapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
+      <GenerateDebugInformation>false</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <EntryPointSymbol>DllMain</EntryPointSymbol>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="AccessControl.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\ExDLL\exdll.h" />
+    <ClInclude Include="resource.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="AccessControl.rc" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/AccessControl.sln
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/AccessControl.sln	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/AccessControl.sln	(revision 728)
@@ -0,0 +1,22 @@
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AccessControl", "AccessControl.vcxproj", "{FA391322-C61F-4CC4-A421-432A0C3D5342}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Release Unicode|Win32 = Release Unicode|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{FA391322-C61F-4CC4-A421-432A0C3D5342}.Debug|Win32.ActiveCfg = Debug|Win32
+		{FA391322-C61F-4CC4-A421-432A0C3D5342}.Debug|Win32.Build.0 = Debug|Win32
+		{FA391322-C61F-4CC4-A421-432A0C3D5342}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32
+		{FA391322-C61F-4CC4-A421-432A0C3D5342}.Release Unicode|Win32.Build.0 = Release Unicode|Win32
+		{FA391322-C61F-4CC4-A421-432A0C3D5342}.Release|Win32.ActiveCfg = Release|Win32
+		{FA391322-C61F-4CC4-A421-432A0C3D5342}.Release|Win32.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/resource.h
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/resource.h	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/resource.h	(revision 728)
@@ -0,0 +1,14 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by AccessControl.rc
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        101
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1001
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_unicode/pluginapi.lib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_unicode/pluginapi.lib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_unicode/pluginapi.h
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_unicode/pluginapi.h	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_unicode/pluginapi.h	(revision 728)
@@ -0,0 +1,101 @@
+#ifndef ___NSIS_PLUGIN__H___
+#define ___NSIS_PLUGIN__H___
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "api.h"
+#include "nsis_tchar.h"
+
+#ifndef NSISCALL
+#  define NSISCALL __stdcall
+#endif
+
+#define EXDLL_INIT()           {  \
+        g_stringsize=string_size; \
+        g_stacktop=stacktop;      \
+        g_variables=variables; }
+
+typedef struct _stack_t {
+  struct _stack_t *next;
+  TCHAR text[1]; // this should be the length of string_size
+} stack_t;
+
+enum
+{
+INST_0,         // $0
+INST_1,         // $1
+INST_2,         // $2
+INST_3,         // $3
+INST_4,         // $4
+INST_5,         // $5
+INST_6,         // $6
+INST_7,         // $7
+INST_8,         // $8
+INST_9,         // $9
+INST_R0,        // $R0
+INST_R1,        // $R1
+INST_R2,        // $R2
+INST_R3,        // $R3
+INST_R4,        // $R4
+INST_R5,        // $R5
+INST_R6,        // $R6
+INST_R7,        // $R7
+INST_R8,        // $R8
+INST_R9,        // $R9
+INST_CMDLINE,   // $CMDLINE
+INST_INSTDIR,   // $INSTDIR
+INST_OUTDIR,    // $OUTDIR
+INST_EXEDIR,    // $EXEDIR
+INST_LANG,      // $LANGUAGE
+__INST_LAST
+};
+
+extern unsigned int g_stringsize;
+extern stack_t **g_stacktop;
+extern TCHAR *g_variables;
+
+int NSISCALL popstring(TCHAR *str); // 0 on success, 1 on empty stack
+int NSISCALL popstringn(TCHAR *str, int maxlen); // with length limit, pass 0 for g_stringsize
+int NSISCALL popint(); // pops an integer
+int NSISCALL popint_or(); // with support for or'ing (2|4|8)
+int NSISCALL myatoi(const TCHAR *s); // converts a string to an integer
+unsigned NSISCALL myatou(const TCHAR *s); // converts a string to an unsigned integer, decimal only
+int NSISCALL myatoi_or(const TCHAR *s); // with support for or'ing (2|4|8)
+void NSISCALL pushstring(const TCHAR *str);
+void NSISCALL pushint(int value);
+TCHAR * NSISCALL getuservariable(const int varnum);
+void NSISCALL setuservariable(const int varnum, const TCHAR *var);
+
+#ifdef _UNICODE
+#define PopStringW(x) popstring(x)
+#define PushStringW(x) pushstring(x)
+#define SetUserVariableW(x,y) setuservariable(x,y)
+
+int  NSISCALL PopStringA(char* ansiStr);
+void NSISCALL PushStringA(const char* ansiStr);
+void NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);
+void NSISCALL GetUserVariableA(const int varnum, char* ansiStr);
+void NSISCALL SetUserVariableA(const int varnum, const char* ansiStr);
+
+#else
+// ANSI defs
+
+#define PopStringA(x) popstring(x)
+#define PushStringA(x) pushstring(x)
+#define SetUserVariableA(x,y) setuservariable(x,y)
+
+int  NSISCALL PopStringW(wchar_t* wideStr);
+void NSISCALL PushStringW(wchar_t* wideStr);
+void NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);
+void NSISCALL GetUserVariableA(const int varnum, char* ansiStr);
+void NSISCALL SetUserVariableW(const int varnum, const wchar_t* wideStr);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif//!___NSIS_PLUGIN__H___
Index: tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_unicode/api.h
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_unicode/api.h	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_unicode/api.h	(revision 728)
@@ -0,0 +1,83 @@
+/*
+ * apih
+ * 
+ * This file is a part of NSIS.
+ * 
+ * Copyright (C) 1999-2009 Nullsoft and Contributors
+ * 
+ * Licensed under the zlib/libpng license (the "License");
+ * you may not use this file except in compliance with the License.
+ * 
+ * Licence details can be found in the file COPYING.
+ * 
+ * This software is provided 'as-is', without any express or implied
+ * warranty.
+ */
+
+#ifndef _NSIS_EXEHEAD_API_H_
+#define _NSIS_EXEHEAD_API_H_
+
+// Starting with NSIS 2.42, you can check the version of the plugin API in exec_flags->plugin_api_version
+// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x))
+// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {}
+
+#define NSISPIAPIVER_1_0 0x00010000
+#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0
+
+// NSIS Plug-In Callback Messages
+enum NSPIM 
+{
+	NSPIM_UNLOAD,    // This is the last message a plugin gets, do final cleanup
+	NSPIM_GUIUNLOAD, // Called after .onGUIEnd
+};
+
+// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback()
+// Return NULL for unknown messages
+// Should always be __cdecl for future expansion possibilities
+typedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);
+
+// extra_parameters data structures containing other interesting stuff
+// but the stack, variables and HWND passed on to plug-ins.
+typedef struct
+{
+  int autoclose;
+  int all_user_var;
+  int exec_error;
+  int abort;
+  int exec_reboot; // NSIS_SUPPORT_REBOOT
+  int reboot_called; // NSIS_SUPPORT_REBOOT
+  int XXX_cur_insttype; // depreacted
+  int plugin_api_version; // see NSISPIAPIVER_CURR
+                          // used to be XXX_insttype_changed
+  int silent; // NSIS_CONFIG_SILENT_SUPPORT
+  int instdir_error;
+  int rtl;
+  int errlvl;
+  int alter_reg_view;
+  int status_update;
+} exec_flags_t;
+
+#ifndef NSISCALL
+#  define NSISCALL __stdcall
+#endif
+
+typedef struct {
+  exec_flags_t *exec_flags;
+  int (NSISCALL *ExecuteCodeSegment)(int, HWND);
+  void (NSISCALL *validate_filename)(TCHAR *);
+  int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors
+} extra_parameters;
+
+// Definitions for page showing plug-ins
+// See Ui.c to understand better how they're used
+
+// sent to the outer window to tell it to go to the next inner window
+#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)
+
+// custom pages should send this message to let NSIS know they're ready
+#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)
+
+// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning
+#define NOTIFY_BYE_BYE 'x'
+
+#endif /* _PLUGIN_H_ */
Index: tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_unicode/nsis_tchar.h
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_unicode/nsis_tchar.h	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_unicode/nsis_tchar.h	(revision 728)
@@ -0,0 +1,214 @@
+/*
+ * nsis_tchar.h
+ * 
+ * This file is a part of NSIS.
+ * 
+ * Copyright (C) 1999-2007 Nullsoft and Contributors
+ * 
+ * This software is provided 'as-is', without any express or implied
+ * warranty.
+ *
+ * For Unicode support by Jim Park -- 08/30/2007
+ */
+
+// Jim Park: Only those we use are listed here.
+
+#pragma once
+
+#ifdef _UNICODE
+
+#ifndef _T
+#define __T(x)   L ## x
+#define _T(x)    __T(x)
+#define _TEXT(x) __T(x)
+#endif
+typedef wchar_t TCHAR;
+typedef wchar_t _TUCHAR;
+
+// program
+#define _tmain      wmain
+#define _tWinMain   wWinMain
+#define _tenviron   _wenviron
+#define __targv     __wargv
+
+// printfs
+#define _ftprintf   fwprintf
+#define _sntprintf  _snwprintf
+#define _stprintf   _swprintf
+#define _tprintf    wprintf
+#define _vftprintf  vfwprintf
+#define _vsntprintf _vsnwprintf
+#define _vstprintf  _vswprintf
+
+// scanfs
+#define _tscanf     wscanf
+#define _stscanf    swscanf
+
+// string manipulations
+#define _tcscat     wcscat
+#define _tcschr     wcschr
+#define _tcsclen    wcslen
+#define _tcscpy     wcscpy
+#define _tcsdup     _wcsdup
+#define _tcslen     wcslen
+#define _tcsnccpy   wcsncpy
+#define _tcsncpy    wcsncpy
+#define _tcsrchr    wcsrchr
+#define _tcsstr     wcsstr
+#define _tcstok     wcstok
+
+// string comparisons
+#define _tcscmp     wcscmp
+#define _tcsicmp    _wcsicmp
+#define _tcsncicmp  _wcsnicmp
+#define _tcsncmp    wcsncmp
+#define _tcsnicmp   _wcsnicmp
+
+// upper / lower
+#define _tcslwr     _wcslwr
+#define _tcsupr     _wcsupr
+#define _totlower   towlower
+#define _totupper   towupper
+
+// conversions to numbers
+#define _tcstoi64   _wcstoi64
+#define _tcstol     wcstol
+#define _tcstoul    wcstoul
+#define _tstof      _wtof
+#define _tstoi      _wtoi
+#define _tstoi64    _wtoi64
+#define _ttoi       _wtoi
+#define _ttoi64     _wtoi64
+#define _ttol       _wtol
+
+// conversion from numbers to strings
+#define _itot       _itow
+#define _ltot       _ltow
+#define _i64tot     _i64tow
+#define _ui64tot    _ui64tow
+
+// file manipulations
+#define _tfopen     _wfopen
+#define _topen      _wopen
+#define _tremove    _wremove
+#define _tunlink    _wunlink
+
+// reading and writing to i/o
+#define _fgettc     fgetwc
+#define _fgetts     fgetws
+#define _fputts     fputws
+#define _gettchar   getwchar
+
+// directory
+#define _tchdir     _wchdir
+
+// environment
+#define _tgetenv    _wgetenv
+#define _tsystem    _wsystem
+
+// time
+#define _tcsftime   wcsftime
+
+#else // ANSI
+
+#ifndef _T
+#define _T(x)    x
+#define _TEXT(x) x
+#endif
+typedef char            TCHAR;
+typedef unsigned char   _TUCHAR;
+
+// program
+#define _tmain      main
+#define _tWinMain   WinMain
+#define _tenviron   environ
+#define __targv     __argv
+
+// printfs
+#define _ftprintf   fprintf
+#define _sntprintf  _snprintf
+#define _stprintf   sprintf
+#define _tprintf    printf
+#define _vftprintf  vfprintf
+#define _vsntprintf _vsnprintf
+#define _vstprintf  vsprintf
+
+// scanfs
+#define _tscanf     scanf
+#define _stscanf    sscanf
+
+// string manipulations
+#define _tcscat     strcat
+#define _tcschr     strchr
+#define _tcsclen    strlen
+#define _tcscnlen   strnlen
+#define _tcscpy     strcpy
+#define _tcsdup     _strdup
+#define _tcslen     strlen
+#define _tcsnccpy   strncpy
+#define _tcsrchr    strrchr
+#define _tcsstr     strstr
+#define _tcstok     strtok
+
+// string comparisons
+#define _tcscmp     strcmp
+#define _tcsicmp    _stricmp
+#define _tcsncmp    strncmp
+#define _tcsncicmp  _strnicmp
+#define _tcsnicmp   _strnicmp
+
+// upper / lower
+#define _tcslwr     _strlwr
+#define _tcsupr     _strupr
+
+#define _totupper   toupper
+#define _totlower   tolower
+
+// conversions to numbers
+#define _tcstol     strtol
+#define _tcstoul    strtoul
+#define _tstof      atof
+#define _tstoi      atoi
+#define _tstoi64    _atoi64
+#define _tstoi64    _atoi64
+#define _ttoi       atoi
+#define _ttoi64     _atoi64
+#define _ttol       atol
+
+// conversion from numbers to strings
+#define _i64tot     _i64toa
+#define _itot       _itoa
+#define _ltot       _ltoa
+#define _ui64tot    _ui64toa
+
+// file manipulations
+#define _tfopen     fopen
+#define _topen      _open
+#define _tremove    remove
+#define _tunlink    _unlink
+
+// reading and writing to i/o
+#define _fgettc     fgetc
+#define _fgetts     fgets
+#define _fputts     fputs
+#define _gettchar   getchar
+
+// directory
+#define _tchdir     _chdir
+
+// environment
+#define _tgetenv    getenv
+#define _tsystem    system
+
+// time
+#define _tcsftime   strftime
+
+#endif
+
+// is functions (the same in Unicode / ANSI)
+#define _istgraph   isgraph
+#define _istascii   __isascii
+
+#define __TFILE__ _T(__FILE__)
+#define __TDATE__ _T(__DATE__)
+#define __TTIME__ _T(__TIME__)
Index: tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/AccessControl.cpp
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/AccessControl.cpp	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/AccessControl.cpp	(revision 728)
@@ -0,0 +1,1444 @@
+
+/* AccessControl plugin for NSIS
+ * Copyright (C) 2003 Mathias Hasselmann <mathias@taschenorakel.de>
+ *
+ * This software is provided 'as-is', without any express or implied 
+ * warranty. In no event will the authors be held liable for any damages 
+ * arising from the use of this software. 
+ *
+ * Permission is granted to anyone to use this software for any purpose, 
+ * including commercial applications, and to alter it and redistribute it 
+ * freely, subject to the following restrictions:
+ *
+ *   1. The origin of this software must not be misrepresented; you must not 
+ *      claim that you wrote the original software. If you use this software 
+ *      in a product, an acknowledgment in the product documentation would be
+ *      appreciated but is not required.
+ *
+ *   2. Altered source versions must be plainly marked as such, and must not 
+ *      be misrepresented as being the original software.
+ *
+ *   3. This notice may not be removed or altered from any source 
+ *      distribution.
+ */
+
+/* Modifications by Afrow UK, kichik and AndersK.
+ * See Docs\AccessControl\Readme.txt for full modifications list.
+ */
+
+#define WIN32_LEAN_AND_MEAN
+#ifdef _WIN64
+#define WINVER 0x502
+#else
+#define WINVER 0x400
+#endif
+
+#include <windows.h>
+#ifdef UNICODE
+#include "nsis_unicode/pluginapi.h"
+#else
+#include "nsis_ansi/pluginapi.h"
+#endif
+#include <aclapi.h>
+#include <sddl.h>
+
+/*****************************************************************************
+ GLOBAL VARIABLES
+ *****************************************************************************/
+
+HINSTANCE g_hInstance = NULL;
+int g_string_size = 1024;
+extra_parameters* g_extra = NULL;
+
+/*****************************************************************************
+ TYPE DEFINITIONS
+ *****************************************************************************/
+
+typedef struct
+{
+  const TCHAR* name;
+  SE_OBJECT_TYPE type;
+  DWORD defaultInheritance;
+  const TCHAR** const permissionNames;
+  const DWORD* const permissionFlags;
+  const int permissionCount;
+}
+SchemeType;
+
+typedef struct
+{
+  BOOL noInherit;
+  HKEY hRootKey;
+}
+Options;
+
+typedef enum
+{
+  ChangeMode_Owner,
+  ChangeMode_Group
+}
+ChangeMode;
+
+/*****************************************************************************
+ UTILITIES
+ *****************************************************************************/
+
+#define SIZE_OF_ARRAY(Array) (sizeof((Array)) / sizeof(*(Array)))
+#define ARRAY_CONTAINS(Array, Index) (Index >= 0 && Index < SIZE_OF_ARRAY(Array))
+
+void* LocalAllocZero(size_t cb) { return LocalAlloc(LPTR, cb); }
+inline void* LocalAlloc(size_t cb) { return LocalAllocZero(cb); }
+
+/*****************************************************************************
+ PLUG-IN HANDLING
+ *****************************************************************************/
+
+#define PUBLIC_FUNCTION(Name) \
+extern "C" void __declspec(dllexport) __cdecl Name(HWND hWndParent, int string_size, TCHAR* variables, stack_t** stacktop, extra_parameters* extra) \
+{ \
+  EXDLL_INIT(); \
+  g_string_size = string_size; \
+  g_extra = extra;
+
+#define PUBLIC_FUNCTION_END \
+}
+
+void showerror_s(const TCHAR* fmt, TCHAR* arg)
+{
+  TCHAR* msg = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+  if (msg)
+  {
+    wsprintf(msg, fmt, arg);
+    pushstring(msg);
+    LocalFree(msg);
+  }
+}
+
+void showerror_d(const TCHAR* fmt, DWORD arg)
+{
+  TCHAR* msg = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+  if (msg)
+  {
+    wsprintf(msg, fmt, arg);
+    pushstring(msg);
+    LocalFree(msg);
+  }
+}
+
+#define ERRSTR_OOM TEXT("OutOfMemory")
+
+#define ABORT_s(x, y) \
+    { showerror_s(TEXT(x), y); goto cleanup; }
+#define ABORT_d(x, y) \
+    { showerror_d(TEXT(x), y); goto cleanup; }
+#define ABORT(x) \
+    { pushstring(TEXT(x)); goto cleanup; }
+
+/*****************************************************************************
+ COMPATIBILITY UTILITIES
+ *****************************************************************************/
+
+#define BuildExplicitAccessWithNameA BuildExplicitAccessWithNameT
+#define BuildExplicitAccessWithNameW BuildExplicitAccessWithNameT
+#if WINVER < 0x500
+#define ConvertStringSidToSidA Compat_ConvertStringSidToSidT
+#define ConvertStringSidToSidW Compat_ConvertStringSidToSidT
+
+static FARPROC AdvApi32_GetProcAddress(LPCSTR Name)
+{
+  return GetProcAddress(LoadLibraryA("ADVAPI32"), Name);
+}
+
+TCHAR* CharPos(TCHAR* szStr, int cchStrLen, TCHAR chFind)
+{
+  for (int i = 0; i < cchStrLen && NULL != *(szStr + i); i++)
+    if (*(szStr + i) == chFind)
+      return szStr + i;
+  return NULL;
+}
+
+BYTE FromHex(TCHAR* szHex)
+{
+  int a = 0;
+  int b = 0;
+
+  if (szHex[0] >= TEXT('0') && szHex[0] <= TEXT('9'))
+    a = szHex[0] - TEXT('0');
+  else if (szHex[0] >= TEXT('A') && szHex[0] <= TEXT('F'))
+    a = szHex[0] - TEXT('A') + 10;
+  else if (szHex[0] >= TEXT('a') && szHex[0] <= TEXT('f'))
+    a = szHex[0] - TEXT('a') + 10;
+
+  if (szHex[1] >= TEXT('0') && szHex[1] <= TEXT('9'))
+    b = szHex[1] - TEXT('0');
+  else if (szHex[1] >= TEXT('A') && szHex[1] <= TEXT('F'))
+    b = szHex[1] - TEXT('A') + 10;
+  else if (szHex[1] >= TEXT('a') && szHex[1] <= TEXT('f'))
+    b = szHex[1] - TEXT('a') + 10;
+
+  return a * 16 + b;
+}
+
+static void SetIdentifierAuthority(SID_IDENTIFIER_AUTHORITY&sia, DWORD val32)
+{
+  sia.Value[5] = (BYTE)((val32 & 0x000000FF) >> 0);
+  sia.Value[4] = (BYTE)((val32 & 0x0000FF00) >> 8);
+  sia.Value[3] = (BYTE)((val32 & 0x00FF0000) >> 16);
+  sia.Value[2] = (BYTE)((val32 & 0xFF000000) >> 24);
+  sia.Value[1] = sia.Value[0] = 0;
+}
+
+// Based on GetBinarySid function from http://www.codeguru.com/cpp/w-p/system/security/article.php/c5659.
+BOOL Compat_ConvertStringSidToSidT(LPTSTR szSid, PSID* ppSid)
+{  
+  // Try to call the real function on 2000+, 
+  // this will enable support for more SID Strings (Those will not work on NT4 so script carefully)
+  FARPROC fp = AdvApi32_GetProcAddress(sizeof(TCHAR) > 1 ? "ConvertStringSidToSidW" : "ConvertStringSidToSidA");
+  bool ret = fp && ((BOOL(WINAPI*)(LPCTSTR,PSID*))fp)(szSid,ppSid);
+  if (ret) return ret;
+
+  *ppSid = NULL;
+  BYTE nByteAuthorityCount = 0;
+  PSID pSid = LocalAllocZero(8 + (sizeof(DWORD) * SID_MAX_SUB_AUTHORITIES));
+  if (!pSid) return false;
+
+  // Building a revision 1 SID in memory, the rest of the code assumes that pSid is zero filled!
+  ((char*)pSid)[0] = 1;
+  SID_IDENTIFIER_AUTHORITY &sidIA = *(SID_IDENTIFIER_AUTHORITY*) ((char*)pSid + 2);
+  DWORD *pSidSA = (DWORD*) ((char*)pSid + 8);
+
+  static const struct { char id0, id1; BYTE ia, sa0, sa1; } sidmap[] = {
+    {'A'|32,'N'|32, (5), (7) , 0}, // NT AUTHORITY\ANONYMOUS LOGON
+    {'A'|32,'U'|32, (5), (11), 0}, // NT AUTHORITY\Authenticated Users
+    {'B'|32,'A'|32, (5), (32), (544)-500}, // BUILTIN\Administrators
+    {'B'|32,'U'|32, (5), (32), (545)-500}, // BUILTIN\Users
+    {'I'|32,'U'|32, (5), (4) , 0}, // NT AUTHORITY\INTERACTIVE
+    {'S'|32,'Y'|32, (5), (18), 0}, // NT AUTHORITY\SYSTEM
+    {'W'|32,'D'|32, (1), (0) , 0}, // Everyone
+  };
+  // Try to lookup a SID string
+  for (int i = 0; i < SIZE_OF_ARRAY(sidmap); ++i)
+  {
+    if ((szSid[0]|32) != sidmap[i].id0 || (szSid[1]|32) != sidmap[i].id1 || szSid[2]) continue;
+    SetIdentifierAuthority(sidIA, sidmap[i].ia);
+    pSidSA[nByteAuthorityCount++] = sidmap[i].sa0;
+    if (sidmap[i].sa1) pSidSA[nByteAuthorityCount++] = (DWORD)sidmap[i].sa1 + 500;
+    goto done;
+  }
+
+  // S-SID_REVISION- + identifierauthority- + subauthorities + NULL
+
+  // Skip S
+  PTSTR ptr;
+  if (!(ptr = CharPos(szSid, lstrlen(szSid), TEXT('-'))))
+    return FALSE;
+  ptr++;
+
+  // Skip SID_REVISION
+  if (!(ptr = CharPos(ptr, lstrlen(ptr), TEXT('-'))))
+    return FALSE;
+  ptr++;
+
+  // Skip identifierauthority
+  PTSTR ptr1;
+  if (!(ptr1 = CharPos(ptr, lstrlen(ptr), TEXT('-'))))
+    return FALSE;
+  *ptr1 = 0;
+  
+  if ((*ptr == TEXT('0')) && (*(ptr+1) == TEXT('x')))
+  {
+    sidIA.Value[0] = FromHex(ptr);
+    sidIA.Value[1] = FromHex(ptr + 2);
+    sidIA.Value[2] = FromHex(ptr + 4);
+    sidIA.Value[3] = FromHex(ptr + 8);
+    sidIA.Value[4] = FromHex(ptr + 10);
+    sidIA.Value[5] = FromHex(ptr + 12);
+  }
+  else
+  {
+    SetIdentifierAuthority(sidIA, myatou(ptr));
+  }
+
+  // Skip -
+  *ptr1 = TEXT('-'), ptr = ptr1, ptr1++;
+
+  for (int i = 0; i < 8; i++)
+  {
+    // Get subauthority count.
+    if (!(ptr = CharPos(ptr, lstrlen(ptr), TEXT('-')))) break;
+    *ptr = 0, ptr++, nByteAuthorityCount++;
+  }
+
+  for (int i = 0; i < nByteAuthorityCount; i++)
+  {
+    // Get subauthority.
+    pSidSA[i] = myatou(ptr1);
+    ptr1 += lstrlen(ptr1) + 1;
+  }
+
+done:
+  if (nByteAuthorityCount)
+  {
+    *ppSid = pSid, ((char*)pSid)[1] = nByteAuthorityCount;
+    return TRUE;
+  }
+  LocalFree(pSid);
+  return FALSE;
+}
+
+// Based on GetTextualSid function from http://www.codeguru.com/cpp/w-p/system/security/article.php/c5659.
+BOOL ConvertSidToStringSidNoAlloc(const PSID pSid, LPTSTR pszSid)
+{
+  // Validate the binary SID
+  if(!IsValidSid(pSid)) return FALSE;
+
+  // Get the identifier authority value from the SID
+  PSID_IDENTIFIER_AUTHORITY psia = GetSidIdentifierAuthority(pSid);
+
+  // Get the number of subauthorities in the SID.
+  DWORD dwSubAuthorities = *GetSidSubAuthorityCount(pSid);
+
+  // Compute the buffer length
+  // S-SID_REVISION- + IdentifierAuthority- + subauthorities- + NULL
+  DWORD dwSidSize = (15 + 12 + (12 * dwSubAuthorities) + 1) * sizeof(TCHAR);
+
+  // Add 'S' prefix and revision number to the string
+  dwSidSize = wsprintf(pszSid, TEXT("S-%lu-"), SID_REVISION);
+
+  // Add SID identifier authority to the string.
+  if((psia->Value[0] != 0) || (psia->Value[1] != 0))
+  {
+    dwSidSize += wsprintf(pszSid + lstrlen(pszSid),
+        TEXT("0x%02hx%02hx%02hx%02hx%02hx%02hx"),
+        (USHORT)psia->Value[0],
+        (USHORT)psia->Value[1],
+        (USHORT)psia->Value[2],
+        (USHORT)psia->Value[3],
+        (USHORT)psia->Value[4],
+        (USHORT)psia->Value[5]);
+  }
+  else
+  {
+    dwSidSize += wsprintf(pszSid + lstrlen(pszSid),
+        TEXT("%lu"),
+        (ULONG)(psia->Value[5]) +
+        (ULONG)(psia->Value[4] << 8) +
+        (ULONG)(psia->Value[3] << 16) +
+        (ULONG)(psia->Value[2] << 24));
+  }
+
+  // Add SID subauthorities to the string
+  for(DWORD dwCounter = 0; dwCounter < dwSubAuthorities; dwCounter++)
+  {
+    dwSidSize += wsprintf(pszSid + dwSidSize, TEXT("-%lu"),
+        *GetSidSubAuthority(pSid, dwCounter));
+  }
+
+  return TRUE;
+}
+
+#ifndef UNICODE
+#define GetNamedSecurityInfoA Delayload_GetNamedSecurityInfoA
+#define SetEntriesInAclA Delayload_SetEntriesInAclA
+#define SetNamedSecurityInfoA Delayload_SetNamedSecurityInfoA
+
+DWORD Delayload_GetNamedSecurityInfoA(LPSTR ON, SE_OBJECT_TYPE OT, SECURITY_INFORMATION SI, PSID*ppSO, PSID*ppSG, PACL*ppD, PACL*ppS, PSECURITY_DESCRIPTOR*ppSD)
+{
+  FARPROC fp = AdvApi32_GetProcAddress("GetNamedSecurityInfoA");
+  if (!fp) return ERROR_NOT_SUPPORTED;
+  return ((DWORD(WINAPI*)(LPSTR,SE_OBJECT_TYPE,SECURITY_INFORMATION,PSID*,PSID*,PACL*,PACL*,PSECURITY_DESCRIPTOR*))fp)(ON,OT,SI,ppSO,ppSG,ppD,ppS,ppSD);
+}
+
+DWORD Delayload_SetEntriesInAclA(ULONG c, PEXPLICIT_ACCESS_A pEA, PACL pOA, PACL*ppNA)
+{
+  FARPROC fp = AdvApi32_GetProcAddress("SetEntriesInAclA");
+  if (!fp) return ERROR_NOT_SUPPORTED;
+  return ((DWORD(WINAPI*)(ULONG,PEXPLICIT_ACCESS_A,PACL,PACL*))fp)(c,pEA,pOA,ppNA);
+}
+
+DWORD Delayload_SetNamedSecurityInfoA(LPSTR ON, SE_OBJECT_TYPE OT, SECURITY_INFORMATION SI, PSID pSO, PSID pSG, PACL pD, PACL pS)
+{
+  FARPROC fp = AdvApi32_GetProcAddress("SetNamedSecurityInfoA");
+  if (!fp) return ERROR_NOT_SUPPORTED;
+  return ((DWORD(WINAPI*)(LPSTR,SE_OBJECT_TYPE,SECURITY_INFORMATION,PSID,PSID,PACL,PACL))fp)(ON,OT,SI,pSO,pSG,pD,pS);
+}
+#endif // ~!UNICODE
+#else
+BOOL ConvertSidToStringSidNoAlloc(const PSID pSid, LPTSTR pszSid)
+{
+  LPTSTR tmp;
+  if (!ConvertSidToStringSid(pSid, &tmp)) return false;
+  lstrcpy(pszSid, tmp), LocalFree(tmp);
+  return true;
+}
+#endif // ~WINVER < 0x500
+
+static VOID BuildExplicitAccessWithNameT(PEXPLICIT_ACCESS pEA, LPTSTR TN, DWORD AP, ACCESS_MODE AM, DWORD Inheritance)
+{
+  TRUSTEE &t = pEA->Trustee;
+  t.pMultipleTrustee = NULL, t.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+  t.TrusteeForm = TRUSTEE_IS_NAME, t.TrusteeType = TRUSTEE_IS_UNKNOWN;
+  t.ptstrName = TN, pEA->grfInheritance = Inheritance;
+  pEA->grfAccessPermissions = AP, pEA->grfAccessMode = AM;
+}
+
+/*****************************************************************************
+ STRING PARSERS
+ *****************************************************************************/
+
+/** Converts a string into an enumeration index. If the enumeration
+ ** contains the string the index of the string within the enumeration
+ ** is return. On error you'll receive -1.
+ **/
+static int ParseEnum(const TCHAR* keywords[], const TCHAR* str)
+{
+  const TCHAR** key;
+
+  for(key = keywords; *key; ++key)
+    if (!lstrcmpi(str, *key)) return (int)(key - keywords);
+
+  return -1;
+}
+
+/** Parses a trustee string. If enclosed in brackets the string contains
+ ** a string SID. Otherwise it's assumed that the string contains a
+ ** trustee name.
+ **/
+static TCHAR* ParseTrustee(TCHAR* trustee, DWORD* trusteeForm)
+{
+  TCHAR* strend = trustee + lstrlen(trustee) - 1;
+
+  if (TEXT('(') == *trustee && TEXT(')') == *strend)
+  {
+    PSID pSid = NULL;
+
+    *strend = TEXT('\0'); 
+    trustee++;
+
+    if (!ConvertStringSidToSid(trustee, &pSid))
+      pSid = NULL;
+
+    *trusteeForm = TRUSTEE_IS_SID;
+    return (TCHAR*)pSid;
+  }
+
+  *trusteeForm = TRUSTEE_IS_NAME;
+  TCHAR* ret = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+  if (ret) lstrcpy(ret, trustee);
+  return ret;
+}
+
+static PSID ParseSid(TCHAR* trustee)
+{
+  PSID pSid = NULL;
+  TCHAR* strend = trustee + lstrlen(trustee) - 1;
+
+  if (TEXT('(') == *trustee && TEXT(')') == *strend)
+  {
+    *strend = TEXT('\0'); 
+    ++trustee;
+
+    if (!ConvertStringSidToSid(trustee, &pSid)) pSid = NULL;
+  }
+  else
+  {
+    DWORD sidLen = 0;
+    DWORD domLen = 0;
+    TCHAR* domain = NULL;
+    SID_NAME_USE use;
+
+    if ((LookupAccountName(NULL, trustee, 
+       NULL, &sidLen, NULL, &domLen, &use) ||
+       ERROR_INSUFFICIENT_BUFFER == GetLastError()) &&
+        NULL != (domain = (TCHAR*)LocalAlloc(domLen*sizeof(TCHAR))) &&
+      NULL != (pSid = (PSID)LocalAlloc(sidLen)))
+    {
+      if (!LookupAccountName(NULL, trustee, 
+        pSid, &sidLen, domain, &domLen, &use))
+      {
+        LocalFree(pSid);
+        pSid = NULL;
+      }
+    }
+
+    LocalFree(domain);
+  }
+
+  return pSid;
+}
+
+/* i know: this function is far to generious in accepting strings. 
+ * but hey: this all is about code size, isn't it? 
+ * so i can live with that pretty well.
+ */
+static DWORD ParsePermissions(const SchemeType* scheme, TCHAR* str)
+{
+  DWORD perms = 0;
+  TCHAR* first, * last;
+
+  for(first = str; *first; first = last)
+  {
+    int token;
+
+    while(*first && *first <= TEXT(' ')) ++first;
+    for(last = first; *last && *last > TEXT(' ') && *last != TEXT('|') && 
+      *last != TEXT('+'); ++last);
+    if (*last) *last++ = TEXT('\0');
+
+    token = ParseEnum(scheme->permissionNames, first);
+    if (token >= 0 && token < scheme->permissionCount)
+      perms|= scheme->permissionFlags[token];
+  }
+
+  return perms;
+}
+
+/*****************************************************************************
+ SYMBOL TABLES
+ *****************************************************************************/
+
+static const TCHAR* g_filePermissionNames[] =
+{
+  TEXT("ReadData"), TEXT("WriteData"), TEXT("AppendData"), 
+  TEXT("ReadEA"), TEXT("WriteEA"), TEXT("Execute"), TEXT("ReadAttributes"), TEXT("WriteAttributes"), 
+  TEXT("Delete"), TEXT("ReadControl"), TEXT("WriteDAC"), TEXT("WriteOwner"), TEXT("Synchronize"),
+  TEXT("FullAccess"), TEXT("GenericRead"), TEXT("GenericWrite"), TEXT("GenericExecute"), NULL
+};
+
+static const DWORD g_filePermissionFlags[] =
+{
+  FILE_READ_DATA, FILE_WRITE_DATA, FILE_APPEND_DATA,
+  FILE_READ_EA, FILE_WRITE_EA, FILE_EXECUTE, FILE_READ_ATTRIBUTES, FILE_WRITE_ATTRIBUTES,
+  DELETE, READ_CONTROL, WRITE_DAC, WRITE_OWNER, SYNCHRONIZE,
+  FILE_ALL_ACCESS, FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_GENERIC_EXECUTE
+};
+
+static const TCHAR* g_directoryPermissionNames[] =
+{
+  TEXT("ListDirectory"), TEXT("AddFile"), TEXT("AddSubdirectory"), 
+  TEXT("ReadEA"), TEXT("WriteEA"), TEXT("Traverse"), TEXT("DeleteChild"), 
+  TEXT("ReadAttributes"), TEXT("WriteAttributes"), 
+  TEXT("Delete"), TEXT("ReadControl"), TEXT("WriteDAC"), TEXT("WriteOwner"), TEXT("Synchronize"),
+  TEXT("FullAccess"), TEXT("GenericRead"), TEXT("GenericWrite"), TEXT("GenericExecute"), NULL
+};
+
+static const DWORD g_directoryPermissionFlags[] =
+{
+  FILE_LIST_DIRECTORY, FILE_ADD_FILE, FILE_ADD_SUBDIRECTORY,
+  FILE_READ_EA, FILE_WRITE_EA, FILE_TRAVERSE, FILE_DELETE_CHILD,
+  FILE_READ_ATTRIBUTES, FILE_WRITE_ATTRIBUTES,
+  DELETE, READ_CONTROL, WRITE_DAC, WRITE_OWNER, SYNCHRONIZE,
+  FILE_ALL_ACCESS, FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_GENERIC_EXECUTE
+};
+
+static const TCHAR* g_registryPermissionNames[] =
+{
+  TEXT("QueryValue"), TEXT("SetValue"), TEXT("CreateSubKey"), 
+  TEXT("EnumerateSubKeys"), TEXT("Notify"), TEXT("CreateLink"), 
+  TEXT("Delete"), TEXT("ReadControl"), TEXT("WriteDAC"), TEXT("WriteOwner"), TEXT("Synchronize"),
+  TEXT("GenericRead"), TEXT("GenericWrite"), TEXT("GenericExecute"), TEXT("FullAccess"), NULL
+};
+
+static const DWORD g_registryPermissionFlags[] =
+{
+  KEY_QUERY_VALUE, KEY_SET_VALUE, KEY_CREATE_SUB_KEY, 
+  KEY_ENUMERATE_SUB_KEYS, KEY_NOTIFY, KEY_CREATE_LINK, 
+  DELETE, READ_CONTROL, WRITE_DAC, WRITE_OWNER, SYNCHRONIZE,
+  KEY_READ, KEY_WRITE, KEY_EXECUTE, KEY_ALL_ACCESS
+};
+
+static const SchemeType g_fileScheme[] =
+{
+  TEXT("file"), SE_FILE_OBJECT,
+  OBJECT_INHERIT_ACE,
+  g_filePermissionNames, 
+  g_filePermissionFlags,
+  SIZE_OF_ARRAY(g_filePermissionFlags)
+};
+
+static const SchemeType g_directoryScheme[] =
+{
+  TEXT("directory"), SE_FILE_OBJECT,
+  OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE,
+  g_directoryPermissionNames, 
+  g_directoryPermissionFlags,
+  SIZE_OF_ARRAY(g_directoryPermissionFlags)
+};
+
+static const SchemeType g_registryScheme[] =
+{ 
+  TEXT("registry"), SE_REGISTRY_KEY,
+  CONTAINER_INHERIT_ACE,
+  g_registryPermissionNames, 
+  g_registryPermissionFlags,
+  SIZE_OF_ARRAY(g_registryPermissionFlags)
+};
+
+static const TCHAR* g_rootKeyNames[] =
+{
+  TEXT("HKCR"), TEXT("HKCU"), TEXT("HKLM"), TEXT("HKU"), NULL
+};
+
+static const HKEY g_rootKeyValues[] =
+{
+  HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS, NULL
+};
+
+static const TCHAR* g_rootKeyPrefixes[] =
+{
+  TEXT("CLASSES_ROOT\\"), TEXT("CURRENT_USER\\"), TEXT("MACHINE\\"), TEXT("USERS\\")
+};
+
+/*****************************************************************************
+ GENERIC ACL HANDLING
+ *****************************************************************************/
+
+static DWORD MySetNamedSecurityInfo(const SchemeType* scheme, TCHAR* path, SECURITY_INFORMATION si, PSID psidOwner, PSID psidGroup, PACL pDacl, Options* options)
+{
+  DWORD ret;
+
+  if (scheme->type == SE_REGISTRY_KEY && (g_extra->exec_flags->alter_reg_view & KEY_WOW64_64KEY))
+  {
+    HKEY hKey = NULL;
+    if ((ret = RegOpenKeyEx(options->hRootKey, path, 0, (si & OWNER_SECURITY_INFORMATION || si & GROUP_SECURITY_INFORMATION ? WRITE_OWNER : 0)|(si & DACL_SECURITY_INFORMATION ? WRITE_DAC : 0)|KEY_WOW64_64KEY, &hKey)) == ERROR_SUCCESS)
+    {
+      SECURITY_DESCRIPTOR sd;
+      InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION);
+      if (si & OWNER_SECURITY_INFORMATION)
+        SetSecurityDescriptorOwner(&sd, psidOwner, FALSE);
+      if (si & GROUP_SECURITY_INFORMATION)
+        SetSecurityDescriptorGroup(&sd, psidGroup, FALSE);
+      if (si & DACL_SECURITY_INFORMATION)
+        SetSecurityDescriptorDacl(&sd, TRUE, pDacl, FALSE);
+      ret = RegSetKeySecurity(hKey, si, &sd);
+      RegCloseKey(hKey);
+    }
+  }
+  else
+  {
+    ret = SetNamedSecurityInfo(path, scheme->type, si, psidOwner, psidGroup, pDacl, NULL);
+  }
+
+  return ret;
+}
+
+static DWORD MyGetNamedSecurityInfo(const SchemeType* scheme, TCHAR* path, SECURITY_INFORMATION si, PSECURITY_DESCRIPTOR* ppsd, Options* options)
+{
+  DWORD ret = 1;
+  
+  if (scheme->type == SE_REGISTRY_KEY && (g_extra->exec_flags->alter_reg_view & KEY_WOW64_64KEY))
+  {
+    HKEY hKey = NULL;
+    if ((ret = RegOpenKeyEx(options->hRootKey, path, 0, READ_CONTROL|KEY_WOW64_64KEY, &hKey)) == ERROR_SUCCESS)
+    {
+      DWORD dwSize = 0;
+      if ((ret = RegGetKeySecurity(hKey, si, NULL, &dwSize)) == ERROR_INSUFFICIENT_BUFFER)
+        if (NULL != (*ppsd = (PSECURITY_DESCRIPTOR)LocalAlloc(dwSize)))
+          ret = RegGetKeySecurity(hKey, si, *ppsd, &dwSize);
+      RegCloseKey(hKey);
+    }
+  }
+  else
+  {
+    ret = GetNamedSecurityInfo(path, scheme->type, si, NULL, NULL, NULL, NULL, ppsd);
+  }
+
+  return ret;
+}
+
+static DWORD ChangeDACL(const SchemeType* scheme, TCHAR* path, DWORD mode, Options* options, TCHAR* param)
+{
+  TCHAR* trusteeName = NULL;
+  PSECURITY_DESCRIPTOR psd = NULL;
+  PSID pSid = NULL;
+  DWORD trusteeForm = TRUSTEE_IS_NAME;
+  DWORD permissions = 0;
+  PACL pOldAcl = NULL;
+  PACL pNewAcl = NULL;
+  EXPLICIT_ACCESS access;
+  BOOL present = TRUE;
+  BOOL defaulted = FALSE;
+
+  DWORD ret = 1;
+
+  if (popstring(param))
+    ABORT("Trustee is missing");
+
+  if (NULL == (trusteeName = ParseTrustee(param, &trusteeForm)))
+    ABORT_s("Bad trustee (%s)", param);
+
+  if (popstring(param))
+    ABORT("Permission flags are missing");
+
+  if (0 == (permissions = ParsePermissions(scheme, param)))
+    ABORT_s("Bad permission flags (%s)", param);
+  
+  ret = MyGetNamedSecurityInfo(scheme, path, DACL_SECURITY_INFORMATION, &psd, options);
+  if (ret != ERROR_SUCCESS)
+    ABORT_d("Cannot read access control list. Error code: %d", ret);
+
+  GetSecurityDescriptorDacl(psd, &present, &pOldAcl, &defaulted);
+
+  BuildExplicitAccessWithName(&access, TEXT(""), permissions, (ACCESS_MODE)mode, scheme->defaultInheritance);
+
+  access.Trustee.TrusteeForm = (TRUSTEE_FORM)trusteeForm;
+  access.Trustee.ptstrName = trusteeName;
+  if (options->noInherit)
+    access.grfInheritance = NO_INHERITANCE;
+
+  ret = SetEntriesInAcl(1, &access, pOldAcl, &pNewAcl);
+  if (ret != ERROR_SUCCESS)
+    ABORT_d("Cannot build new access control list. Error code: %d", ret);
+
+  ret = MySetNamedSecurityInfo(scheme, path, DACL_SECURITY_INFORMATION, NULL, NULL, pNewAcl, options);
+  if (ret != ERROR_SUCCESS)
+    ABORT_d("Cannot apply new access control list. Error code: %d", ret);
+
+cleanup:
+  LocalFree(pNewAcl);
+  LocalFree(psd);
+  LocalFree(trusteeName);
+  return ret;
+}
+
+static DWORD ChangeInheritance(const SchemeType* scheme, TCHAR* path, Options* options)
+{
+  PSECURITY_DESCRIPTOR psd = NULL;
+  PACL pOldAcl = NULL;
+  BOOL present = TRUE;
+  BOOL defaulted = FALSE;
+
+  DWORD ret = MyGetNamedSecurityInfo(scheme, path, DACL_SECURITY_INFORMATION, &psd, options);
+  if (ret != ERROR_SUCCESS)
+    ABORT_d("Cannot read access control list. Error code: %d", ret);
+
+  GetSecurityDescriptorDacl(psd, &present, &pOldAcl, &defaulted);
+  
+  ret = MySetNamedSecurityInfo(scheme, path, DACL_SECURITY_INFORMATION | (!options->noInherit ? UNPROTECTED_DACL_SECURITY_INFORMATION : PROTECTED_DACL_SECURITY_INFORMATION), NULL, NULL, pOldAcl, options);
+  if (ret != ERROR_SUCCESS)
+    ABORT_d("Cannot change access control list inheritance. Error code: %d", ret);
+
+cleanup:
+  LocalFree(psd);
+  return ret;
+}
+
+BOOL SetPrivilege(HANDLE hToken, LPCTSTR lpszPrivilege, BOOL bEnablePrivilege) 
+{
+  TOKEN_PRIVILEGES tp;
+  LUID luid;
+
+  if (!LookupPrivilegeValue(NULL, lpszPrivilege, &luid))
+    return FALSE;
+
+  tp.PrivilegeCount = 1;
+  tp.Privileges[0].Luid = luid;
+  tp.Privileges[0].Attributes = (bEnablePrivilege ? SE_PRIVILEGE_ENABLED : 0);
+
+  if (!AdjustTokenPrivileges(
+         hToken,
+         FALSE,
+         &tp,
+         sizeof(TOKEN_PRIVILEGES),
+         (PTOKEN_PRIVILEGES)NULL,
+         (PDWORD)NULL))
+    return FALSE;
+
+  if (GetLastError() == ERROR_NOT_ALL_ASSIGNED)
+    return FALSE;
+
+  return TRUE;
+}
+
+static DWORD ChangeOwner(const SchemeType* scheme, TCHAR* path, ChangeMode mode, Options* options, TCHAR* param)
+{
+  DWORD ret = 1;
+  PSID pSid = NULL, pSidOwner = NULL, pSidGroup = NULL;
+  SECURITY_INFORMATION what;
+  HANDLE hToken;
+
+  if (popstring(param))
+    ABORT("Trustee is missing");
+
+  if (NULL == (pSid = ParseSid(param)))
+    ABORT_s("Bad trustee (%s)", param);
+
+  switch(mode)
+  {
+  case ChangeMode_Owner:
+    what = OWNER_SECURITY_INFORMATION;
+    pSidOwner = pSid;
+    break;
+
+  case ChangeMode_Group:
+    what = GROUP_SECURITY_INFORMATION;
+    pSidGroup = pSid;
+    break;
+
+  default:
+    ABORT_d("Bug: Unsupported change mode: %d", mode);
+  }
+
+  if (!OpenProcessToken(GetCurrentProcess(),
+    TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
+    ABORT_d("Cannot open process token. Error code: %d", GetLastError());
+
+  // You only need WRITE_OWNER to change the owner of the object to yourself
+  // blogs.msdn.com/b/oldnewthing/archive/2005/08/18/453054.aspx
+  BOOL privRe = SetPrivilege(hToken, SE_RESTORE_NAME, TRUE);
+  BOOL privTO = SetPrivilege(hToken, SE_TAKE_OWNERSHIP_NAME, TRUE);
+
+  ret = MySetNamedSecurityInfo(scheme, path, what, pSidOwner, pSidGroup, NULL, options);
+
+  if (privRe) SetPrivilege(hToken, SE_RESTORE_NAME, FALSE);
+  if (privTO) SetPrivilege(hToken, SE_TAKE_OWNERSHIP_NAME, FALSE);
+
+  if (ret != ERROR_SUCCESS)
+    ABORT_d("Cannot apply new ownership. Error code: %d", ret);
+
+cleanup:
+  LocalFree(pSid);
+  CloseHandle(hToken);
+  return ret;
+}
+
+static DWORD GetOwner(const SchemeType* scheme, TCHAR* path, ChangeMode mode, TCHAR* owner, TCHAR* domain, Options* options)
+{
+  SECURITY_INFORMATION what;
+  PSECURITY_DESCRIPTOR psd = NULL;
+  PSID pSid = NULL, pSidGroup = NULL, pSidOwner = NULL;
+  SID_NAME_USE eUse = SidTypeUnknown;
+  DWORD dwOwner = g_string_size, dwDomain = g_string_size;
+  BOOL defaulted = FALSE;
+  DWORD ret = 1;
+
+  switch(mode)
+  {
+  case ChangeMode_Owner:
+    what = OWNER_SECURITY_INFORMATION;
+    break;
+
+  case ChangeMode_Group:
+    what = GROUP_SECURITY_INFORMATION;
+    break;
+
+  default:
+    ABORT_d("Bug: Unsupported change mode: %d", mode);
+  }
+  
+  ret = MyGetNamedSecurityInfo(scheme, path, what, &psd, options);
+  if (ret != ERROR_SUCCESS)
+    ABORT_d("Cannot get current ownership. Error code: %d", ret);
+
+  if (mode == OWNER_SECURITY_INFORMATION)
+    GetSecurityDescriptorOwner(psd, &pSidOwner, &defaulted);
+  else
+    GetSecurityDescriptorGroup(psd, &pSidGroup, &defaulted);
+
+  if (!LookupAccountSid(NULL, (pSidOwner ? pSidOwner : pSidGroup),
+          owner, &dwOwner, domain, &dwDomain, &eUse))
+    ABORT_d("Cannot look up owner. Error code: %d", GetLastError());
+
+cleanup:
+  LocalFree(psd);
+  return ret;
+}
+
+static DWORD ClearACL(const SchemeType* scheme, TCHAR* path, Options* options, TCHAR* param)
+{
+  TCHAR* trusteeName = NULL;
+  PSID pSid = NULL;
+  DWORD trusteeForm = TRUSTEE_IS_NAME;
+  DWORD permissions = 0;
+  PACL pNewAcl = NULL;
+  EXPLICIT_ACCESS access;
+
+  DWORD ret = 1;
+
+  if (popstring(param))
+    ABORT("Trustee is missing");
+
+  if (NULL == (trusteeName = ParseTrustee(param, &trusteeForm)))
+    ABORT_s("Bad trustee (%s)", param);
+
+  if (popstring(param))
+    ABORT("Permission flags are missing");
+
+  if (0 == (permissions = ParsePermissions(scheme, param)))
+    ABORT_s("Bad permission flags (%s)", param);
+
+  BuildExplicitAccessWithName(&access, TEXT(""), permissions, SET_ACCESS, scheme->defaultInheritance);
+
+  access.Trustee.TrusteeForm = (TRUSTEE_FORM)trusteeForm;
+  access.Trustee.ptstrName = trusteeName;
+  if (options->noInherit)
+    access.grfInheritance = NO_INHERITANCE;
+
+  ret = SetEntriesInAcl(1, &access, NULL, &pNewAcl);
+  if (ret != ERROR_SUCCESS)
+    ABORT_d("Cannot build new access control list. Error code: %d", ret);
+  
+  ret = MySetNamedSecurityInfo(scheme, path, DACL_SECURITY_INFORMATION, NULL, NULL, pNewAcl, options);
+  if (ret != ERROR_SUCCESS)
+    ABORT_d("Cannot change access control list inheritance. Error code: %d", ret);
+
+cleanup:
+  LocalFree(pNewAcl);
+  LocalFree(trusteeName);
+  return ret;
+}
+
+/*****************************************************************************
+ FILESYSTEM BASED ACL HANDLING
+ *****************************************************************************/
+
+static const SchemeType* PopFileArgs(TCHAR* path, Options* options)
+{
+  if (popstring(path) == 0)
+  {
+    DWORD attr;
+    options->noInherit = FALSE;
+    if (lstrcmpi(path, TEXT("/noinherit")) == 0)
+    {
+      options->noInherit = TRUE;
+      popstring(path);
+    }
+    attr = GetFileAttributes(path);
+
+    if (INVALID_FILE_ATTRIBUTES != attr)
+      return FILE_ATTRIBUTE_DIRECTORY & attr
+        ? g_directoryScheme
+        : g_fileScheme;
+    else
+      ABORT("Invalid filesystem path missing");
+  }
+  else
+    ABORT("Filesystem path missing");
+
+cleanup:
+  return NULL;
+}
+
+static void ChangeFileInheritance(BOOL inherit)
+{
+  DWORD ret = 1;
+  TCHAR* path = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+  if (path)
+  {
+    const SchemeType* scheme;
+    Options options;
+
+    if (NULL != (scheme = PopFileArgs(path, &options)))
+    {
+        options.noInherit = !inherit;
+        if (0 == (ret = ChangeInheritance(scheme, path, &options)))
+          pushstring(TEXT("ok"));
+    }
+
+    LocalFree(path);
+  }
+
+  if (ret) pushstring(TEXT("error"));
+}
+
+static void ChangeFileDACL(DWORD mode)
+{
+  DWORD ret = 1;
+  TCHAR* path = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+  if (path)
+  {
+    TCHAR* param = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+    if (param)
+    {
+      const SchemeType* scheme;
+      Options options;
+
+      if (NULL != (scheme = PopFileArgs(path, &options)))
+        if (0 == (ret = ChangeDACL(scheme, path, mode, &options, param)))
+          pushstring(TEXT("ok"));
+
+      LocalFree(param);
+    }
+
+    LocalFree(path);
+  }
+
+  if (ret) pushstring(TEXT("error"));
+}
+
+static void ChangeFileOwner(ChangeMode mode)
+{
+  DWORD ret = 1;
+  TCHAR* path = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+  if (path)
+  {
+    TCHAR* param = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+    if (param)
+    {
+      const SchemeType* scheme;
+      Options options;
+
+      if (NULL != (scheme = PopFileArgs(path, &options)))
+        if (0 == (ret = ChangeOwner(scheme, path, mode, &options, param)))
+          pushstring(TEXT("ok"));
+    
+      LocalFree(param);
+    }
+
+    LocalFree(path);
+  }
+
+  if (ret) pushstring(TEXT("error"));
+}
+
+static void PushFileOwner(ChangeMode mode)
+{
+  DWORD ret = 1;
+  TCHAR* path = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+  if (path)
+  {
+    TCHAR* owner = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+    if (owner)
+    {
+      TCHAR* domain = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+      if (domain)
+      {
+        const SchemeType* scheme;
+        Options options;
+
+        if (NULL != (scheme = PopFileArgs(path, &options)))
+        {
+          if (0 == (ret = GetOwner(scheme, path, mode, owner, domain, &options)))
+            pushstring(owner);
+        }
+      
+        LocalFree(domain);
+      }
+      
+      LocalFree(owner);
+    }
+
+    LocalFree(path);
+  }
+
+  if (ret) pushstring(TEXT("error"));
+}
+
+/*****************************************************************************
+ REGISTRY BASED ACL HANDLING
+ *****************************************************************************/
+
+static BOOL PopRegKeyArgs(TCHAR* path, Options* options, TCHAR* param)
+{
+  int iRootKey;
+  BOOL success = FALSE;
+
+  if (popstring(param) == 0)
+  {
+    options->noInherit = FALSE;
+    if (lstrcmpi(param, TEXT("/noinherit")) == 0)
+    {
+      options->noInherit = TRUE;
+      popstring(param);
+    }
+  }
+  else
+    ABORT("Root key name missing");
+
+  iRootKey = ParseEnum(g_rootKeyNames, param);
+  if (!ARRAY_CONTAINS(g_rootKeyPrefixes, iRootKey))
+    ABORT_s("Bad root key name (%s)", param);
+
+  if (popstring(param) != 0)
+    ABORT("Registry key name missing");
+
+  if (g_extra->exec_flags->alter_reg_view & KEY_WOW64_64KEY)
+  {
+    options->hRootKey = g_rootKeyValues[iRootKey];
+    lstrcpy(path, param);
+  }
+  else
+  {
+    lstrcpy(path, g_rootKeyPrefixes[iRootKey]);
+    lstrcat(path, param);
+  }
+
+  success = TRUE;
+
+cleanup:
+  return success;
+}
+
+static void ChangeRegKeyInheritance(BOOL inherit)
+{
+  DWORD ret = 1;
+  TCHAR* path = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+  if (path)
+  {
+    TCHAR* param = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+    if (param)
+    {
+      Options options;
+
+      if (PopRegKeyArgs(path, &options, param))
+      {
+        options.noInherit = !inherit;
+        if (0 == (ret = ChangeInheritance(g_registryScheme, path, &options)))
+          pushstring(TEXT("ok"));
+      }
+
+      LocalFree(param);
+    }
+
+    LocalFree(path);
+  }
+
+  if (ret) pushstring(TEXT("error"));
+}
+
+static void ChangeRegKeyDACL(DWORD mode)
+{
+  DWORD ret = 1;
+  TCHAR* path = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+  if (path)
+  {
+    TCHAR* param = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+    if (param)
+    {
+      Options options;
+
+      if (PopRegKeyArgs(path, &options, param))
+        if (0 == (ret = ChangeDACL(g_registryScheme, path, mode, &options, param)))
+          pushstring(TEXT("ok"));
+
+      LocalFree(param);
+    }
+
+    LocalFree(path);
+  }
+
+  if (ret) pushstring(TEXT("error"));
+}
+
+static void ChangeRegKeyOwner(ChangeMode mode)
+{
+  DWORD ret = 1;
+  TCHAR* path = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+  if (path)
+  {
+    TCHAR* param = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+    if (param)
+    {
+      Options options;
+
+      if (PopRegKeyArgs(path, &options, param))
+        if (0 == (ret = ChangeOwner(g_registryScheme, path, mode, &options, param)))
+          pushstring(TEXT("ok"));
+
+      LocalFree(param);
+    }
+
+    LocalFree(path);
+  }
+
+  if (ret) pushstring(TEXT("error"));
+}
+
+static void PushRegKeyOwner(ChangeMode mode)
+{
+  DWORD ret = 1;
+  TCHAR* path = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+  if (path)
+  {
+    TCHAR* owner = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+    if (owner)
+    {
+      TCHAR* domain = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));
+
+      if (domain)
+      {
+        Options options;
+
+        if (PopRegKeyArgs(path, &options, owner))
+          if (0 == (ret = GetOwner(g_registryScheme, path, mode, owner, domain, &options)))
+            pushstring(owner);
+
+        LocalFree(domain);
+      }
+
+      LocalFree(owner);
+    }
+
+    LocalFree(path);
+  }
+
+  if (ret) pushstring(TEXT("error"));
+}
+
+/*****************************************************************************
+ PUBLIC FILE RELATED FUNCTIONS
+ *****************************************************************************/
+
+PUBLIC_FUNCTION(EnableFileInheritance)
+  ChangeFileInheritance(TRUE);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(DisableFileInheritance)
+  ChangeFileInheritance(FALSE);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(GrantOnFile)
+  ChangeFileDACL(GRANT_ACCESS);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(SetOnFile)
+  ChangeFileDACL(SET_ACCESS);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(DenyOnFile)
+  ChangeFileDACL(DENY_ACCESS);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(RevokeOnFile)
+  ChangeFileDACL(REVOKE_ACCESS);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(SetFileOwner)
+  ChangeFileOwner(ChangeMode_Owner);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(SetFileGroup)
+  ChangeFileOwner(ChangeMode_Group);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(GetFileOwner)
+  PushFileOwner(ChangeMode_Owner);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(GetFileGroup)
+  PushFileOwner(ChangeMode_Group);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(ClearOnFile)
+{
+  DWORD ret = 1;
+  TCHAR* path = (TCHAR*)LocalAlloc(string_size*sizeof(TCHAR));
+
+  if (path)
+  {
+    TCHAR* param = (TCHAR*)LocalAlloc(string_size*sizeof(TCHAR));
+    
+    if (param)
+    {
+      const SchemeType* scheme;
+      Options options;
+
+      if (NULL != (scheme = PopFileArgs(path, &options)))
+        if (0 == (ret = ClearACL(scheme, path, &options, param)))
+          pushstring(TEXT("ok"));
+
+      LocalFree(param);
+    }
+
+    LocalFree(path);
+  }
+
+  if (ret) pushstring(TEXT("error"));
+}
+PUBLIC_FUNCTION_END
+
+/*****************************************************************************
+ PUBLIC REGISTRY RELATED FUNCTIONS
+ *****************************************************************************/
+
+PUBLIC_FUNCTION(EnableRegKeyInheritance)
+  ChangeRegKeyInheritance(TRUE);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(DisableRegKeyInheritance)
+  ChangeRegKeyInheritance(FALSE);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(GrantOnRegKey)
+  ChangeRegKeyDACL(GRANT_ACCESS);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(SetOnRegKey)
+  ChangeRegKeyDACL(SET_ACCESS);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(DenyOnRegKey)
+  ChangeRegKeyDACL(DENY_ACCESS);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(RevokeOnRegKey)
+  ChangeRegKeyDACL(REVOKE_ACCESS);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(SetRegKeyOwner)
+  ChangeRegKeyOwner(ChangeMode_Owner);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(SetRegKeyGroup)
+  ChangeRegKeyOwner(ChangeMode_Group);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(GetRegKeyOwner)
+  PushRegKeyOwner(ChangeMode_Owner);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(GetRegKeyGroup)
+  PushRegKeyOwner(ChangeMode_Group);
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(ClearOnRegKey)
+{
+  DWORD ret = 1;
+  TCHAR* path = (TCHAR*)LocalAlloc(string_size*sizeof(TCHAR));
+
+  if (path)
+  {
+    TCHAR* param = (TCHAR*)LocalAlloc(string_size*sizeof(TCHAR));
+
+    if (param)
+    {
+      Options options;
+
+      if (PopRegKeyArgs(path, &options, param))
+        if (0 == (ret = ClearACL(g_registryScheme, path, &options, param)))
+          pushstring(TEXT("ok"));
+
+      LocalFree(param);
+    }
+
+    LocalFree(path);
+  }
+
+  if (ret) pushstring(TEXT("error"));
+}
+PUBLIC_FUNCTION_END
+
+/*****************************************************************************
+ OTHER ACCOUNT RELATED FUNCTIONS
+ *****************************************************************************/
+
+PUBLIC_FUNCTION(NameToSid)
+{
+  DWORD ret = 1;
+  TCHAR *param = (TCHAR*)LocalAlloc(string_size*sizeof(TCHAR)), *retstr = ERRSTR_OOM;
+
+  if (param)
+  {
+    if (popstring(param) == 0)
+    {
+      DWORD dwSid = 0;
+      DWORD dwDomain = 0;
+      SID_NAME_USE eUse;
+      LookupAccountName(NULL, param, NULL, &dwSid, NULL, &dwDomain, &eUse);
+
+      if (dwSid > 0)
+      {
+        PSID pSid = (PSID)LocalAlloc(dwSid);
+        if (pSid)
+        {
+          TCHAR* domain = (TCHAR*)LocalAlloc(dwDomain*sizeof(TCHAR));
+          if (domain)
+          {
+            retstr = param;
+            if (!LookupAccountName(NULL, param, pSid, &dwSid, domain, &dwDomain, &eUse) || !ConvertSidToStringSidNoAlloc(pSid, param))
+              wsprintf(param, TEXT("Cannot look up name. Error code: %d"), GetLastError());
+            else
+              ret = 0;
+            LocalFree(domain);
+          }
+          LocalFree(pSid);
+        }
+      }
+    }
+  }
+  pushstring(retstr);
+  LocalFree(param);
+
+  if (ret) pushstring(TEXT("error"));
+}
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(SidToName)
+{
+  DWORD ret = 1;
+  TCHAR *param = (TCHAR*)LocalAlloc(string_size*sizeof(TCHAR));
+
+  if (param)
+  {
+    DWORD dwName = string_size;
+    TCHAR* name = (TCHAR*)LocalAlloc(dwName*sizeof(TCHAR));
+
+    if (name)
+    {
+      DWORD dwDomain = string_size;
+      TCHAR* domain = (TCHAR*)LocalAlloc(dwDomain*sizeof(TCHAR));
+
+      if (domain)
+      {
+        if (popstring(param) == 0)
+        {
+          PSID pSid = NULL;
+          SID_NAME_USE eUse;
+          if (!ConvertStringSidToSid(param, &pSid) || !LookupAccountSid(NULL, pSid, name, &dwName, domain, &dwDomain, &eUse))
+          {
+            wsprintf(param, TEXT("Cannot look up SID. Error code: %d"), GetLastError());
+            pushstring(param); // BUGBUG: What if LocalAlloc fails and we never get here?
+          }
+          else
+          {
+            pushstring(name);
+            pushstring(domain);
+            ret = 0;
+          }
+          LocalFree(pSid);
+        }
+        LocalFree(domain);
+      }
+      LocalFree(name);
+    }
+    LocalFree(param);
+  }
+
+  if (ret) pushstring(TEXT("error"));
+}
+PUBLIC_FUNCTION_END
+
+PUBLIC_FUNCTION(GetCurrentUserName)
+{
+  TCHAR *name = (TCHAR*)LocalAlloc(string_size*sizeof(TCHAR)), *retstr = TEXT("error");
+  DWORD dwName = string_size;
+  if (name && GetUserName(name, &dwName)) retstr = name;
+  pushstring(retstr);
+  LocalFree(name);
+}
+PUBLIC_FUNCTION_END
+
+#ifdef _VC_NODEFAULTLIB
+#define DllMain _DllMainCRTStartup
+#endif
+EXTERN_C BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
+{
+  g_hInstance = (HINSTANCE)hInst;
+  return TRUE;
+}
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/AccessControl.rc
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/AccessControl.rc
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_ansi/pluginapi.lib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_ansi/pluginapi.lib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_ansi/pluginapi.h
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_ansi/pluginapi.h	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_ansi/pluginapi.h	(revision 728)
@@ -0,0 +1,74 @@
+#ifndef ___NSIS_PLUGIN__H___
+#define ___NSIS_PLUGIN__H___
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "api.h"
+
+#ifndef NSISCALL
+#  define NSISCALL __stdcall
+#endif
+
+#define EXDLL_INIT()           {  \
+        g_stringsize=string_size; \
+        g_stacktop=stacktop;      \
+        g_variables=variables; }
+
+typedef struct _stack_t {
+  struct _stack_t *next;
+  char text[1]; // this should be the length of string_size
+} stack_t;
+
+enum
+{
+INST_0,         // $0
+INST_1,         // $1
+INST_2,         // $2
+INST_3,         // $3
+INST_4,         // $4
+INST_5,         // $5
+INST_6,         // $6
+INST_7,         // $7
+INST_8,         // $8
+INST_9,         // $9
+INST_R0,        // $R0
+INST_R1,        // $R1
+INST_R2,        // $R2
+INST_R3,        // $R3
+INST_R4,        // $R4
+INST_R5,        // $R5
+INST_R6,        // $R6
+INST_R7,        // $R7
+INST_R8,        // $R8
+INST_R9,        // $R9
+INST_CMDLINE,   // $CMDLINE
+INST_INSTDIR,   // $INSTDIR
+INST_OUTDIR,    // $OUTDIR
+INST_EXEDIR,    // $EXEDIR
+INST_LANG,      // $LANGUAGE
+__INST_LAST
+};
+
+extern unsigned int g_stringsize;
+extern stack_t **g_stacktop;
+extern char *g_variables;
+
+int NSISCALL popstring(char *str); // 0 on success, 1 on empty stack
+int NSISCALL popstringn(char *str, int maxlen); // with length limit, pass 0 for g_stringsize
+int NSISCALL popint(); // pops an integer
+int NSISCALL popint_or(); // with support for or'ing (2|4|8)
+int NSISCALL myatoi(const char *s); // converts a string to an integer
+unsigned NSISCALL myatou(const char *s); // converts a string to an unsigned integer, decimal only
+int NSISCALL myatoi_or(const char *s); // with support for or'ing (2|4|8)
+void NSISCALL pushstring(const char *str);
+void NSISCALL pushint(int value);
+char * NSISCALL getuservariable(const int varnum);
+void NSISCALL setuservariable(const int varnum, const char *var);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif//!___NSIS_PLUGIN__H___
Index: tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_ansi/api.h
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_ansi/api.h	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/AccessControl/nsis_ansi/api.h	(revision 728)
@@ -0,0 +1,83 @@
+/*
+ * apih
+ * 
+ * This file is a part of NSIS.
+ * 
+ * Copyright (C) 1999-2009 Nullsoft and Contributors
+ * 
+ * Licensed under the zlib/libpng license (the "License");
+ * you may not use this file except in compliance with the License.
+ * 
+ * Licence details can be found in the file COPYING.
+ * 
+ * This software is provided 'as-is', without any express or implied
+ * warranty.
+ */
+
+#ifndef _NSIS_EXEHEAD_API_H_
+#define _NSIS_EXEHEAD_API_H_
+
+// Starting with NSIS 2.42, you can check the version of the plugin API in exec_flags->plugin_api_version
+// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x))
+// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {}
+
+#define NSISPIAPIVER_1_0 0x00010000
+#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0
+
+// NSIS Plug-In Callback Messages
+enum NSPIM 
+{
+	NSPIM_UNLOAD,    // This is the last message a plugin gets, do final cleanup
+	NSPIM_GUIUNLOAD, // Called after .onGUIEnd
+};
+
+// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback()
+// Return NULL for unknown messages
+// Should always be __cdecl for future expansion possibilities
+typedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);
+
+// extra_parameters data structures containing other interesting stuff
+// but the stack, variables and HWND passed on to plug-ins.
+typedef struct
+{
+  int autoclose;
+  int all_user_var;
+  int exec_error;
+  int abort;
+  int exec_reboot; // NSIS_SUPPORT_REBOOT
+  int reboot_called; // NSIS_SUPPORT_REBOOT
+  int XXX_cur_insttype; // depreacted
+  int plugin_api_version; // see NSISPIAPIVER_CURR
+                          // used to be XXX_insttype_changed
+  int silent; // NSIS_CONFIG_SILENT_SUPPORT
+  int instdir_error;
+  int rtl;
+  int errlvl;
+  int alter_reg_view;
+  int status_update;
+} exec_flags_t;
+
+#ifndef NSISCALL
+#  define NSISCALL __stdcall
+#endif
+
+typedef struct {
+  exec_flags_t *exec_flags;
+  int (NSISCALL *ExecuteCodeSegment)(int, HWND);
+  void (NSISCALL *validate_filename)(char *);
+  int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors
+} extra_parameters;
+
+// Definitions for page showing plug-ins
+// See Ui.c to understand better how they're used
+
+// sent to the outer window to tell it to go to the next inner window
+#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)
+
+// custom pages should send this message to let NSIS know they're ready
+#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)
+
+// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning
+#define NOTIFY_BYE_BYE 'x'
+
+#endif /* _PLUGIN_H_ */
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI/ioSpecial.ini
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI/ioSpecial.ini	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI/ioSpecial.ini	(revision 728)
@@ -0,0 +1,19 @@
+[Settings]
+Rect=1044
+NumFields=3
+[Field 1]
+Type=bitmap
+Left=0
+Right=109
+Top=0
+Bottom=193
+Flags=RESIZETOFIT
+[Field 2]
+Type=label
+Left=120
+Right=315
+Top=10
+[Field 3]
+Type=label
+Left=120
+Right=315
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI/ioSpecial.ini
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI/System.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI/System.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI/System.nsh	(revision 728)
@@ -0,0 +1,2206 @@
+/*
+
+NSIS Modern User Interface - Version 1.8
+Copyright 2002-2015 Joost Verburg
+
+*/
+
+!echo "NSIS Modern User Interface version 1.8 - Copyright 2002-2015 Joost Verburg"
+
+;--------------------------------
+
+!ifndef MUI_INCLUDED
+!define MUI_INCLUDED
+
+!define MUI_SYSVERSION "1.8"
+
+!verbose push
+
+!ifndef MUI_VERBOSE
+  !define MUI_VERBOSE 3
+!endif
+
+!verbose ${MUI_VERBOSE}
+
+;--------------------------------
+;HEADER FILES, DECLARATIONS
+
+!include InstallOptions.nsh
+!include LangFile.nsh
+!include WinMessages.nsh
+
+Var MUI_TEMP1
+Var MUI_TEMP2
+
+;--------------------------------
+;INSERT CODE
+
+!macro MUI_INSERT
+
+  !ifndef MUI_INSERT
+    !define MUI_INSERT
+
+    !ifdef MUI_PRODUCT | MUI_VERSION
+      !warning "The MUI_PRODUCT and MUI_VERSION defines have been removed. Use a normal Name command now."
+    !endif
+
+    !insertmacro MUI_INTERFACE
+
+    !insertmacro MUI_FUNCTION_GUIINIT
+    !insertmacro MUI_FUNCTION_ABORTWARNING
+  
+    !ifdef MUI_IOCONVERT_USED
+      !insertmacro INSTALLOPTIONS_FUNCTION_WRITE_CONVERT
+    !endif
+
+    !ifdef MUI_UNINSTALLER
+      !insertmacro MUI_UNFUNCTION_GUIINIT
+      !insertmacro MUI_FUNCTION_UNABORTWARNING
+    
+      !ifdef MUI_UNIOCONVERT_USED
+        !insertmacro INSTALLOPTIONS_UNFUNCTION_WRITE_CONVERT
+      !endif
+    !endif
+
+  !endif
+
+!macroend
+
+;--------------------------------
+;GENERAL
+
+!macro MUI_DEFAULT SYMBOL CONTENT
+
+  !ifndef "${SYMBOL}"
+    !define "${SYMBOL}" "${CONTENT}"
+  !endif
+
+!macroend
+
+!macro MUI_DEFAULT_IOCONVERT SYMBOL CONTENT
+
+  !ifndef "${SYMBOL}"
+    !define "${SYMBOL}" "${CONTENT}"
+    !insertmacro MUI_SET "${SYMBOL}_DEFAULTSET"
+    !insertmacro MUI_SET "MUI_${MUI_PAGE_UNINSTALLER_PREFIX}IOCONVERT_USED"
+  !else
+    !insertmacro MUI_UNSET "${SYMBOL}_DEFAULTSET" 
+  !endif
+
+!macroend
+
+!macro MUI_SET SYMBOL
+
+  !ifndef "${SYMBOL}"
+    !define "${SYMBOL}"
+  !endif
+
+!macroend
+
+!macro MUI_UNSET SYMBOL
+
+  !ifdef "${SYMBOL}"
+    !undef "${SYMBOL}"
+  !endif
+
+!macroend
+
+;--------------------------------
+;INTERFACE - COMPILE TIME SETTINGS
+
+!macro MUI_INTERFACE
+
+  !ifndef MUI_INTERFACE
+    !define MUI_INTERFACE
+
+    !ifdef MUI_INSERT_NSISCONF
+      !insertmacro MUI_NSISCONF
+    !endif
+
+    !insertmacro MUI_DEFAULT MUI_UI "${NSISDIR}\Contrib\UIs\modern.exe"
+    !insertmacro MUI_DEFAULT MUI_UI_HEADERIMAGE "${NSISDIR}\Contrib\UIs\modern_headerbmp.exe"
+    !insertmacro MUI_DEFAULT MUI_UI_HEADERIMAGE_RIGHT "${NSISDIR}\Contrib\UIs\modern_headerbmpr.exe"
+    !insertmacro MUI_DEFAULT MUI_UI_COMPONENTSPAGE_SMALLDESC "${NSISDIR}\Contrib\UIs\modern_smalldesc.exe"
+    !insertmacro MUI_DEFAULT MUI_UI_COMPONENTSPAGE_NODESC "${NSISDIR}\Contrib\UIs\modern_nodesc.exe"
+    !insertmacro MUI_DEFAULT MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
+    !insertmacro MUI_DEFAULT MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
+    !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_CHECKBITMAP "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp"
+    !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_BGCOLOR "/windows"
+    !insertmacro MUI_DEFAULT MUI_INSTFILESPAGE_COLORS "/windows"
+    !insertmacro MUI_DEFAULT MUI_INSTFILESPAGE_PROGRESSBAR "smooth"
+    !insertmacro MUI_DEFAULT MUI_BGCOLOR "FFFFFF"
+    !insertmacro MUI_DEFAULT MUI_WELCOMEFINISHPAGE_INI "${NSISDIR}\Contrib\Modern UI\ioSpecial.ini"
+    !insertmacro MUI_DEFAULT MUI_UNWELCOMEFINISHPAGE_INI "${NSISDIR}\Contrib\Modern UI\ioSpecial.ini"
+    !insertmacro MUI_DEFAULT MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp"
+    !insertmacro MUI_DEFAULT MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp"
+
+    !ifdef MUI_HEADERIMAGE
+
+      !insertmacro MUI_DEFAULT MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp"
+
+      !ifndef MUI_HEADERIMAGE_UNBITMAP
+        !define MUI_HEADERIMAGE_UNBITMAP "${MUI_HEADERIMAGE_BITMAP}"
+        !ifdef MUI_HEADERIMAGE_BITMAP_NOSTRETCH
+          !insertmacro MUI_SET MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH
+        !endif
+      !endif
+
+      !ifdef MUI_HEADERIMAGE_BITMAP_RTL
+        !ifndef MUI_HEADERIMAGE_UNBITMAP_RTL
+          !define MUI_HEADERIMAGE_UNBITMAP_RTL "${MUI_HEADERIMAGE_BITMAP_RTL}"
+          !ifdef MUI_HEADERIMAGE_BITMAP_RTL_NOSTRETCH
+            !insertmacro MUI_SET MUI_HEADERIMAGE_UNBITMAP_RTL_NOSTRETCH
+          !endif
+        !endif
+      !endif
+
+    !endif
+
+    XPStyle On
+
+    ChangeUI all "${MUI_UI}"
+    !ifdef MUI_HEADERIMAGE
+      !ifndef MUI_HEADERIMAGE_RIGHT
+        ChangeUI IDD_INST "${MUI_UI_HEADERIMAGE}"
+      !else
+        ChangeUI IDD_INST "${MUI_UI_HEADERIMAGE_RIGHT}"
+      !endif
+    !endif
+    !ifdef MUI_COMPONENTSPAGE_SMALLDESC
+      ChangeUI IDD_SELCOM "${MUI_UI_COMPONENTSPAGE_SMALLDESC}"
+    !else ifdef MUI_COMPONENTSPAGE_NODESC
+       ChangeUI IDD_SELCOM "${MUI_UI_COMPONENTSPAGE_NODESC}"
+    !endif
+
+    Icon "${MUI_ICON}"
+    UninstallIcon "${MUI_UNICON}"
+
+    CheckBitmap "${MUI_COMPONENTSPAGE_CHECKBITMAP}"
+    LicenseBkColor "${MUI_LICENSEPAGE_BGCOLOR}"
+    InstallColors ${MUI_INSTFILESPAGE_COLORS}
+    InstProgressFlags ${MUI_INSTFILESPAGE_PROGRESSBAR}
+
+    SubCaption 4 " "
+    UninstallSubCaption 2 " "
+
+    !insertmacro MUI_DEFAULT MUI_ABORTWARNING_TEXT "$(MUI_TEXT_ABORTWARNING)"
+    !insertmacro MUI_DEFAULT MUI_UNABORTWARNING_TEXT "$(MUI_UNTEXT_ABORTWARNING)"
+
+  !endif
+
+!macroend
+
+;--------------------------------
+;INTERFACE - RUN-TIME
+
+!macro MUI_INNERDIALOG_TEXT CONTROL TEXT
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  FindWindow $MUI_TEMP1 "#32770" "" $HWNDPARENT
+  GetDlgItem $MUI_TEMP1 $MUI_TEMP1 ${CONTROL}
+  SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 "STR:${TEXT}"
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_HEADER_TEXT_INTERNAL ID TEXT
+
+  GetDlgItem $MUI_TEMP1 $HWNDPARENT "${ID}"
+
+  !ifdef MUI_HEADER_TRANSPARENT_TEXT
+
+    ShowWindow $MUI_TEMP1 ${SW_HIDE}
+
+  !endif
+
+  SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 "STR:${TEXT}"
+
+  !ifdef MUI_HEADER_TRANSPARENT_TEXT
+
+    ShowWindow $MUI_TEMP1 ${SW_SHOWNA}
+
+  !endif
+
+!macroend
+
+!macro MUI_HEADER_TEXT TEXT SUBTEXT
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !ifdef MUI_HEADER_TRANSPARENT_TEXT
+
+    LockWindow on
+
+  !endif
+
+  !insertmacro MUI_HEADER_TEXT_INTERNAL 1037 "${TEXT}"
+  !insertmacro MUI_HEADER_TEXT_INTERNAL 1038 "${SUBTEXT}"
+
+  !ifdef MUI_HEADER_TRANSPARENT_TEXT
+
+    LockWindow off
+
+  !endif
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_HEADER_TEXT_PAGE TEXT SUBTEXT
+
+  !ifdef MUI_PAGE_HEADER_TEXT & MUI_PAGE_HEADER_SUBTEXT
+    !insertmacro MUI_HEADER_TEXT "${MUI_PAGE_HEADER_TEXT}" "${MUI_PAGE_HEADER_SUBTEXT}"
+  !else ifdef MUI_PAGE_HEADER_TEXT
+    !insertmacro MUI_HEADER_TEXT "${MUI_PAGE_HEADER_TEXT}" "${SUBTEXT}"
+  !else ifdef MUI_PAGE_HEADER_SUBTEXT
+    !insertmacro MUI_HEADER_TEXT "${TEXT}" "${MUI_PAGE_HEADER_SUBTEXT}"
+  !else
+    !insertmacro MUI_HEADER_TEXT "${TEXT}" "${SUBTEXT}"
+  !endif
+
+  !insertmacro MUI_UNSET MUI_PAGE_HEADER_TEXT
+  !insertmacro MUI_UNSET MUI_PAGE_HEADER_SUBTEXT
+
+!macroend
+
+!macro MUI_DESCRIPTION_BEGIN
+
+  FindWindow $MUI_TEMP1 "#32770" "" $HWNDPARENT
+  GetDlgItem $MUI_TEMP1 $MUI_TEMP1 1043
+
+  StrCmp $0 -1 0 mui.description_begin_done
+    SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 "STR:"
+    EnableWindow $MUI_TEMP1 0
+    SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 "STR:$MUI_TEXT"
+    Goto mui.description_done
+  mui.description_begin_done:
+
+!macroend
+
+!macro MUI_DESCRIPTION_TEXT VAR TEXT
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  StrCmp $0 ${VAR} 0 mui.description_${VAR}_done
+    SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 "STR:"
+    EnableWindow $MUI_TEMP1 1
+    SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 "STR:${TEXT}"
+    Goto mui.description_done
+  mui.description_${VAR}_done:
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_DESCRIPTION_END
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  mui.description_done:
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_ENDHEADER
+
+  IfAbort mui.endheader_abort
+
+    !ifdef MUI_INSTFILESPAGE_FINISHHEADER_TEXT & MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT
+      !insertmacro MUI_HEADER_TEXT "${MUI_INSTFILESPAGE_FINISHHEADER_TEXT}" "${MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT}"
+    !else ifdef MUI_INSTFILESPAGE_FINISHHEADER_TEXT
+      !insertmacro MUI_HEADER_TEXT "${MUI_INSTFILESPAGE_FINISHHEADER_TEXT}" "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_SUBTITLE)"
+    !else ifdef MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT
+      !insertmacro MUI_HEADER_TEXT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_TITLE)" "${MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT}"
+    !else
+      !insertmacro MUI_HEADER_TEXT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_TITLE)" "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_SUBTITLE)"
+    !endif
+
+  Goto mui.endheader_done
+
+  mui.endheader_abort:
+
+    !ifdef MUI_INSTFILESPAGE_ABORTHEADER_TEXT & MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT
+      !insertmacro MUI_HEADER_TEXT "${MUI_INSTFILESPAGE_ABORTHEADER_TEXT}" "${MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT}"
+    !else ifdef MUI_INSTFILESPAGE_ABORTHEADER_TEXT
+      !insertmacro MUI_HEADER_TEXT "${MUI_INSTFILESPAGE_ABORTHEADER_TEXT}" "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_SUBTITLE)"
+    !else ifdef MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT
+      !insertmacro MUI_HEADER_TEXT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_TITLE)" "${MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT}"
+    !else
+      !insertmacro MUI_HEADER_TEXT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_TITLE)" "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_SUBTITLE)"
+    !endif
+
+  mui.endheader_done:
+
+!macroend
+
+!macro MUI_ABORTWARNING
+
+  !ifdef MUI_FINISHPAGE_ABORTWARNINGCHECK
+    StrCmp $MUI_NOABORTWARNING "1" mui.quit
+  !endif
+
+  !ifdef MUI_ABORTWARNING_CANCEL_DEFAULT
+    MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 "${MUI_ABORTWARNING_TEXT}" IDYES mui.quit
+  !else
+    MessageBox MB_YESNO|MB_ICONEXCLAMATION "${MUI_ABORTWARNING_TEXT}" IDYES mui.quit
+  !endif
+
+  Abort
+  mui.quit:
+
+!macroend
+
+!macro MUI_UNABORTWARNING
+
+  !ifdef MUI_UNABORTWARNING_CANCEL_DEFAULT
+    MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 "${MUI_UNABORTWARNING_TEXT}" IDYES mui.quit
+  !else
+    MessageBox MB_YESNO|MB_ICONEXCLAMATION "${MUI_UNABORTWARNING_TEXT}" IDYES mui.quit
+  !endif
+
+  Abort
+  mui.quit:
+
+!macroend
+
+!macro MUI_GUIINIT
+
+  !insertmacro MUI_WELCOMEFINISHPAGE_INIT ""
+  !insertmacro MUI_HEADERIMAGE_INIT ""
+
+  !insertmacro MUI_GUIINIT_BASIC
+
+!macroend
+
+!macro MUI_UNGUIINIT
+
+  !insertmacro MUI_WELCOMEFINISHPAGE_INIT "UN"
+  !insertmacro MUI_HEADERIMAGE_INIT "UN"
+
+  !insertmacro MUI_GUIINIT_BASIC
+
+  !ifdef MUI_UNFINISHPAGE
+    !ifndef MUI_UNFINISHPAGE_NOAUTOCLOSE
+      SetAutoClose true
+    !endif
+  !endif
+
+!macroend
+
+!macro MUI_GUIINIT_BASIC
+
+  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037
+  CreateFont $MUI_TEMP2 "$(^Font)" "$(^FontSize)" "700"
+  SendMessage $MUI_TEMP1 ${WM_SETFONT} $MUI_TEMP2 0
+
+  !ifndef MUI_HEADER_TRANSPARENT_TEXT
+
+    SetCtlColors $MUI_TEMP1 "" "${MUI_BGCOLOR}"
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038
+    SetCtlColors $MUI_TEMP1 "" "${MUI_BGCOLOR}"
+
+  !else
+
+    SetCtlColors $MUI_TEMP1 "" "transparent"
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038
+    SetCtlColors $MUI_TEMP1 "" "transparent"
+
+  !endif
+
+  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1034
+  SetCtlColors $MUI_TEMP1 "" "${MUI_BGCOLOR}"
+
+  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039
+  SetCtlColors $MUI_TEMP1 "" "${MUI_BGCOLOR}"
+
+  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028
+  SetCtlColors $MUI_TEMP1 /BRANDING
+  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256
+  SetCtlColors $MUI_TEMP1 /BRANDING
+  SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 "STR:$(^Branding) "
+
+!macroend
+
+!macro MUI_WELCOMEFINISHPAGE_INIT UNINSTALLER
+
+  !ifdef MUI_${UNINSTALLER}WELCOMEPAGE | MUI_${UNINSTALLER}FINISHPAGE
+
+    !insertmacro INSTALLOPTIONS_EXTRACT_AS "${MUI_${UNINSTALLER}WELCOMEFINISHPAGE_INI}" "ioSpecial.ini"
+    File "/oname=$PLUGINSDIR\modern-wizard.bmp" "${MUI_${UNINSTALLER}WELCOMEFINISHPAGE_BITMAP}"
+
+    !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 1" "Text" "$PLUGINSDIR\modern-wizard.bmp"
+
+    !ifdef MUI_${UNINSTALLER}WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 1" "Flags" ""
+    !endif
+
+  !endif
+
+!macroend
+
+!macro MUI_HEADERIMAGE_INIT UNINSTALLER
+
+  !ifdef MUI_HEADERIMAGE
+
+    InitPluginsDir
+
+    !ifdef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL
+
+    StrCmp $(^RTL) 0 mui.headerimageinit_nortl
+
+        File "/oname=$PLUGINSDIR\modern-header.bmp" "${MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL}"
+
+        !ifndef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL_NOSTRETCH
+          SetBrandingImage /IMGID=1046 /RESIZETOFIT "$PLUGINSDIR\modern-header.bmp"
+        !else
+          SetBrandingImage /IMGID=1046 "$PLUGINSDIR\modern-header.bmp"
+        !endif
+
+        Goto mui.headerimageinit_done
+
+      mui.headerimageinit_nortl:
+
+    !endif
+
+        File "/oname=$PLUGINSDIR\modern-header.bmp" "${MUI_HEADERIMAGE_${UNINSTALLER}BITMAP}"
+
+        !ifndef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_NOSTRETCH
+          SetBrandingImage /IMGID=1046 /RESIZETOFIT "$PLUGINSDIR\modern-header.bmp"
+        !else
+          SetBrandingImage /IMGID=1046 "$PLUGINSDIR\modern-header.bmp"
+        !endif
+
+    !ifdef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL
+
+    mui.headerimageinit_done:
+
+    !endif
+
+  !endif
+
+!macroend
+
+;--------------------------------
+;INTERFACE - FUNCTIONS
+
+!macro MUI_FUNCTION_GUIINIT
+
+  Function .onGUIInit
+
+    !insertmacro MUI_GUIINIT
+
+    !ifdef MUI_CUSTOMFUNCTION_GUIINIT
+      Call "${MUI_CUSTOMFUNCTION_GUIINIT}"
+    !endif
+
+  FunctionEnd
+
+!macroend
+
+!macro MUI_FUNCTION_DESCRIPTION_BEGIN
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !ifndef MUI_VAR_TEXT
+    Var MUI_TEXT
+    !define MUI_VAR_TEXT
+  !endif
+
+  Function .onMouseOverSection
+    !insertmacro MUI_DESCRIPTION_BEGIN
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_FUNCTION_DESCRIPTION_END
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+    !insertmacro MUI_DESCRIPTION_END
+    !ifdef MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION
+      Call "${MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION}"
+    !endif
+  FunctionEnd
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNFUNCTION_DESCRIPTION_BEGIN
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  Function un.onMouseOverSection
+    !insertmacro MUI_DESCRIPTION_BEGIN
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNFUNCTION_DESCRIPTION_END
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+    !insertmacro MUI_DESCRIPTION_END
+    !ifdef MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION
+      Call "${MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION}"
+    !endif
+  FunctionEnd
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_FUNCTION_ABORTWARNING
+
+  Function .onUserAbort
+    !ifdef MUI_ABORTWARNING
+      !insertmacro MUI_ABORTWARNING
+    !endif
+    !ifdef MUI_CUSTOMFUNCTION_ABORT
+      Call "${MUI_CUSTOMFUNCTION_ABORT}"
+    !endif
+  FunctionEnd
+
+!macroend
+
+!macro MUI_FUNCTION_UNABORTWARNING
+
+  Function un.onUserAbort
+    !ifdef MUI_UNABORTWARNING
+      !insertmacro MUI_UNABORTWARNING
+    !endif
+    !ifdef MUI_CUSTOMFUNCTION_UNABORT
+      Call "${MUI_CUSTOMFUNCTION_UNABORT}"
+    !endif
+  FunctionEnd
+
+!macroend
+
+!macro MUI_UNFUNCTION_GUIINIT
+
+  Function un.onGUIInit
+
+  !insertmacro MUI_UNGUIINIT
+
+  !ifdef MUI_CUSTOMFUNCTION_UNGUIINIT
+    Call "${MUI_CUSTOMFUNCTION_UNGUIINIT}"
+  !endif
+
+  FunctionEnd
+
+!macroend
+
+!macro MUI_FUNCTIONS_DESCRIPTION_BEGIN
+
+  ;1.65 compatibility
+
+  !warning "Modern UI macro name has changed. Please change MUI_FUNCTIONS_DESCRIPTION_BEGIN to MUI_FUNCTION_DESCRIPTION_BEGIN."
+
+  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+
+!macroend
+
+!macro MUI_FUNCTIONS_DESCRIPTION_END
+
+  ;1.65 compatibility
+
+  !warning "Modern UI macro name has changed. Please change MUI_FUNCTIONS_DESCRIPTION_END to MUI_FUNCTION_DESCRIPTION_END."
+
+  !insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+!macroend
+
+;--------------------------------
+;START MENU FOLDER
+
+!macro MUI_STARTMENU_GETFOLDER ID VAR
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !ifdef MUI_STARTMENUPAGE_${ID}_REGISTRY_ROOT & MUI_STARTMENUPAGE_${ID}_REGISTRY_KEY & MUI_STARTMENUPAGE_${ID}_REGISTRY_VALUENAME
+
+    ReadRegStr $MUI_TEMP1 "${MUI_STARTMENUPAGE_${ID}_REGISTRY_ROOT}" "${MUI_STARTMENUPAGE_${ID}_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_${ID}_REGISTRY_VALUENAME}"
+      StrCmp $MUI_TEMP1 "" +3
+        StrCpy "${VAR}" $MUI_TEMP1
+        Goto +2
+
+        StrCpy "${VAR}" "${MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER}"
+
+   !else
+
+     StrCpy "${VAR}" "${MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER}"
+
+   !endif
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_STARTMENU_WRITE_BEGIN ID
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !define MUI_STARTMENUPAGE_CURRENT_ID "${ID}"
+
+  StrCpy $MUI_TEMP1 "${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}" 1
+  StrCmp $MUI_TEMP1 ">" mui.startmenu_write_${MUI_STARTMENUPAGE_CURRENT_ID}_done
+
+  StrCmp "${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}" "" 0 mui.startmenu_writebegin_${MUI_STARTMENUPAGE_CURRENT_ID}_notempty
+
+    !insertmacro MUI_STARTMENU_GETFOLDER "${MUI_STARTMENUPAGE_CURRENT_ID}" "${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}"
+
+  mui.startmenu_writebegin_${MUI_STARTMENUPAGE_CURRENT_ID}_notempty:
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_STARTMENU_WRITE_END
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !ifdef MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_ROOT & MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_KEY & MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_VALUENAME
+    WriteRegStr "${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_ROOT}" "${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_VALUENAME}" "${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}"
+  !endif
+
+  mui.startmenu_write_${MUI_STARTMENUPAGE_CURRENT_ID}_done:
+
+  !undef MUI_STARTMENUPAGE_CURRENT_ID
+
+  !verbose pop
+
+!macroend
+
+;--------------------------------
+;PAGES
+
+!macro MUI_PAGE_INIT
+
+  !insertmacro MUI_INTERFACE
+
+  !insertmacro MUI_DEFAULT MUI_PAGE_UNINSTALLER_PREFIX ""
+  !insertmacro MUI_DEFAULT MUI_PAGE_UNINSTALLER_FUNCPREFIX ""
+
+  !insertmacro MUI_UNSET MUI_UNIQUEID
+
+  !define MUI_UNIQUEID ${__LINE__}
+
+!macroend
+
+!macro MUI_UNPAGE_INIT
+
+  !ifndef MUI_UNINSTALLER
+    !define MUI_UNINSTALLER
+  !endif
+
+  !define MUI_PAGE_UNINSTALLER
+
+  !insertmacro MUI_UNSET MUI_PAGE_UNINSTALLER_PREFIX
+  !insertmacro MUI_UNSET MUI_PAGE_UNINSTALLER_FUNCPREFIX
+
+  !define MUI_PAGE_UNINSTALLER_PREFIX "UN"
+  !define MUI_PAGE_UNINSTALLER_FUNCPREFIX "un."
+
+!macroend
+
+!macro MUI_UNPAGE_END
+
+  !undef MUI_PAGE_UNINSTALLER
+  !undef MUI_PAGE_UNINSTALLER_PREFIX
+  !undef MUI_PAGE_UNINSTALLER_FUNCPREFIX
+
+!macroend
+
+!macro MUI_PAGE_WELCOME
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_PAGE_INIT
+
+  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEPAGE
+
+  !insertmacro MUI_DEFAULT_IOCONVERT MUI_WELCOMEPAGE_TITLE "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TITLE)"
+  !insertmacro MUI_DEFAULT_IOCONVERT MUI_WELCOMEPAGE_TEXT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TEXT)"
+
+  !ifndef MUI_VAR_HWND
+    Var MUI_HWND
+    !define MUI_VAR_HWND
+  !endif
+
+  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom
+
+    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomeLeave_${MUI_UNIQUEID}
+
+  PageExEnd
+
+  !insertmacro MUI_FUNCTION_WELCOMEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomeLeave_${MUI_UNIQUEID}
+
+  !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE
+  !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE_3LINES
+  !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TEXT
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_PAGE_LICENSE LICENSEDATA
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_PAGE_INIT
+
+  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}LICENSEPAGE
+
+  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_TEXT_TOP "$(MUI_INNERTEXT_LICENSE_TOP)"
+  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_BUTTON ""
+  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_CHECKBOX_TEXT ""
+  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT ""
+  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE ""
+
+  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}license
+
+    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicensePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseLeave_${MUI_UNIQUEID}
+
+    Caption " "
+
+    LicenseData "${LICENSEDATA}"
+
+    !ifndef MUI_LICENSEPAGE_TEXT_BOTTOM
+      !ifndef MUI_LICENSEPAGE_CHECKBOX & MUI_LICENSEPAGE_RADIOBUTTONS
+        LicenseText "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_LICENSE_BOTTOM)" "${MUI_LICENSEPAGE_BUTTON}"
+      !else ifdef MUI_LICENSEPAGE_CHECKBOX
+        LicenseText "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_LICENSE_BOTTOM_CHECKBOX)" "${MUI_LICENSEPAGE_BUTTON}"
+      !else
+        LicenseText "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS)" "${MUI_LICENSEPAGE_BUTTON}"
+      !endif
+    !else
+      LicenseText "${MUI_LICENSEPAGE_TEXT_BOTTOM}" "${MUI_LICENSEPAGE_BUTTON}"
+    !endif
+
+    !ifdef MUI_LICENSEPAGE_CHECKBOX
+      LicenseForceSelection checkbox "${MUI_LICENSEPAGE_CHECKBOX_TEXT}"
+    !else ifdef MUI_LICENSEPAGE_RADIOBUTTONS
+      LicenseForceSelection radiobuttons "${MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT}" "${MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE}"
+    !endif
+
+  PageExEnd
+
+  !insertmacro MUI_FUNCTION_LICENSEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicensePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseLeave_${MUI_UNIQUEID}
+
+  !insertmacro MUI_UNSET MUI_LICENSEPAGE_TEXT_TOP
+  !insertmacro MUI_UNSET MUI_LICENSEPAGE_TEXT_BOTTOM
+  !insertmacro MUI_UNSET MUI_LICENSEPAGE_BUTTON
+  !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX
+    !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX_TEXT
+  !insertmacro MUI_UNSET MUI_LICENSEPAGE_RADIOBUTTONS
+    !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX_TEXT_ACCEPT
+    !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX_TEXT_DECLINE
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_PAGE_COMPONENTS
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_PAGE_INIT
+
+  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}COMPONENTSPAGE
+
+  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_TOP ""
+  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_COMPLIST ""
+  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_INSTTYPE ""
+  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE "$(MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE)"
+  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO "$(MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO)"
+
+  !ifndef MUI_VAR_TEXT
+    Var MUI_TEXT
+    !define MUI_VAR_TEXT
+  !endif
+
+  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}components
+
+    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsLeave_${MUI_UNIQUEID}
+
+    Caption " "
+
+    ComponentText "${MUI_COMPONENTSPAGE_TEXT_TOP}" "${MUI_COMPONENTSPAGE_TEXT_INSTTYPE}" "${MUI_COMPONENTSPAGE_TEXT_COMPLIST}"
+
+  PageExEnd
+
+  !insertmacro MUI_FUNCTION_COMPONENTSPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsLeave_${MUI_UNIQUEID}
+
+  !undef MUI_COMPONENTSPAGE_TEXT_TOP
+  !undef MUI_COMPONENTSPAGE_TEXT_COMPLIST
+  !undef MUI_COMPONENTSPAGE_TEXT_INSTTYPE
+  !insertmacro MUI_UNSET MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE
+  !insertmacro MUI_UNSET MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_PAGE_DIRECTORY
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_PAGE_INIT
+
+  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}DIRECTORYPAGE
+
+  !insertmacro MUI_DEFAULT MUI_DIRECTORYPAGE_TEXT_TOP ""
+  !insertmacro MUI_DEFAULT MUI_DIRECTORYPAGE_TEXT_DESTINATION ""
+
+  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}directory
+
+    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryLeave_${MUI_UNIQUEID}
+
+    Caption " "
+
+    DirText "${MUI_DIRECTORYPAGE_TEXT_TOP}" "${MUI_DIRECTORYPAGE_TEXT_DESTINATION}"
+
+    !ifdef MUI_DIRECTORYPAGE_VARIABLE
+      DirVar "${MUI_DIRECTORYPAGE_VARIABLE}"
+    !endif
+
+    !ifdef MUI_DIRECTORYPAGE_VERIFYONLEAVE
+      DirVerify leave
+    !endif
+
+  PageExEnd
+
+  !insertmacro MUI_FUNCTION_DIRECTORYPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryLeave_${MUI_UNIQUEID}
+
+  !undef MUI_DIRECTORYPAGE_TEXT_TOP
+  !undef MUI_DIRECTORYPAGE_TEXT_DESTINATION
+  !insertmacro MUI_UNSET MUI_DIRECTORYPAGE_BGCOLOR
+  !insertmacro MUI_UNSET MUI_DIRECTORYPAGE_VARIABLE
+  !insertmacro MUI_UNSET MUI_DIRECTORYPAGE_VERIFYONLEAVE
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_PAGE_STARTMENU ID VAR
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_PAGE_INIT
+
+  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}STARTMENUPAGE
+
+  !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_DEFAULTFOLDER "$(^Name)"
+  !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_TEXT_TOP "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_STARTMENU_TOP)"
+  !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_TEXT_CHECKBOX "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_STARTMENU_CHECKBOX)"
+
+  !define MUI_STARTMENUPAGE_VARIABLE "${VAR}"
+  !define "MUI_STARTMENUPAGE_${ID}_VARIABLE" "${MUI_STARTMENUPAGE_VARIABLE}"
+  !define "MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER" "${MUI_STARTMENUPAGE_DEFAULTFOLDER}"
+  !ifdef MUI_STARTMENUPAGE_REGISTRY_ROOT
+    !define "MUI_STARTMENUPAGE_${ID}_REGISTRY_ROOT" "${MUI_STARTMENUPAGE_REGISTRY_ROOT}"
+  !endif
+  !ifdef MUI_STARTMENUPAGE_REGISTRY_KEY
+    !define "MUI_STARTMENUPAGE_${ID}_REGISTRY_KEY" "${MUI_STARTMENUPAGE_REGISTRY_KEY}"
+  !endif
+  !ifdef MUI_STARTMENUPAGE_REGISTRY_VALUENAME
+    !define "MUI_STARTMENUPAGE_${ID}_REGISTRY_VALUENAME" "${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}"
+  !endif
+
+  !ifndef MUI_VAR_HWND
+    Var MUI_HWND
+    !define MUI_VAR_HWND
+  !endif
+
+  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom
+
+    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuLeave_${MUI_UNIQUEID}
+
+    Caption " "
+
+  PageExEnd
+
+  !insertmacro MUI_FUNCTION_STARTMENUPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuLeave_${MUI_UNIQUEID}
+
+  !undef MUI_STARTMENUPAGE_VARIABLE
+  !undef MUI_STARTMENUPAGE_TEXT_TOP
+  !undef MUI_STARTMENUPAGE_TEXT_CHECKBOX
+  !undef MUI_STARTMENUPAGE_DEFAULTFOLDER
+  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_NODISABLE
+  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_ROOT
+  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_KEY
+  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_VALUENAME
+  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_BGCOLOR
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_PAGE_INSTFILES
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_PAGE_INIT
+
+  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INSTFILESPAGE
+
+  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}instfiles
+
+    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesLeave_${MUI_UNIQUEID}
+
+    Caption " "
+
+  PageExEnd
+
+  !insertmacro MUI_FUNCTION_INSTFILESPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesLeave_${MUI_UNIQUEID}
+
+  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_FINISHHEADER_TEXT
+  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT
+  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_ABORTWARNING_TEXT
+  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_ABORTWARNING_SUBTEXT
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_PAGE_FINISH
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_PAGE_INIT
+
+  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}FINISHPAGE
+
+  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_TITLE "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_INFO_TITLE)"
+  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_TEXT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_INFO_TEXT)"
+  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_BUTTON "$(MUI_BUTTONTEXT_FINISH)"
+  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_TEXT_REBOOT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_INFO_REBOOT)"
+  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_TEXT_REBOOTNOW "$(MUI_TEXT_FINISH_REBOOTNOW)"
+  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_TEXT_REBOOTLATER "$(MUI_TEXT_FINISH_REBOOTLATER)"
+  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_RUN_TEXT "$(MUI_TEXT_FINISH_RUN)"
+  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_SHOWREADME_TEXT "$(MUI_TEXT_FINISH_SHOWREADME)"
+  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_LINK_COLOR "000080"
+
+  !ifndef MUI_VAR_HWND
+    Var MUI_HWND
+    !define MUI_VAR_HWND
+  !endif
+
+  !ifndef MUI_PAGE_UNINSTALLER
+    !ifndef MUI_FINISHPAGE_NOAUTOCLOSE
+      AutoCloseWindow true
+    !endif
+  !endif
+
+  !ifdef MUI_FINISHPAGE_CANCEL_ENABLED
+    !ifndef MUI_VAR_NOABORTWARNING
+      !define MUI_VAR_NOABORTWARNING
+      Var MUI_NOABORTWARNING
+    !endif
+  !endif
+
+  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom
+
+    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishLeave_${MUI_UNIQUEID}
+
+    Caption " "
+
+  PageExEnd
+
+  !insertmacro MUI_FUNCTION_FINISHPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishLeave_${MUI_UNIQUEID}
+
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_TITLE
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_TITLE_3LINES
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_LARGE
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_BUTTON
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_CANCEL_ENABLED
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_REBOOT
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_REBOOTNOW
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_REBOOTLATER
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_REBOOTLATER_DEFAULT
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_TEXT
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_PARAMETERS
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_NOTCHECKED
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_FUNCTION
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_TEXT
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_FUNCTION
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_LINK
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_LINK_LOCATION
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_LINK_COLOR
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_NOREBOOTSUPPORT
+
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_CURFIELD_TOP
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_CURFIELD_BOTTOM
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNPAGE_WELCOME
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_UNPAGE_INIT
+
+    !insertmacro MUI_PAGE_WELCOME
+
+  !insertmacro MUI_UNPAGE_END
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNPAGE_CONFIRM
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !ifndef MUI_UNINSTALLER
+    !define MUI_UNINSTALLER
+  !endif
+
+  !insertmacro MUI_PAGE_INIT
+
+  !insertmacro MUI_SET MUI_UNCONFIRMPAGE
+
+  !insertmacro MUI_DEFAULT MUI_UNCONFIRMPAGE_TEXT_TOP ""
+  !insertmacro MUI_DEFAULT MUI_UNCONFIRMPAGE_TEXT_LOCATION ""
+
+  PageEx un.uninstConfirm
+
+    PageCallbacks un.mui.ConfirmPre_${MUI_UNIQUEID} un.mui.ConfirmShow_${MUI_UNIQUEID} un.mui.ConfirmLeave_${MUI_UNIQUEID}
+
+    Caption " "
+
+    UninstallText "${MUI_UNCONFIRMPAGE_TEXT_TOP}" "${MUI_UNCONFIRMPAGE_TEXT_LOCATION}"
+
+  PageExEnd
+
+  !insertmacro MUI_UNFUNCTION_CONFIRMPAGE un.mui.ConfirmPre_${MUI_UNIQUEID} un.mui.ConfirmShow_${MUI_UNIQUEID} un.mui.ConfirmLeave_${MUI_UNIQUEID}
+
+  !insertmacro MUI_UNSET MUI_UNCONFIRMPAGE_TEXT_TOP
+  !insertmacro MUI_UNSET MUI_UNCONFIRMPAGE_TEXT_LOCATION
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNPAGE_LICENSE LICENSEDATA
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_UNPAGE_INIT
+
+    !insertmacro MUI_PAGE_LICENSE "${LICENSEDATA}"
+
+  !insertmacro MUI_UNPAGE_END
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNPAGE_COMPONENTS
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_UNPAGE_INIT
+
+    !insertmacro MUI_PAGE_COMPONENTS
+
+  !insertmacro MUI_UNPAGE_END
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNPAGE_DIRECTORY
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_UNPAGE_INIT
+
+    !insertmacro MUI_PAGE_DIRECTORY
+
+  !insertmacro MUI_UNPAGE_END
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNPAGE_INSTFILES
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_UNPAGE_INIT
+
+    !insertmacro MUI_PAGE_INSTFILES
+
+  !insertmacro MUI_UNPAGE_END
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNPAGE_FINISH
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_UNPAGE_INIT
+
+    !insertmacro MUI_PAGE_FINISH
+
+  !insertmacro MUI_UNPAGE_END
+
+  !verbose pop
+
+!macroend
+
+;--------------------------------
+;PAGE FUNCTIONS
+
+!macro MUI_PAGE_FUNCTION_CUSTOM TYPE
+
+  !ifdef MUI_PAGE_CUSTOMFUNCTION_${TYPE}
+    Call "${MUI_PAGE_CUSTOMFUNCTION_${TYPE}}"
+    !undef MUI_PAGE_CUSTOMFUNCTION_${TYPE}
+  !endif
+
+!macroend
+
+!macro MUI_WELCOMEFINISHPAGE_FUNCTION_CUSTOM
+
+  !ifdef MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT
+    Call "${MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT}"
+    !undef MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT
+  !endif
+
+!macroend
+
+!macro MUI_FUNCTION_WELCOMEPAGE PRE LEAVE
+
+  Function "${PRE}"
+
+    !insertmacro MUI_WELCOMEFINISHPAGE_FUNCTION_CUSTOM
+
+    !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "NumFields" "3"
+    !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "NextButtonText" ""
+    !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelEnabled" ""
+
+    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT "ioSpecial.ini" "Field 2" "Text" MUI_WELCOMEPAGE_TITLE
+
+    !ifndef MUI_WELCOMEPAGE_TITLE_3LINES
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 2" "Bottom" "38"
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Top" "45"
+    !else
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 2" "Bottom" "48"
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Top" "55"
+    !endif
+
+    !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Bottom" "185"
+    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT "ioSpecial.ini" "Field 3" "Text" MUI_WELCOMEPAGE_TEXT
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+
+    LockWindow on
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028
+    ShowWindow $MUI_TEMP1 ${SW_HIDE}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256
+    ShowWindow $MUI_TEMP1 ${SW_HIDE}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1035
+    ShowWindow $MUI_TEMP1 ${SW_HIDE}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037
+    ShowWindow $MUI_TEMP1 ${SW_HIDE}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038
+    ShowWindow $MUI_TEMP1 ${SW_HIDE}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039
+    ShowWindow $MUI_TEMP1 ${SW_HIDE}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045
+    ShowWindow $MUI_TEMP1 ${SW_NORMAL}
+    LockWindow off
+
+    !insertmacro INSTALLOPTIONS_INITDIALOG "ioSpecial.ini"
+    Pop $MUI_HWND
+    SetCtlColors $MUI_HWND "" "${MUI_BGCOLOR}"
+
+    GetDlgItem $MUI_TEMP1 $MUI_HWND 1201
+    SetCtlColors $MUI_TEMP1 "" "${MUI_BGCOLOR}"
+
+    CreateFont $MUI_TEMP2 "$(^Font)" "12" "700"
+    SendMessage $MUI_TEMP1 ${WM_SETFONT} $MUI_TEMP2 0
+
+    GetDlgItem $MUI_TEMP1 $MUI_HWND 1202
+    SetCtlColors $MUI_TEMP1 "" "${MUI_BGCOLOR}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+
+    !insertmacro INSTALLOPTIONS_SHOW
+
+    LockWindow on
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028
+    ShowWindow $MUI_TEMP1 ${SW_NORMAL}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256
+    ShowWindow $MUI_TEMP1 ${SW_NORMAL}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1035
+    ShowWindow $MUI_TEMP1 ${SW_NORMAL}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037
+    ShowWindow $MUI_TEMP1 ${SW_NORMAL}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038
+    ShowWindow $MUI_TEMP1 ${SW_NORMAL}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039
+    ShowWindow $MUI_TEMP1 ${SW_NORMAL}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045
+    ShowWindow $MUI_TEMP1 ${SW_HIDE}
+    LockWindow off
+
+  FunctionEnd
+
+  Function "${LEAVE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+  FunctionEnd
+
+!macroend
+
+!macro MUI_FUNCTION_LICENSEPAGE PRE SHOW LEAVE
+
+  Function "${PRE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_LICENSE_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_LICENSE_SUBTITLE)
+
+  FunctionEnd
+
+  Function "${SHOW}"
+
+    !insertmacro MUI_INNERDIALOG_TEXT 1040 "${MUI_LICENSEPAGE_TEXT_TOP}"
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+
+  FunctionEnd
+
+  Function "${LEAVE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+  FunctionEnd
+
+!macroend
+
+!macro MUI_FUNCTION_COMPONENTSPAGE PRE SHOW LEAVE
+
+  Function "${PRE}"
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_COMPONENTS_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_COMPONENTS_SUBTITLE)
+  FunctionEnd
+
+  Function "${SHOW}"
+
+    !insertmacro MUI_INNERDIALOG_TEXT 1042 "${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE}"
+
+    FindWindow $MUI_TEMP1 "#32770" "" $HWNDPARENT
+    GetDlgItem $MUI_TEMP1 $MUI_TEMP1 1043
+    EnableWindow $MUI_TEMP1 0
+
+    !insertmacro MUI_INNERDIALOG_TEXT 1043 "${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO}"
+    StrCpy $MUI_TEXT "${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO}"
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+
+  FunctionEnd
+
+  Function "${LEAVE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+  FunctionEnd
+
+!macroend
+
+!macro MUI_FUNCTION_DIRECTORYPAGE PRE SHOW LEAVE
+
+  Function "${PRE}"
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_DIRECTORY_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_DIRECTORY_SUBTITLE)
+  FunctionEnd
+
+  Function "${SHOW}"
+    !ifdef MUI_DIRECTORYPAGE_BGCOLOR
+      FindWindow $MUI_TEMP1 "#32770" "" $HWNDPARENT
+      GetDlgItem $MUI_TEMP1 $MUI_TEMP1 1019
+      SetCtlColors $MUI_TEMP1 "" "${MUI_DIRECTORYPAGE_BGCOLOR}"
+    !endif
+    
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+  FunctionEnd
+
+  Function "${LEAVE}"
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+  FunctionEnd
+
+!macroend
+
+!macro MUI_FUNCTION_STARTMENUPAGE PRE LEAVE
+
+  Function "${PRE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+
+     !ifdef MUI_STARTMENUPAGE_REGISTRY_ROOT & MUI_STARTMENUPAGE_REGISTRY_KEY & MUI_STARTMENUPAGE_REGISTRY_VALUENAME
+
+      StrCmp "${MUI_STARTMENUPAGE_VARIABLE}" "" 0 +4
+
+      ReadRegStr $MUI_TEMP1 "${MUI_STARTMENUPAGE_REGISTRY_ROOT}" "${MUI_STARTMENUPAGE_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}"
+        StrCmp $MUI_TEMP1 "" +2
+          StrCpy "${MUI_STARTMENUPAGE_VARIABLE}" $MUI_TEMP1
+
+    !endif
+
+    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_TEXT_STARTMENU_TITLE) $(MUI_TEXT_STARTMENU_SUBTITLE)
+
+    StrCmp $(^RTL) 0 mui.startmenu_nortl
+      !ifndef MUI_STARTMENUPAGE_NODISABLE
+        StartMenu::Init /rtl /noicon /autoadd /text "${MUI_STARTMENUPAGE_TEXT_TOP}" /lastused "${MUI_STARTMENUPAGE_VARIABLE}" /checknoshortcuts "${MUI_STARTMENUPAGE_TEXT_CHECKBOX}" "${MUI_STARTMENUPAGE_DEFAULTFOLDER}"
+      !else
+        StartMenu::Init /rtl /noicon /autoadd /text "${MUI_STARTMENUPAGE_TEXT_TOP}" /lastused "${MUI_STARTMENUPAGE_VARIABLE}" "${MUI_STARTMENUPAGE_DEFAULTFOLDER}"
+      !endif
+      Goto mui.startmenu_initdone
+    mui.startmenu_nortl:
+      !ifndef MUI_STARTMENUPAGE_NODISABLE
+        StartMenu::Init /noicon /autoadd /text "${MUI_STARTMENUPAGE_TEXT_TOP}" /lastused "${MUI_STARTMENUPAGE_VARIABLE}" /checknoshortcuts "${MUI_STARTMENUPAGE_TEXT_CHECKBOX}" "${MUI_STARTMENUPAGE_DEFAULTFOLDER}"
+      !else
+        StartMenu::Init /noicon /autoadd /text "${MUI_STARTMENUPAGE_TEXT_TOP}" /lastused "${MUI_STARTMENUPAGE_VARIABLE}" "${MUI_STARTMENUPAGE_DEFAULTFOLDER}"
+      !endif
+    mui.startmenu_initdone:
+
+  Pop $MUI_HWND
+
+  !ifdef MUI_STARTMENUPAGE_BGCOLOR
+    GetDlgItem $MUI_TEMP1 $MUI_HWND 1002
+    SetCtlColors $MUI_TEMP1 "" "${MUI_STARTMENUPAGE_BGCOLOR}"
+    GetDlgItem $MUI_TEMP1 $MUI_HWND 1004
+    SetCtlColors $MUI_TEMP1 "" "${MUI_STARTMENUPAGE_BGCOLOR}"
+  !endif
+
+  !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+
+  StartMenu::Show
+
+    Pop $MUI_TEMP1
+    StrCmp $MUI_TEMP1 "success" 0 +2
+      Pop "${MUI_STARTMENUPAGE_VARIABLE}"
+
+  FunctionEnd
+
+  Function "${LEAVE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+  FunctionEnd
+
+!macroend
+
+!macro MUI_FUNCTION_INSTFILESPAGE PRE SHOW LEAVE
+
+  Function "${PRE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLING_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLING_SUBTITLE)
+
+  FunctionEnd
+
+  Function "${SHOW}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+
+  FunctionEnd
+
+  Function "${LEAVE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+    !insertmacro MUI_ENDHEADER
+    !insertmacro MUI_LANGDLL_SAVELANGUAGE
+
+  FunctionEnd
+
+!macroend
+
+!macro MUI_FUNCTION_FINISHPAGE PRE LEAVE
+
+  Function "${PRE}"
+
+    !insertmacro MUI_WELCOMEFINISHPAGE_FUNCTION_CUSTOM
+
+    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT "ioSpecial.ini" "Settings" "NextButtonText" MUI_FINISHPAGE_BUTTON
+
+    !ifdef MUI_FINISHPAGE_CANCEL_ENABLED
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelEnabled" "1"
+    !endif
+
+    !ifndef MUI_FINISHPAGE_TITLE_3LINES
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 2" "Bottom" "38"
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Top" "45"
+    !else
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 2" "Bottom" "48"
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Top" "55"
+    !endif
+
+    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT "ioSpecial.ini" "Field 2" "Text" MUI_FINISHPAGE_TITLE
+
+    !ifdef MUI_FINISHPAGE_RUN | MUI_FINISHPAGE_SHOWREADME
+      !ifndef MUI_FINISHPAGE_TITLE_3LINES
+        !ifndef MUI_FINISHPAGE_TEXT_LARGE
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Bottom" "85"
+        !else
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Bottom" "115"
+        !endif
+      !else
+        !ifndef MUI_FINISHPAGE_TEXT_LARGE
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Bottom" "95"
+        !else
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Bottom" "125"
+        !endif
+      !endif
+    !else
+      !ifndef MUI_FINISHPAGE_LINK
+        !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Bottom" "185"
+      !else
+        !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Bottom" "175"
+      !endif
+    !endif
+
+    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT
+
+      IfRebootFlag 0 mui.finish_noreboot_init
+
+        !ifndef MUI_FINISHPAGE_TITLE_3LINES
+          !ifndef MUI_FINISHPAGE_TEXT_LARGE
+            !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Bottom" "85"
+          !else
+            !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Bottom" "115"
+          !endif
+        !else
+          !ifndef MUI_FINISHPAGE_TEXT_LARGE
+            !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Bottom" "95"
+          !else
+            !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Bottom" "125"
+          !endif
+        !endif
+
+        !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT "ioSpecial.ini" "Field 3" "Text" MUI_FINISHPAGE_TEXT_REBOOT
+
+        !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "Numfields" "5"
+
+        !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Type" "RadioButton"
+        !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT "ioSpecial.ini" "Field 4" "Text" MUI_FINISHPAGE_TEXT_REBOOTNOW
+        !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Left" "120"
+        !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Right" "321"
+        !ifndef MUI_FINISHPAGE_TITLE_3LINES
+          !ifndef MUI_FINISHPAGE_TEXT_LARGE
+            !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Top" "90"
+            !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Bottom" "100"
+          !else
+            !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Top" "120"
+            !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Bottom" "130"
+          !endif
+        !else
+          !ifndef MUI_FINISHPAGE_TEXT_LARGE
+            !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Top" "100"
+            !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Bottom" "110"
+          !else
+            !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Top" "130"
+            !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Bottom" "140"
+          !endif
+        !endif
+        !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Type" "RadioButton"
+        !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT "ioSpecial.ini" "Field 5" "Text" MUI_FINISHPAGE_TEXT_REBOOTLATER
+        !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Left" "120"
+        !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Right" "321"
+        !ifndef MUI_FINISHPAGE_TITLE_3LINES
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Top" "110"
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Bottom" "120"
+        !else
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Top" "110"
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Bottom" "120"
+        !endif
+        !ifdef MUI_FINISHPAGE_REBOOTLATER_DEFAULT
+		  !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "State" "0"
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "State" "1"
+        !else
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "State" "1"
+		  !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "State" "0"
+        !endif
+
+        Goto mui.finish_load
+
+      mui.finish_noreboot_init:
+
+    !endif
+
+    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT "ioSpecial.ini" "Field 3" "Text" MUI_FINISHPAGE_TEXT
+
+    !ifdef MUI_FINISHPAGE_RUN
+
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Type" "CheckBox"
+      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT "ioSpecial.ini" "Field 4" "Text" MUI_FINISHPAGE_RUN_TEXT
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Left" "120"
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Right" "315"
+      !ifndef MUI_FINISHPAGE_TITLE_3LINES
+        !ifndef MUI_FINISHPAGE_TEXT_LARGE
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Top" "90"
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Bottom" "100"
+        !else
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Top" "120"
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Bottom" "130"
+        !endif
+      !else
+        !ifndef MUI_FINISHPAGE_TEXT_LARGE
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Top" "100"
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Bottom" "110"
+        !else
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Top" "130"
+          !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Bottom" "140"
+        !endif
+      !endif
+      !ifndef MUI_FINISHPAGE_RUN_NOTCHECKED
+        !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "State" "1"
+      !endif
+
+    !endif
+
+    !ifdef MUI_FINISHPAGE_SHOWREADME
+
+      !ifdef MUI_FINISHPAGE_CURFIELD_NO
+        !undef MUI_FINISHPAGE_CURFIELD_NO
+      !endif
+
+      !ifndef MUI_FINISHPAGE_RUN
+        !define MUI_FINISHPAGE_CURFIELD_NO 4
+        !ifndef MUI_FINISHPAGE_TITLE_3LINES
+          !ifndef MUI_FINISHPAGE_TEXT_LARGE
+            !define MUI_FINISHPAGE_CURFIELD_TOP 90
+            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 100
+          !else
+            !define MUI_FINISHPAGE_CURFIELD_TOP 120
+            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 130
+          !endif
+        !else
+          !ifndef MUI_FINISHPAGE_TEXT_LARGE
+            !define MUI_FINISHPAGE_CURFIELD_TOP 100
+            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 110
+          !else
+            !define MUI_FINISHPAGE_CURFIELD_TOP 130
+            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 140
+          !endif
+        !endif
+      !else
+        !define MUI_FINISHPAGE_CURFIELD_NO 5
+        !ifndef MUI_FINISHPAGE_TITLE_3LINES
+          !ifndef MUI_FINISHPAGE_TEXT_LARGE
+            !define MUI_FINISHPAGE_CURFIELD_TOP 110
+            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 120
+          !else
+            !define MUI_FINISHPAGE_CURFIELD_TOP 140
+            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 150
+          !endif
+        !else
+          !ifndef MUI_FINISHPAGE_TEXT_LARGE
+            !define MUI_FINISHPAGE_CURFIELD_TOP 120
+            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 130
+          !else
+            !define MUI_FINISHPAGE_CURFIELD_TOP 150
+            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 160
+          !endif
+        !endif
+      !endif
+
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field ${MUI_FINISHPAGE_CURFIELD_NO}" "Type" "CheckBox"
+      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT "ioSpecial.ini" "Field ${MUI_FINISHPAGE_CURFIELD_NO}" "Text" MUI_FINISHPAGE_SHOWREADME_TEXT
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field ${MUI_FINISHPAGE_CURFIELD_NO}" "Left" "120"
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field ${MUI_FINISHPAGE_CURFIELD_NO}" "Right" "315"
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field ${MUI_FINISHPAGE_CURFIELD_NO}" "Top" ${MUI_FINISHPAGE_CURFIELD_TOP}
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field ${MUI_FINISHPAGE_CURFIELD_NO}" "Bottom" ${MUI_FINISHPAGE_CURFIELD_BOTTOM}
+      !ifndef MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
+         !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field ${MUI_FINISHPAGE_CURFIELD_NO}" "State" "1"
+      !endif
+
+    !endif
+
+    !ifdef MUI_FINISHPAGE_LINK
+
+      !ifdef MUI_FINISHPAGE_CURFIELD_NO
+        !undef MUI_FINISHPAGE_CURFIELD_NO
+      !endif
+
+      !ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME
+        !define MUI_FINISHPAGE_CURFIELD_NO 6
+      !else ifdef MUI_FINISHPAGE_RUN | MUI_FINISHPAGE_SHOWREADME
+        !define MUI_FINISHPAGE_CURFIELD_NO 5
+      !else
+        !define MUI_FINISHPAGE_CURFIELD_NO 4
+      !endif
+
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field ${MUI_FINISHPAGE_CURFIELD_NO}" "Type" "Link"
+      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT "ioSpecial.ini" "Field ${MUI_FINISHPAGE_CURFIELD_NO}" "Text" MUI_FINISHPAGE_LINK
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field ${MUI_FINISHPAGE_CURFIELD_NO}" "Left" "120"
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field ${MUI_FINISHPAGE_CURFIELD_NO}" "Right" "315"
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field ${MUI_FINISHPAGE_CURFIELD_NO}" "Top" "175"
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field ${MUI_FINISHPAGE_CURFIELD_NO}" "Bottom" "185"
+      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT "ioSpecial.ini" "Field ${MUI_FINISHPAGE_CURFIELD_NO}" "State" MUI_FINISHPAGE_LINK_LOCATION
+
+    !endif
+
+    !ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME & MUI_FINISHPAGE_LINK
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "Numfields" "6"
+    !else ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "Numfields" "5"
+    !else ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_LINK
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "Numfields" "5"
+    !else ifdef MUI_FINISHPAGE_SHOWREADME & MUI_FINISHPAGE_LINK
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "Numfields" "5"
+    !else ifdef MUI_FINISHPAGE_RUN | MUI_FINISHPAGE_SHOWREADME | MUI_FINISHPAGE_LINK
+      !insertmacro INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "Numfields" "4"
+    !endif
+
+    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT
+       mui.finish_load:
+    !endif
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+
+    LockWindow on
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028
+    ShowWindow $MUI_TEMP1 ${SW_HIDE}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256
+    ShowWindow $MUI_TEMP1 ${SW_HIDE}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1035
+    ShowWindow $MUI_TEMP1 ${SW_HIDE}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037
+    ShowWindow $MUI_TEMP1 ${SW_HIDE}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038
+    ShowWindow $MUI_TEMP1 ${SW_HIDE}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039
+    ShowWindow $MUI_TEMP1 ${SW_HIDE}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045
+    ShowWindow $MUI_TEMP1 ${SW_NORMAL}
+    LockWindow off
+
+    !insertmacro INSTALLOPTIONS_INITDIALOG "ioSpecial.ini"
+    Pop $MUI_HWND
+    SetCtlColors $MUI_HWND "" "${MUI_BGCOLOR}"
+
+    GetDlgItem $MUI_TEMP1 $MUI_HWND 1201
+    SetCtlColors $MUI_TEMP1 "" "${MUI_BGCOLOR}"
+
+    CreateFont $MUI_TEMP2 "$(^Font)" "12" "700"
+    SendMessage $MUI_TEMP1 ${WM_SETFONT} $MUI_TEMP2 0
+
+    GetDlgItem $MUI_TEMP1 $MUI_HWND 1202
+    SetCtlColors $MUI_TEMP1 "" "${MUI_BGCOLOR}"
+
+    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT
+
+      IfRebootFlag 0 mui.finish_noreboot_show
+
+        GetDlgItem $MUI_TEMP1 $MUI_HWND 1203
+        SetCtlColors $MUI_TEMP1 "" "${MUI_BGCOLOR}"
+
+        GetDlgItem $MUI_TEMP1 $MUI_HWND 1204
+        SetCtlColors $MUI_TEMP1 "" "${MUI_BGCOLOR}"
+
+        Goto mui.finish_show
+
+      mui.finish_noreboot_show:
+
+    !endif
+
+    !ifdef MUI_FINISHPAGE_RUN
+      GetDlgItem $MUI_TEMP1 $MUI_HWND 1203
+      SetCtlColors $MUI_TEMP1 "" "${MUI_BGCOLOR}"
+    !endif
+
+    !ifdef MUI_FINISHPAGE_SHOWREADME
+      !ifndef MUI_FINISHPAGE_RUN
+        GetDlgItem $MUI_TEMP1 $MUI_HWND 1203
+      !else
+        GetDlgItem $MUI_TEMP1 $MUI_HWND 1204
+      !endif
+      SetCtlColors $MUI_TEMP1 "" "${MUI_BGCOLOR}"
+    !endif
+
+    !ifdef MUI_FINISHPAGE_LINK
+      !ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME
+        GetDlgItem $MUI_TEMP1 $MUI_HWND 1205
+      !else ifdef MUI_FINISHPAGE_RUN | MUI_FINISHPAGE_SHOWREADME
+        GetDlgItem $MUI_TEMP1 $MUI_HWND 1204
+      !else
+        GetDlgItem $MUI_TEMP1 $MUI_HWND 1203
+      !endif
+      SetCtlColors $MUI_TEMP1 "${MUI_FINISHPAGE_LINK_COLOR}" "${MUI_BGCOLOR}"
+    !endif
+
+    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT
+      mui.finish_show:
+    !endif
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+
+    !ifdef MUI_FINISHPAGE_CANCEL_ENABLED
+      StrCpy $MUI_NOABORTWARNING "1"
+    !endif
+
+    !insertmacro INSTALLOPTIONS_SHOW
+
+    !ifdef MUI_FINISHPAGE_CANCEL_ENABLED
+      StrCpy $MUI_NOABORTWARNING ""
+    !endif
+
+    LockWindow on
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028
+    ShowWindow $MUI_TEMP1 ${SW_NORMAL}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256
+    ShowWindow $MUI_TEMP1 ${SW_NORMAL}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1035
+    ShowWindow $MUI_TEMP1 ${SW_NORMAL}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037
+    ShowWindow $MUI_TEMP1 ${SW_NORMAL}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038
+    ShowWindow $MUI_TEMP1 ${SW_NORMAL}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039
+    ShowWindow $MUI_TEMP1 ${SW_NORMAL}
+
+    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045
+    ShowWindow $MUI_TEMP1 ${SW_HIDE}
+    LockWindow off
+
+  FunctionEnd
+
+  Function "${LEAVE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT
+
+      IfRebootFlag "" mui.finish_noreboot_end
+
+        !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 "ioSpecial.ini" "Field 4" "State"
+
+          StrCmp $MUI_TEMP1 "1" 0 +2
+            Reboot
+
+          Return
+
+      mui.finish_noreboot_end:
+
+    !endif
+
+    !ifdef MUI_FINISHPAGE_RUN
+
+      !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 "ioSpecial.ini" "Field 4" "State"
+
+      StrCmp $MUI_TEMP1 "1" 0 mui.finish_norun
+        !ifndef MUI_FINISHPAGE_RUN_FUNCTION
+          !ifndef MUI_FINISHPAGE_RUN_PARAMETERS
+            StrCpy $MUI_TEMP1 "$\"${MUI_FINISHPAGE_RUN}$\""
+          !else
+            StrCpy $MUI_TEMP1 "$\"${MUI_FINISHPAGE_RUN}$\" ${MUI_FINISHPAGE_RUN_PARAMETERS}"
+          !endif
+          Exec "$MUI_TEMP1"
+        !else
+          Call "${MUI_FINISHPAGE_RUN_FUNCTION}"
+        !endif
+
+        mui.finish_norun:
+
+    !endif
+
+    !ifdef MUI_FINISHPAGE_SHOWREADME
+
+      !ifndef MUI_FINISHPAGE_RUN
+        !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 "ioSpecial.ini" "Field 4" "State"
+      !else
+        !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 "ioSpecial.ini" "Field 5" "State"
+      !endif
+
+      StrCmp $MUI_TEMP1 "1" 0 mui.finish_noshowreadme
+        !ifndef MUI_FINISHPAGE_SHOWREADME_FUNCTION
+           ExecShell "open" "${MUI_FINISHPAGE_SHOWREADME}"
+        !else
+          Call "${MUI_FINISHPAGE_SHOWREADME_FUNCTION}"
+        !endif
+
+        mui.finish_noshowreadme:
+
+    !endif
+
+  FunctionEnd
+
+!macroend
+
+!macro MUI_UNFUNCTION_CONFIRMPAGE PRE SHOW LEAVE
+
+  Function "${PRE}"
+
+   !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+   !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_UNTEXT_CONFIRM_TITLE) $(MUI_UNTEXT_CONFIRM_SUBTITLE)
+
+  FunctionEnd
+
+  Function "${SHOW}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+
+  FunctionEnd
+
+  Function "${LEAVE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+  FunctionEnd
+
+!macroend
+
+;--------------------------------
+;INSTALL OPTIONS (CUSTOM PAGES)
+
+!macro MUI_INSTALLOPTIONS_EXTRACT FILE
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro INSTALLOPTIONS_EXTRACT "${FILE}"
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_EXTRACT_AS FILE FILENAME
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro INSTALLOPTIONS_EXTRACT_AS "${FILE}" "${FILENAME}"
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_DISPLAY FILE
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro INSTALLOPTIONS_DISPLAY "${FILE}"
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_DISPLAY_RETURN FILE
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro INSTALLOPTIONS_DISPLAY_RETURN "${FILE}"
+  
+  !verbose pop
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_INITDIALOG FILE
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro INSTALLOPTIONS_INITDIALOG "${FILE}"
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_SHOW
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro INSTALLOPTIONS_SHOW
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_SHOW_RETURN
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro INSTALLOPTIONS_SHOW_RETURN
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_READ VAR FILE SECTION KEY
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro INSTALLOPTIONS_READ "${VAR}" "${FILE}" "${SECTION}" "${KEY}"
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_WRITE FILE SECTION KEY VALUE
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro INSTALLOPTIONS_WRITE "${FILE}" "${SECTION}" "${KEY}" "${VALUE}"
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT FILE SECTION KEY SYMBOL
+
+  ;Converts default strings from language files to InstallOptions format
+  ;Only for use inside MUI
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !ifndef "${SYMBOL}_DEFAULTSET"
+    !insertmacro INSTALLOPTIONS_WRITE "${FILE}" "${SECTION}" "${KEY}" "${${SYMBOL}}"
+  !else
+    Push "${${SYMBOL}}"
+    Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}Nsis2Io
+    Pop $MUI_TEMP1
+    !insertmacro INSTALLOPTIONS_WRITE "${FILE}" "${SECTION}" "${KEY}" $MUI_TEMP1
+  !endif
+
+  !verbose pop
+
+!macroend
+
+;--------------------------------
+;RESERVE FILES
+
+!macro MUI_RESERVEFILE_INSTALLOPTIONS
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_RESERVEFILE_LANGDLL
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  ReserveFile "${NSISDIR}\Plugins\LangDLL.dll"
+
+  !verbose pop
+
+!macroend
+
+;--------------------------------
+;LANGUAGES
+
+!macro MUI_LANGUAGE LANGUAGE
+
+  ;Include a language
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_INSERT
+
+  LoadLanguageFile "${NSISDIR}\Contrib\Language files\${LANGUAGE}.nlf"
+
+  ;Include language file
+  !insertmacro LANGFILE_INCLUDE_WITHDEFAULT "${NSISDIR}\Contrib\Language files\${LANGUAGE}.nsh" "${NSISDIR}\Contrib\Language files\English.nsh"
+
+  ;Add language to list of languages for selection dialog  
+  !ifndef MUI_LANGDLL_LANGUAGES
+    !define MUI_LANGDLL_LANGUAGES "'${LANGFILE_${LANGUAGE}_NAME}' '${LANG_${LANGUAGE}}' "
+    !define MUI_LANGDLL_LANGUAGES_CP "'${LANGFILE_${LANGUAGE}_NAME}' '${LANG_${LANGUAGE}}' '${LANG_${LANGUAGE}_CP}' "
+  !else
+    !ifdef MUI_LANGDLL_LANGUAGES_TEMP
+      !undef MUI_LANGDLL_LANGUAGES_TEMP
+    !endif
+    !define MUI_LANGDLL_LANGUAGES_TEMP "${MUI_LANGDLL_LANGUAGES}"
+    !undef MUI_LANGDLL_LANGUAGES
+
+	!ifdef MUI_LANGDLL_LANGUAGES_CP_TEMP
+      !undef MUI_LANGDLL_LANGUAGES_CP_TEMP
+    !endif
+    !define MUI_LANGDLL_LANGUAGES_CP_TEMP "${MUI_LANGDLL_LANGUAGES_CP}"
+    !undef MUI_LANGDLL_LANGUAGES_CP
+
+    !define MUI_LANGDLL_LANGUAGES "'${LANGFILE_${LANGUAGE}_NAME}' '${LANG_${LANGUAGE}}' ${MUI_LANGDLL_LANGUAGES_TEMP}"
+    !define MUI_LANGDLL_LANGUAGES_CP "'${LANGFILE_${LANGUAGE}_NAME}' '${LANG_${LANGUAGE}}' '${LANG_${LANGUAGE}_CP}' ${MUI_LANGDLL_LANGUAGES_CP_TEMP}"
+  !endif
+  
+  !verbose pop
+
+!macroend
+
+;--------------------------------
+;LANGUAGE SELECTION DIALOG
+
+!macro MUI_LANGDLL_DISPLAY
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_DEFAULT MUI_LANGDLL_WINDOWTITLE "Installer Language"
+  !insertmacro MUI_DEFAULT MUI_LANGDLL_INFO "Please select a language."
+
+  !ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME
+
+    ReadRegStr $MUI_TEMP1 "${MUI_LANGDLL_REGISTRY_ROOT}" "${MUI_LANGDLL_REGISTRY_KEY}" "${MUI_LANGDLL_REGISTRY_VALUENAME}"
+    StrCmp $MUI_TEMP1 "" mui.langdll_show
+      StrCpy $LANGUAGE $MUI_TEMP1
+      !ifndef MUI_LANGDLL_ALWAYSSHOW
+        Goto mui.langdll_done
+      !endif
+    mui.langdll_show:
+
+  !endif
+  
+  !ifdef NSIS_CONFIG_SILENT_SUPPORT
+    IfSilent mui.langdll_done
+  !endif  
+
+  !ifdef MUI_LANGDLL_ALLLANGUAGES
+    LangDLL::LangDialog "${MUI_LANGDLL_WINDOWTITLE}" "${MUI_LANGDLL_INFO}" A ${MUI_LANGDLL_LANGUAGES} ""
+  !else
+    LangDLL::LangDialog "${MUI_LANGDLL_WINDOWTITLE}" "${MUI_LANGDLL_INFO}" AC ${MUI_LANGDLL_LANGUAGES_CP} ""
+  !endif
+
+  Pop $LANGUAGE
+  StrCmp $LANGUAGE "cancel" 0 +2
+    Abort
+
+  !ifdef NSIS_CONFIG_SILENT_SUPPORT
+    mui.langdll_done:
+  !else ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME
+    mui.langdll_done:
+  !endif
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_LANGDLL_SAVELANGUAGE
+
+  !ifndef MUI_PAGE_UNINSTALLER
+
+    IfAbort mui.langdllsavelanguage_abort
+
+    !ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME
+      WriteRegStr "${MUI_LANGDLL_REGISTRY_ROOT}" "${MUI_LANGDLL_REGISTRY_KEY}" "${MUI_LANGDLL_REGISTRY_VALUENAME}" $LANGUAGE
+    !endif
+
+    mui.langdllsavelanguage_abort:
+
+  !endif
+
+!macroend
+
+!macro MUI_UNGETLANGUAGE
+
+  !verbose pop
+
+  !ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME
+
+    ReadRegStr $MUI_TEMP1 "${MUI_LANGDLL_REGISTRY_ROOT}" "${MUI_LANGDLL_REGISTRY_KEY}" "${MUI_LANGDLL_REGISTRY_VALUENAME}"
+    StrCmp $MUI_TEMP1 "" 0 mui.ungetlanguage_setlang
+
+  !endif
+
+  !insertmacro MUI_LANGDLL_DISPLAY
+
+  !ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME
+
+    Goto mui.ungetlanguage_done
+
+    mui.ungetlanguage_setlang:
+      StrCpy $LANGUAGE $MUI_TEMP1
+
+    mui.ungetlanguage_done:
+
+  !endif
+
+  !verbose pop
+
+!macroend
+
+;--------------------------------
+;END
+
+!endif
+
+!verbose pop
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Localization.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Localization.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Localization.nsh	(revision 728)
@@ -0,0 +1,192 @@
+/*
+
+NSIS Modern User Interface
+Localization
+
+*/
+
+;--------------------------------
+;Variables
+
+!macro MUI_LANGDLL_VARIABLES
+
+  !ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME
+    !ifndef MUI_LANGDLL_REGISTRY_VARAIBLES
+      !define MUI_LANGDLL_REGISTRY_VARAIBLES
+
+      ;/GLOBAL because the macros are included in a function
+      Var /GLOBAL mui.LangDLL.RegistryLanguage
+
+    !endif
+  !endif
+
+!macroend
+
+
+;--------------------------------
+;Include langauge files
+
+!macro MUI_LANGUAGE LANGUAGE
+
+  ;Include a language
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_INSERT
+
+  LoadLanguageFile "${NSISDIR}\Contrib\Language files\${LANGUAGE}.nlf"
+
+  ;Include language file
+  !insertmacro LANGFILE_INCLUDE_WITHDEFAULT "${NSISDIR}\Contrib\Language files\${LANGUAGE}.nsh" "${NSISDIR}\Contrib\Language files\English.nsh"
+
+  ;Add language to list of languages for selection dialog
+  !ifndef MUI_LANGDLL_LANGUAGES
+    !define MUI_LANGDLL_LANGUAGES "'${LANGFILE_${LANGUAGE}_NAME}' '${LANG_${LANGUAGE}}' "
+    !define MUI_LANGDLL_LANGUAGES_CP "'${LANGFILE_${LANGUAGE}_NAME}' '${LANG_${LANGUAGE}}' '${LANG_${LANGUAGE}_CP}' "
+  !else
+    !ifdef MUI_LANGDLL_LANGUAGES_TEMP
+      !undef MUI_LANGDLL_LANGUAGES_TEMP
+    !endif
+    !define MUI_LANGDLL_LANGUAGES_TEMP "${MUI_LANGDLL_LANGUAGES}"
+    !undef MUI_LANGDLL_LANGUAGES
+
+    !ifdef MUI_LANGDLL_LANGUAGES_CP_TEMP
+      !undef MUI_LANGDLL_LANGUAGES_CP_TEMP
+    !endif
+    !define MUI_LANGDLL_LANGUAGES_CP_TEMP "${MUI_LANGDLL_LANGUAGES_CP}"
+    !undef MUI_LANGDLL_LANGUAGES_CP
+
+    !define MUI_LANGDLL_LANGUAGES "'${LANGFILE_${LANGUAGE}_NAME}' '${LANG_${LANGUAGE}}' ${MUI_LANGDLL_LANGUAGES_TEMP}"
+    !define MUI_LANGDLL_LANGUAGES_CP "'${LANGFILE_${LANGUAGE}_NAME}' '${LANG_${LANGUAGE}}' '${LANG_${LANGUAGE}_CP}' ${MUI_LANGDLL_LANGUAGES_CP_TEMP}"
+  !endif
+
+  !verbose pop
+
+!macroend
+
+
+;--------------------------------
+;Language selection
+
+!macro MUI_LANGDLL_DISPLAY
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_LANGDLL_VARIABLES
+
+  !insertmacro MUI_DEFAULT MUI_LANGDLL_WINDOWTITLE "Installer Language"
+  !insertmacro MUI_DEFAULT MUI_LANGDLL_INFO "Please select a language."
+
+  !ifdef MUI_LANGDLL_REGISTRY_VARAIBLES
+
+    ReadRegStr $mui.LangDLL.RegistryLanguage "${MUI_LANGDLL_REGISTRY_ROOT}" "${MUI_LANGDLL_REGISTRY_KEY}" "${MUI_LANGDLL_REGISTRY_VALUENAME}"
+    
+    ${if} $mui.LangDLL.RegistryLanguage != ""
+      ;Set default langauge to registry language
+      StrCpy $LANGUAGE $mui.LangDLL.RegistryLanguage
+    ${endif}
+
+  !endif
+
+  !ifdef NSIS_CONFIG_SILENT_SUPPORT
+    ${unless} ${Silent}
+  !endif
+
+  !ifndef MUI_LANGDLL_ALWAYSSHOW
+  !ifdef MUI_LANGDLL_REGISTRY_VARAIBLES
+    ${if} $mui.LangDLL.RegistryLanguage == ""
+  !endif
+  !endif
+  
+  ;Show langauge selection dialog
+  !ifdef MUI_LANGDLL_ALLLANGUAGES
+    LangDLL::LangDialog "${MUI_LANGDLL_WINDOWTITLE}" "${MUI_LANGDLL_INFO}" A ${MUI_LANGDLL_LANGUAGES} ""
+  !else
+    LangDLL::LangDialog "${MUI_LANGDLL_WINDOWTITLE}" "${MUI_LANGDLL_INFO}" AC ${MUI_LANGDLL_LANGUAGES_CP} ""
+  !endif
+  
+    Pop $LANGUAGE
+    ${if} $LANGUAGE == "cancel"
+      Abort
+    ${endif}
+  
+  !ifndef MUI_LANGDLL_ALWAYSSHOW
+  !ifdef MUI_LANGDLL_REGISTRY_VARAIBLES
+    ${endif}
+  !endif
+  !endif
+
+
+  !ifdef NSIS_CONFIG_SILENT_SUPPORT
+    ${endif}
+  !endif
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_LANGDLL_SAVELANGUAGE
+
+  ;Save language in registry
+
+  !ifndef MUI_PAGE_UNINSTALLER
+
+    IfAbort mui.langdllsavelanguage_abort
+
+    !ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME
+      WriteRegStr "${MUI_LANGDLL_REGISTRY_ROOT}" "${MUI_LANGDLL_REGISTRY_KEY}" "${MUI_LANGDLL_REGISTRY_VALUENAME}" $LANGUAGE
+    !endif
+
+    mui.langdllsavelanguage_abort:
+
+  !endif
+
+!macroend
+
+!macro MUI_UNGETLANGUAGE
+
+  ;Get language from registry in uninstaller
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_LANGDLL_VARIABLES
+
+  !ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME
+
+    ReadRegStr $mui.LangDLL.RegistryLanguage "${MUI_LANGDLL_REGISTRY_ROOT}" "${MUI_LANGDLL_REGISTRY_KEY}" "${MUI_LANGDLL_REGISTRY_VALUENAME}"
+    
+    ${if} $mui.LangDLL.RegistryLanguage = ""
+
+  !endif
+
+  !insertmacro MUI_LANGDLL_DISPLAY
+
+  !ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME
+
+    ${else}
+      StrCpy $LANGUAGE $mui.LangDLL.RegistryLanguage
+    ${endif}
+
+  !endif
+
+  !verbose pop
+
+!macroend
+
+
+;--------------------------------
+;Rerserve LangDLL file
+
+!macro MUI_RESERVEFILE_LANGDLL
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  ReserveFile "${NSISDIR}\Plugins\LangDLL.dll"
+
+  !verbose pop
+
+!macroend
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/Welcome.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/Welcome.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/Welcome.nsh	(revision 728)
@@ -0,0 +1,180 @@
+/*
+
+NSIS Modern User Interface
+Welcome page (implemented using nsDialogs)
+
+*/
+
+;--------------------------------
+;Page interface settings and variables
+
+!macro MUI_WELCOMEPAGE_INTERFACE
+
+  !ifndef MUI_WELCOMEPAGE_INTERFACE
+    !define MUI_WELCOMEPAGE_INTERFACE
+    Var mui.WelcomePage
+        
+    Var mui.WelcomePage.Image
+    Var mui.WelcomePage.Image.Bitmap
+    
+    Var mui.WelcomePage.Title
+    Var mui.WelcomePage.Title.Font
+    
+    Var mui.WelcomePage.Text    
+  !endif
+  
+  !insertmacro MUI_DEFAULT MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp"  
+
+!macroend
+
+
+;--------------------------------
+;Interface initialization
+
+!macro MUI_WELCOMEPAGE_GUIINIT
+
+  !ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEWELCOMEPAGE_GUINIT
+    !define MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEWELCOMEPAGE_GUINIT
+
+    Function ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePage.GUIInit
+      
+      InitPluginsDir
+      File "/oname=$PLUGINSDIR\modern-wizard.bmp" "${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP}"
+    
+      !ifdef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT
+        Call "${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT}"
+      !endif   
+    
+    FunctionEnd
+  
+    !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePage.GUIInit
+
+  !endif
+
+!macroend
+
+
+;--------------------------------
+;Page declaration
+
+!macro MUI_PAGEDECLARATION_WELCOME
+
+  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEPAGE ""
+  !insertmacro MUI_WELCOMEPAGE_INTERFACE
+  
+  !insertmacro MUI_WELCOMEPAGE_GUIINIT
+
+  !insertmacro MUI_DEFAULT MUI_WELCOMEPAGE_TITLE "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TITLE)"
+  !insertmacro MUI_DEFAULT MUI_WELCOMEPAGE_TEXT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TEXT)"
+  
+  !insertmacro MUI_PAGE_FUNCTION_FULLWINDOW
+
+  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom
+
+    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomeLeave_${MUI_UNIQUEID}
+
+  PageExEnd
+
+  !insertmacro MUI_FUNCTION_WELCOMEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomeLeave_${MUI_UNIQUEID}
+
+  !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE
+  !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE_3LINES
+  !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TEXT
+
+!macroend
+
+!macro MUI_PAGE_WELCOME
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_PAGE_INIT
+  !insertmacro MUI_PAGEDECLARATION_WELCOME
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNPAGE_WELCOME
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_UNPAGE_INIT
+  !insertmacro MUI_PAGEDECLARATION_WELCOME
+
+  !verbose pop
+
+!macroend
+
+
+;--------------------------------
+;Page functions
+
+!macro MUI_FUNCTION_WELCOMEPAGE PRE LEAVE
+
+  Function "${PRE}"
+  
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE  
+
+    ;Create dialog
+    nsDialogs::Create 1044
+    Pop $mui.WelcomePage
+    nsDialogs::SetRTL $(^RTL)
+    SetCtlColors $mui.WelcomePage "" "${MUI_BGCOLOR}"    
+
+    ;Image control
+    ${NSD_CreateBitmap} 0u 0u 109u 193u ""
+    Pop $mui.WelcomePage.Image
+    !ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
+      ${NSD_SetStretchedImage} $mui.WelcomePage.Image $PLUGINSDIR\modern-wizard.bmp $mui.WelcomePage.Image.Bitmap
+    !else
+      ${NSD_SetImage} $mui.WelcomePage.Image $PLUGINSDIR\modern-wizard.bmp $mui.WelcomePage.Image.Bitmap
+    !endif
+
+    ;Positiong of controls
+
+    ;Title    
+    !ifndef MUI_WELCOMEPAGE_TITLE_3LINES
+      !define MUI_WELCOMEPAGE_TITLE_HEIGHT 28
+    !else
+      !define MUI_WELCOMEPAGE_TITLE_HEIGHT 38
+    !endif
+    
+    ;Text
+    ;17 = 10 (top margin) + 7 (distance between texts)
+    !define /math MUI_WELCOMEPAGE_TEXT_TOP 17 + ${MUI_WELCOMEPAGE_TITLE_HEIGHT}
+
+    ;Title
+    ${NSD_CreateLabel} 120u 10u 195u ${MUI_WELCOMEPAGE_TITLE_HEIGHT}u "${MUI_WELCOMEPAGE_TITLE}"
+    Pop $mui.WelcomePage.Title
+    SetCtlColors $mui.WelcomePage.Title "" "${MUI_BGCOLOR}"    
+    CreateFont $mui.WelcomePage.Title.Font "$(^Font)" "12" "700"
+    SendMessage $mui.WelcomePage.Title ${WM_SETFONT} $mui.WelcomePage.Title.Font 0
+
+    ;Welcome text
+    ${NSD_CreateLabel} 120u ${MUI_WELCOMEPAGE_TEXT_TOP}u 195u 130u "${MUI_WELCOMEPAGE_TEXT}"
+    Pop $mui.WelcomePage.Text
+    SetCtlColors $mui.WelcomePage.Text "" "${MUI_BGCOLOR}"
+
+    ;Show page
+    Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageLoadFullWindow
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+    nsDialogs::Show
+    Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageUnloadFullWindow    
+
+    ;Delete image from memory
+    ${NSD_FreeImage} $mui.WelcomePage.Image.Bitmap
+
+    !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE_HEIGHT
+    !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TEXT_TOP
+    
+  FunctionEnd
+
+  Function "${LEAVE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+  FunctionEnd
+
+!macroend
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/Finish.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/Finish.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/Finish.nsh	(revision 728)
@@ -0,0 +1,491 @@
+ /*
+
+NSIS Modern User Interface
+Finish page (implemented using nsDialogs)
+
+*/
+
+;--------------------------------
+;Page interface settings and variables
+
+!macro MUI_FINISHPAGE_INTERFACE
+
+  !ifndef MUI_FINISHPAGE_INTERFACE
+    !define MUI_FINISHPAGE_INTERFACE
+    Var mui.FinishPage
+        
+    Var mui.FinishPage.Image
+    Var mui.FinishPage.Image.Bitmap
+    
+    Var mui.FinishPage.Title
+    Var mui.FinishPage.Title.Font
+    
+    Var mui.FinishPage.Text
+  !endif
+
+  !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT
+    !ifndef MUI_FINISHPAGE_RETURNVALUE_VARIABLES
+      !define MUI_FINISHPAGE_RETURNVALUE_VARIABLES
+      Var mui.FinishPage.ReturnValue
+    !endif
+  !else ifdef MUI_FINISHPAGE_RUN | MUI_FINISHPAGE_SHOWREADME
+    !ifndef MUI_FINISHPAGE_RETURNVALUE_VARIABLES
+      !define MUI_FINISHPAGE_RETURNVALUE_VARIABLES
+      Var mui.FinishPage.ReturnValue
+    !endif 
+  !endif
+    
+  !ifdef MUI_FINISHPAGE_CANCEL_ENABLED
+    !ifndef MUI_FINISHPAGE_CANCEL_ENABLED_VARIABLES
+      !define MUI_FINISHPAGE_CANCEL_ENABLED_VARIABLES
+      Var mui.FinishPage.DisableAbortWarning
+    !endif  
+  !endif
+  
+  !ifdef MUI_FINISHPAGE_RUN
+    !ifndef MUI_FINISHPAGE_RUN_VARIABLES
+      !define MUI_FINISHPAGE_RUN_VARIABLES
+      Var mui.FinishPage.Run
+    !endif
+  !endif
+  
+  !ifdef MUI_FINISHPAGE_SHOWREADME
+    !ifndef MUI_FINISHPAGE_SHOREADME_VARAIBLES
+      !define MUI_FINISHPAGE_SHOREADME_VARAIBLES
+      Var mui.FinishPage.ShowReadme
+    !endif
+  !endif
+  
+  !ifdef MUI_FINISHPAGE_LINK
+    !ifndef MUI_FINISHPAGE_LINK_VARIABLES
+      !define MUI_FINISHPAGE_LINK_VARIABLES
+      Var mui.FinishPage.Link
+    !endif
+  !endif
+  
+  !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT
+    !ifndef MUI_FINISHPAGE_REBOOT_VARIABLES
+      !define MUI_FINISHPAGE_REBOOT_VARIABLES
+      Var mui.FinishPage.RebootNow
+      Var mui.FinishPage.RebootLater
+    !endif
+  !endif
+
+  !insertmacro MUI_DEFAULT MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp"  
+
+!macroend
+
+
+;--------------------------------
+;Interface initialization
+
+!macro MUI_FINISHPAGE_GUIINIT
+
+  !ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_GUINIT
+    !define MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_GUINIT
+
+    Function ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.GUIInit
+  
+      InitPluginsDir  
+      File "/oname=$PLUGINSDIR\modern-wizard.bmp" "${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP}"
+    
+      !ifdef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT
+        Call "${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT}"
+      !endif
+      
+      !ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}FINISHPAGE_NOAUTOCLOSE
+        SetAutoClose true
+      !endif
+    
+    FunctionEnd
+  
+    !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.GUIInit
+    
+  !endif    
+
+!macroend
+
+
+;--------------------------------
+;Abort warning
+
+!macro MUI_FINISHPAGE_ABORTWARNING
+
+  !ifdef MUI_FINISHPAGE_CANCEL_ENABLED
+  
+    !ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}FINISHPAGE_ABORTWARNING
+      !define MUI_${MUI_PAGE_UNINSTALLER_PREFIX}FINISHPAGE_ABORTWARNING
+
+      Function ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.AbortWarning
+
+        ${if} $mui.FinishPage.DisableAbortWarning == "1"
+          Quit
+        ${endif}
+      
+        !ifdef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_ABORTWARNING
+          Call ${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_ABORTWARNING}
+        !endif
+  
+      FunctionEnd
+    
+      !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_ABORTWARNING ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.AbortWarning
+    
+    !endif
+  
+  !endif
+
+!macroend
+
+
+;--------------------------------
+;Page declaration
+
+!macro MUI_PAGEDECLARATION_FINISH
+
+  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}FINISHPAGE ""
+  !insertmacro MUI_FINISHPAGE_INTERFACE
+  
+  !insertmacro MUI_FINISHPAGE_GUIINIT
+  !insertmacro MUI_FINISHPAGE_ABORTWARNING
+
+  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_TITLE "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_INFO_TITLE)"
+  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_TEXT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_INFO_TEXT)"
+  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_BUTTON "$(MUI_BUTTONTEXT_FINISH)"
+  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_TEXT_REBOOT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_INFO_REBOOT)"
+  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_TEXT_REBOOTNOW "$(MUI_TEXT_FINISH_REBOOTNOW)"
+  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_TEXT_REBOOTLATER "$(MUI_TEXT_FINISH_REBOOTLATER)"
+  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_RUN_TEXT "$(MUI_TEXT_FINISH_RUN)"
+  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_SHOWREADME_TEXT "$(MUI_TEXT_FINISH_SHOWREADME)"
+  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_LINK_COLOR "000080"
+
+  !insertmacro MUI_PAGE_FUNCTION_FULLWINDOW
+
+  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom
+
+    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.Pre_${MUI_UNIQUEID} \
+      ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.Leave_${MUI_UNIQUEID}
+
+    Caption " "
+
+  PageExEnd
+
+  !insertmacro MUI_FUNCTION_FINISHPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.Pre_${MUI_UNIQUEID} \
+    ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.Leave_${MUI_UNIQUEID} \
+    ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.Link_${MUI_UNIQUEID}
+
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_TITLE
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_TITLE_3LINES
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_LARGE
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_BUTTON
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_CANCEL_ENABLED
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_REBOOT
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_REBOOTNOW
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_REBOOTLATER
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_REBOOTLATER_DEFAULT
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_TEXT
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_PARAMETERS
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_NOTCHECKED
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_FUNCTION
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_TEXT
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_FUNCTION
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_LINK
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_LINK_LOCATION
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_LINK_COLOR
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_NOREBOOTSUPPORT
+
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_ABORTWARNINGCHECK
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_CURFIELD_TOP
+  !insertmacro MUI_UNSET MUI_FINISHPAGE_CURFIELD_BOTTOM
+
+!macroend
+
+!macro MUI_PAGE_FINISH
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_PAGE_INIT
+  !insertmacro MUI_PAGEDECLARATION_FINISH
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNPAGE_FINISH
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_UNPAGE_INIT
+  !insertmacro MUI_PAGEDECLARATION_FINISH
+
+  !verbose pop
+
+!macroend
+
+
+;--------------------------------
+;Page functions
+
+!macro MUI_FUNCTION_FINISHPAGE PRE LEAVE LINK
+
+  !ifdef MUI_FINISHPAGE_LINK
+  
+  Function "${LINK}"
+  
+    ExecShell open "${MUI_FINISHPAGE_LINK_LOCATION}"
+  
+  FunctionEnd
+  
+  !endif
+  
+  Function "${PRE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+
+    ;Set text on Next button
+    SendMessage $mui.Button.Next ${WM_SETTEXT} 0 "STR:${MUI_FINISHPAGE_BUTTON}"
+    
+    ;Enable cancel button if set in script
+    !ifdef MUI_FINISHPAGE_CANCEL_ENABLED
+      EnableWindow $mui.Button.Cancel 1
+    !endif
+    
+    ;Create dialog
+    nsDialogs::Create 1044
+    Pop $mui.FinishPage
+    nsDialogs::SetRTL $(^RTL)
+    SetCtlColors $mui.FinishPage "" "${MUI_BGCOLOR}"
+
+    ;Image control
+    ${NSD_CreateBitmap} 0u 0u 109u 193u ""
+    Pop $mui.FinishPage.Image
+    !ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
+      ${NSD_SetStretchedImage} $mui.FinishPage.Image $PLUGINSDIR\modern-wizard.bmp $mui.FinishPage.Image.Bitmap
+    !else
+      ${NSD_SetImage} $mui.FinishPage.Image $PLUGINSDIR\modern-wizard.bmp $mui.FinishPage.Image.Bitmap
+    !endif
+    
+    ;Positiong of controls
+
+    ;Title    
+    !ifndef MUI_FINISHPAGE_TITLE_3LINES
+      !define MUI_FINISHPAGE_TITLE_HEIGHT 28
+    !else
+      !define MUI_FINISHPAGE_TITLE_HEIGHT 38
+    !endif
+    
+    ;Text
+    ;17 = 10 (top margin) + 7 (distance between texts)
+    !define /math MUI_FINISHPAGE_TEXT_TOP 17 + ${MUI_FINISHPAGE_TITLE_HEIGHT}
+    
+    ;Height if space required for radio buttons or check boxes
+    !ifndef MUI_FINISHPAGE_TEXT_LARGE
+      !define MUI_FINISHPAGE_TEXT_HEIGHT_BUTTONS 40
+    !else
+      !define MUI_FINISHPAGE_TEXT_HEIGHT_BUTTONS 60
+    !endif
+    
+    !define /math MUI_FINISHPAGE_TEXT_BOTTOM_BUTTONS ${MUI_FINISHPAGE_TEXT_TOP} + ${MUI_FINISHPAGE_TEXT_HEIGHT_BUTTONS}
+    
+    ;Positioning of radio buttons to ask for a reboot
+    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT
+      !define /math MUI_FINISHPAGE_REBOOTNOW_TOP ${MUI_FINISHPAGE_TEXT_BOTTOM_BUTTONS} + 5 ;Distance between text and options
+      ;25 = 10 (height of first radio button) + 15 (distance between buttons)
+      !define /math MUI_FINISHPAGE_REBOOTLATER_TOP ${MUI_FINISHPAGE_REBOOTNOW_TOP} + 25
+    !endif
+    
+    ;Positioning of checkboxes
+    !ifdef MUI_FINISHPAGE_RUN
+      !define /math MUI_FINISHPAGE_RUN_TOP ${MUI_FINISHPAGE_TEXT_BOTTOM_BUTTONS} + 5 ;Distance between text and options 
+    !endif
+    !ifdef MUI_FINISHPAGE_SHOWREADME
+      !ifdef MUI_FINISHPAGE_RUN
+        ;25 = 10 (height of run checkbox) + 10 (distance between checkboxes)
+        !define /math MUI_FINISHPAGE_SHOWREADME_TOP ${MUI_FINISHPAGE_RUN_TOP} + 20
+      !else
+        !define /math MUI_FINISHPAGE_SHOWREADME_TOP ${MUI_FINISHPAGE_TEXT_BOTTOM_BUTTONS} + 5 ;Distance between text and options    
+      !endif
+    !endif
+
+    !ifndef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME
+      ;Height if full space is available for text and link
+      !ifndef MUI_FINISHPAGE_LINK
+        !define MUI_FINISHPAGE_TEXT_HEIGHT 130
+      !else
+        !define MUI_FINISHPAGE_TEXT_HEIGHT 120
+      !endif
+    !endif 
+    
+    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT
+
+      ${if} ${RebootFlag}
+
+        ;Title text
+        ${NSD_CreateLabel} 120u 10u 195u ${MUI_FINISHPAGE_TITLE_HEIGHT}u "${MUI_FINISHPAGE_TITLE}"
+        Pop $mui.FinishPage.Title
+        SetCtlColors $mui.FinishPage.Title "" "${MUI_BGCOLOR}"
+        CreateFont $mui.FinishPage.Title.Font "$(^Font)" "12" "700"
+        SendMessage $mui.FinishPage.Title ${WM_SETFONT} $mui.FinishPage.Title.Font 0
+
+        ;Finish text
+        ${NSD_CreateLabel} 120u 45u 195u ${MUI_FINISHPAGE_TEXT_HEIGHT_BUTTONS}u "${MUI_FINISHPAGE_TEXT_REBOOT}"
+        Pop $mui.FinishPage.Text
+        SetCtlColors $mui.FinishPage.Text "" "${MUI_BGCOLOR}"
+      
+        ;Radio buttons for reboot page
+        ${NSD_CreateRadioButton} 120u ${MUI_FINISHPAGE_REBOOTNOW_TOP}u 195u 10u "${MUI_FINISHPAGE_TEXT_REBOOTNOW}"
+        Pop $mui.FinishPage.RebootNow
+        SetCtlColors $mui.FinishPage.RebootNow "" "${MUI_BGCOLOR}"        
+        ${NSD_CreateRadioButton} 120u ${MUI_FINISHPAGE_REBOOTLATER_TOP}u 195u 10u "${MUI_FINISHPAGE_TEXT_REBOOTLATER}"
+        Pop $mui.FinishPage.RebootLater
+        SetCtlColors $mui.FinishPage.RebootLater "" "${MUI_BGCOLOR}"
+        !ifndef MUI_FINISHPAGE_REBOOTLATER_DEFAULT
+          SendMessage $mui.FinishPage.RebootNow ${BM_SETCHECK} ${BST_CHECKED} 0
+        !else
+          SendMessage $mui.FinishPage.RebootLater ${BM_SETCHECK} ${BST_CHECKED} 0
+        !endif
+        ${NSD_SetFocus} $mui.FinishPage.RebootNow
+
+      ${else}
+
+    !endif
+        
+        ;Title text
+        ${NSD_CreateLabel} 120u 10u 195u ${MUI_FINISHPAGE_TITLE_HEIGHT}u "${MUI_FINISHPAGE_TITLE}"
+        Pop $mui.FinishPage.Title
+        SetCtlColors $mui.FinishPage.Title "" "${MUI_BGCOLOR}"
+        CreateFont $mui.FinishPage.Title.Font "$(^Font)" "12" "700"
+        SendMessage $mui.FinishPage.Title ${WM_SETFONT} $mui.FinishPage.Title.Font 0
+
+        ;Finish text
+        !ifndef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME
+          ${NSD_CreateLabel} 120u ${MUI_FINISHPAGE_TEXT_TOP}u 195u ${MUI_FINISHPAGE_TEXT_HEIGHT}u "${MUI_FINISHPAGE_TEXT}"
+        !else
+          ${NSD_CreateLabel} 120u ${MUI_FINISHPAGE_TEXT_TOP}u 195u ${MUI_FINISHPAGE_TEXT_HEIGHT_BUTTONS}u "${MUI_FINISHPAGE_TEXT}"
+        !endif
+        Pop $mui.FinishPage.Text
+        SetCtlColors $mui.FinishPage.Text "" "${MUI_BGCOLOR}"
+    
+        ;Checkboxes
+        !ifdef MUI_FINISHPAGE_RUN
+          ${NSD_CreateCheckbox} 120u ${MUI_FINISHPAGE_RUN_TOP}u 195u 10u "${MUI_FINISHPAGE_RUN_TEXT}"
+          Pop $mui.FinishPage.Run
+          SetCtlColors $mui.FinishPage.Run "" "${MUI_BGCOLOR}"
+          !ifndef MUI_FINISHPAGE_RUN_NOTCHECKED
+            SendMessage $mui.FinishPage.Run ${BM_SETCHECK} ${BST_CHECKED} 0
+          !endif
+          ${NSD_SetFocus} $mui.FinishPage.Run
+        !endif
+        !ifdef MUI_FINISHPAGE_SHOWREADME
+          ${NSD_CreateCheckbox} 120u ${MUI_FINISHPAGE_SHOWREADME_TOP}u 195u 10u "${MUI_FINISHPAGE_SHOWREADME_TEXT}"
+          Pop $mui.FinishPage.ShowReadme
+          SetCtlColors $mui.FinishPage.ShowReadme "" "${MUI_BGCOLOR}"
+          !ifndef MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
+            SendMessage $mui.FinishPage.ShowReadme ${BM_SETCHECK} ${BST_CHECKED} 0
+          !endif
+          !ifndef MUI_FINISHPAGE_RUN
+            ${NSD_SetFocus} $mui.FinishPage.ShowReadme
+          !endif
+        !endif
+    
+        ;Link
+        !ifdef MUI_FINISHPAGE_LINK
+          ${NSD_CreateLink} 120u 175u 195u 10u "${MUI_FINISHPAGE_LINK}"
+          Pop $mui.FinishPage.Link
+          SetCtlColors $mui.FinishPage.Link "${MUI_FINISHPAGE_LINK_COLOR}" "${MUI_BGCOLOR}"
+          ${NSD_OnClick} $mui.FinishPage.Link "${LINK}"
+        !endif
+        
+    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT        
+      ${endif}
+    !endif
+
+    !ifdef MUI_FINISHPAGE_CANCEL_ENABLED
+      StrCpy $mui.FinishPage.DisableAbortWarning "1"
+    !endif
+
+    ;Show page
+    Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageLoadFullWindow
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+    nsDialogs::Show
+    Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageUnloadFullWindow 
+    
+    !ifdef MUI_FINISHPAGE_CANCEL_ENABLED
+      StrCpy $mui.FinishPage.DisableAbortWarning ""
+    !endif
+    
+    ;Delete image from memory
+    ${NSD_FreeImage} $mui.FinishPage.Image.Bitmap
+    
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_TITLE_HEIGHT
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_TOP
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_HEIGHT
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_HEIGHT_BUTTONS
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_BOTTOM_BUTTONS
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_REBOOTNOW_TOP
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_REBOOTLATER_TOP
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_TOP
+    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_TOP
+
+  FunctionEnd
+
+  Function "${LEAVE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT
+
+      ;Check whether the user has chosen to reboot the computer
+      ${if} ${RebootFlag}
+        SendMessage $mui.FinishPage.RebootNow ${BM_GETCHECK} 0 0 $mui.FinishPage.ReturnValue
+        ${if} $mui.FinishPage.ReturnValue = ${BST_CHECKED}
+          Reboot
+        ${else}
+          Return
+        ${endif}
+      ${endif}
+
+    !endif
+
+    ;Run functions depending on checkbox state 
+
+    !ifdef MUI_FINISHPAGE_RUN
+    
+      SendMessage $mui.FinishPage.Run ${BM_GETCHECK} 0 0 $mui.FinishPage.ReturnValue
+
+      ${if} $mui.FinishPage.ReturnValue = ${BST_CHECKED}
+        !ifndef MUI_FINISHPAGE_RUN_FUNCTION
+          !ifndef MUI_FINISHPAGE_RUN_PARAMETERS
+            Exec "$\"${MUI_FINISHPAGE_RUN}$\""
+          !else
+            Exec "$\"${MUI_FINISHPAGE_RUN}$\" ${MUI_FINISHPAGE_RUN_PARAMETERS}"
+          !endif
+        !else
+          Call "${MUI_FINISHPAGE_RUN_FUNCTION}"
+        !endif
+      ${endif}
+
+    !endif
+
+    !ifdef MUI_FINISHPAGE_SHOWREADME
+
+      SendMessage $mui.FinishPage.ShowReadme ${BM_GETCHECK} 0 0 $mui.FinishPage.ReturnValue
+
+      ${if} $mui.FinishPage.ReturnValue = ${BST_CHECKED}
+        !ifndef MUI_FINISHPAGE_SHOWREADME_FUNCTION
+          ExecShell open "${MUI_FINISHPAGE_SHOWREADME}"
+        !else
+          Call "${MUI_FINISHPAGE_SHOWREADME_FUNCTION}"
+        !endif
+      ${endif}
+
+    !endif
+
+  FunctionEnd
+
+!macroend
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/License.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/License.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/License.nsh	(revision 728)
@@ -0,0 +1,145 @@
+/*
+
+NSIS Modern User Interface
+License page
+
+*/
+
+;--------------------------------
+;Page interface settings and variables
+
+!macro MUI_LICENSEPAGE_INTERFACE
+
+  !ifndef MUI_LICENSEPAGE_INTERFACE
+    !define MUI_LICENSEPAGE_INTERFACE
+    Var mui.LicensePage
+    
+    Var mui.Licensepage.TopText
+    Var mui.Licensepage.Text
+    Var mui.Licensepage.LicenseText
+    
+    !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_BGCOLOR "/windows"
+    
+    ;Apply settings
+    LicenseBkColor "${MUI_LICENSEPAGE_BGCOLOR}"
+  !endif
+
+!macroend
+
+
+;--------------------------------
+;Page declaration
+
+!macro MUI_PAGEDECLARATION_LICENSE LICENSEDATA
+
+  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}LICENSEPAGE ""
+  !insertmacro MUI_LICENSEPAGE_INTERFACE  
+
+  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_TEXT_TOP "$(MUI_INNERTEXT_LICENSE_TOP)"
+  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_BUTTON ""
+  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_CHECKBOX_TEXT ""
+  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT ""
+  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE ""
+
+  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}license
+
+    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicensePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseLeave_${MUI_UNIQUEID}
+
+    Caption " "
+
+    LicenseData "${LICENSEDATA}"
+
+    !ifndef MUI_LICENSEPAGE_TEXT_BOTTOM
+      !ifndef MUI_LICENSEPAGE_CHECKBOX & MUI_LICENSEPAGE_RADIOBUTTONS
+        LicenseText "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_LICENSE_BOTTOM)" "${MUI_LICENSEPAGE_BUTTON}"
+      !else ifdef MUI_LICENSEPAGE_CHECKBOX
+        LicenseText "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_LICENSE_BOTTOM_CHECKBOX)" "${MUI_LICENSEPAGE_BUTTON}"
+      !else
+        LicenseText "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS)" "${MUI_LICENSEPAGE_BUTTON}"
+      !endif
+    !else
+      LicenseText "${MUI_LICENSEPAGE_TEXT_BOTTOM}" "${MUI_LICENSEPAGE_BUTTON}"
+    !endif
+
+    !ifdef MUI_LICENSEPAGE_CHECKBOX
+      LicenseForceSelection checkbox "${MUI_LICENSEPAGE_CHECKBOX_TEXT}"
+    !else ifdef MUI_LICENSEPAGE_RADIOBUTTONS
+      LicenseForceSelection radiobuttons "${MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT}" "${MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE}"
+    !endif
+
+  PageExEnd
+
+  !insertmacro MUI_FUNCTION_LICENSEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicensePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseLeave_${MUI_UNIQUEID}
+
+  !insertmacro MUI_UNSET MUI_LICENSEPAGE_TEXT_TOP
+  !insertmacro MUI_UNSET MUI_LICENSEPAGE_TEXT_BOTTOM
+  !insertmacro MUI_UNSET MUI_LICENSEPAGE_BUTTON
+  !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX
+    !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX_TEXT
+  !insertmacro MUI_UNSET MUI_LICENSEPAGE_RADIOBUTTONS
+    !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX_TEXT_ACCEPT
+    !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX_TEXT_DECLINE
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_PAGE_LICENSE LICENSEDATA
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_PAGE_INIT
+  !insertmacro MUI_PAGEDECLARATION_LICENSE "${LICENSEDATA}"
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNPAGE_LICENSE LICENSEDATA
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_UNPAGE_INIT
+  !insertmacro MUI_PAGEDECLARATION_LICENSE "${LICENSEDATA}"
+
+  !verbose pop
+
+!macroend
+
+
+;--------------------------------
+;Page functions
+
+!macro MUI_FUNCTION_LICENSEPAGE PRE SHOW LEAVE
+
+  Function "${PRE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_LICENSE_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_LICENSE_SUBTITLE)
+
+  FunctionEnd
+
+  Function "${SHOW}"
+
+    ;Get conrol handles
+    FindWindow $mui.LicensePage "#32770" "" $HWNDPARENT
+    GetDlgItem $mui.LicensePage.TopText $mui.LicensePage 1040
+    GetDlgItem $mui.LicensePage.Text $mui.LicensePage 1006
+    GetDlgItem $mui.LicensePage.LicenseText $mui.LicensePage 1000
+    
+    ;Top text
+    SendMessage $mui.LicensePage.TopText ${WM_SETTEXT} 0 "STR:${MUI_LICENSEPAGE_TEXT_TOP}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+
+  FunctionEnd
+
+  Function "${LEAVE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+  FunctionEnd
+
+!macroend
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/StartMenu.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/StartMenu.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/StartMenu.nsh	(revision 728)
@@ -0,0 +1,235 @@
+/*
+
+NSIS Modern User Interface
+Start Menu folder page
+
+*/
+
+;--------------------------------
+;Page interface settings and variables
+
+!macro MUI_STARTMENUPAGE_INTERFACE
+
+  !ifndef MUI_STARTMENUPAGE_INTERFACE
+    !define MUI_STARTMENUPAGE_INTERFACE
+    Var mui.StartMenuPage
+    Var mui.StartMenuPage.Location
+    Var mui.StartMenuPage.FolderList
+
+    Var mui.StartMenuPage.Temp
+  !endif
+
+  !ifdef MUI_STARTMENUPAGE_REGISTRY_ROOT & MUI_STARTMENUPAGE_REGISTRY_KEY & MUI_STARTMENUPAGE_REGISTRY_VALUENAME
+    !ifndef MUI_STARTMENUPAGE_REGISTRY_VARIABLES
+      !define MUI_STARTMENUPAGE_REGISTRY_VARIABLES
+        Var mui.StartMenuPage.RegistryLocation
+    !endif
+  !endif
+
+!macroend
+
+
+;--------------------------------
+;Page declaration
+
+!macro MUI_PAGEDECLARATION_STARTMENU ID VAR
+
+  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}STARTMENUPAGE ""
+  !insertmacro MUI_STARTMENUPAGE_INTERFACE  
+
+  !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_DEFAULTFOLDER "$(^Name)"
+  !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_TEXT_TOP "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_STARTMENU_TOP)"
+  !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_TEXT_CHECKBOX "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_STARTMENU_CHECKBOX)"
+
+  !define MUI_STARTMENUPAGE_VARIABLE "${VAR}"
+  !define "MUI_STARTMENUPAGE_${ID}_VARIABLE" "${MUI_STARTMENUPAGE_VARIABLE}"
+  !define "MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER" "${MUI_STARTMENUPAGE_DEFAULTFOLDER}"
+  !ifdef MUI_STARTMENUPAGE_REGISTRY_ROOT
+    !define "MUI_STARTMENUPAGE_${ID}_REGISTRY_ROOT" "${MUI_STARTMENUPAGE_REGISTRY_ROOT}"
+  !endif
+  !ifdef MUI_STARTMENUPAGE_REGISTRY_KEY
+    !define "MUI_STARTMENUPAGE_${ID}_REGISTRY_KEY" "${MUI_STARTMENUPAGE_REGISTRY_KEY}"
+  !endif
+  !ifdef MUI_STARTMENUPAGE_REGISTRY_VALUENAME
+    !define "MUI_STARTMENUPAGE_${ID}_REGISTRY_VALUENAME" "${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}"
+  !endif
+
+  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom
+
+    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuLeave_${MUI_UNIQUEID}
+
+    Caption " "
+
+  PageExEnd
+
+  !insertmacro MUI_FUNCTION_STARTMENUPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuLeave_${MUI_UNIQUEID}
+
+  !undef MUI_STARTMENUPAGE_VARIABLE
+  !undef MUI_STARTMENUPAGE_TEXT_TOP
+  !undef MUI_STARTMENUPAGE_TEXT_CHECKBOX
+  !undef MUI_STARTMENUPAGE_DEFAULTFOLDER
+  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_NODISABLE
+  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_ROOT
+  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_KEY
+  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_VALUENAME
+
+!macroend
+
+!macro MUI_PAGE_STARTMENU ID VAR
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_PAGE_INIT
+  !insertmacro MUI_PAGEDECLARATION_STARTMENU "${ID}" "${VAR}"
+
+  !verbose pop
+
+!macroend
+
+;--------------------------------
+;Page functions
+
+!macro MUI_FUNCTION_STARTMENUPAGE PRE LEAVE
+
+  Function "${PRE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+
+    !ifdef MUI_STARTMENUPAGE_REGISTRY_ROOT & MUI_STARTMENUPAGE_REGISTRY_KEY & MUI_STARTMENUPAGE_REGISTRY_VALUENAME
+      
+      ;Get Start Menu location from registry
+
+      ${if} "${MUI_STARTMENUPAGE_VARIABLE}" == ""
+
+        ReadRegStr $mui.StartMenuPage.RegistryLocation  "${MUI_STARTMENUPAGE_REGISTRY_ROOT}" "${MUI_STARTMENUPAGE_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}"
+        ${if} $mui.StartMenuPage.RegistryLocation != ""
+          StrCpy "${MUI_STARTMENUPAGE_VARIABLE}" $mui.StartMenuPage.RegistryLocation
+        ${endif}
+
+        ClearErrors
+
+      ${endif}
+
+    !endif
+
+    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_TEXT_STARTMENU_TITLE) $(MUI_TEXT_STARTMENU_SUBTITLE)
+
+    ${if} $(^RTL) == "0"
+       !ifndef MUI_STARTMENUPAGE_NODISABLE
+        StartMenu::Init /noicon /autoadd /text "${MUI_STARTMENUPAGE_TEXT_TOP}" /lastused "${MUI_STARTMENUPAGE_VARIABLE}" /checknoshortcuts "${MUI_STARTMENUPAGE_TEXT_CHECKBOX}" "${MUI_STARTMENUPAGE_DEFAULTFOLDER}"
+      !else
+        StartMenu::Init /noicon /autoadd /text "${MUI_STARTMENUPAGE_TEXT_TOP}" /lastused "${MUI_STARTMENUPAGE_VARIABLE}" "${MUI_STARTMENUPAGE_DEFAULTFOLDER}"
+      !endif
+    ${else}
+      !ifndef MUI_STARTMENUPAGE_NODISABLE
+        StartMenu::Init /rtl /noicon /autoadd /text "${MUI_STARTMENUPAGE_TEXT_TOP}" /lastused "${MUI_STARTMENUPAGE_VARIABLE}" /checknoshortcuts "${MUI_STARTMENUPAGE_TEXT_CHECKBOX}" "${MUI_STARTMENUPAGE_DEFAULTFOLDER}"
+      !else
+        StartMenu::Init /rtl /noicon /autoadd /text "${MUI_STARTMENUPAGE_TEXT_TOP}" /lastused "${MUI_STARTMENUPAGE_VARIABLE}" "${MUI_STARTMENUPAGE_DEFAULTFOLDER}"
+      !endif
+    ${endif}
+
+    Pop $mui.StartMenuPage
+
+    ;Get control handles
+    GetDlgItem $mui.StartMenuPage.Location $mui.StartMenuPage 1002
+    GetDlgItem $mui.StartMenuPage.FolderList $mui.StartMenuPage 1004
+
+    !ifdef MUI_STARTMENUPAGE_BGCOLOR
+      SetCtlColors $mui.StartMenuPage.Location "" "${MUI_STARTMENUPAGE_BGCOLOR}"
+      SetCtlColors $mui.StartMenuMenu.FolderList "" "${MUI_STARTMENUPAGE_BGCOLOR}"
+    !endif
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+
+    StartMenu::Show
+
+    Pop $mui.StartMenuPage.Temp
+    ${if} $mui.StartMenuPage.Temp ==  "success"
+      Pop "${MUI_STARTMENUPAGE_VARIABLE}"
+    ${endif}
+
+  FunctionEnd
+
+  Function "${LEAVE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+  FunctionEnd
+
+!macroend
+
+
+;--------------------------------
+;Script macros to get Start Menu folder
+
+!macro MUI_STARTMENU_GETFOLDER ID VAR
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  ;Get Start Menu folder from registry
+  ;Can be called from the script in the uninstaller
+
+  !ifdef MUI_STARTMENUPAGE_${ID}_REGISTRY_ROOT & MUI_STARTMENUPAGE_${ID}_REGISTRY_KEY & MUI_STARTMENUPAGE_${ID}_REGISTRY_VALUENAME
+
+    ReadRegStr $mui.StartMenuPage.RegistryLocation "${MUI_STARTMENUPAGE_${ID}_REGISTRY_ROOT}" "${MUI_STARTMENUPAGE_${ID}_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_${ID}_REGISTRY_VALUENAME}"
+    
+    ${if} $mui.StartMenuPage.RegistryLocation != ""
+      StrCpy "${VAR}" $mui.StartMenuPage.RegistryLocation
+    ${else}
+      StrCpy "${VAR}" "${MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER}"
+    ${endif}
+
+  !else
+
+    StrCpy "${VAR}" "${MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER}"
+
+  !endif
+   
+  !verbose pop   
+
+!macroend
+
+!macro MUI_STARTMENU_WRITE_BEGIN ID
+
+  ;The code in the script to write the shortcuts should be put between the
+  ;MUI_STARTMENU_WRITE_BEGIN and MUI_STARTMENU_WRITE_END macros
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !define MUI_STARTMENUPAGE_CURRENT_ID "${ID}"
+
+  StrCpy $mui.StartMenuPage.Temp "${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}" 1
+  
+  ;If the folder start with >, the user has chosen not to create a shortcut
+  ${if} $mui.StartMenuPage.Temp != ">"
+
+    ${if} "${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}" == ""
+      ;Get folder from registry if the variable doesn't contain anything
+      !insertmacro MUI_STARTMENU_GETFOLDER "${MUI_STARTMENUPAGE_CURRENT_ID}" "${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}"
+    ${endif}
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_STARTMENU_WRITE_END
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+    !ifdef MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_ROOT & MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_KEY & MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_VALUENAME
+      ;Write folder to registry
+      WriteRegStr "${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_ROOT}" "${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_VALUENAME}" "${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}"
+    !endif
+
+  ${endif}
+
+  !undef MUI_STARTMENUPAGE_CURRENT_ID
+
+  !verbose pop
+
+!macroend
+
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/Directory.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/Directory.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/Directory.nsh	(revision 728)
@@ -0,0 +1,125 @@
+/*
+
+NSIS Modern User Interface
+Directory page
+
+*/
+
+;--------------------------------
+;Page interface settings and variables
+
+!macro MUI_DIRECTORYPAGE_INTERFACE
+
+  !ifndef MUI_DIRECTORYPAGE_INTERFACE
+    !define MUI_DIRECTORYPAGE_INTERFACE
+    Var mui.DirectoryPage
+    
+    Var mui.DirectoryPage.Text
+    
+    Var mui.DirectoryPage.DirectoryBox        
+    Var mui.DirectoryPage.Directory
+    Var mui.DirectoryPage.BrowseButton
+    
+    Var mui.DirectoryPage.SpaceRequired
+    Var mui.DirectoryPage.SpaceAvailable    
+  !endif
+
+!macroend
+
+
+;--------------------------------
+;Page declaration
+
+!macro MUI_PAGEDECLARATION_DIRECTORY
+
+  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}DIRECTORYPAGE ""
+  !insertmacro MUI_DIRECTORYPAGE_INTERFACE
+
+  !insertmacro MUI_DEFAULT MUI_DIRECTORYPAGE_TEXT_TOP ""
+  !insertmacro MUI_DEFAULT MUI_DIRECTORYPAGE_TEXT_DESTINATION ""
+
+  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}directory
+
+    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryLeave_${MUI_UNIQUEID}
+
+    Caption " "
+
+    DirText "${MUI_DIRECTORYPAGE_TEXT_TOP}" "${MUI_DIRECTORYPAGE_TEXT_DESTINATION}"
+
+    !ifdef MUI_DIRECTORYPAGE_VARIABLE
+      DirVar "${MUI_DIRECTORYPAGE_VARIABLE}"
+    !endif
+
+    !ifdef MUI_DIRECTORYPAGE_VERIFYONLEAVE
+      DirVerify leave
+    !endif
+
+  PageExEnd
+
+  !insertmacro MUI_FUNCTION_DIRECTORYPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryLeave_${MUI_UNIQUEID}
+
+  !undef MUI_DIRECTORYPAGE_TEXT_TOP
+  !undef MUI_DIRECTORYPAGE_TEXT_DESTINATION
+  !insertmacro MUI_UNSET MUI_DIRECTORYPAGE_VARIABLE
+  !insertmacro MUI_UNSET MUI_DIRECTORYPAGE_VERIFYONLEAVE
+
+!macroend
+
+!macro MUI_PAGE_DIRECTORY
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_PAGE_INIT
+  !insertmacro MUI_PAGEDECLARATION_DIRECTORY
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNPAGE_DIRECTORY
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_UNPAGE_INIT
+  !insertmacro MUI_PAGEDECLARATION_DIRECTORY
+
+  !verbose pop
+
+!macroend
+
+
+;--------------------------------
+;Page functions
+
+!macro MUI_FUNCTION_DIRECTORYPAGE PRE SHOW LEAVE
+
+  Function "${PRE}"
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_DIRECTORY_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_DIRECTORY_SUBTITLE)
+  FunctionEnd
+
+  Function "${SHOW}"
+  
+    ;Get control handles
+    FindWindow $mui.DirectoryPage "#32770" "" $HWNDPARENT
+    GetDlgItem $mui.DirectoryPage.Text $mui.DirectoryPage 1006
+    GetDlgItem $mui.DirectoryPage.DirectoryBox $mui.DirectoryPage 1020
+    GetDlgItem $mui.DirectoryPage.Directory $mui.DirectoryPage 1019 
+    GetDlgItem $mui.DirectoryPage.BrowseButton $mui.DirectoryPage 1001
+    GetDlgItem $mui.DirectoryPage.SpaceRequired $mui.DirectoryPage 1023    
+    GetDlgItem $mui.DirectoryPage.SpaceAvailable $mui.DirectoryPage 1024
+  
+    !ifdef MUI_DIRECTORYPAGE_BGCOLOR
+      SetCtlColors $mui.DirectoryPage.Directory "" "${MUI_DIRECTORYPAGE_BGCOLOR}"
+    !endif
+    
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+  FunctionEnd
+
+  Function "${LEAVE}"
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+  FunctionEnd
+
+!macroend
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/Components.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/Components.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/Components.nsh	(revision 728)
@@ -0,0 +1,242 @@
+/*
+
+NSIS Modern User Interface
+Components page
+
+*/
+
+;--------------------------------
+;Page interface settings and variables
+
+!macro MUI_COMPONENTSPAGE_INTERFACE
+
+  !ifndef MUI_COMPONENTSPAGE_INTERFACE
+    !define MUI_COMPONENTSPAGE_INTERFACE
+    Var mui.ComponentsPage
+    
+    Var mui.ComponentsPage.Text
+    Var mui.ComponentsPage.InstTypesText
+    Var mui.ComponentsPage.ComponentsText 
+
+    Var mui.ComponentsPage.InstTypes
+    Var mui.ComponentsPage.Components    
+    
+    Var mui.ComponentsPage.DescriptionTitle
+    Var mui.ComponentsPage.DescriptionText.Info
+    Var mui.ComponentsPage.DescriptionText
+    
+    Var mui.ComponentsPage.SpaceRequired
+    
+    !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_CHECKBITMAP "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp"
+    
+    !insertmacro MUI_DEFAULT MUI_UI_COMPONENTSPAGE_SMALLDESC "${NSISDIR}\Contrib\UIs\modern_smalldesc.exe"
+    !insertmacro MUI_DEFAULT MUI_UI_COMPONENTSPAGE_NODESC "${NSISDIR}\Contrib\UIs\modern_nodesc.exe"
+    
+    ;Apply settings
+    
+    !ifdef MUI_COMPONENTSPAGE_SMALLDESC
+      ChangeUI IDD_SELCOM "${MUI_UI_COMPONENTSPAGE_SMALLDESC}"
+    !else ifdef MUI_COMPONENTSPAGE_NODESC
+      ChangeUI IDD_SELCOM "${MUI_UI_COMPONENTSPAGE_NODESC}"
+    !endif
+
+    CheckBitmap "${MUI_COMPONENTSPAGE_CHECKBITMAP}"    
+       
+  !endif
+
+!macroend
+
+
+;--------------------------------
+;Page declaration
+
+!macro MUI_PAGEDECLARATION_COMPONENTS
+
+  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}COMPONENTSPAGE ""
+  !insertmacro MUI_COMPONENTSPAGE_INTERFACE
+
+  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_TOP ""
+  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_COMPLIST ""
+  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_INSTTYPE ""
+  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE "$(MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE)"
+  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO "$(MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO)"
+  
+  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}components
+
+    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsLeave_${MUI_UNIQUEID}
+
+    Caption " "
+
+    ComponentText "${MUI_COMPONENTSPAGE_TEXT_TOP}" "${MUI_COMPONENTSPAGE_TEXT_INSTTYPE}" "${MUI_COMPONENTSPAGE_TEXT_COMPLIST}"
+
+  PageExEnd
+
+  !insertmacro MUI_FUNCTION_COMPONENTSPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsLeave_${MUI_UNIQUEID}
+
+  !undef MUI_COMPONENTSPAGE_TEXT_TOP
+  !undef MUI_COMPONENTSPAGE_TEXT_COMPLIST
+  !undef MUI_COMPONENTSPAGE_TEXT_INSTTYPE
+  !insertmacro MUI_UNSET MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE
+  !insertmacro MUI_UNSET MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO
+
+!macroend
+
+!macro MUI_PAGE_COMPONENTS
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_PAGE_INIT
+  !insertmacro MUI_PAGEDECLARATION_COMPONENTS
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNPAGE_COMPONENTS
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_UNPAGE_INIT
+  !insertmacro MUI_PAGEDECLARATION_COMPONENTS
+
+  !verbose pop
+
+!macroend
+
+
+;--------------------------------
+;Page functions
+
+!macro MUI_FUNCTION_COMPONENTSPAGE PRE SHOW LEAVE
+
+  Function "${PRE}"
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_COMPONENTS_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_COMPONENTS_SUBTITLE)
+  FunctionEnd
+
+  Function "${SHOW}"
+  
+    ;Get control hanldes
+    FindWindow $mui.ComponentsPage "#32770" "" $HWNDPARENT
+    GetDlgItem $mui.ComponentsPage.Text             $mui.ComponentsPage 1006
+    GetDlgItem $mui.ComponentsPage.InstTypesText    $mui.ComponentsPage 1021
+    GetDlgItem $mui.ComponentsPage.ComponentsText   $mui.ComponentsPage 1022
+    GetDlgItem $mui.ComponentsPage.InstTypes        $mui.ComponentsPage 1017
+    GetDlgItem $mui.ComponentsPage.Components       $mui.ComponentsPage 1032
+    GetDlgItem $mui.ComponentsPage.DescriptionTitle $mui.ComponentsPage 1042
+    GetDlgItem $mui.ComponentsPage.DescriptionText  $mui.ComponentsPage 1043
+    GetDlgItem $mui.ComponentsPage.SpaceRequired    $mui.ComponentsPage 1023    
+
+    ;Default text in description textbox
+    SendMessage $mui.ComponentsPage.DescriptionTitle ${WM_SETTEXT} 0 "STR:${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE}"
+    EnableWindow $mui.ComponentsPage.DescriptionText 0
+    SendMessage $mui.ComponentsPage.DescriptionText ${WM_SETTEXT} 0 "STR:${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO}"
+
+    StrCpy $mui.ComponentsPage.DescriptionText.Info "${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO}" ;Text for current components page
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+
+  FunctionEnd
+
+  Function "${LEAVE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+  FunctionEnd
+
+!macroend
+
+
+;--------------------------------
+;Script functions for components descriptions
+
+!macro MUI_DESCRIPTION_BEGIN
+
+  ${if} $0 == -1
+    ;No mouse hover over component in list
+    SendMessage $mui.ComponentsPage.DescriptionText ${WM_SETTEXT} 0 "STR:"
+    EnableWindow $mui.ComponentsPage.DescriptionText 0
+    SendMessage $mui.ComponentsPage.DescriptionText ${WM_SETTEXT} 0 "STR:$mui.ComponentsPage.DescriptionText.Info"
+
+!macroend
+
+!macro MUI_DESCRIPTION_TEXT VAR TEXT
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  ${elseif} $0 == ${VAR}
+    SendMessage $mui.ComponentsPage.DescriptionText ${WM_SETTEXT} 0 "STR:"
+    EnableWindow $mui.ComponentsPage.DescriptionText 1
+    SendMessage $mui.ComponentsPage.DescriptionText ${WM_SETTEXT} 0 "STR:${TEXT}"
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_DESCRIPTION_END
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  ${endif}
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_FUNCTION_DESCRIPTION_BEGIN
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  Function .onMouseOverSection
+    !insertmacro MUI_DESCRIPTION_BEGIN
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_FUNCTION_DESCRIPTION_END
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+    !insertmacro MUI_DESCRIPTION_END
+    !ifdef MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION
+      Call "${MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION}"
+    !endif
+  FunctionEnd
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNFUNCTION_DESCRIPTION_BEGIN
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  Function un.onMouseOverSection
+    !insertmacro MUI_DESCRIPTION_BEGIN
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNFUNCTION_DESCRIPTION_END
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+    !insertmacro MUI_DESCRIPTION_END
+    !ifdef MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION
+      Call "${MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION}"
+    !endif
+  FunctionEnd
+
+  !verbose pop
+
+!macroend
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/UninstallConfirm.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/UninstallConfirm.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/UninstallConfirm.nsh	(revision 728)
@@ -0,0 +1,96 @@
+/*
+
+NSIS Modern User Interface
+Uninstall confirmation page
+
+*/
+
+;--------------------------------
+;Page interface settings and variables
+
+!macro MUI_UNCONFIRMPAGE_INTERFACE
+
+  !ifndef MUI_UNCONFIRMPAGE_INTERFACE
+    !define MUI_UNCONFIRMPAGE_INTERFACE
+    Var mui.UnConfirmPage
+    
+    Var mui.UnConfirmPage.Text
+    Var mui.UnConfirmPage.DirectoryText
+    Var mui.UnConfirmPage.Directory    
+  !endif
+
+!macroend
+
+
+;--------------------------------
+;Page declaration
+
+!macro MUI_PAGEDECLARATION_CONFIRM
+
+  !insertmacro MUI_SET MUI_UNCONFIRMPAGE ""
+  !insertmacro MUI_UNCONFIRMPAGE_INTERFACE  
+
+  !insertmacro MUI_DEFAULT MUI_UNCONFIRMPAGE_TEXT_TOP ""
+  !insertmacro MUI_DEFAULT MUI_UNCONFIRMPAGE_TEXT_LOCATION ""
+
+  PageEx un.uninstConfirm
+
+    PageCallbacks un.mui.ConfirmPre_${MUI_UNIQUEID} un.mui.ConfirmShow_${MUI_UNIQUEID} un.mui.ConfirmLeave_${MUI_UNIQUEID}
+
+    Caption " "
+
+    UninstallText "${MUI_UNCONFIRMPAGE_TEXT_TOP}" "${MUI_UNCONFIRMPAGE_TEXT_LOCATION}"
+
+  PageExEnd
+
+  !insertmacro MUI_UNFUNCTION_CONFIRMPAGE un.mui.ConfirmPre_${MUI_UNIQUEID} un.mui.ConfirmShow_${MUI_UNIQUEID} un.mui.ConfirmLeave_${MUI_UNIQUEID}
+
+  !insertmacro MUI_UNSET MUI_UNCONFIRMPAGE_TEXT_TOP
+  !insertmacro MUI_UNSET MUI_UNCONFIRMPAGE_TEXT_LOCATION
+
+!macroend
+
+!macro MUI_UNPAGE_CONFIRM
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_UNPAGE_INIT
+  !insertmacro MUI_PAGEDECLARATION_CONFIRM
+  
+  !verbose pop
+
+!macroend
+
+
+;--------------------------------
+;Page functions
+
+!macro MUI_UNFUNCTION_CONFIRMPAGE PRE SHOW LEAVE
+
+  Function "${PRE}"
+
+   !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+   !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_UNTEXT_CONFIRM_TITLE) $(MUI_UNTEXT_CONFIRM_SUBTITLE)
+
+  FunctionEnd
+
+  Function "${SHOW}"
+
+    ;Get controls handles
+    FindWindow $mui.UnConfirmPage "#32770" "" $HWNDPARENT
+    GetDlgItem $mui.UnConfirmPage.Text $mui.UnConfirmPage 1006
+    GetDlgItem $mui.UnConfirmPage.DirectoryText $mui.UnConfirmPage 1029
+    GetDlgItem $mui.UnConfirmPage.Directory $mui.UnConfirmPage 1000
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+
+  FunctionEnd
+
+  Function "${LEAVE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+  FunctionEnd
+
+!macroend
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/InstallFiles.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/InstallFiles.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages/InstallFiles.nsh	(revision 728)
@@ -0,0 +1,149 @@
+/*
+
+NSIS Modern User Interface
+InstallFiles page
+
+*/
+
+;--------------------------------
+;Page interface settings and variables
+
+!macro MUI_INSTFILESPAGE_INTERFACE
+
+  !ifndef MUI_INSTFILESYPAGE_INTERFACE
+    !define MUI_INSTFILESYPAGE_INTERFACE
+    
+    !insertmacro MUI_DEFAULT MUI_INSTFILESPAGE_COLORS "/windows"
+    !insertmacro MUI_DEFAULT MUI_INSTFILESPAGE_PROGRESSBAR "smooth"    
+    
+    Var mui.InstFilesPage
+    
+    Var mui.InstFilesPage.Text
+    Var mui.InstFilesPage.ProgressBar
+    Var mui.InstFilesPage.ShowLogButton
+    Var mui.InstFilesPage.Log
+    
+    ;Apply settings
+    InstallColors ${MUI_INSTFILESPAGE_COLORS}
+    InstProgressFlags ${MUI_INSTFILESPAGE_PROGRESSBAR}
+    SubCaption 4 " "
+    UninstallSubCaption 2 " "   
+  !endif
+
+!macroend
+
+
+;--------------------------------
+;Page declaration
+
+!macro MUI_PAGEDECLARATION_INSTFILES
+
+  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INSTFILESPAGE ""
+  !insertmacro MUI_INSTFILESPAGE_INTERFACE
+  
+  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}instfiles
+
+    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesLeave_${MUI_UNIQUEID}
+
+    Caption " "
+
+  PageExEnd
+
+  !insertmacro MUI_FUNCTION_INSTFILESPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesLeave_${MUI_UNIQUEID}
+
+  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_FINISHHEADER_TEXT
+  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT
+  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_ABORTWARNING_TEXT
+  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_ABORTWARNING_SUBTEXT
+
+!macroend
+
+!macro MUI_PAGE_INSTFILES
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_PAGE_INIT
+  !insertmacro MUI_PAGEDECLARATION_INSTFILES
+
+  !verbose pop
+
+!macroend
+
+!macro MUI_UNPAGE_INSTFILES
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !insertmacro MUI_UNPAGE_INIT
+  !insertmacro MUI_PAGEDECLARATION_INSTFILES
+
+  !verbose pop
+
+!macroend
+
+
+;--------------------------------
+;Page functions
+
+!macro MUI_FUNCTION_INSTFILESPAGE PRE SHOW LEAVE
+
+  Function "${PRE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLING_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLING_SUBTITLE)
+
+  FunctionEnd
+
+  Function "${SHOW}"
+
+    ;Get controls handles
+    FindWindow $mui.InstFilesPage "#32770" "" $HWNDPARENT
+    GetDlgItem $mui.InstFilesPage.Text $mui.InstFilesPage 1006
+    GetDlgItem $mui.InstFilesPage.ProgressBar $mui.InstFilesPage 1004
+    GetDlgItem $mui.InstFilesPage.ShowLogButton $mui.InstFilesPage 1027    
+    GetDlgItem $mui.InstFilesPage.Log $mui.InstFilesPage 1016
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+
+  FunctionEnd
+
+  Function "${LEAVE}"
+
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+    ;Set text on completed page header
+
+    IfAbort mui.endheader_abort
+
+      !ifdef MUI_INSTFILESPAGE_FINISHHEADER_TEXT & MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT
+        !insertmacro MUI_HEADER_TEXT "${MUI_INSTFILESPAGE_FINISHHEADER_TEXT}" "${MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT}"
+      !else ifdef MUI_INSTFILESPAGE_FINISHHEADER_TEXT
+        !insertmacro MUI_HEADER_TEXT "${MUI_INSTFILESPAGE_FINISHHEADER_TEXT}" "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_SUBTITLE)"
+      !else ifdef MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT
+        !insertmacro MUI_HEADER_TEXT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_TITLE)" "${MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT}"
+      !else
+        !insertmacro MUI_HEADER_TEXT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_TITLE)" "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_SUBTITLE)"
+      !endif
+
+    Goto mui.endheader_done
+
+    mui.endheader_abort:
+
+      !ifdef MUI_INSTFILESPAGE_ABORTHEADER_TEXT & MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT
+        !insertmacro MUI_HEADER_TEXT "${MUI_INSTFILESPAGE_ABORTHEADER_TEXT}" "${MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT}"
+      !else ifdef MUI_INSTFILESPAGE_ABORTHEADER_TEXT
+        !insertmacro MUI_HEADER_TEXT "${MUI_INSTFILESPAGE_ABORTHEADER_TEXT}" "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_SUBTITLE)"
+      !else ifdef MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT
+        !insertmacro MUI_HEADER_TEXT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_TITLE)" "${MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT}"
+      !else
+        !insertmacro MUI_HEADER_TEXT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_TITLE)" "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_SUBTITLE)"
+      !endif
+
+    mui.endheader_done:
+
+      !insertmacro MUI_LANGDLL_SAVELANGUAGE
+
+  FunctionEnd
+
+!macroend
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/MUI2.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/MUI2.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/MUI2.nsh	(revision 728)
@@ -0,0 +1,122 @@
+/*
+
+NSIS Modern User Interface - Version 2.0
+Copyright 2002-2015 Joost Verburg
+
+*/
+
+!echo "NSIS Modern User Interface version 2.0 - Copyright 2002-2015 Joost Verburg"
+
+;--------------------------------
+
+!ifndef MUI_INCLUDED
+!define MUI_INCLUDED
+
+!define MUI_SYSVERSION "2.0"
+
+!verbose push
+
+!ifndef MUI_VERBOSE
+  !define MUI_VERBOSE 3
+!endif
+
+!verbose ${MUI_VERBOSE}
+
+!addincludedir "${NSISDIR}\Contrib\Modern UI 2"
+
+;--------------------------------
+;Header files required by MUI
+
+!include WinMessages.nsh
+!include LogicLib.nsh
+!include nsDialogs.nsh
+!include LangFile.nsh
+
+
+;--------------------------------
+;Macros for compile-time defines
+
+!macro MUI_DEFAULT SYMBOL CONTENT
+
+  ;Define symbol if not yet defined
+  ;For setting default values
+
+  !ifndef "${SYMBOL}"
+    !define "${SYMBOL}" "${CONTENT}"
+  !endif
+
+!macroend
+
+!macro MUI_SET SYMBOL CONTENT
+
+  ;Define symbol and undefine if neccesary
+  
+  !insertmacro MUI_UNSET "${SYMBOL}"
+  !define "${SYMBOL}" "${CONTENT}"
+
+!macroend
+
+!macro MUI_UNSET SYMBOL
+
+  ;Undefine symbol if defined
+
+  !ifdef "${SYMBOL}"
+    !undef "${SYMBOL}"
+  !endif
+
+!macroend
+
+
+;--------------------------------
+;MUI interface
+
+!include "Deprecated.nsh"
+!include "Interface.nsh"
+!include "Localization.nsh"
+!include "Pages.nsh"
+
+
+;--------------------------------
+;Pages
+
+!include "Pages\Components.nsh"
+!include "Pages\Directory.nsh"
+!include "Pages\Finish.nsh"
+!include "Pages\InstallFiles.nsh"
+!include "Pages\License.nsh"
+!include "Pages\StartMenu.nsh"
+!include "Pages\UninstallConfirm.nsh"
+!include "Pages\Welcome.nsh"
+
+
+;--------------------------------
+;Insert MUI code in script
+
+!macro MUI_INSERT
+
+  !ifndef MUI_INSERT
+    !define MUI_INSERT
+
+    ;This macro is included when the first language file is included,
+    ;after the pages.
+
+    ;Interface settings
+    !insertmacro MUI_INTERFACE
+
+    ;Interface functions - Installer
+    !insertmacro MUI_FUNCTION_GUIINIT
+    !insertmacro MUI_FUNCTION_ABORTWARNING
+
+    ;Interface functions - Uninstaller
+    !ifdef MUI_UNINSTALLER
+      !insertmacro MUI_UNFUNCTION_GUIINIT
+      !insertmacro MUI_FUNCTION_UNABORTWARNING
+    !endif
+
+  !endif
+
+!macroend
+
+!endif
+
+!verbose pop
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Pages.nsh	(revision 728)
@@ -0,0 +1,160 @@
+/*
+
+NSIS Modern User Interface
+Support code for all pages
+
+*/
+
+;--------------------------------
+;Page initialization
+
+!macro MUI_PAGE_INIT
+
+  ;Include interface settings in neccesary
+  !insertmacro MUI_INTERFACE
+
+  ;Define settings for installer page
+  !insertmacro MUI_UNSET MUI_PAGE_UNINSTALLER
+  !insertmacro MUI_UNSET MUI_PAGE_UNINSTALLER_PREFIX
+  !insertmacro MUI_UNSET MUI_PAGE_UNINSTALLER_FUNCPREFIX
+  
+  !insertmacro MUI_SET MUI_PAGE_UNINSTALLER_PREFIX ""
+  !insertmacro MUI_SET MUI_PAGE_UNINSTALLER_FUNCPREFIX ""
+
+  ;Generate unique ID
+  !insertmacro MUI_UNSET MUI_UNIQUEID
+  !define MUI_UNIQUEID ${__LINE__}
+
+!macroend
+
+!macro MUI_UNPAGE_INIT
+
+  ;Include interface settings
+  !insertmacro MUI_INTERFACE
+
+  ;Define prefixes for uninstaller page
+  !insertmacro MUI_SET MUI_UNINSTALLER ""
+  
+  !insertmacro MUI_SET MUI_PAGE_UNINSTALLER ""
+  !insertmacro MUI_SET MUI_PAGE_UNINSTALLER_PREFIX "UN"
+  !insertmacro MUI_SET MUI_PAGE_UNINSTALLER_FUNCPREFIX "un."
+  
+  ;Generate unique ID
+  !insertmacro MUI_UNSET MUI_UNIQUEID
+  !define MUI_UNIQUEID ${__LINE__}  
+
+!macroend
+
+
+;--------------------------------
+;Header text for standard MUI page
+
+!macro MUI_HEADER_TEXT_PAGE TEXT SUBTEXT
+
+  !ifdef MUI_PAGE_HEADER_TEXT & MUI_PAGE_HEADER_SUBTEXT
+    !insertmacro MUI_HEADER_TEXT "${MUI_PAGE_HEADER_TEXT}" "${MUI_PAGE_HEADER_SUBTEXT}"
+  !else ifdef MUI_PAGE_HEADER_TEXT
+    !insertmacro MUI_HEADER_TEXT "${MUI_PAGE_HEADER_TEXT}" "${SUBTEXT}"
+  !else ifdef MUI_PAGE_HEADER_SUBTEXT
+    !insertmacro MUI_HEADER_TEXT "${TEXT}" "${MUI_PAGE_HEADER_SUBTEXT}"
+  !else
+    !insertmacro MUI_HEADER_TEXT "${TEXT}" "${SUBTEXT}"
+  !endif
+
+  !insertmacro MUI_UNSET MUI_PAGE_HEADER_TEXT
+  !insertmacro MUI_UNSET MUI_PAGE_HEADER_SUBTEXT
+
+!macroend
+
+
+;--------------------------------
+;Header text for custom page
+
+!macro MUI_HEADER_TEXT TEXT SUBTEXT ;Called from script
+
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+
+  !ifdef MUI_HEADER_TRANSPARENT_TEXT
+    LockWindow on
+  !endif
+
+  SendMessage $mui.Header.Text ${WM_SETTEXT} 0 "STR:${TEXT}"
+  SendMessage $mui.Header.SubText ${WM_SETTEXT} 0 "STR:${SUBTEXT}"
+
+  !ifdef MUI_HEADER_TRANSPARENT_TEXT
+    LockWindow off
+  !endif
+
+  !verbose pop
+
+!macroend
+
+
+;--------------------------------
+;Custom page functions
+
+!macro MUI_PAGE_FUNCTION_CUSTOM TYPE
+
+  !ifdef MUI_PAGE_CUSTOMFUNCTION_${TYPE}
+    Call "${MUI_PAGE_CUSTOMFUNCTION_${TYPE}}"
+    !undef MUI_PAGE_CUSTOMFUNCTION_${TYPE}
+  !endif
+
+!macroend
+
+
+;--------------------------------
+;Support for full window pages (like welcome/finish page)
+
+!macro MUI_PAGE_FUNCTION_FULLWINDOW
+
+  !ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_FULLWINDOW
+    !define MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_FULLWINDOW
+
+    Function ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageLoadFullWindow
+    
+      LockWindow on
+      
+      ;The branding text needs to be hidden because the full windows page
+      ;overlaps with it.
+      ShowWindow $mui.Branding.Background ${SW_HIDE}
+      ShowWindow $mui.Branding.Text ${SW_HIDE}      
+      
+      ;The texts need to be hidden because otherwise they may show through
+      ;the page above when the Alt key is pressed.
+      ShowWindow $mui.Header.Text ${SW_HIDE}
+      ShowWindow $mui.Header.SubText ${SW_HIDE}
+      ShowWindow $mui.Header.Image ${SW_HIDE}
+
+      ;Show line below full width of page
+      ShowWindow $mui.Line.Standard ${SW_HIDE}
+      ShowWindow $mui.Line.FullWindow ${SW_NORMAL}
+      
+      LockWindow off
+      
+    FunctionEnd
+    
+    Function ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageUnloadFullWindow
+    
+      ;Set everything back to normal again
+    
+      LockWindow on
+      
+      ShowWindow $mui.Branding.Background ${SW_NORMAL}
+      ShowWindow $mui.Branding.Text ${SW_NORMAL}
+      
+      ShowWindow $mui.Header.Text ${SW_NORMAL}
+      ShowWindow $mui.Header.SubText ${SW_NORMAL}
+      ShowWindow $mui.Header.Image ${SW_NORMAL}
+      
+      ShowWindow $mui.Line.Standard ${SW_NORMAL}
+      ShowWindow $mui.Line.FullWindow ${SW_HIDE}
+      
+      LockWindow off
+      
+    FunctionEnd    
+    
+  !endif
+
+!macroend
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Deprecated.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Deprecated.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Deprecated.nsh	(revision 728)
@@ -0,0 +1,72 @@
+/*
+
+NSIS Modern User Interface
+Deprecated code - display warnings
+
+*/
+
+;--------------------------------
+;InstallOptions
+
+!define INSTALLOPTIONS_ERROR "MUI_INSTALLOPTIONS_* macros are no longer a part of MUI2. Include InstallOptions.nsh and use INSTALLOPTIONS_* macros instead. It is also recommended to upgrade to nsDialogs."
+
+!macro MUI_INSTALLOPTIONS_EXTRACT FILE
+
+  !error "${INSTALLOPTIONS_ERROR}"
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_EXTRACT_AS FILE FILENAME
+
+  !error "${INSTALLOPTIONS_ERROR}"
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_DISPLAY FILE
+
+  !error "${INSTALLOPTIONS_ERROR}"
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_DISPLAY_RETURN FILE
+
+  !error "${INSTALLOPTIONS_ERROR}"
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_INITDIALOG FILE
+
+  !error "${INSTALLOPTIONS_ERROR}"
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_SHOW
+
+  !error "${INSTALLOPTIONS_ERROR}"
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_SHOW_RETURN
+
+  !error "${INSTALLOPTIONS_ERROR}"
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_READ VAR FILE SECTION KEY
+
+  !error "${INSTALLOPTIONS_ERROR}"
+
+!macroend
+
+!macro MUI_INSTALLOPTIONS_WRITE FILE SECTION KEY VALUE
+
+  !error "${INSTALLOPTIONS_ERROR}"
+
+!macroend
+
+!macro MUI_RESERVEFILE_INSTALLOPTIONS
+
+  !define MUI_DOLLAR "$"
+  !error "MUI_RESERVEFILE_INSTALLOPTIONS is no longer supported as InstallOptions is no longer used by MUI2. Instead, use ReserveFile '${MUI_DOLLAR}{NSISDIR}\Plugins\InstallOptions.dll'. It is also recommended to upgrade to nsDialogs."
+
+!macroend
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Interface.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Interface.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Modern UI 2/Interface.nsh	(revision 728)
@@ -0,0 +1,304 @@
+/*
+
+NSIS Modern User Interface
+Interface code for all pages
+
+*/
+
+;--------------------------------
+;Variables
+
+Var mui.Header.Text
+Var mui.Header.Text.Font
+Var mui.Header.SubText
+Var mui.Header.Background
+Var mui.Header.Image
+
+Var mui.Branding.Text
+Var mui.Branding.Background
+
+Var mui.Line.Standard
+Var mui.Line.FullWindow
+
+Var mui.Button.Next
+Var mui.Button.Cancel
+Var mui.Button.Back
+
+
+;--------------------------------
+;General interface settings
+
+!macro MUI_INTERFACE
+
+  !ifndef MUI_INTERFACE
+
+    !define MUI_INTERFACE
+
+    ;These values are set after the interface settings in the script,
+    ;so the script itself can override all values.
+
+    ;Default interface settings in nsisconf.nsh
+    !ifdef MUI_INSERT_NSISCONF
+      !insertmacro MUI_NSISCONF
+    !endif
+
+    ;Default interface settings
+    !insertmacro MUI_DEFAULT MUI_UI "${NSISDIR}\Contrib\UIs\modern.exe"
+    !insertmacro MUI_DEFAULT MUI_UI_HEADERIMAGE "${NSISDIR}\Contrib\UIs\modern_headerbmp.exe"
+    !insertmacro MUI_DEFAULT MUI_UI_HEADERIMAGE_RIGHT "${NSISDIR}\Contrib\UIs\modern_headerbmpr.exe"
+    !insertmacro MUI_DEFAULT MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
+    !insertmacro MUI_DEFAULT MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
+    !insertmacro MUI_DEFAULT MUI_BGCOLOR "FFFFFF"
+
+    ;Default header images
+    !ifdef MUI_HEADERIMAGE
+
+      !insertmacro MUI_DEFAULT MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp"
+
+      !ifndef MUI_HEADERIMAGE_UNBITMAP
+        !define MUI_HEADERIMAGE_UNBITMAP "${MUI_HEADERIMAGE_BITMAP}"
+        !ifdef MUI_HEADERIMAGE_BITMAP_NOSTRETCH
+          !insertmacro MUI_SET MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH ""
+        !endif
+      !endif
+
+      !ifdef MUI_HEADERIMAGE_BITMAP_RTL
+        !ifndef MUI_HEADERIMAGE_UNBITMAP_RTL
+          !define MUI_HEADERIMAGE_UNBITMAP_RTL "${MUI_HEADERIMAGE_BITMAP_RTL}"
+          !ifdef MUI_HEADERIMAGE_BITMAP_RTL_NOSTRETCH
+            !insertmacro MUI_SET MUI_HEADERIMAGE_UNBITMAP_RTL_NOSTRETCH ""
+          !endif
+        !endif
+      !endif
+
+    !endif
+
+    ;Default texts
+    !insertmacro MUI_DEFAULT MUI_ABORTWARNING_TEXT "$(MUI_TEXT_ABORTWARNING)"
+    !insertmacro MUI_DEFAULT MUI_UNABORTWARNING_TEXT "$(MUI_UNTEXT_ABORTWARNING)"  
+
+    ;Apply settings
+
+    XPStyle On ;XP style setting in manifest resource
+
+    ;Dialog resources
+    ChangeUI all "${MUI_UI}" 
+    !ifdef MUI_HEADERIMAGE
+      !ifndef MUI_HEADERIMAGE_RIGHT
+        ChangeUI IDD_INST "${MUI_UI_HEADERIMAGE}"
+      !else
+        ChangeUI IDD_INST "${MUI_UI_HEADERIMAGE_RIGHT}"
+      !endif
+    !endif
+
+    ;Icons
+    Icon "${MUI_ICON}"
+    UninstallIcon "${MUI_UNICON}"
+
+  !endif
+
+!macroend
+
+
+;--------------------------------
+;Abort warning message box
+
+!macro MUI_ABORTWARNING
+
+  !ifdef MUI_ABORTWARNING_CANCEL_DEFAULT
+    MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 "${MUI_ABORTWARNING_TEXT}" IDYES mui.Quit
+  !else
+    MessageBox MB_YESNO|MB_ICONEXCLAMATION "${MUI_ABORTWARNING_TEXT}" IDYES mui.Quit
+  !endif
+  
+  Abort
+  mui.Quit:
+
+!macroend
+
+!macro MUI_UNABORTWARNING
+
+  !ifdef MUI_UNABORTWARNING_CANCEL_DEFAULT
+    MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 "${MUI_UNABORTWARNING_TEXT}" IDYES mui.Quit
+  !else
+    MessageBox MB_YESNO|MB_ICONEXCLAMATION "${MUI_UNABORTWARNING_TEXT}" IDYES mui.Quit
+  !endif
+
+  Abort
+  mui.Quit:
+
+!macroend
+
+
+;--------------------------------
+;Initialization of GUI
+
+!macro MUI_HEADERIMAGE_INIT UNINSTALLER
+
+  ;Load and display header image
+
+  !ifdef MUI_HEADERIMAGE
+
+    InitPluginsDir
+
+    !ifdef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL
+
+      ${if} $(^RTL) == 1
+
+        File "/oname=$PLUGINSDIR\modern-header.bmp" "${MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL}"
+
+        !ifndef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL_NOSTRETCH
+          SetBrandingImage /IMGID=1046 /RESIZETOFIT "$PLUGINSDIR\modern-header.bmp"
+        !else
+          SetBrandingImage /IMGID=1046 "$PLUGINSDIR\modern-header.bmp"
+        !endif
+
+      ${else}
+
+    !endif
+
+        File "/oname=$PLUGINSDIR\modern-header.bmp" "${MUI_HEADERIMAGE_${UNINSTALLER}BITMAP}"
+
+        !ifndef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_NOSTRETCH
+          SetBrandingImage /IMGID=1046 /RESIZETOFIT "$PLUGINSDIR\modern-header.bmp"
+        !else
+          SetBrandingImage /IMGID=1046 "$PLUGINSDIR\modern-header.bmp"
+        !endif
+
+    !ifdef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL
+
+      ${endif}
+
+    !endif
+
+  !endif
+
+!macroend
+
+!macro MUI_GUIINIT_OUTERDIALOG UNINSTALLER
+
+  ;Initialize outer dialog (fonts & colors)
+
+  ;Header
+  GetDlgItem $mui.Header.Text $HWNDPARENT 1037
+  CreateFont $mui.Header.Text.Font "$(^Font)" "$(^FontSize)" "700"
+  SendMessage $mui.Header.Text ${WM_SETFONT} $mui.Header.Text.Font 0
+  
+  GetDlgItem $mui.Header.SubText $HWNDPARENT 1038
+
+  !ifndef MUI_HEADER_TRANSPARENT_TEXT
+    SetCtlColors $mui.Header.Text "" "${MUI_BGCOLOR}"
+    SetCtlColors $mui.Header.SubText "" "${MUI_BGCOLOR}"
+  !else
+    SetCtlColors $mui.Header.Text "" "transparent"
+    SetCtlColors $mui.Header.SubText "" "transparent"
+  !endif
+  
+  ;Header image
+  !insertmacro MUI_HEADERIMAGE_INIT "${UNINSTALLER}"
+
+  ;Header background
+  GetDlgItem $mui.Header.Background $HWNDPARENT 1034
+  SetCtlColors $mui.Header.Background "" "${MUI_BGCOLOR}"
+
+  ;Header image background
+  GetDlgItem $mui.Header.Image $HWNDPARENT 1039
+  SetCtlColors $mui.Header.Image "" "${MUI_BGCOLOR}"
+
+  ;Branding text
+  GetDlgItem $mui.Branding.Background $HWNDPARENT 1028
+  SetCtlColors $mui.Branding.Background /BRANDING
+  GetDlgItem $mui.Branding.Text $HWNDPARENT 1256
+  SetCtlColors $mui.Branding.Text /BRANDING
+  SendMessage $mui.Branding.Text ${WM_SETTEXT} 0 "STR:$(^Branding) "
+  
+  ;Lines
+  GetDlgItem $mui.Line.Standard $HWNDPARENT 1035
+  GetDlgItem $mui.Line.FullWindow $HWNDPARENT 1045
+  
+  ;Buttons
+  GetDlgItem $mui.Button.Next $HWNDPARENT 1
+  GetDlgItem $mui.Button.Cancel $HWNDPARENT 2
+  GetDlgItem $mui.Button.Back $HWNDPARENT 3
+
+!macroend
+
+
+;--------------------------------
+;Interface functions
+
+!macro MUI_FUNCTION_GUIINIT
+
+  Function .onGUIInit
+
+    !insertmacro MUI_GUIINIT_OUTERDIALOG ""
+
+    !ifdef MUI_PAGE_FUNCTION_GUIINIT
+      Call "${MUI_PAGE_FUNCTION_GUIINIT}"
+    !endif  
+
+    !ifdef MUI_CUSTOMFUNCTION_GUIINIT
+      Call "${MUI_CUSTOMFUNCTION_GUIINIT}"
+    !endif
+
+  FunctionEnd
+
+!macroend
+
+!macro MUI_UNFUNCTION_GUIINIT
+
+  Function un.onGUIInit  
+
+    !insertmacro MUI_GUIINIT_OUTERDIALOG UN
+    
+    !ifdef MUI_UNPAGE_FUNCTION_GUIINIT
+      Call "${MUI_UNPAGE_FUNCTION_GUIINIT}"
+    !endif    
+
+    !ifdef MUI_CUSTOMFUNCTION_UNGUIINIT
+      Call "${MUI_CUSTOMFUNCTION_UNGUIINIT}"
+    !endif
+
+  FunctionEnd
+
+!macroend
+
+!macro MUI_FUNCTION_ABORTWARNING
+
+  Function .onUserAbort
+  
+    !ifdef MUI_PAGE_FUNCTION_ABORTWARNING
+      Call ${MUI_PAGE_FUNCTION_ABORTWARNING}
+    !endif
+  
+    !ifdef MUI_ABORTWARNING
+      !insertmacro MUI_ABORTWARNING
+    !endif
+    
+    !ifdef MUI_CUSTOMFUNCTION_ABORT
+      Call "${MUI_CUSTOMFUNCTION_ABORT}"
+    !endif
+    
+  FunctionEnd
+
+!macroend
+
+!macro MUI_FUNCTION_UNABORTWARNING
+
+  Function un.onUserAbort
+  
+    !ifdef MUI_UNPAGE_FUNCTION_ABORTWARNING
+      Call ${MUI_UNPAGE_FUNCTION_ABORTWARNING}
+    !endif  
+  
+    !ifdef MUI_UNABORTWARNING
+      !insertmacro MUI_UNABORTWARNING
+    !endif
+    
+    !ifdef MUI_CUSTOMFUNCTION_UNABORT
+      Call "${MUI_CUSTOMFUNCTION_UNABORT}"
+    !endif
+    
+  FunctionEnd
+
+!macroend
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Hungarian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Hungarian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Hungarian.nsh	(revision 728)
@@ -0,0 +1,122 @@
+;Language: Hungarian (1038)
+;Translation by Jozsef Tamas Herczeg ( - 1.61-ig),
+;               Lajos Molnar (Orfanik) <orfanik@axelero.hu> ( 1.62 - tõl)
+
+!insertmacro LANGFILE "Hungarian" "Magyar"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Üdvözli a(z) $(^NameDA) Telepítõ Varázsló"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "A(z) $(^NameDA) telepítése következik a számítógépre.$\r$\n$\r$\nJavasoljuk, hogy indítás elõtt zárja be a futó alkalmazásokat. Így a telepítõ a rendszer újraindítása nélkül tudja frissíteni a szükséges rendszerfájlokat.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Üdvözli a(z) $(^NameDA) Eltávolító Varázsló"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Ez a varázsló segíti a(z) $(^NameDA) eltávolításában.$\r$\n$\r$\nMielõtt elkezdi az eltávilítást gyõzõdjön meg arról, hogy a(z) $(^NameDA) nem fut.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Licencszerzõdés"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "A(z) $(^NameDA) telepítése elõtt tekintse át a szerzõdés feltételeit."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Ha elfogadja a szerzõdés valamennyi feltételét, az Elfogadom gombbal folytathatja. El kell fogadnia a(z) $(^NameDA) telepítéséhez."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Amennyiben elfogadja a feltételeket, jelölje be a jelölõnényzeten. A(z) $(^NameDA) telepítéséhez el kell fogadnia a feltételeket. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Amennyiben elfogadja a feltételeket, válassza az elsõ opciót. A(z) $(^NameDA) telepítéséhez el kell fogadnia a feltételeket. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Licencszerzõdés"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "A(z) $(^NameDA) eltávolítása elõtt tekintse át a szerzõdés feltételeit."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Ha elfogadja a szerzõdés valamennyi feltételét, az Elfogadom gombbal folytathatja. El kell fogadnia a(z) $(^NameDA) eltávolításához."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Amennyiben elfogadja a feltételeket, jelölje be a jelölõnényzeten. A(z) $(^NameDA) eltávolításához el kell fogadnia a feltételeket. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Amennyiben elfogadja a feltételeket, válassza az elsõ opciót. A(z) $(^NameDA) eltávolításához el kell fogadnia a feltételeket. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "A PageDown gombbal olvashatja el a szerzõdés folytatását."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Összetevõk kiválasztása"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Válassza ki, hogy a(z) $(^NameDA) mely funkcióit kívánja telepíteni."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Összetevõk kiválasztása"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Válassza ki, hogy a(z) $(^NameDA) mely funkcióit kívánja eltávolítani."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Leírás"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Vigye rá az egeret az összetevõre, hogy megtekinthesse a leírását."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Vigye rá az egeret az összetevõre, hogy megtekinthesse a leírását."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Telepítési hely kiválasztása"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Válassza ki a(z) $(^NameDA) telepítésének mappáját."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Telepítési hely kiválasztása"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Válassza ki a(z) $(^NameDA) telepítésének mappáját."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Telepítési folyamat"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Kis türelmet a(z) $(^NameDA) telepítéséig."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Telepítés befejezõdött"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "A telepítés sikeresen befejezõdött."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "A telepítés megszakadt"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "A telepítés sikertelen volt."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Eltávolítási folyamat"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Kis türelmet a(z) $(^NameDA) eltávolításáig."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Az eltávolítás befejezõdött"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Az eltávolítás sikeresen befejezõdött."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Az eltávolítás megszakadt"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Az eltávolítás sikertelen volt."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "A(z) $(^NameDA) telepítése megtörtént."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "A(z) $(^NameDA) telepítése megtörtént.$\r$\n$\r$\nA Befejezés gomb megnyomásával zárja be a varázslót."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "A(z) $(^NameDA) telepítésének befejezéséhez újra kell indítani a rendszert. Most akarja újraindítani?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "A(z) $(^NameDA) eltávolítás varázslójának befejezése."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "A(z) $(^NameDA) eltávolítása sikeresen befejezõdött.$\r$\n$\r$\nA Finish-re kattintva bezárul ez a varázsló."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "A számítógépet újra kell indítani, hogy a(z) $(^NameDA) eltávolítása teljes legyen. Akarja most újraindítani a rendszert?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Most indítom újra"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Késõbb fogom újraindítani"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "$(^NameDA) futtatása"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "OlvassEl fájl megjelenítése"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Befejezés"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Start menü mappa kijelölése"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Start menü mappa kijelölése a program parancsikonjaihoz."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Jelöljön ki egy mappát a Start menüben, melybe a program parancsikonjait fogja elhelyezni. Beírhatja új mappa nevét is."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Nincs parancsikon elhelyezés"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "A(z) $(^NameDA) Eltávolítása."
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "A(z) $(^NameDA) eltávolítása következik a számítógéprõl."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Biztos, hogy ki akar lépni a(z) $(^Name) Telepítõbõl?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Biztos, hogy ki akar lépni a(z) $(^Name) Eltávolítóból?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Belarusian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Belarusian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Belarusian.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1059
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1251
+# RTL - anything else than RTL means LTR
+-
+# Translation by Sitnikov Vjacheslav [ glory_man@tut.by ]
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+Óñòàíî¢êà $(^Name)
+# ^UninstallCaption
+Âûäàëåííå $(^Name)
+# ^LicenseSubCaption
+: Ë³öýíç³éíàå ïàãàäíåííå
+# ^ComponentsSubCaption
+: Ïàðàìåòðû ¢ñòàíî¢ê³
+# ^DirSubCaption
+: Ïàïêà óñòàíî¢ê³
+# ^InstallingSubCaption
+: Êàï³ðàâàííå ôàéëà¢
+# ^CompletedSubCaption
+: Ïðàöýäóðà çàâåðøåíà
+# ^UnComponentsSubCaption
+: Ïàðàìåòðû âûäàëåííÿ
+# ^UnDirSubCaption
+: Ïàïêà âûäàëåííÿ
+# ^ConfirmSubCaption
+: Ïàöâÿðäæýííå
+# ^UninstallingSubCaption
+: Âûäàëåííå ôàéëà¢
+# ^UnCompletedSubCaption
+: Ïðàöýäóðà çàâåðøàíà
+# ^BackBtn
+< &Íàçàä
+# ^NextBtn
+&Äàëåé >
+# ^AgreeBtn
+&Çãîäçåí
+# ^AcceptBtn
+ß &ïðûìàþ ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ
+# ^DontAcceptBtn
+ß í&å ïðûìàþ ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ
+# ^InstallBtn
+&Óñòàëÿâàöü
+# ^UninstallBtn
+Âûä&àë³öü
+# ^CancelBtn
+Àäìÿí³öü
+# ^CloseBtn
+Çà&÷ûí³öü
+# ^BrowseBtn
+À&ãëÿä ...
+# ^ShowDetailsBtn
+Ïàäðà&áÿçíà...
+# ^ClickNext
+Íàö³ñí³öå êíîïêó "Äàëåé", êàá ïðàöÿãíóöü óñòàíî¢êó ïðàãðàìû.
+# ^ClickInstall
+Íàö³ñí³öå êíîïêó "Óñòàëÿâàöü" äëÿ ïà÷àòêó ïðàöýñà ¢ñòàíî¢ê³ ïðàãðàìû.
+# ^ClickUninstall
+Íàö³ñí³öå êíîïêó "Âûäàë³öü" äëÿ ïà÷àòêó ïðàöýñà âûäàëåííÿ ïðàãðàìû.
+# ^Name
+²ìÿ
+# ^Completed
+Çàâåðøàíà
+# ^LicenseText
+Êàë³ ëàñêà, ïðà÷ûòàéöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ ïåðàä ïà÷àòêàì óñòàíî¢ê³ $(^NameDA). Êàë³ Âû ïðûìàåöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ, íàö³ñí³öå êíîïêó "Çãîäçåí".
+# ^LicenseTextCB
+Êàë³ ëàñêà, ïðà÷ûòàéöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ ïåðàä ïà÷àòêàì óñòàíî¢ê³ $(^NameDA). Êàë³ Âû ïðûìàåöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ, óñòàëþéöå ñöÿæîê í³æýé. $_CLICK
+# ^LicenseTextRB
+Êàë³ ëàñêà, ïðà÷ûòàéöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ ïåðàä ïà÷àòêàì óñòàíî¢ê³ $(^NameDA). Êàë³ Âû ïðûìàåöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ, âûëó÷ûöå ïåðøû âàðûÿíò ç ïðàïàíàâàíûõ íiæýé. $_CLICK
+# ^UnLicenseText
+Êàë³ ëàñêà, ïðà÷ûòàéöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ ïåðàä ïà÷àòêàì âûäàëåííÿ $(^NameDA). Êàë³ Âû ïðûìàåöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ, íàöiñíiöå êíîïêó "Çãîäçåí".
+# ^UnLicenseTextCB
+Êàë³ ëàñêà, ïðà÷ûòàéöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ ïåðàä ïà÷àòêàì âûäàëåííÿ $(^NameDA). Êàë³ Âû ïðûìàåöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ, óñòàëþéöå ñöÿæîê í³æýé. $_CLICK
+# ^UnLicenseTextRB
+Êàë³ ëàñêà, ïðà÷ûòàéöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ ïåðàä ïà÷àòêàì âûäàëåííÿ $(^NameDA). Êàë³ Âû ïðûìàåöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ, âûëó÷ûöå ïåðøû âàðûÿíò ç ïðàïàíàâàíûõ íiæýé. $_CLICK
+# ^Custom
+Âûáàðêîâà
+# ^ComponentsText
+Âûçíà÷öå êàìïàíåíòû ïðàãðàìû, ÿêiÿ Âû æàäàåöå ¢ñòàíàâiöü. $_CLICK
+# ^ComponentsSubText1
+Âûçíà÷öå òûï óñòàíî¢êi:
+# ^ComponentsSubText2_NoInstTypes
+Âûçíà÷öå êàìïàíåíòû ïðàãðàìû, êàá óñòàíàâiöü iõ:
+# ^ComponentsSubText2
+àëüáî âûçíà÷öå êàìïàíåíòû ïðàãðàìû, êàá óñòàíàâiöü iõ ïà ñâàéìó æàäàííþ:
+# ^UnComponentsText
+Âûçíà÷öå êàìïàíåíòû, ÿêiÿ Âû æàäàåöå âûäàëiöü, i çíiìiöå ñöÿæê³, âûáðàíûÿ äëÿ òûõ êàìïàíåíòà¢, ÿêiÿ íå òðýáà âûäàëÿöü. $_CLICK
+# ^UnComponentsSubText1
+Âûçíà÷öå òûï âûäàëåííÿ:
+# ^UnComponentsSubText2_NoInstTypes
+Âûçíà÷öå êàìïàíåíòû äëÿ âûäàëåííÿ:
+# ^UnComponentsSubText2
+àëüáî âûçíà÷öå êàìïàíåíòû ïðàãðàìû äëÿ âûäàëåííÿ:
+# ^DirText
+Ïðàãðàìà ¢ñòàëþå $(^NameDA) ó âûçíà÷àíóþ ïàïêó. Êàá óñòàíàâiöü ïðàãðàìó ¢ iíøàé ïàïê³, íàöiñíiöå êíîïêó "Àãëÿä" i âûçíà÷öå ïàòðýáíóþ ïàïêó. $_CLICK
+# ^DirSubText
+Ïàïêà óñòàíî¢êi
+# ^DirBrowseText
+Âûçíà÷öå ïàïêó äëÿ ¢ñòàíî¢êi $(^NameDA):
+# ^UnDirText
+Ïðàãðàìà âûäàëiöü $(^NameDA) ç àäçíà÷àíàé ïàïê³. Êàá âûðàá³öü âûäàëåííå ç iíøàé ïàïê³, íàöiñíiöå êíîïêó "Àãëÿä" i âûçíà÷öå ïàòðýáíóþ ïàïêó. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Âûçíà÷öå ïàïêó, ç ÿêîé Âû æàäàåöå âûäàëiöü $(^NameDA):
+# ^SpaceAvailable
+"Äàñÿæíà íà äûñêó: "
+# ^SpaceRequired
+"Ïàòðýáíàå ìåñöà íà äûñêó: "
+# ^UninstallingText
+Ïðàãðàìà âûäàëiöü $(^NameDA) ç Âàøàãà êàìïóòàðà. $_CLICK
+# ^UninstallingSubText
+Âûäàëåííå ç:
+# ^FileError
+Íåìàã÷ûìà àä÷ûí³öü ôàéë äëÿ çàïiñó: \r\n\r\n$0\r\n\r\nÍàöiñíiöå êíîïêó "Ïåðàïûíiöü", êàá ïåðàïûíiöü óñòàíî¢êó;\r\n"Ïà¢òàðûöü", êàá ïà¢òàðûöü ñïðîáó çàïiñó ¢ ôàéë;\r\n"²ãíàðàâàöü", êàá ïðàïóñöiöü ãýòà äçåÿííå.
+# ^FileError_NoIgnore
+Íåìàã÷ûìà àä÷ûí³öü ôàéë äëÿ çàïiñó: \r\n\r\n$0\r\n\r\nÍàöiñíiöå êíîïêó "Ïà¢òàðûöü", êàá ïà¢òàðûöü ñïðîáó çàïiñó ¢ ôàéë;\r\n"Àäìÿí³öü", êàá ïåðàïûíiöü óñòàíî¢êó.
+# ^CantWrite
+"Íåìàã÷ûìà çàïiñàöü: "
+# ^CopyFailed
+Êàïiðàâàííå íÿ¢äàëà
+# ^CopyTo
+"Êàïiðàâàííå ¢ "
+# ^Registering
+"Ðýãiñòðàöûÿ: "
+# ^Unregistering
+"Âûäàëåííå ðýãiñòðàöûi: "
+# ^SymbolNotFound
+"Íåìàã÷ûìà àäøóêàöü ñiìâàë: "
+# ^CouldNotLoad
+"Íåìàã÷ûìà çàãðóçiöü: "
+# ^CreateFolder
+"Ñòâàðýííå ïàïê³: "
+# ^CreateShortcut
+"Ñòâàðýííå ÿðëûêó: "
+# ^CreatedUninstaller
+"Ñòâàðýííå ïðàãðàìû âûäàëåííÿ: "
+# ^Delete
+"Âûäàëåííå ôàéëà: "
+# ^DeleteOnReboot
+"Âûäàëåííå ïàñëÿ ïåðåçàãðóçêi êàìïóòàðà: "
+# ^ErrorCreatingShortcut
+"Ïàìûëêà ñòâàðýííÿ ÿðëûêó: " 
+# ^ErrorCreating
+"Ïàìûëêà ñòâàðýííÿ: "
+# ^ErrorDecompressing
+Íåìàã÷ûìà âûöÿãíóöü äàäçåíûÿ. Ìàã÷ûìà ïàøêîäæàíû äûñòðûáóòû¢.
+# ^ErrorRegistering
+Íåìàã÷ûìà çàðýã³ñòðàâàöü á³áë³ÿòýêó (DLL)
+# ^ExecShell
+"Âûêàíàííå êàìàíäû àáàëîíê³: " 
+# ^Exec
+"Âûêàíàííå: "
+# ^Extract
+"Âûìàííå: "
+# ^ErrorWriting
+"Âûìàííå: ïàìûëêà çàïiñó ôàéëà"
+# ^InvalidOpcode
+äûñòðûáóòû¢ ïàøêîäæàíû: êîä ïàìûëêi
+# ^NoOLE
+"Íÿìà OLE äëÿ: " 
+# ^OutputFolder
+"Êàòàëîã óñòàíî¢êi: "
+# ^RemoveFolder
+"Âûäàëåííå ïàïê³: "
+# ^RenameOnReboot
+"Ïåðàíàçâà ïàñëÿ ïåðåçàãðóçêi êàìïóòàðà: "
+# ^Rename
+"Ïåðàíàçâà: "
+# ^Skipped
+"Ïðàïóø÷àíà: "
+# ^CopyDetails
+Êàïiðàâàöü çâåñòêi ¢ áóôåð àáìåíà 
+# ^LogInstall
+Çàïiñâàöü ó ëîã ïðàöýñ óñòàíî¢êi
+# byte
+Á
+# kilo
+Ê
+# mega
+Ì
+# giga
+Ã
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Japanese.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Japanese.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Japanese.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1041
+# Font and size - dash (-) means default
+‚l‚r ‚oƒSƒVƒbƒN
+9
+# Codepage - dash (-) means ANSI code page
+932
+# RTL - anything else than RTL means LTR
+-
+# Translation by Dnanako, updated by Takahiro Yoshimura <takahiro_y@monolithworks.co.jp>
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) ƒZƒbƒgƒAƒbƒv
+# ^UninstallCaption
+$(^Name) ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹
+# ^LicenseSubCaption
+�Fƒ‰ƒCƒZƒ“ƒXŒ_–ñ�‘
+# ^ComponentsSubCaption
+�FƒCƒ“ƒXƒg�[ƒ‹ ƒIƒvƒVƒ‡ƒ“
+# ^DirSubCaption
+�FƒCƒ“ƒXƒg�[ƒ‹ ƒtƒHƒ‹ƒ_
+# ^InstallingSubCaption
+�FƒCƒ“ƒXƒg�[ƒ‹
+# ^CompletedSubCaption
+�FŠ®—¹
+# ^UnComponentsSubCaption
+: ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹ ƒIƒvƒVƒ‡ƒ“
+# ^UnDirSubCaption
+: ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹ ƒtƒHƒ‹ƒ_
+# ^ComfirmSubCaption
+�FŠm”F
+# ^UninstallingSubCaption
+�FƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹
+# ^UnCompletedSubCaption
+�FŠ®—¹
+# ^BackBtn
+< –ß‚é(&B)
+# ^NextBtn
+ŽŸ‚Ö(&N) >
+# ^AgreeBtn
+“¯ˆÓ‚·‚é(&A)
+# ^AcceptBtn
+‚±‚Ìƒ‰ƒCƒZƒ“ƒXŒ_–ñ�‘‚É“¯ˆÓ‚µ‚Ü‚·(&A)
+# ^DontAcceptBtn
+‚±‚Ìƒ‰ƒCƒZƒ“ƒXŒ_–ñ�‘‚É‚Í“¯ˆÓ‚Å‚«‚Ü‚¹‚ñ(&D)
+# ^InstallBtn
+ƒCƒ“ƒXƒg�[ƒ‹
+# ^UninstallBtn
+±Ý²Ý½Ä°Ù(&U)
+# ^CancelBtn
+ƒLƒƒƒ“ƒZƒ‹
+# ^CloseBtn
+•Â‚¶‚é(&C)
+# ^BrowseBtn
+ŽQ�Æ(&R)...
+# ^ShowDetailsBtn
+�Ú�×‚ð•\Ž¦(&D)
+# ^ClickNext
+‘±‚¯‚é‚É‚Í [ŽŸ‚Ö] ‚ðƒNƒŠƒbƒN‚µ‚Ä‰º‚³‚¢�B
+# ^ClickInstall
+ƒCƒ“ƒXƒg�[ƒ‹‚ðŽn‚ß‚é‚É‚Í [ƒCƒ“ƒXƒg�[ƒ‹] ‚ðƒNƒŠƒbƒN‚µ‚Ä‰º‚³‚¢�B
+# ^ClickUninstall
+ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚ðŽn‚ß‚é‚É‚Í [±Ý²Ý½Ä°Ù] ‚ðƒNƒŠƒbƒN‚µ‚Ä‰º‚³‚¢�B
+# ^Name
+ƒAƒvƒŠƒP�[ƒVƒ‡ƒ“
+# ^Completed
+Š®—¹
+# ^LicenseText
+$(^NameDA)‚ðƒCƒ“ƒXƒg�[ƒ‹‚·‚é‘O‚É�Aƒ‰ƒCƒZƒ“ƒXŒ_–ñ�‘‚ðŠm”F‚µ‚Ä‰º‚³‚¢�BŒ_–ñ�‘‚Ì‘S‚Ä‚Ì�ðŒ�‚É“¯ˆÓ‚·‚é‚È‚ç‚Î�A[“¯ˆÓ‚·‚é] ƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‰º‚³‚¢�B
+# ^LicenseTextCB
+$(^NameDA)‚ðƒCƒ“ƒXƒg�[ƒ‹‚·‚é‘O‚É�Aƒ‰ƒCƒZƒ“ƒXŒ_–ñ�‘‚ðŠm”F‚µ‚Ä‰º‚³‚¢�BŒ_–ñ�‘‚Ì‘S‚Ä‚Ì�ðŒ�‚É“¯ˆÓ‚·‚é‚È‚ç‚Î�A‰º‚Ìƒ`ƒFƒbƒNƒ{ƒbƒNƒX‚ðƒNƒŠƒbƒN‚µ‚Ä‰º‚³‚¢�B $_CLICK
+# ^LicenseTextRB
+$(^NameDA)‚ðƒCƒ“ƒXƒg�[ƒ‹‚·‚é‘O‚É�Aƒ‰ƒCƒZƒ“ƒXŒ_–ñ�‘‚ðŠm”F‚µ‚Ä‰º‚³‚¢�BŒ_–ñ�‘‚Ì‘S‚Ä‚Ì�ðŒ�‚É“¯ˆÓ‚·‚é‚È‚ç‚Î�A‰º‚É•\Ž¦‚³‚ê‚Ä‚¢‚éƒIƒvƒVƒ‡ƒ“‚Ì‚¤‚¿�A�Å�‰‚Ì‚à‚Ì‚ð‘I‚ñ‚Å‰º‚³‚¢�B $_CLICK
+# ^UnLicenseText
+$(^NameDA)‚ðƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚·‚é‘O‚É�Aƒ‰ƒCƒZƒ“ƒXŒ_–ñ�‘‚ðŠm”F‚µ‚Ä‰º‚³‚¢�BŒ_–ñ�‘‚Ì‘S‚Ä‚Ì�ðŒ�‚É“¯ˆÓ‚·‚é‚È‚ç‚Î�A[“¯ˆÓ‚·‚é] ƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‰º‚³‚¢�B
+# ^UnLicenseTextCB
+$(^NameDA)‚ðƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚·‚é‘O‚É�Aƒ‰ƒCƒZƒ“ƒXŒ_–ñ�‘‚ðŠm”F‚µ‚Ä‰º‚³‚¢�BŒ_–ñ�‘‚Ì‘S‚Ä‚Ì�ðŒ�‚É“¯ˆÓ‚·‚é‚È‚ç‚Î�A‰º‚Ìƒ`ƒFƒbƒNƒ{ƒbƒNƒX‚ðƒNƒŠƒbƒN‚µ‚Ä‰º‚³‚¢�B $_CLICK
+# ^UnLicenseTextRB
+$(^NameDA)‚ðƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚·‚é‘O‚É�Aƒ‰ƒCƒZƒ“ƒXŒ_–ñ�‘‚ðŠm”F‚µ‚Ä‰º‚³‚¢�BŒ_–ñ�‘‚Ì‘S‚Ä‚Ì�ðŒ�‚É“¯ˆÓ‚·‚é‚È‚ç‚Î�A‰º‚É•\Ž¦‚³‚ê‚Ä‚¢‚éƒIƒvƒVƒ‡ƒ“‚Ì‚¤‚¿�A�Å�‰‚Ì‚à‚Ì‚ð‘I‚ñ‚Å‰º‚³‚¢�B $_CLICK
+# ^Custom
+ƒJƒXƒ^ƒ€
+# ^ComponentsText
+ƒCƒ“ƒXƒg�[ƒ‹‚µ‚½‚¢ƒRƒ“ƒ|�[ƒlƒ“ƒg‚Éƒ`ƒFƒbƒN‚ð•t‚¯‚Ä‰º‚³‚¢�B•s—v‚È‚à‚Ì‚É‚Â‚¢‚Ä‚Í�Aƒ`ƒFƒbƒN‚ðŠO‚µ‚Ä‰º‚³‚¢�B $_CLICK
+# ^ComponentsSubText1
+ƒCƒ“ƒXƒg�[ƒ‹ ƒ^ƒCƒv‚ð‘I‘ð�F
+# ^ComponentsSubText2_NoInstTypes
+ƒCƒ“ƒXƒg�[ƒ‹ ƒRƒ“ƒ|�[ƒlƒ“ƒg‚ð‘I‘ð�F
+# ^ComponentsSubText2
+‚Ü‚½‚Í�AƒCƒ“ƒXƒg�[ƒ‹ ƒIƒvƒVƒ‡ƒ“ ƒRƒ“ƒ|�[ƒlƒ“ƒg‚ð‘I‘ð�F
+# ^UnComponentsText
+ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚µ‚½‚¢ƒRƒ“ƒ|�[ƒlƒ“ƒg‚Éƒ`ƒFƒbƒN‚ð•t‚¯‚Ä‰º‚³‚¢�B‚»‚¤‚Å‚È‚¢‚à‚Ì‚É‚Â‚¢‚Ä‚Í�Aƒ`ƒFƒbƒN‚ðŠO‚µ‚Ä‰º‚³‚¢�B $_CLICK
+# ^UnComponentsSubText1
+ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹ ƒ^ƒCƒv‚ð‘I‘ð�F
+# ^UnComponentsSubText2_NoInstTypes
+ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹ ƒRƒ“ƒ|�[ƒlƒ“ƒg‚ð‘I‘ð�F
+# ^UnComponentsSubText2
+‚Ü‚½‚Í�AƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹ ƒIƒvƒVƒ‡ƒ“ ƒRƒ“ƒ|�[ƒlƒ“ƒg‚ð‘I‘ð�F
+# ^DirText
+$(^NameDA)‚ðˆÈ‰º‚ÌƒtƒHƒ‹ƒ_‚ÉƒCƒ“ƒXƒg�[ƒ‹‚µ‚Ü‚·�BˆÙ‚È‚Á‚½ƒtƒHƒ‹ƒ_‚ÉƒCƒ“ƒXƒg�[ƒ‹‚·‚é‚É‚Í�A[ŽQ�Æ] ‚ð‰Ÿ‚µ‚Ä�A•Ê‚ÌƒtƒHƒ‹ƒ_‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢�B $_CLICK
+# ^DirSubText
+ƒCƒ“ƒXƒg�[ƒ‹�æ ƒtƒHƒ‹ƒ_
+# ^DirBrowseText
+$(^NameDA)‚ðƒCƒ“ƒXƒg�[ƒ‹‚·‚éƒtƒHƒ‹ƒ_‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢�F
+# ^UnDirText
+$(^NameDA)‚ðˆÈ‰º‚ÌƒtƒHƒ‹ƒ_‚©‚çƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚µ‚Ü‚·�BˆÙ‚È‚Á‚½ƒtƒHƒ‹ƒ_‚©‚çƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚·‚é‚É‚Í�A[ŽQ�Æ] ‚ð‰Ÿ‚µ‚Ä�A•Ê‚ÌƒtƒHƒ‹ƒ_‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢�B $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+$(^NameDA)‚ðƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚·‚éƒtƒHƒ‹ƒ_‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢�F
+# ^SpaceAvailable
+—˜—p‰Â”\‚ÈƒfƒBƒXƒNƒXƒy�[ƒX�F 
+# ^SpaceRequired
+•K—v‚ÈƒfƒBƒXƒNƒXƒy�[ƒX�F 
+# ^UninstallingText
+$(^NameDA)‚Í�AˆÈ‰º‚ÌƒtƒHƒ‹ƒ_‚©‚çƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚³‚ê‚Ü‚·�B $_CLICK
+# ^UninstallingSubText
+ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹Œ³�F
+# ^FileError
+�‰Šúƒtƒ@ƒCƒ‹‚Ì�ì�¬ƒGƒ‰�[�F\r\n\t"$0"\r\nƒCƒ“ƒXƒg�[ƒ‹‚ð’†Ž~‚·‚é‚É‚Í’†Ž~‚ð,\r\n�Ä‚Ñ‚±‚Ìƒtƒ@ƒCƒ‹‚Ì�ì�¬‚ðŽŽ‚Ý‚é‚É‚Í�ÄŽŽ�s‚ð, ‚Ü‚½\r\n‚±‚Ìƒtƒ@ƒCƒ‹‚ðƒXƒLƒbƒv‚µ‚Ä‘±‚¯‚é‚É‚Í–³Ž‹‚ð‰Ÿ‚µ‚Ä‚­‚¾‚³‚¢
+# ^FileError_NoIgnore
+�‰Šúƒtƒ@ƒCƒ‹‚Ì�ì�¬ƒGƒ‰�[: \r\n\t"$0"\r\n�Ä‚Ñ‚±‚Ìƒtƒ@ƒCƒ‹‚Ì�ì�¬‚ðŽŽ‚Ý‚é‚É‚Í�ÄŽŽ�s‚ð, ‚Ü‚½\r\nƒCƒ“ƒXƒg�[ƒ‹‚ð’†Ž~‚·‚é‚É‚ÍƒLƒƒƒ“ƒZƒ‹‚ð‰Ÿ‚µ‚Ä‰º‚³‚¢
+# ^CantWrite
+�ì�¬‚Å‚«‚Ü‚¹‚ñ�F
+# ^CopyFailed
+ƒRƒs�[‚ÍŽ¸”s‚µ‚Ü‚µ‚½
+# ^CopyTo
+ƒRƒs�[‚µ‚Ü‚·
+# ^Registering
+“o˜^’†:
+# ^Unregistering
+“o˜^‰ð�œ’†:
+# ^SymbolNotFound
+ƒVƒ“ƒ{ƒ‹‚ðŒ©‚Â‚¯‚é‚±‚Æ‚ª‚Å‚«‚Ü‚¹‚ñ�F
+# ^CouldNotLoad
+ƒ��[ƒh‚·‚é‚±‚Æ‚ª‚Å‚«‚Ü‚¹‚ñ�F
+# ^CreateFolder
+ƒtƒHƒ‹ƒ_‚Ì�ì�¬�F
+# ^CreateShortcut
+ƒVƒ‡�[ƒgƒJƒbƒg‚Ì�ì�¬�F
+# ^CreatedUninstaller
+ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‰‚Ì�ì�¬�F
+# ^Delete
+ƒtƒ@ƒCƒ‹‚Ì�í�œ�F
+# ^DeleteOnReboot
+ƒŠƒu�[ƒgŽž‚É�í�œ�F
+# ^ErrorCreatingShortcut
+ƒVƒ‡�[ƒgƒJƒbƒg‚Ì�ì�¬ƒGƒ‰�[�F
+# ^ErrorCreating
+�ì�¬ƒGƒ‰�[�F
+# ^ErrorDecompressing
+ƒf�[ƒ^‚Ì’Š�oƒGƒ‰�[\r\n\r\nƒCƒ“ƒXƒg�[ƒ‰‚ª”j‘¹‚µ‚Ä‚¢‚Ü‚·�B
+# ^ErrorRegistering
+DLL‚Ì“o˜^ƒGƒ‰�[
+# ^ExecShell
+Šg’£Žq‚ÌŠÖ˜A•t‚¯ŽÀ�s: 
+# ^Execute
+ŽÀ�s�F
+# ^Extract
+’Š�o�F
+# ^ErrorWriting
+’Š�o�Fƒtƒ@ƒCƒ‹�ì�¬ƒGƒ‰�[
+# ^InvalidOpcode
+ƒCƒ“ƒXƒg�[ƒ‹‚Ì•s�³�F–³Œø‚Èopcode
+# ^NoOLE
+OLE‚ª‚ ‚è‚Ü‚¹‚ñ�F
+# ^OutputFolder
+�o—Í�æƒtƒHƒ‹ƒ_�F
+# ^RemoveFolder
+ƒtƒHƒ‹ƒ_‚Ì�í�œ�F
+# ^RenameOnReboot
+ƒŠƒu�[ƒgŽž‚É–¼‘O‚Ì•Ï�X�F
+# ^Rename
+–¼‘O‚Ì•Ï�X�F
+# ^Skipped
+ƒXƒLƒbƒv�F
+# ^CopyDetails
+ƒNƒŠƒbƒvƒ{�[ƒh‚Ö�Ú�×‚ðƒRƒs�[
+# ^LogInstall
+ƒCƒ“ƒXƒg�[ƒ‹ƒvƒ�ƒZƒX‚ðƒ�ƒOƒw‹L˜^
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Korean.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Korean.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Korean.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Korean (1042)
+;By linak linak@korea.com ( ~ V2.0 BETA3 ) By kippler@gmail.com(www.kipple.pe.kr) ( V2.0 BETA3 ~ ) (last update:2007/09/05)
+
+!insertmacro LANGFILE "Korean" "Korean"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "$(^NameDA) ¼³Ä¡¸¦ ½ÃÀÛÇÕ´Ï´Ù."
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "ÀÌ ÇÁ·Î±×·¥Àº ´ç½ÅÀÇ ÄÄÇ»ÅÍ¿¡ $(^NameDA)(À»)¸¦ ¼³Ä¡ÇÒ °ÍÀÔ´Ï´Ù.$\r$\n$\r$\n¼³Ä¡¸¦ ½ÃÀÛÇÏ±â Àü °¡´ÉÇÑ ÇÑ ¸ðµç ÇÁ·Î±×·¥À» Á¾·áÇÏ¿© ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù. ÀÌ´Â ÀçºÎÆÃÀ» ÇÏÁö ¾Ê°í¼­µµ ½Ã½ºÅÛ ÆÄÀÏÀ» ¼öÁ¤ÇÒ ¼ö ÀÖ°Ô ÇØÁÝ´Ï´Ù.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "$(^NameDA) Á¦°Å¸¦ ½ÃÀÛÇÕ´Ï´Ù."
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "ÀÌ ÇÁ·Î±×·¥Àº ´ç½ÅÀÇ ÄÄÇ»ÅÍ¿¡¼­ $(^NameDA)(À»)¸¦ Á¦°ÅÇÒ °ÍÀÔ´Ï´Ù.$\r$\n$\r$\nÁ¦°Å¸¦ ½ÃÀÛÇÏ±â Àü¿¡ $(^NameDA)(À»)¸¦ Á¾·áÇÏ¿© ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "»ç¿ë±Ç °è¾à"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "$(^NameDA)(À»)¸¦ ¼³Ä¡ÇÏ½Ã±â Àü¿¡ »ç¿ë±Ç °è¾à ³»¿ëÀ» »ìÆìº¸½Ã±â ¹Ù¶ø´Ï´Ù."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "³»¿ë¿¡ µ¿ÀÇÇÏ¼Ì´Ù¸é 'µ¿ÀÇÇÔ'À» ´­·¯ ÁÖ¼¼¿ä. $(^NameDA)(À»)¸¦ ¼³Ä¡ÇÏ±â À§ÇØ¼­´Â ¹Ýµå½Ã ³»¿ë¿¡ µ¿ÀÇÇÏ¼Å¾ß ÇÕ´Ï´Ù."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "³»¿ë¿¡ µ¿ÀÇÇÏ¼Ì´Ù¸é ¾Æ·¡ »çÇ×À» ¼±ÅÃÇØ ÁÖ¼¼¿ä. $(^NameDA)(À»)¸¦ ¼³Ä¡ÇÏ±â À§ÇØ¼­´Â ¹Ýµå½Ã ³»¿ë¿¡ µ¿ÀÇÇÏ¼Å¾ß ÇÕ´Ï´Ù. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "³»¿ë¿¡ µ¿ÀÇÇÏ¼Ì´Ù¸é Ã¹ ¹øÂ° »çÇ×À» ¼±ÅÃÇØ ÁÖ¼¼¿ä. $(^NameDA)(À»)¸¦ ¼³Ä¡ÇÏ±â À§ÇØ¼­´Â ¹Ýµå½Ã ³»¿ë¿¡ µ¿ÀÇÇÏ¼Å¾ß ÇÕ´Ï´Ù. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "»ç¿ë±Ç °è¾à µ¿ÀÇ"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "$(^NameDA)(À»)¸¦ Á¦°ÅÇÏ½Ã±â Àü¿¡ »ç¿ë±Ç °è¾à ³»¿ëÀ» »ìÆìº¸½Ã±â ¹Ù¶ø´Ï´Ù."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "³»¿ë¿¡ µ¿ÀÇÇÏ¼Ì´Ù¸é 'µ¿ÀÇÇÔ'À» ´­·¯ ÁÖ¼¼¿ä. $(^NameDA)(À»)¸¦ Á¦°ÅÇÏ±â À§ÇØ¼­´Â ¹Ýµå½Ã ³»¿ë¿¡ µ¿ÀÇÇÏ¼Å¾ß ÇÕ´Ï´Ù."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "³»¿ë¿¡ µ¿ÀÇÇÏ¼Ì´Ù¸é ¾Æ·¡ »çÇ×À» ¼±ÅÃÇØ ÁÖ¼¼¿ä. $(^NameDA)(À»)¸¦ Á¦°ÅÇÏ±â À§ÇØ¼­´Â ¹Ýµå½Ã ³»¿ë¿¡ µ¿ÀÇÇÏ¼Å¾ß ÇÕ´Ï´Ù. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "³»¿ë¿¡ µ¿ÀÇÇÏ¼Ì´Ù¸é Ã¹ ¹øÂ° »çÇ×À» ¼±ÅÃÇØ ÁÖ¼¼¿ä. $(^NameDA)(À»)¸¦ Á¦°ÅÇÏ±â À§ÇØ¼­´Â ¹Ýµå½Ã ³»¿ë¿¡ µ¿ÀÇÇÏ¼Å¾ß ÇÕ´Ï´Ù. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "»ç¿ë±Ç °è¾à µ¿ÀÇ »çÇ×ÀÇ ³ª¸ÓÁö ºÎºÐÀ» º¸½Ã·Á¸é [Page Down] Å°¸¦ ´­·¯ ÁÖ¼¼¿ä."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "±¸¼º ¿ä¼Ò ¼±ÅÃ"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "¼³Ä¡ÇÏ°íÀÚ ÇÏ´Â $(^NameDA)ÀÇ ±¸¼º ¿ä¼Ò¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "±¸¼º ¿ä¼Ò ¼±ÅÃ"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Á¦°ÅÇÏ°íÀÚ ÇÏ´Â $(^NameDA)ÀÇ ±¸¼º ¿ä¼Ò¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "»ó¼¼ ¼³¸í"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "»ó¼¼ ¼³¸íÀ» º¸°í ½ÍÀ¸½Å ºÎºÐ¿¡ ¸¶¿ì½º¸¦ ¿Ã·Á³õÀ¸¼¼¿ä."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "»ó¼¼ ¼³¸íÀ» º¸°í ½ÍÀ¸½Å ºÎºÐ¿¡ ¸¶¿ì½º¸¦ ¿Ã·Á³õÀ¸¼¼¿ä."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "¼³Ä¡ À§Ä¡ ¼±ÅÃ"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "$(^NameDA)(À»)¸¦ ¼³Ä¡ÇÒ Æú´õ¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Á¦°Å À§Ä¡ ¼±ÅÃ"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "$(^NameDA)(À»)¸¦ Á¦°ÅÇÒ Æú´õ¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "¼³Ä¡Áß"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "$(^NameDA)(À»)¸¦ ¼³Ä¡ÇÏ´Â µ¿¾È Àá½Ã ±â´Ù·Á ÁÖ¼¼¿ä."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "¼³Ä¡ ¿Ï·á"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "¼³Ä¡°¡ ¼º°øÀûÀ¸·Î ¿Ï·áµÇ¾ú½À´Ï´Ù."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "¼³Ä¡ Ãë¼Ò"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "ÇÁ·Î±×·¥ ¼³Ä¡°¡ Ãë¼ÒµÇ¾ú½À´Ï´Ù."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Á¦°ÅÁß"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "$(^NameDA)(À»)¸¦ Á¦°ÅÇÏ´Â µ¿¾È Àá½Ã ±â´Ù·Á ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Á¦°Å ¸¶Ä§"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "ÇÁ·Î±×·¥À» ¼º°øÀûÀ¸·Î Á¦°ÅÇÏ¿´½À´Ï´Ù."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "ÇÁ·Î±×·¥ Á¦°Å Ãë¼Ò"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "ÇÁ·Î±×·¥ Á¦°Å°¡ Ãë¼ÒµÇ¾ú½À´Ï´Ù."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "$(^NameDA) ¼³Ä¡ ¿Ï·á"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA)ÀÇ ¼³Ä¡°¡ ¿Ï·áµÇ¾ú½À´Ï´Ù. ¼³Ä¡ ÇÁ·Î±×·¥À» ¸¶Ä¡·Á¸é '¸¶Ä§' ¹öÆ°À» ´­·¯ ÁÖ¼¼¿ä."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "$(^NameDA)ÀÇ ¼³Ä¡¸¦ ¿Ï·áÇÏ±â À§ÇØ¼­´Â ½Ã½ºÅÛÀ» ´Ù½Ã ½ÃÀÛÇØ¾ß ÇÕ´Ï´Ù. Áö±Ý ÀçºÎÆÃ ÇÏ½Ã°Ú½À´Ï±î?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Á¦°Å ¿Ï·á"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA)ÀÇ Á¦°Å°¡ ¿Ï·á µÇ¾ú½À´Ï´Ù."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "$(^NameDA)ÀÇ Á¦°Å¸¦ ¿Ï·áÇÏ±â À§ÇØ¼­´Â ½Ã½ºÅÛÀ» ´Ù½Ã ½ÃÀÛÇØ¾ß ÇÕ´Ï´Ù. Áö±Ý ÀçºÎÆÃ ÇÏ½Ã°Ú½À´Ï±î?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Áö±Ý ÀçºÎÆÃ ÇÏ°Ú½À´Ï´Ù."
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "³ªÁß¿¡ ÀçºÎÆÃ ÇÏ°Ú½À´Ï´Ù."
+  ${LangFileString} MUI_TEXT_FINISH_RUN "$(^NameDA) ½ÇÇàÇÏ±â(&R)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Readme ÆÄÀÏ º¸±â(&S)"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "¸¶Ä§"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "½ÃÀÛ ¸Þ´º Æú´õ ¼±ÅÃ"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "ÇÁ·Î±×·¥ÀÇ ¹Ù·Î °¡±â ¾ÆÀÌÄÜÀÌ »ý¼ºµÉ ½ÃÀÛ ¸Þ´º Æú´õ ¼±ÅÃ."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "ÇÁ·Î±×·¥ÀÇ ¹Ù·Î °¡±â ¾ÆÀÌÄÜÀÌ »ý¼ºµÉ ½ÃÀÛ ¸Þ´º Æú´õ¸¦ ¼±ÅÃÇÏ¼¼¿ä. »õ·Î¿î Æú´õ¸¦ »ý¼ºÇÏ·Á¸é Æú´õ ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "¹Ù·Î °¡±â ¾ÆÀÌÄÜÀ» ¸¸µéÁö ¾Ê°Ú½À´Ï´Ù."
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "$(^NameDA) Á¦°Å"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "$(^NameDA) Á¦°ÅÇÏ±â"
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "$(^Name) ¼³Ä¡¸¦ Ãë¼ÒÇÏ½Ã°Ú½À´Ï±î?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "$(^Name) Á¦°Å¸¦ Ãë¼ÒÇÏ½Ã°Ú½À´Ï±î?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/TradChinese.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/TradChinese.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/TradChinese.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1028
+# Font and size - dash (-) means default ¦r«¬¦WºÙ»P¤j¤p
+·s²Ó©úÅé
+9
+# Codepage - dash (-) means ANSI code page ANSI ¦r½X­¶
+950
+# RTL - anything else than RTL means LTR ¥Ñ¥k¦Ü¥ª®Ñ¼g
+-
+# Translator: Kii Ali <kiiali@cpatch.org>;Revision date: 2004-12-14
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) ¦w¸Ë
+# ^UninstallCaption
+$(^Name) ¸Ñ°£¦w¸Ë
+# ^LicenseSubCaption
+: ±ÂÅv¨óÄ³
+# ^ComponentsSubCaption
+: ¦w¸Ë¿ï¶µ
+# ^DirSubCaption
+: ¦w¸Ë¸ê®Æ§¨
+# ^InstallingSubCaption
+: ¥¿¦b¦w¸Ë
+# ^CompletedSubCaption
+: ¤w§¹¦¨
+# ^UnComponentsSubCaption
+: ¸Ñ°£¦w¸Ë¿ï¶µ
+# ^UnDirSubCaption
+: ¸Ñ°£¦w¸Ë¸ê®Æ§¨
+# ^ConfirmSubCaption
+: ½T»{
+# ^UninstallingSubCaption
+: ¥¿¦b¸Ñ°£¦w¸Ë
+# ^UnCompletedSubCaption
+: §¹¦¨
+# ^BackBtn
+< ¤W¤@¨B(&P)
+# ^NextBtn
+¤U¤@¨B(&N) >
+# ^AgreeBtn
+§Ú±µ¨ü(&I)
+# ^AcceptBtn
+§Ú±µ¨ü¡u±ÂÅv¨óÄ³¡v¤¤ªº±ø´Ú(&A)
+# ^DontAcceptBtn
+§Ú¤£±µ¨ü¡u±ÂÅv¨óÄ³¡v¤¤ªº±ø´Ú(&N)
+# ^InstallBtn
+¦w¸Ë(&I)
+# ^UninstallBtn
+²¾°£(&U)
+# ^CancelBtn
+¨ú®ø(&C)
+# ^CloseBtn
+Ãö³¬(&L)
+# ^BrowseBtn
+ÂsÄý(&B)...
+# ^ShowDetailsBtn
+Åã¥Ü²Ó¸`(&D)
+# ^ClickNext
+«ö¤@¤U [¤U¤@¨B(N)] Ä~Äò¡C
+# ^ClickInstall
+«ö¤@¤U [¦w¸Ë(I)] ¶}©l¦w¸Ë¶iµ{¡C
+# ^ClickUninstall
+«ö¤@¤U [¸Ñ°£¦w¸Ë(U)] ¶}©l¸Ñ°£¦w¸Ë¶iµ{¡C
+# ^Name
+¦WºÙ
+# ^Completed
+¤w§¹¦¨
+# ^LicenseText
+¦b¦w¸Ë $(^NameDA) ¤§«e½ÐÀË¾\±ÂÅv¨óÄ³¡C¦pªG§A±µ¨ü¨óÄ³¤¤©Ò¦³±ø´Ú¡A«ö¤@¤U [§Ú¦P·N(I)] ¡C
+# ^LicenseTextCB
+¦b¦w¸Ë $(^NameDA) ¤§«e½ÐÀË¾\±ÂÅv¨óÄ³¡C¦pªG§A±µ¨ü¨óÄ³¤¤©Ò¦³±ø´Ú¡A«ö¤@¤U¤U¤èªº¤Ä¿ï®Ø¡C $_CLICK
+# ^LicenseTextRB
+¦b¦w¸Ë $(^NameDA) ¤§«e½ÐÀË¾\±ÂÅv¨óÄ³¡C¦pªG§A±µ¨ü¨óÄ³¤¤©Ò¦³±ø´Ú¡A¿ï¾Ü¤U¤èªº²Ä¤@­Ó¿ï¶µ¡C $_CLICK
+# ^UnLicenseText
+¦b¸Ñ°£¦w¸Ë $(^NameDA) ¤§«e½ÐÀË¾\±ÂÅv¨óÄ³¡C¦pªG§A±µ¨ü¨óÄ³¤¤©Ò¦³±ø´Ú¡A«ö¤@¤U [§Ú¦P·N(I)] ¡C
+# ^UnLicenseTextCB
+¦b¸Ñ°£¦w¸Ë $(^NameDA) ¤§«e½ÐÀË¾\±ÂÅv¨óÄ³¡C¦pªG§A±µ¨ü¨óÄ³¤¤©Ò¦³±ø´Ú¡A«ö¤@¤U¤U¤èªº¤Ä¿ï®Ø¡C $_CLICK
+# ^UnLicenseTextRB
+¦b¸Ñ°£¦w¸Ë $(^NameDA) ¤§«e½ÐÀË¾\±ÂÅv¨óÄ³¡C¦pªG§A±µ¨ü¨óÄ³¤¤©Ò¦³±ø´Ú¡A¿ï¾Ü¤U¤èªº²Ä¤@­Ó¿ï¶µ¡C $_CLICK
+# ^Custom
+¦Û­q
+# ^ComponentsText
+¤Ä¿ï§A·Q­n¦w¸Ëªº¤¸¥ó¡A¨Ã¸Ñ°£¤Ä¿ï§A¤£§Æ±æ¦w¸Ëªº¤¸¥ó¡C $_CLICK
+# ^ComponentsSubText1
+¿ï¨ú¦w¸ËªºÃþ«¬: 
+# ^ComponentsSubText2_NoInstTypes
+¿ï¨ú¦w¸Ëªº¤¸¥ó: 
+# ^ComponentsSubText2
+©ÎªÌ¡A¦Û­q¿ï¨ú·Q¦w¸Ëªº¤¸¥ó: 
+# ^UnComponentsText
+¤Ä¿ï§A·Q­n¸Ñ°£¦w¸Ëªº¤¸¥ó¡A¨Ã¸Ñ°£¤Ä¿ï§A¤£§Æ±æ¸Ñ°£¦w¸Ëªº¤¸¥ó¡C $_CLICK
+# ^UnComponentsSubText1
+¿ï¾Ü¸Ñ°£¦w¸ËªºÃþ«¬: 
+# ^UnComponentsSubText2_NoInstTypes
+¿ï¾Ü­n¸Ñ°£¦w¸Ëªº¤¸¥ó: 
+# ^UnComponentsSubText2
+©Î¬O¡A¿ï¾Ü·Q­n¸Ñ°£¦w¸Ëªº¥i¿ï¶µ¤¸¥ó: 
+# ^DirText
+Setup ±N¦w¸Ë $(^NameDA) ¦b¤U¦C¸ê®Æ§¨¡C­n¦w¸Ë¨ì¤£¦P¸ê®Æ§¨¡A«ö¤@¤U [ÂsÄý(B)] ¨Ã¿ï¾Ü¨ä¥Lªº¸ê®Æ§¨¡C $_CLICK
+# ^DirSubText
+¥Ø¼Ð¸ê®Æ§¨
+# ^DirBrowseText
+¿ï¾Ü­n¦w¸Ë $(^NameDA) ªº¸ê®Æ§¨¦ì¸m: 
+# ^UnDirText
+Setup ±N¸Ñ°£¦w¸Ë $(^NameDA) ¦b¤U¦C¸ê®Æ§¨¡C­n¸Ñ°£¦w¸Ë¨ì¤£¦P¸ê®Æ§¨¡A«ö¤@¤U [ÂsÄý(B)] ¨Ã¿ï¾Ü¨ä¥Lªº¸ê®Æ§¨¡C $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+¿ï¾Ü­n¸Ñ°£¦w¸Ë $(^NameDA) ªº¸ê®Æ§¨¦ì¸m: 
+# ^SpaceAvailable
+"¥i¥ÎªÅ¶¡: "
+# ^SpaceRequired
+"©Ò»ÝªÅ¶¡: "
+# ^UninstallingText
+³o­ÓºëÆF±N±q§Aªº¹q¸£¸Ñ°£¦w¸Ë $(^NameDA) ¡C $_CLICK
+# ^UninstallingSubText
+¸Ñ°£¦w¸Ë¥Ø¿ý: 
+# ^FileError
+µLªk¶}±Ò­n¼g¤JªºÀÉ®×: \r\n\t"$0"\r\n«ö¤@¤U [Abort] ©ñ±ó¦w¸Ë¡A\r\n [Retry] ­«·s¹Á¸Õ¼g¤JÀÉ®×¡A©Î\r\n [Ignore] ©¿²¤³o­ÓÀÉ®×¡C
+# ^FileError_NoIgnore
+µLªk¶}±Ò­n¼g¤JªºÀÉ®×: \r\n\t"$0"\r\n«ö¤@¤U [Retry] ­«·s¹Á¸Õ¼g¤JÀÉ®×¡A©Î\r\n [Cancel] ¨ú®ø¦w¸Ë¡C
+# ^CantWrite
+"µLªk¼g¤J: "
+# ^CopyFailed
+"½Æ»s¥¢±Ñ "
+# ^CopyTo
+"½Æ»s¨ì: "
+# ^Registering
+"¥¿¦bµù¥U: "
+# ^Unregistering
+"¥¿¦b¸Ñ°£µù¥U: "
+# ^SymbolNotFound
+"µLªk§ä¨ì²Å¸¹: "
+# ^CouldNotLoad
+"µLªk¸ü¤J: "
+# ^CreateFolder
+"«Ø¥ß¸ê®Æ§¨: " 
+# ^CreateShortcut
+"«Ø¥ß±¶®|: "
+# ^CreatedUninstaller
+"«Ø¥ß¸Ñ°£¦w¸Ëµ{¦¡: "
+# ^Delete
+"§R°£ÀÉ®×: "
+# ^DeleteOnReboot
+"­«·s±Ò°Ê«á§R°£: "
+# ^ErrorCreatingShortcut
+"¥¿¦b«Ø¥ß±¶®|®Éµo¥Í¿ù»~: "
+# ^ErrorCreating
+"¥¿¦b«Ø¥ß®Éµo¥Í¿ù»~: "
+# ^ErrorDecompressing
+"¥¿¦b¸ÑÀ£ÁY¸ê®Æµo¥Í¿ù»~¡I¤w·lÃaªº¦w¸Ëµ{¦¡¡H"
+# ^ErrorRegistering
+"¥¿¦bµù¥U DLL ®Éµo¥Í¿ù»~"
+# ^ExecShell
+"°õ¦æ¥~³¡µ{¦¡: "
+# ^Exec
+"°õ¦æ: "
+# ^Extract
+"©â¨ú: "
+# ^ErrorWriting
+"©â¨ú: µLªk¼g¤JÀÉ®× "
+# ^InvalidOpcode
+"¦w¸Ë·l·´: µL®Äªº§@·~¥N½X "
+# ^NoOLE
+"¨S¦³ OLE ¥Î©ó: "
+# ^OutputFolder
+"¿é¥X¥Ø¿ý: "
+# ^RemoveFolder
+"²¾°£¥Ø¿ý: "
+# ^RenameOnReboot
+"­«·s±Ò°Ê«á­«·s©R¦W: "
+# ^Rename
+"­«·s©R¦W: "
+# ^Skipped
+"¤w²¤¹L: "
+# ^CopyDetails
+"½Æ»s²Ó¸`¨ì°Å¶KÃ¯ "
+# ^LogInstall
+"¤é»x¦w¸Ë¶iµ{"
+# byte
+B
+# kilo
+K
+# mega
+M
+# giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Ukrainian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Ukrainian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Ukrainian.nsh	(revision 728)
@@ -0,0 +1,122 @@
+;Language: Ukrainian (1058)
+;By Yuri Holubow, http://www.Nash-Soft.com
+;Correct by Osidach Vitaly (Vit_Os2)
+
+!insertmacro LANGFILE "Ukrainian" "Ukrainian"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Ëàñêàâî ïðîñèìî äî Ìàéñòðà Âñòàíîâëåííÿ $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Äàíà ïðîãðàìà âñòàíîâèòü $(^NameDA) íà Âàø êîìï'þòåð.$\r$\n$\r$\nÐåêîìåíäîâàíî çàêðèòè âñ³ ïðîãðàìè ïåðåä ïî÷àòêîì ³íñòàëÿö³¿. Öå äîçâîëèòü ïðîãðàì³ âñòàíîâëåííÿ îíîâèòè ñèñòåìí³ ôàéëè áåç ïåðåçàâàíòàæåííÿ ñèñòåìè.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Ëàñêàâî ïðîñèìî äî Ìàéñòðà Âèäàëåííÿ $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Äàíèé ìàéñòåð äîìîæå âèäàëèòè $(^NameDA).$\r$\n$\r$\nÏåðåä ïî÷àòêîì âèäàëåííÿ, ïåðåâ³ðòå, ÷è íå çàïóùåíî $(^NameDA).$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Ë³öåíç³éíà Óãîäà"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Áóäü-ëàñêà ïåðåãëÿíüòå ë³öåíç³þ ïåðåä âñòàíîâëåííÿì $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "ßêùî Âè ïðèéìàºòå âñi óìîâè Óãîäè, íàòèñíiòü íà êíîïêó Çãîäåí. Âè ïîâèííi ïðèéíÿòè óìîâè Óãîäè äëÿ âñòàíîâëåííÿ $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "ßêùî Âè ïðèéìàºòå âñ³ óìîâè Óãîäè, âñòàíîâ³òü â³äì³òêó ó êâàäðàòèêó íèæ÷å. Âè ïîâèíí³ ïðèéíÿòè óìîâè Óãîäè äëÿ âñòàíîâëåííÿ $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "ßêùî Âè ïðèéìàºòå âñ³ óìîâè Óãîäè, âèáåð³òü ïåðøèé âàð³àíò ç òèõ ùî íèæ÷å. Âè ïîâèíí³ ïðèéíÿòè óìîâè Óãîäè äëÿ âñòàíîâëåííÿ $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Ë³öåíç³éíà óãîäà"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Ïðî÷èòàéòå óìîâè ë³öåíç³éíî¿ óãîäè ïåðåä âèäàëåííÿì $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "ßêùî Âè ïðèéìàºòå âñi óìîâè Óãîäè, íàòèñíiòü íà êíîïêó Çãîäåí. Âè ïîâèííi ïðèéíÿòè óìîâè Óãîäè äëÿ âèäàëåííÿ $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "ßêùî Âè ïðèéìàºòå âñ³ óìîâè Óãîäè, âñòàíîâ³òü â³äì³òêó ó êâàäðàòèêó íèæ÷å. Âè ïîâèíí³ ïðèéíÿòè óìîâè Óãîäè äëÿ âèäàëåííÿ $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "ßêùî Âè ïðèéìàºòå âñ³ óìîâè Óãîäè, âèáåð³òü ïåðøèé âàð³àíò ç òèõ, ùî íèæ÷å. Âè ïîâèíí³ ïðèéíÿòè óìîâè Óãîäè äëÿ âèäàëåííÿ $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Íàòèñíiòü PageDown ùîá ïåðåì³ñòèòèñü âíèç óãîäè."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Îáåð³òü êîìïîíåíòè"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Îáåð³òü êîìïîíåíòè $(^NameDA) ÿêi Âè áàæàºòå âñòàíîâèòè."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Êîìïîíåíòè ïðîãðàìè"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Îáåð³òü ÿê³ êîìïîíåíòè $(^NameDA) Âè áàæàºòå âèäàëèòè."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Îïèñ"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Ïiäâåäiòü âàøó ìèøêó äî êîìïîíåíòà, ùîá ïîáà÷èòè éîãî îïèñ."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Ïiäâåäiòü âàøó ìèøêó äî êîìïîíåíòà, ùîá ïîáà÷èòè éîãî îïèñ."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Îáåðiòü òåêó âñòàíîâëåííÿ"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Îáåðiòü òåêó äëÿ âñòàíîâëåííÿ $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Âèá³ð òåêè äëÿ âèäàëåííÿ"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Îáåð³òü òåêó, ç ÿêî¿ Âè áàæàºòå âèäàëèòè $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Êîï³þâàííÿ ôàéë³â"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Áóäü-ëàñêà çà÷åêàéòå, äîêè ïðîãðàìà âñòàíîâëåííÿ ñêîï³þº âñ³ íåîáõ³äí³ ôàéëè $(^NameDA)."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Âñòàíîâëåííÿ çàâåðøåíî"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Âñòàíîâëåííÿ óñïiøíî çàâåðøåíî."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Âñòàíîâëåííÿ ïåðåðâàíà"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Âñòàíîâëåííÿ íå áóëî óñïiøíî çàâåðøåíî."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Âèäàëåííÿ"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Áóäü-ëàñêà çà÷åêàéòå, éäå âèäàëåííÿ ôàéë³â $(^NameDA)."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Âèäàëåííÿ çàâåðøåíî"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Âèäàëåííÿ ïðîãðàìè áóëî óñï³øíî çàâåðøåíî."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Âèäàëåííÿ ïåðåðâàíî"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Âèäàëåííÿ íå áóëî âèêîíàíî ïîâí³ñòþ."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Çàâåðøåííÿ ìàéñòðà âñòàíîâëåííÿ $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) âñòàíîâëåíî íà âàø êîìï'þòåð.$\r$\n$\r$\nÍàòèñí³òü Ê³íåöü äëÿ âèõîäó."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Äëÿ òîãî, ùîá çàâåðøèòè âñòàíîâëåííÿ $(^NameDA) Âàø êîìï'þòåð ïîâèíåí ïåðåçàâàíòàæèòèñÿ. Çðîáèòè öå çàðàç?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Çàâåðøåííÿ Ìàéñòðà Âèäàëåííÿ $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) âèäàëåíèé ç âàøîãî êîìï'þòåðà.$\r$\n$\r$\nÍàòèñí³òü Âèõ³ä, ùîá çàêðèòè Ìàéñòðà."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Äëÿ òîãî, ùîá çàê³í÷èòè âèäàëåííÿ $(^NameDA) âàø êîìï'þòåð ïîâèíåí ïåðåçàâàíòàæèòèñÿ. Âè áàæàºòå çðîáèòè öå çàðàç?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Ïåðåçàâàíòàæèòèñÿ çàðàç"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "ß õî÷ó ïåðåçàâàíòàæèòèñÿ âëàñíîðó÷ ï³çí³øå"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Çàïóñòèòè $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Ïîêàçàòè ³íôîðìàö³þ ïðî ïðîãðàìó"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Ê³íåöü"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Òåêà â ìåíþ Ïóñê"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Îáåð³òü òåêó â ìåíþ Ïóñê äëÿ ÿðëèê³â ïðîãðàìè."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Îáåð³òü òåêó â ìåíþ Ïóñê â ÿêó áóäóòü ïîì³ùåí³ ÿðëèêè äëÿ âñòàíîâëåíî¿ ïðîãðàìè. Âè òàêîæ ìîæåòå ââåñòè ³íøå ³ì'ÿ äëÿ ñòâîðåííÿ íîâî¿ òåêè."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Íå ñòâîðþâàòè ÿðëèêè"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Âèäàëåííÿ $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Âèäàëåííÿ $(^NameDA) ç âàøîãî êîìï'þòåðà."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Âè âïåâíåííi, ùî áàæàºòå ïîêèíóòè âñòàíîâëåííÿ $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Âè âïåâíåíí³ ùî áàæàºòå ïîêèíóòè Ìàéñòð Âèäàëåííÿ $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Arabic.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Arabic.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Arabic.nsh	(revision 728)
@@ -0,0 +1,122 @@
+;Language: Arabic (1025)
+;Translation by asdfuae@msn.com
+;updated by Rami Kattan
+
+!insertmacro LANGFILE "Arabic" "Arabic"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "ãÑÍÈÇ Èß Ýí ãÑÔÏ ÅÚÏÇÏ $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "ÓíÓÇÚÏß åÐÇ ÇáãÑÔÏ Ýí ÊäÕíÈ $(^NameDA).$\r$\n$\r$\nãä ÇáãÝÖá ÅÛáÇÞ ÌãíÚ ÇáÈÑÇãÌ ÞÈá ÇáÊäÕíÈ. ÓíÓÇÚÏ åÐÇ Ýí ÊÌÏíÏ ãáÝÇÊ ÇáäÙÇã Ïæä ÇáÍÇÌÉ áÅÚÇÏÉ ÊÔÛíá ÇáÌåÇÒ.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "ãÑÍÈÇ Èß Ýí ãÑÔÏ ÅÒÇáÉ $(^NameDA) "
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "åÐÇ ÇáãÑÔÏ ÓíÏáøß ÃËäÇÁ ÅÒÇáÉ $(^NameDA).$\r$\n$\r$\n ÞÈá ÇáÈÏÁ ÈÇáÅÒÇáÉ¡ íÑÌì ÇáÊÃßÏ ãä Ãä $(^NameDA) ÛíÑ ÔÛøÇá.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "ÅÊÝÇÞíÉþ ÇáÊÑÎíÕ"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "ÇáÑÌÇÁ ãÑÇÌÚÉ ÅÊÝÇÞíÉþ ÇáÊÑÎíÕ ÞÈá ÊäÕíÈ $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "ÚäÏ ÇáãæÇÝÞÉ Úáì ÔÑæØ ÇáÅÊÝÇÞíÉþ¡ ÅÖÛØ ÃæÇÝÞ ááãÊÇÈÚÉ. íÌÈ ÇáãæÇÝÞÉ Úáì ÇáÅÊÝÇÞíÉþ áÊäÕíÈ $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "ÚäÏ ÇáãæÇÝÞÉ Úáì ÔÑæØ ÇáÅÊÝÇÞíÉþ¡ Úáøã ãÑÈÚ ÇáÚáÇãÉ ÇáÊÇáí. íÌÈ ÇáãæÇÝÞÉ Úáì ÇáÅÊÝÇÞíÉþ áÊäÕíÈ $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "ÚäÏ ÇáãæÇÝÞÉ Úáì ÔÑæØ ÇáÅÊÝÇÞíÉ¡ ÅÎÊÑ ÇáÎíÇÑ ÇáÃæá ãä ÇáÊÇáí. íÌÈ ÇáãæÇÝÞÉ Úáì ÇáÅÊÝÇÞíÉ áÊäÕíÈ $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "ÅÊÝÇÞíÉ ÇáÊÑÎíÕ"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "ÇáÑÌÇÁ ãÑÇÌÚÉ ÔÑæØ ÇáÊÑÎíÕ ÞÈá ÅÒÇáÉ $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "ÚäÏ ÇáãæÇÝÞÉ Úáì ÔÑæØ ÇáÅÊÝÇÞíÉ¡ ÅÖÛØ Úáì ãæÇÝÞ. íÌÈ ÇáãæÇÝÞÉ Úáì ÇáÅÊÝÇÞíÉ áÅÒÇáÉ $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "ÚäÏ ÇáãæÇÝÞÉ Úáì ÔÑæØ ÇáÅÊÝÇÞíÉ¡ Úáøã ÇáãÑÈÚ ÇáÚáÇãÉ ÇáÊÇáí. íÌÈ ÇáãæÇÝÞÉ Úáì ÇáÅÊÝÇÞíÉ áÅÒÇáÉ $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "ÚäÏ ÇáãæÇÝÞÉ Úáì ÔÑæØ ÇáÅÊÝÇÞíÉ¡ ÅÎÊÑ ÇáÎíÇÑ ÇáÃæá ãä ÇáÊÇáí. íÌÈ ÇáãæÇÝÞÉ Úáì ÇáÅÊÝÇÞíÉ áÅÒÇáÉ $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "ÅÖÚØ ãÝÊÇÍ ÕÝÍÉ ááÃÓÝá áÑÄíÉ ÈÇÞí ÇáÅÊÝÇÞíÉ"
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "ÅÎÊÑ ÇáãßæäÇÊ"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "ÅÎÊÑ ãíÒÇÊ $(^NameDA) ÇáãÑÇÏ ÊäÕíÈåÇ."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "ÅÎÊÑ ÇáãßæäÇÊ"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "ÅÎÊÑ ãíÒÇÊ $(^NameDA) ÇáãÑÇÏ ÅÒÇáÊåÇ."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "ÇáæÕÝ"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "ÃÔÑ ÈÇáÝÃÑÉ ÝæÞ ÃÍÏ ÇáãßæäÇÊ áÑÄíÉ ÇáæÕÝ"
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "ÃÔÑ ÈÇáÝÃÑÉ ÝæÞ ÃÍÏ ÇáãßæäÇÊ áÑÄíÉ ÇáæÕÝ"
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "ÅÎÊÑ ãæÞÚ ÇáÊäÕíÈ"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "ÅÎÊÑ ÇáãÌáÏ ÇáãÑÇÏ ÊäÕíÈ $(^NameDA) Ýíå."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "ÅÎÊÑ ãæÞÚ ÇáãÒíá"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "ÅÎÊÑ ÇáãÌáÏ ÇáÐí ÓíÒÇá ãäå $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "ÊäÕíÈ"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "ÇáÑÌÇÁ ÇáÅäÊÙÇÑ ÃËäÇÁ ÊäÕíÈ $(^NameDA)."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "ÅäÊåì ÇáÊäÕíÈ"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "ÅäÊåÊ ÚãáíÉ ÇáÊäÕíÈ ÈäÌÇÍ."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "ÅáÛÇÁ ÇáÊäÕíÈ"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "áã íäÊåí ÇáÊäÕíÈ ÈäÌÇÍ."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "ÅÒÇáÉ"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "ÇáÑÌÇÁ ÇáÅäÊÙÇÑ ÃËäÇÁ ÅÒÇáÉ $(^NameDA)."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "ÅäÊåì"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "ÅäÊåÊ ÚãáíÉ ÇáÅÒÇáÉ ÈäÌÇÍ."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "ÅáÛÇÁ ÇáÅÒÇáÉ"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "áã ÊäÊåí ÇáÅÒÇáÉ ÈäÌÇÍ."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "ÅäåÇÁ ãÑÔÏ ÅÚÏÇÏ $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "áÞÏ Êã ÊäÕíÈ $(^NameDA) Úáì ÇáÌåÇÒ$\r$\n$\r$\nÅÖÛØ ÅäåÇÁ áÅÛáÇÞ ãÑÔÏ ÇáÅÚÏÇÏ."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "íÌÈ ÅÚÇÏÉ ÊÔÛíá ÇáÌåÇÒ áÅäåÇÁ ÊäÕíÈ $(^NameDA). åá ÊÑíÏ ÅÚÇÏÉ ÇáÊÔÛíá ÇáÂä¿"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "ÅäåÇÁ ãÑÔÏ ÅÒÇáÉ $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "áÞÏ Êã ÅÒÇáÉ $(^NameDA) ãä ÇáÌåÇÒ.$\r$\n$\r$\n ÅÖÛØ ÅäåÇÁ áÅÛáÇÞ ÇáãÑÔÏ."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "íÌÈ ÅÚÇÏÉ ÊÔÛíá ÇáÌåÇÒ áÅäåÇÁ ÅÒÇáÉ $(^NameDA). åá ÊÑíÏ ÅÚÇÏÉ ÇáÊÔÛíá ÇáÂä¿"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "ÃÚÏ ÇáÊÔÛíá ÇáÂä"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "ÃÑÛÈ Ýí ÅÚÇÏÉ ÊÔÛíá ÇáÌåÇÒ Ýí æÞÊ áÇÍÞ"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&ÔÛá $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "ÇÚÑÖ& ÃÞÑÃäí"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&ÅäåÇÁ"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "ÅÎÊÑ ãÌáÏ ÞÇÆãÉ ÇÈÏÃ"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "ÅÎÊÑ ãÌáÏ ÞÇÆãÉ ÇÈÏÃ áÅÎÊÕÇÑÇÊ $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "ÅÎÊÑ ÇáãÌáÏ Ýí ÞÇÆãÉ ÇÈÏÃ ÇáÐí ÓÊäÔÃ Ýíå ÅÎÊÕÇÑÇÊ ÇáÈÑäÇãÌ. íãßä ÃíÖÇ ßÊÇÈÉ ÅÓã áÅäÔÇÁ ãÌáÏ ÌÏíÏ."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "áÇ ÊäÔÆ ÅÎÊÕÇÑÇÊ"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "ÅÒÇáÉ $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "ÅÒÇáÉ $(^NameDA) ãä ÇáÌåÇÒ."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "åá ÃäÊ ãÊÃßÏ ãä ÅÛáÇÞ ãäÕøÈ $(^Name)¿"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "åá ÃäÊ ãÊÃßÏ ãä Ãäß ÇáÎÑæÌ ãä ãÒíá $(^Name)¿"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Serbian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Serbian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Serbian.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Serbian (3098)
+;Translation by Ñð�àí Îáóžèíà <obucina@srpskijezik.edu.yu>
+
+!insertmacro LANGFILE "Serbian" "Serbian Cyrillic"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Äîáðîäîøëè ó âîäè÷ çà èíñòàëàöè¼ó ïðîãðàìà $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Áèžåòå âî�åíè êðîç ïðîöåñ èíñòàëàöè¼å ïðîãðàìà $(^NameDA).$\r$\n$\r$\nÏðåïîðó÷šèâî ¼å äà èñêšó÷èòå ñâå äðóãå ïðîãðàìå ïðå ïî÷åòêà èíñòàëàöè¼å. Îâî ìîæå îìîãóžèòè àæóðèðàœå ñèñòåìñêèõ ôà¼ëîâà áåç ïîòðåáå çà ïîíîâíèì ïîêðåòàœåì ðà÷óíàðà.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Äîáðîäîøëè ó äåèíñòàëàöè¼ó ïðîãðàìà $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Áèžåòå âî�åíè êðîç ïðîöåñ äåèíñòàëàöè¼å ïðîãðàìà $(^NameDA).$\r$\n$\r$\nÏðå ïî÷åòêà äåèíñòàëàöè¼å, óâåðèòå ñå äà ¼å ïðîãðàì $(^NameDA) èñêšó÷åí. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Äîãîâîð î ïðàâó êîðèøžåœà"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Ïàæšèâî ïðî÷èòà¼òå äîãîâîð î ïðàâó êîðèøžåœà ïðå èíñòàëàöè¼å ïðîãðàìà $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Àêî ïðèõâàòàòå ñâå óñëîâå äîãîâîðà, ïðèòèñíèòå äóãìå „Ïðèõâàòàì“ çà íàñòàâàê. Ìîðàòå ïðèõâàòèòè äîãîâîð äà áèñòå èíñòàëèðàëè ïðîãðàì $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Àêî ïðèõâàòàòå ñâå óñëîâå äîãîâîðà, îáåëåæèòå êâàäðàòèž èñïîä. Ìîðàòå ïðèõâàòèòè äîãîâîð äà áèñòå èíñòàëèðàëè ïðîãðàì $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Àêî ïðèõâàòàòå ñâå óñëîâå äîãîâîðà, èçàáåðèòå ïðâó îïöè¼ó èñïîä. Ìîðàòå ïðèõâàòèòè äîãîâîð äà áèñòå èíñòàëèðàëè ïðîãðàì $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Äîãîâîð î ïðàâó êîðèøžåœà"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Ïàæšèâî ïðî÷èòà¼òå äîãîâîð î ïðàâó êîðèøžåœà ïðå äåèíñòàëàöè¼å ïðîãðàìà $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Àêî ïðèõâàòàòå ñâå óñëîâå äîãîâîðà, ïðèòèñíèòå äóãìå „Ïðèõâàòàì“ çà íàñòàâàê. Ìîðàòå ïðèõâàòèòè äîãîâîð äà áèñòå äåèíñòàëèðàëè ïðîãðàì $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Àêî ïðèõâàòàòå ñâå óñëîâå äîãîâîðà, îáåëåæèòå êâàäðàòèž èñïîä. Ìîðàòå ïðèõâàòèòè äîãîâîð äà áèñòå äåèíñòàëèðàëè ïðîãðàì $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Àêî ïðèõâàòàòå ñâå óñëîâå äîãîâîðà, èçàáåðèòå ïðâó îïöè¼ó èñïîä. Ìîðàòå ïðèõâàòèòè äîãîâîð äà áèñòå äåèíñòàëèðàëè ïðîãðàì $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Ïðèòèñíèòå Page Down äà áèñòå âèäåëè îñòàòàê äîãîâîðà."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Èçáîð êîìïîíåíòè çà èíñòàëàöè¼ó"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Èçàáåðèòå êîìïîíåíòå çà èíñòàëàöè¼ó. Èíñòàëèðà¼ó ñå ñàìî îçíà÷åíå êîìïîíåíòå."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Èçáîð êîìïîíåíòè çà äåèíñòàëàöè¼ó"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Èçàáåðèòå êîìïîíåíòå çà äåèíñòàëàöè¼ó. Äåèíñòàëèðà¼ó ñå ñàìî îçíà÷åíå êîìïîíåíòå."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Îïèñ"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Ïðå�èòå êóðñîðîì ìèøà ïðåêî èìåíà êîìïîíåíòå äà áèñòå âèäåëè œåí îïèñ."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Ïðå�èòå êóðñîðîì ìèøà ïðåêî èìåíà êîìïîíåíòå äà áèñòå âèäåëè œåí îïèñ."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Èçáîð ôîëäåðà çà èíñòàëàöè¼ó"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Èçàáåðèòå ôîëäåð ó êî¼è žåòå èíñòàëèðàòè ïðîãðàì $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Èçáîð ôîëäåðà çà äåèíñòàëaöè¼ó"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Èçàáåðèòå ôîëäåð èç êîãà žåòå äåèíñòàëèðàòè ïðîãðàì $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Èíñòàëàöè¼à"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Ñà÷åêà¼òå äîê ñå ïðîãðàì $(^NameDA) èíñòàëèðà."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Çàâðøåíà èíñòàëàöè¼à"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Èíñòàëàöè¼à ¼å óñïåøíî çàâðøåíà."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Ïðåêèíóòà èíñòàëàöè¼à"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Èíñòàëàöè¼à ¼å ïðåêèíóòà è íè¼å óñïåøíî çàâðøåíà."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Äåèíñòàëàöè¼à"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Ñà÷åêà¼òå äîê ñå ïðîãðàì $(^NameDA) äåèíñòàëèðà."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Çàâðøåíà äåèíñòàëàöè¼à"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Äåèíñòàëàöè¼à ¼å óñïåøíî çàâðøåíà."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Ïðåêèíóòà äåèíñòàëàöè¼à"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Äåèíñòàëàöè¼à ¼å ïðåêèíóòà è íè¼å óñïåøíî çàâðøåíà."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Çàâðøåíà èíñòàëàöè¼à ïðîãðàìà $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Ïðîãðàì $(^NameDA) ¼å èíñòàëèðàí íà ðà÷óíàð.$\r$\n$\r$\nÏðèòèñíèòå äóãìå „Êðà¼“ çà çàòâàðàœå îâîã ïðîçîðà."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Ðà÷óíàð ìîðà áèòè ïîíîâî ïîêðåíóò äà áè ñå ïðîöåñ èíñòàëàöè¼å ïðîãðàìà $(^NameDA) óñïåøíî çàâðøèî. Æåëèòå ëè òî îäìàõ äà óðàäèòå?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Çàâðøåíà äåèíñòàëàöè¼à ïðîãðàìà $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "Ïðîãðàì $(^NameDA) ¼å äåèíñòàëèðàí ñà ðà÷óíàðà.$\r$\n$\r$\nÏðèòèñíèòå äóãìå „Êðà¼“ çà çàòâàðàœå îâîã ïðîçîðà."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Ðà÷óíàð ìîðà áèòè ïîíîâî ïîêðåíóò äà áè ñå ïðîöåñ äåèíñòàëàöè¼å ïðîãðàìà $(^NameDA) óñïåøíî çàâðøèî. Æåëèòå ëè òî äà óðàäèòå îäìàõ?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Îäìàõ ïîíîâî ïîêðåíè ðà÷óíàð"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Áåç ïîíîâíîã ïîêðåòàœà"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "Ïîêðåíè ïðîãðàì $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Ïðèêàæè Ïðî÷èòà¼Ìå ôà¼ë"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "Êðà¼"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Èçáîð ôîëäåðà ó Ñòàðò ìåíè¼ó"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Èçàáåðèòå ôîëäåð ó Ñòàðò ìåíè¼ó ó êîìå žåòå êðåèðàòè ïðå÷èöå."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Èçàáåðèòå ôîëäåð ó Ñòàðò ìåíè¼ó ó êîìå æåëèòå äà áóäó êðåèðàíå ïðå÷èöå ïðîãðàìà. Ìîæåòå óïèñàòè è èìå çà êðåèðàœå íîâîã ôîëäåðà."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Áåç êðåèðàœà ïðå÷èöà"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Äåèíñòàëàöè¼à ïðîãðàìà $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Äåèíñòàëàöè¼à ïðîãðàìà $(^NameDA) ñà ðà÷óíàðà."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Ñèãóðíî æåëèòå äà ïðåêèíåòå èíñòàëàöè¼ó ïðîãðàìà $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Ñèãóðíî æåëèòå äà ïðåêèíåòå äåèíñòàëàöè¼ó ïðîãðàìà $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Mongolian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Mongolian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Mongolian.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Mongolian (1104)
+;By Bayarsaikhan Enkhtaivan
+
+!insertmacro LANGFILE "Mongolian" "Mongolian"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "$(^NameDA) Ñóóëãàöàä òàâòàé ìîðèë"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "$(^NameDA) ñóóëãàöûí èëáý÷èíã òà øóóä àøèãëàæ áîëíî.$\r$\n$\r$\n¯¿íèéã ñóóëãàõûí ºìíº áóñàä á¿õ ïðîãðàìóóäàà õààõûã çºâëºæ áàéíà. Ñèñòåìèéí ôàéëóóäûã øèíý÷èëáýë êîìïüþòåðýý äàõèí à÷ààëàõã¿é áàéõ áîëîìæòîé.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "$(^NameDA) Ñóóëãàöûã óñòãàõ èëáý÷èíä òàâòàé ìîðèë"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "$(^NameDA) óñòãàöûí èëáý÷èíã òà øóóä àøèãëàæ áîëíî.$\r$\n$\r$\nÓñòãàõûí ºìíº $(^NameDA) íü àæèëëààã¿é ýñýõèéã øàëãà.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Ëèöåíçèéí çºâøººðºë"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "$(^NameDA)-ûã ñóóëãàõûíõàà ºìíº çºâøèëöëèéí ç¿éë¿¿äèéã óíøèíà óó."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Õýðýâ çºâøèëöëèéí ç¿éëñèéã çºâøººð÷ áàéâàë, Çºâøººðëºº òîâ÷èéã äàðàí ¿ðãýëæë¿¿ëíý ¿¿. $(^NameDA)-ûã ñóóëãàõûí òóëä çààâàë çºâøººðºõ øààðäëàãàòàé."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Õýðýâ çºâøèëöëèéí ç¿éëñèéã çºâøººð÷ áàéâàë, Çºâëºõ õàéðöãèéã äàðàí ¿ðãýëæë¿¿ëíý ¿¿. $(^NameDA)-ûã ñóóëãàõûí òóëä çààâàë çºâøººðºõ øààðäëàãàòàé. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Õýðýâ çºâøèëöëèéí ç¿éëñèéã çºâøººð÷ áàéâàë, äîîðõîîñ ýõíèéã íü ñîíãîí ¿ðãýëæë¿¿ëíý ¿¿. $(^NameDA)-ûã ñóóëãàõûí òóëä çààâàë çºâøººðºõ øààðäëàãàòàé. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Ëèöåíçèéí çºâøººðºë"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "$(^NameDA) óñòãàõûí ºìíº çºâøèëöëèéí ç¿éëñèéã óíøèíà óó."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Õýðýâ çºâøèëöëèéí ç¿éëñèéã çºâøººð÷ áàéâàë, Çºâøººðëºº òîâ÷èéã äàðàí ¿ðãýëæë¿¿ëíý ¿¿. $(^NameDA)-ûã óñòãàõûí òóëä çààâàë çºâøººðºõ øààðäëàãàòàé."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Õýðýâ çºâøèëöëèéí ç¿éëñèéã çºâøººð÷ áàéâàë, Çºâëºõ õàéðöãèéã äàðàí ¿ðãýëæë¿¿ëíý ¿¿. $(^NameDA)-ûã óñòãàõûí òóëä çààâàë çºâøººðºõ øààðäëàãàòàé. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Õýðýâ çºâøèëöëèéí ç¿éëñèéã çºâøººð÷ áàéâàë, äîîðõîîñ ýõíèéã íü ñîíãîí ¿ðãýëæë¿¿ëíý ¿¿. $(^NameDA)-ûã óñòãàõûí òóëä çààâàë çºâøººðºõ øààðäëàãàòàé. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Page Down òîâ÷èéã äàðàí çºâøèëöëèéã äîîø ã¿éëãýíý ¿¿."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Íýãäëèéã ñîíãîõ"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "$(^NameDA)-ûã ñóóëãàõàä øààðäàãäàõ õýñãèéã ñîíãîíî óó."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Íýãäëèéã ñîíãîõ"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "$(^NameDA)-ûí óñòãàõ øààðäëàãàòàé íýãäëèéã ñîíãîõ."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Òàéëáàð"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Òà õóëãàíààðàà íýãäëèéí äýýð î÷èõîä ò¿¿íèé òàéëáàðûã õàðóóëíà."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Òà õóëãàíààðàà íýãäëèéí äýýð î÷èõîä ò¿¿íèé òàéëáàðûã õàðóóëíà."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Ñóóëãàõ áàéðëàëûã ñîíãîõ"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "$(^NameDA) ñóóëãàöûí ñóóëãàõ çàìûã ñîíãî."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Óñòãàöûí áàéðëàëûã ñîíãîõ"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "$(^NameDA)-ûã óñòãàõ õàâòñûã ñîíãîõ."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Ñóóëãàæ áàéíà"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "$(^NameDA)-ûã ñóóëãàæ äóóñòàë ò¿ð õ¿ëýýíý ¿¿."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Ñóóëãàæ äóóñëàà"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Ñóóëãàö àìæèëòòàé áîëîâ."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Ñóóëãàëò òàñëàãäëàà"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Ñóóëãàëò àìæèëòã¿é áîëîâ."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Óñòãàæ áàéíà"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "$(^NameDA) -ûã çàéëóóëæ äóóñòàë ò¿ð õ¿ëýýíý ¿¿."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Óñòãàæ äóóñëàà"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Óñòãàëò àìæèëòòàé äóóñëàà."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Óñòãàö òàñëàãäëàà"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Óñòãàëò àìæèëòã¿é áîëëîî."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "$(^NameDA) Ñóóëãàöûí èëáý÷èí äóóñëàà"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) íü òàíû êîìïüþòåðò ñóóëàà.$\r$\n$\r$\nÒºãñãºë äýýð äàðâàë õààíà."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "$(^NameDA)-ûí ñóóëãàöûí äàðààëàëä òà êîìïüþòåðýý äàõèí à÷ààëñíààð äóóñíà. Òà äàõèí à÷ààëàõûã õ¿ñýæ áàéíà óó?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "$(^NameDA) Óñòãàöûí èëáý÷èí äóóñëàà"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) íü òàíû êîìïüþòåðýýñ çàéëóóëàãäëàà.$\r$\n$\r$\nÒºãñãºë äýýð äàðâàë õààíà."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "$(^NameDA) Óñòãàöûí äàðààëàëä òà êîìïüþòåðýý äàõèí à÷ààëñíààð äóóñíà. Òà ä.à÷ààëìààð áàéíà óó?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Ä.À÷ààë"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Áè äàðàà ä.à÷ààëàõûã õ¿ñýæ áàéíà."
+  ${LangFileString} MUI_TEXT_FINISH_RUN "$(^NameDA) àæèëëóóëàõ"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Readme õàðóóëàõ"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Òºãñãºë"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Start öýñíèé õàâòñûã ñîíãî"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Start öýñ äýõ $(^NameDA) shortcut-ûí õàâòñûã ñîíãî."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Start öýñýíä ïðîãðàìûí shortcut ¿¿ñãýõ õàâòñûã ñîíãî. Ýñâýë òà øèíý íýðýýð ¿¿ñãýæ áîëíî."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Do not create shortcuts"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "$(^NameDA)--ûí Óñòãàö"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "$(^NameDA) -ûã òàíû êîìïüþòåðýýñ çàéëóóëàõ."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "$(^Name) -ûí ñóóëãàöààñ ãàðìààð áàéíà óó?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "$(^Name) Óñòãàöààñ ãàðìààð áàéíà óó?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Lithuanian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Lithuanian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Lithuanian.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1063
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1257
+# RTL - anything else than RTL means LTR
+-
+# Translation by Vytautas Krivickas (Vytautas)
+# Updated by Danielius Scepanskis (Daan daniel@takas.lt) 2004.03.24
+# ^Branding
+Nullsoft instaliavimo sistema %s
+# ^SetupCaption
+$(^Name) Ádiegimas
+# ^UninstallCaption
+$(^Name) Ðalinti
+# ^LicenseSubCaption
+: Naudojimo sutartis
+# ^ComponentsSubCaption
+: Ádiegimo nustatymai
+# ^DirSubCaption
+: Ádiegimo katalogas
+# ^InstallingSubCaption
+: Ádiegiama
+# ^CompletedSubCaption
+: Baigta
+# ^UnComponentsSubCaption
+: Iðtrinimo nustatymai
+# ^UnDirSubCaption
+: Iðtrinimo katalogas
+# ^ConfirmSubCaption
+: Patvirtinimas
+# ^UninstallingSubCaption
+: Panaikinama
+# ^UnCompletedSubCaption
+: Baigta
+# ^BackBtn
+< &Atgal
+# ^NextBtn
+&Toliau >
+# ^AgreeBtn
+Að &sutinku
+# ^AcceptBtn
+Að &sutinku su naudojimo sutarties sàlygomis
+# ^DontAcceptBtn
+Að &nesutinku su naudojimo sutarties sàlygomis
+# ^InstallBtn
+&Ádiegti
+# ^UninstallBtn
+&Panaikinti
+# ^CancelBtn
+Nutraukti
+# ^CloseBtn
+&Uþdaryti
+# ^BrowseBtn
+P&asirinkti...
+# ^ShowDetailsBtn
+Parodyti &detales
+# ^ClickNext
+Paspauskite toliau
+# ^ClickInstall
+Paspauskite ádiegti
+# ^ClickUninstall
+Paspauskite iðtrinti
+# ^Name
+Vardas
+# ^Completed
+Baigta
+# ^LicenseText
+Praðome perskaityti sutartá prieð ádiegdami $(^NameDA). Jei jûs sutinkate su nurodytomis sàlygomis, spauskite Sutinku.
+# ^LicenseTextCB
+Praðome perskaityti sutartá prieð ádiegdami $(^NameDA). Jei jûs sutinkate su nurodytomis sàlygomis, padëkite varnelæ tam skirtame laukelyje. $_CLICK
+# ^LicenseTextRB
+Praðome perskaityti sutartá prieð ádiegdami $(^NameDA). Jei jûs sutinkate su nurodytomis sàlygomis, pasirinkite pirmà pasirinkimà esantá þemiau. $_CLICK
+# ^UnLicenseText
+Praðome perskaityti sutartá prieð iðtrinant $(^NameDA). Jei jûs sutinkate su nurodytomis sàlygomis, spauskite Sutinku.
+# ^UnLicenseTextCB
+Praðome perskaityti sutartá prieð iðtrinant $(^NameDA). Jei jûs sutinkate su nurodytomis sàlygomis, padëkite varnelæ tam skirtame laukelyje. $_CLICK
+# ^UnLicenseTextRB
+Praðome perskaityti sutartá prieð iðtrinant $(^NameDA). Jei jûs sutinkate su nurodytomis sàlygomis, pasirinkite pirmà pasirinkimà esantá þemiau.  $_CLICK
+# ^Custom
+Kitoks
+# ^ComponentsText
+Padëkite varneles laukeliuose komponentø kuriuos norite ádiegti ir nuimkite nuo kuriø nenorite ádiegti. $_CLICK
+# ^ComponentsSubText1
+Pasirinkite ádiegimo bûdà:
+# ^ComponentsSubText2_NoInstTypes
+Pasirinkite komponentus, kuriuos ádiegti:
+# ^ComponentsSubText2
+Arba, pasirinkite neprivalomus komponentus, kuriuos jûs norite ádiegti:
+# ^UnComponentsText
+Padëkite varneles laukeliuose komponentø kuriuos norite paðalinti ir nuimkite nuo kuriø nenorite paðalinti. $_CLICK
+# ^UnComponentsSubText1
+Pasirinkite ðalinimo bûdà:
+# ^UnComponentsSubText2_NoInstTypes
+Pasirinkite komponentus, kuriuos ðalinti:
+# ^UnComponentsSubText2
+Arba, pasirinkite neprivalomus komponentus, kuriuos jûs norite paðalinti:
+# ^DirText
+Ádiegimas dabar ádiegs $(^NameDA) ðiame kataloge. Jeigu norite pakeisti ðá katalogà, paspauskite Pasirinkti. $_CLICK
+# ^DirSubText
+Ádiegimo katalogas
+# ^DirBrowseText
+Pasirinkite katalogà, kur ádiegti $(^NameDA):
+# ^UnDirText
+Ádiegimas dabar paðalins $(^NameDA) ið ðio katalogo. Jeigu norite pakeisti ðá katalogà paspauskite Pasirinkti. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Pasirinkite katalogà ið kurio paðalinti $(^NameDA):
+# ^SpaceAvailable
+Yra vietos: 
+# ^SpaceRequired
+Reikia vietos: 
+# ^UninstallingText
+$(^NameDA) dabar bus paðalintas ið ðio katalogo. $_CLICK
+# ^UninstallingSubText
+Trinama ið:
+# ^FileError
+Klaida atidarant failà áraðymui: \r\n\t"$0"\r\nPaspauskite Nutraukti, jei norite nutraukti ádiegimà,\r\nPakartoti, jei norite pabandyti dar kartà áraðyti failà, ar\r\nIgnoruoti, jei norite praleisti ðá failà
+# ^FileError_NoIgnore
+Klaida atidarant failà áraðymui: \r\n\t"$0"\r\nPaspauskite Pakartoti, jei norite pabandyti dar kartà áraðyti failà, ar\r\nNutraukti, jei norite nutraukti ádiegimà.
+# ^CantWrite
+"Negalima áraðyti: "
+# ^CopyFailed
+Kopijavimas nepavyko
+# ^CopyTo
+Kopijuoti á 
+# ^Registering
+"Uþregistruojama: "
+# ^Unregistering
+"Iðregistruojama: "
+# ^SymbolNotFound
+Nerastas simbolis: 
+# ^CouldNotLoad
+Negaliu ákrauti: 
+# ^CreateFolder
+Sukurti katalogà: 
+# ^CreateShortcut
+Sukurti nuorodà: 
+# ^CreatedUninstaller
+Sukurti panaikinimo programà:
+# ^Delete
+Iðtrinti failà: 
+# ^DeleteOnReboot
+"Iðtrinti perkraunant: "
+# ^ErrorCreatingShortcut
+"Klaida kuriant nuorodà: "
+# ^ErrorCreating
+"Klaida kuriant: "
+# ^ErrorDecompressing
+Klaida iðskleidþiant duomenis! Sugadintas ádiegimo failas?
+# ^ErrorRegistering
+Klaida uþregistruojant DLL
+# ^ExecShell
+"VykdytiShell: "
+# ^Exec
+"Vykdyti: "
+# ^Extract
+"Iðskleisti: "
+# ^ErrorWriting
+Iðskleisti: klaida áraðant á failà
+# ^InvalidOpcode
+Ádiegimo failas sugadintas: neteisingas opkodas
+# ^NoOLE
+"Nëra OLE dël: "
+# ^OutputFolder
+"Paskirties katalogas: "
+# ^RemoveFolder
+"Panaikinti katalogà: "
+# ^RenameOnReboot
+"Pervardinti perkraunant: "
+# ^Rename
+"Pervardinti: "
+# ^Skipped
+"Praleista: "
+# ^CopyDetails
+Kopijuoti detales á atmintá
+# ^LogInstall
+Áraðyti ádiegimo detales
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Thai.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Thai.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Thai.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Thai (1054)
+;By SoKoOLz, TuW@nNu (asdfuae)
+
+!insertmacro LANGFILE "Thai" "Thai"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "ÂÔ¹´ÕµéÍ¹ÃÑºà¢éÒÊÙè¡ÒÃµÔ´µÑé§â»Ãá¡ÃÁ $(^NameDA) "
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "µÑÇµÔ´µÑé§ÍÑµÔâ¹ÁÑµÔ¨Ð¹Ó¤Ø³ä»ÊÙè¡ÒÃµÔ´µÑé§¢Í§ $(^NameDA).$\r$\n$\r$\nàÃÒ¢Íá¹Ð¹ÓãËé»Ô´â»Ãá¡ÃÁÍ×è¹æãËéËÁ´¡èÍ¹·Õè¨ÐàÃÔèÁµÔ´µÑé§, ¹Õè¨Ðà»ç¹¡ÒÃÍÑ»à´·ä¿Åìä´é§èÒÂ¢Öé¹â´Â¤Ø³äÁè¨Óà»ç¹µéÍ§·Ó¡ÒÃÃÕºÙ·¤ÍÁ¾ÔÇàµÍÃì¢Í§¤Ø³$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "ÂÔ¹´ÕµéÍ¹ÃÑºÊÙè¡ÒÃÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§ÍÑµÔâ¹ÁÑµÔ¢Í§ $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "µÑÇµÔ´µÑé§ÍÑµÔâ¹ÁÑµÔ¹Õé¨Ð¹Ó¤Ø³ä»ÊÙè¡ÒÃÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§¢Í§ $(^NameDA).$\r$\n$\r$\n¡ÒÃ¨ÐàÃÔèÁ¡ÒÃÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§¹Õé, â»Ã´µÃÇ¨ÊÍºÇèÒ $(^NameDA) äÁèä´éãªéÍÂÙè$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "¢éÍµ¡Å§àÃ×èÍ§ÅÔ¢ÊÔ·¸Ôì"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "â»Ã´ÍèÒ¹·Ç¹ÅÔ¢ÊÔ·¸Ôìã¹ËÑÇ¢éÍµèÒ§æÍÕ¡¤ÃÑé§¡èÍ¹·Õè¤Ø³¨Ð·Ó¡ÒÃµÔ´µÑé§ $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "¶éÒ¤Ø³ÂÍÁÃÑº¢éÍµ¡Å§àÃ×èÍ§ÅÔ¢ÊÔ·¸Ôì, ¡´ ©Ñ¹ÂÍÁÃÑº à¾×èÍ·ÓµèÍä», ¤Ø³µéÍ§ÂÍÁÃÑºã¹¢éÍµ¡Å§ÅÔ¢ÊÔ·¸Ôìà¾×èÍ·Õè¨Ð·Ó¡ÒÃµÔ´µÑé§ $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "¶éÒ¤Ø³ÂÍÁÃÑº¢éÍµ¡Å§àÃ×èÍ§ÅÔ¢ÊÔ·¸, ¡´àÅ×Í¡ã¹¡ÅèÍ§¢éÒ§ÅèÒ§¹Õé  ¤Ø³µéÍ§ÂÍÁÃÑºã¹¢éÍµ¡Å§ÅÔ¢ÊÔ·¸Ôìà¾×èÍ·Õè¨Ð·Ó¡ÒÃµÔ´µÑé§ $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "¶éÒ¤Ø³ÂÍÁÃÑº¢éÍµ¡Å§àÃ×èÍ§ÅÔ¢ÊÔ·¸,  àÅ×Í¡µÑÇàÅ×Í¡áÃ¡´éÒ¹ÅèÒ§¹Õé ¤Ø³µéÍ§ÂÍÁÃÑºã¹¢éÍµ¡Å§ÅÔ¢ÊÔ·¸Ôìà¾×èÍ·Õè¨Ð·Ó¡ÒÃµÔ´µÑé§ $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "¢éÍµ¡Å§àÃ×èÍ§ÅÔ¢ÊÔ·¸Ôì"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "¡ÃØ³ÒÍèÒ¹¢éÍµ¡Å§´éÒ¹ÅÔ¢ÊÔ·¸Ôì¡èÍ¹µÔ´µÑé§â»Ãá¡ÃÁ $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "¶éÒ¤Ø³ÂÍÁÃÑºã¹¢éÍµ¡Å§¹Õé ¡ÃØ³Ò¡´»ØèÁ ©Ñ¹ÂÍÁÃÑº áÅÐ¤Ø³¨ÐµéÍ§µ¡Å§¡èÍ¹·Õè¨ÐàÃÔèÁ¡ÒÃÂ¡àÅÔ¡µÔ´µÑé§â»Ãá¡ÃÁ $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "¶éÒ¤Ø³ÂÍÁÃÑº¢éÍµ¡Å§àÃ×èÍ§ÅÔ¢ÊÔ·¸Ôì, ¡´àÅ×Í¡ã¹¡ÅèÍ§¢éÒ§ÅèÒ§¹Õé ¤Ø³µéÍ§ÂÍÁÃÑºã¹¢éÍµ¡Å§ÅÔ¢ÊÔ·¸Ôìà¾×èÍ·Õè¨Ð·Ó¡ÒÃµÔ´µÑé§ $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "¶éÒ¤Ø³ÂÍÁÃÑº¢éÍµ¡Å§àÃ×èÍ§ÅÔ¢ÊÔ·¸Ôì, àÅ×Í¡µÑÇàÅ×Í¡áÃ¡´éÒ¹ÅèÒ§¹Õé ¤Ø³µéÍ§ÂÍÁÃÑºã¹¢éÍµ¡Å§ÅÔ¢ÊÔ·¸Ôìà¾×èÍ·Õè¨Ð·Ó¡ÒÃµÔ´µÑé§ $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "¡´ Page Down à¾×èÍÍèÒ¹¢éÍµ¡Å§·Ñé§ËÁ´"
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "àÅ×Í¡ÊèÇ¹»ÃÐ¡Íº"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "àÅ×Í¡ÊÔè§·Õè¤Ø³µéÍ§¡ÒÃãªé§Ò¹¨Ò¡ $(^NameDA) ·Õè¤Ø³µéÍ§¡ÒÃµÔ´µÑé§"
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "àÅ×Í¡ÊèÇ¹»ÃÐ¡Íº"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "àÅ×Í¡ÊÔè§·Õè¤Ø³µéÍ§¡ÒÃãªé§Ò¹¨Ò¡ $(^NameDA) ·Õè¤Ø³µéÍ§Â¡àÅÔ¡¡ÒÃµÔ´µÑé§"
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "ÃÒÂÅÐàÍÕÂ´"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "¢ÂÑºàÁÒÊì¢Í§¤Ø³àË¹×ÍÊèÇ¹»ÃÐ¡Íºà¾×èÍ´ÙÃÒÂÅÐàÍÕÂ´"
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "¢ÂÑºàÁÒÊì¢Í§¤Ø³àË¹×ÍÊèÇ¹»ÃÐ¡Íºà¾×èÍ´ÙÃÒÂÅÐàÍÕÂ´"
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "àÅ×Í¡·Õè·ÕèµéÍ§¡ÒÃµÔ´µÑé§"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "àÅ×Í¡á¼éÁ·ÕèµéÍ§¡ÒÃµÔ´µÑé§ $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "àÅ×Í¡á¿éÁ·ÕèµéÍ§¡ÒÃÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "àÅ×Í¡á¿éÁ·Õè¤Ø³µéÍ§¡ÒÃÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§¢Í§ $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "¡ÓÅÑ§µÔ´µÑé§"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "â»Ã´ÃÍã¹¢³Ð·Õè $(^NameDA) ¡ÓÅÑ§¶Ù¡µÔ´µÑé§"
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "¡ÒÃµÔ´µÑé§àÊÃç¨ÊÔé¹"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "¡ÒÃµÔ´µÑé§àÊÃç¨ÊÁºÙÃ³ì"
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "¡ÒÃµÔ´µÑé§¶Ù¡Â¡àÅÔ¡"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "¡ÒÃµÔ´µÑé§äÁèàÊÃç¨ÊÁºÙÃ³ì"
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "¡ÓÅÑ§Â¡àÅÔ¡¡ÒÃµÔ´µÑé§"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "â»Ã´ÃÍã¹¢³Ð·Õè $(^NameDA) ¡ÓÅÑ§¶Ù¡Â¡àÅÔ¡¡ÒÃµÔ´µÑé§."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "¡ÒÃÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§àÊÃç¨ÊÔé¹"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "¡ÒÃÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§àÊÃç¨ÊÔé¹â´ÂÊÁºÙÃ³ì"
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "¡ÒÃÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§¶Ù¡Â¡àÅÔ¡"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "¡ÒÃÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§äÁèÊÓàÃç¨"
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "¡ÒÃµÔ´µÑé§ÍÑµÔâ¹ÁÑµÔ¢Í§  $(^NameDA) ¡ÓÅÑ§àÊÃç¨ÊÔé¹"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) ä´é¶Ù¡µÔ´µÑé§Å§ã¹à¤Ã×èÍ§¤ÍÁ¾ÔÇàµÍÃì¢Í§¤Ø³áÅéÇ$\r$\n$\r$\n¡´ àÊÃç¨ÊÔé¹à¾×èÍ»Ô´µÑÇµÔ´µÑé§ÍÑµÔâ¹ÁÑµÔ"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "à¤Ã×èÍ§¤ÍÁ¾ÔÇàµÍÃì¢Í§¤Ø³¨Óà»ç¹µéÍ§ÃÕÊµÒÃ·ìà¾×èÍ¡ÒÃµÔ´µÑé§¢Í§ $(^NameDA) ¨ÐàÃÕÂºÃéÍÂ, ¤Ø³µéÍ§¡ÒÃ¨Ð ÃÕºÙ· à´ÕëÂÇ¹ÕéäËÁ?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "¡ÒÃÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§ÍÑµÔâ¹ÁÑµÔ¢Í§ $(^NameDA) ¡ÓÅÑ§àÊÃç¨ÊÁºÙÃ³ì"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) ä´é¶Ù¡Â¡àÅÔ¡ÍÍ¡¨Ò¡à¤Ã×èÍ§¤ÍÁ¾ÔÇàµÍÃì¢Í§¤Ø³áÅéÇ $\r$\n$\r$\n¡´ àÊÃç¨ÊÔé¹ à¾×èÍ»Ô´Ë¹éÒ¨ÍµÔ´µÑé§ÍÑµÔâ¹ÁÑµÔ"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "à¤Ã×èÍ§¤ÍÁ¾ÔÇàµÍÃì¢Í§¤Ø³¨Óà»ç¹µéÍ§ÃÕÊµÒÃì·ã¹¡ÒÃ·Õè¨Ð·Ó¡ÒÃÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§¢Í§ $(^NameDA) àÊÃç¨ÊÔé¹, ¤Ø³µéÍ§¡ÒÃ¨ÐÃÕºÙ·à´ÕëÂÇ¹ÕéäËÁ?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "ÃÕºÙ· à´ÕëÂÇ¹Õé"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "©Ñ¹µéÍ§¡ÒÃ ÃÕºÙ·´éÇÂµ¹àÍ§ ·ÕËÅÑ§"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&ÃÑ¹ $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&áÊ´§ÃÒÂÅÐàÍÕÂ´"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&àÊÃç¨ÊÔé¹"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "àÅ×Í¡á¿éÁ Start Menu"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "àÅ×Í¡á¿éÁ Start Menu à¾×èÍÊÃéÒ§ªÍÃìµ¤Ñ·¢Í§ $(^NameDA). "
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "àÅ×Í¡á¼éÁ Start Menu ·Õè¤Ø³µéÍ§¡ÒÃ¨ÐÊÃéÒ§ªÍÃìµ¤Ñ·¢Í§â»Ãá¡ÃÁ, ¤Ø³ÂÑ§ÊÒÁÒÃ¶¡ÓË¹´ª×èÍà¾×èÍÊÃéÒ§á¿éÁãËÁèä´éÍÕ¡´éÇÂ"
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "äÁèµéÍ§ÊÃéÒ§ ªÍÃìµ¤Ñ·"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Â¡àÅÔ¡¡ÒÃµÔ´µÑé§ $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Â¡àÅÔ¡¡ÒÃµÔ´µÑé§ $(^NameDA) ¨Ò¡à¤Ã×èÍ§¤ÍÁ¾ÔÇàµÍÃì¢Í§¤Ø³"
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "¤Ø³á¹èã¨ËÃ×ÍÇèÒ¤Ø³µéÍ§¡ÒÃ¨ÐÍÍ¡¨Ò¡¡ÒÃµÔ´µÑé§¢Í§ $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "¤Ø³á¹èã¨ËÃ×ÍÇèÒ¤Ø³µéÍ§¡ÒÃÍÍ¡¨Ò¡¡ÒÃÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§¢Í§ $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/PortugueseBR.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/PortugueseBR.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/PortugueseBR.nsh	(revision 728)
@@ -0,0 +1,129 @@
+;Language: Brazilian Portuguese (1046)
+;By Felipe
+
+!insertmacro LANGFILE "PortugueseBR" "Português Brasileiro"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Bem-vindo ao Assistente de Instalação do $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Este assistente guiará você através da instalação do $(^NameDA).$\r$\n$\r$\nÉ recomendado que você feche todos os outros aplicativos antes de iniciar o Instalador. Isto tornará possível atualizar os arquivos de sistema relevantes sem ter que reiniciar seu computador.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Bem-vindo ao Assistente de Desinstalação do $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Este assistente guiará você através da desinstalação do $(^NameDA).$\r$\n$\r$\nAntes de iniciar a desinstalação, tenha certeza de que o $(^NameDA) não está em execução.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Acordo da licença"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Por favor, reveja os termos da licença antes de instalar o $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Se você aceita os termos do acordo, clique em Eu Concordo para continuar. Você deve aceitar o acordo para instalar o $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Se você aceita os termos do acordo, clique na caixa de seleção abaixo. Você deve aceitar o acordo para instalar o $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Se você aceita os termos do acordo, selecione a primeira opção abaixo. Você deve aceitar o acordo para instalar o $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Acordo da licença"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Por favor, reveja os termos da licença antes de desinstalar o $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Se você aceita os termos do acordo, clique em Eu Concordo para continuar. Você deve aceitar o acordo para desinstalar o $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Se você aceita os termos do acordo, clique na caixa de seleção abaixo. Você deve aceitar o acordo para desinstalar o $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Se você aceita os termos do acordo, selecione a primeira opção abaixo. Você deve aceitar o acordo para desinstalar o $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Pressione Page Down para ver o resto do acordo."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Escolher Componentes"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Escolha quais funções do $(^NameDA) você quer instalar."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Escolher Componentes"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Escolha quais funções do $(^NameDA) você quer desinstalar."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Descrição"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Posicione seu mouse sobre um componente para ver sua descrição."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Posicione seu mouse sobre um componente para ver sua descrição."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Escolher o Local da Instalação"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Escolha a pasta na qual instalar o $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Escolher o Local da Desinstalação"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Escolha a pasta da qual desinstalar o $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Instalando"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Por favor espere enquanto o $(^NameDA) está sendo instalado."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Instalação Completa"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "O Instalador completou com sucesso."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Instalação Abortada"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "O Instalador não completou com sucesso."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Desinstalando"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Por favor espere enquanto o $(^NameDA) está sendo desinstalado."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Desinstalação Completa"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "A desinstalação foi completada com sucesso."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Desinstalação Abortada"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "A desinstalação não foi completada com sucesso."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Completando o Assistente de Instalação do $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "O $(^NameDA) foi instalado no seu computador.$\r$\n$\r$\nClique em Terminar para fechar este assistente."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Seu computador deve ser reiniciado para completar a instalação do $(^NameDA). Você quer reiniciar agora?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Completando o Assistente de Desinstalação do $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) foi desinstalado do seu computador.$\r$\n$\r$\nClique em Terminar para fechar este assistente."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Seu computador tem que ser reiniciado para completar a desinstalação do $(^NameDA). Você quer reiniciar agora?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Reiniciar agora"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Eu quero reiniciar manualmente depois"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Executar $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Mostrar o Readme"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Terminar"
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Escolher a Pasta do Menu Iniciar"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Escolher uma pasta do Menu Iniciar para os atalhos do $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Selecione a pasta do Menu Iniciar na qual você gostaria de criar os atalhos do programa. Você pode também inserir um nome para criar uma nova pasta."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Não criar atalhos"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Desinstalar o $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Remover o $(^NameDA) do seu computador."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Você tem certeza de que quer sair do Instalador do $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Você tem certeza de que quer sair da Desinstalação do $(^Name)?"
+!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "Escolher Usuários"
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "Escolher para quais usuários você quer instalar o $(^NameDA)."
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "Selecione se você quer instalar o $(^NameDA) para si mesmo ou para todos os usuários deste computador. $(^ClickNext)"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "Instalar para qualquer um usando este computador"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Instalar apenas para mim"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Croatian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Croatian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Croatian.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1050
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1250
+# RTL - anything else than RTL means LTR
+-
+# Translation by Igor Ostriz
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) Instalacija
+# ^UninstallCaption
+$(^Name) Uklanjanje
+# ^LicenseSubCaption
+: Licenenèni uvjeti
+# ^ComponentsSubCaption
+: Instalacijske opcije
+# ^DirSubCaption
+: Instalacijska mapa
+# ^InstallingSubCaption
+: Instaliranje
+# ^CompletedSubCaption
+: Završeno
+# ^UnComponentsSubCaption
+: Opcije uklanjanja
+# ^UnDirSubCaption
+: Mapa uklanjanja
+# ^ConfirmSubCaption
+: Potvrda
+# ^UninstallingSubCaption
+: Uklanjanje
+# ^UnCompletedSubCaption
+: Završeno
+# ^BackBtn
+< &Nazad
+# ^NextBtn
+&Dalje >
+# ^AgreeBtn
+&Prihvaæam
+# ^AcceptBtn
+&Prihvaæam uvjete licenènog ugovora
+# ^DontAcceptBtn
+&Ne prihvaæam uvjete licenènog ugovora
+# ^InstallBtn
+&Instaliraj
+# ^UninstallBtn
+&Ukloni
+# ^CancelBtn
+Odustani
+# ^CloseBtn
+&Zatvori
+# ^BrowseBtn
+&Pregledaj...
+# ^ShowDetailsBtn
+Prikaži &detalje
+# ^ClickNext
+Za nastavak odaberite 'Dalje'.
+# ^ClickInstall
+Za poèetak instalacije odaberite 'Instaliraj'.
+# ^ClickUninstall
+Za poèetak uklanjanja odaberite 'Ukloni'.
+# ^Name
+Ime
+# ^Completed
+Završeno
+# ^LicenseText
+Molim proèitajte licencu prije instalacije programa $(^NameDA). Ukoliko prihvaæate sve uvjete ugovora, odaberite 'Prihvaæam'.
+# ^LicenseTextCB
+Molim proèitajte licencu prije instalacije programa $(^NameDA). Ukoliko prihvaæate sve uvjete ugovora, oznaèite donji kvadratiæ. $_CLICK
+# ^LicenseTextRB
+Molim proèitajte licencu prije instalacije programa $(^NameDA). Ukoliko prihvaæate sve uvjete ugovora, odaberite prvu donju opciju. $_CLICK
+# ^UnLicenseText
+Molim proèitajte licencu prije uklanjanja programa $(^NameDA). Ukoliko prihvaæate sve uvjete ugovora, odaberite 'Prihvaæam'.
+# ^UnLicenseTextCB
+Molim proèitajte licencu prije uklanjanja programa $(^NameDA). Ukoliko prihvaæate sve uvjete ugovora, oznaèite donji kvadratiæ. $_CLICK
+# ^UnLicenseTextRB
+Molim proèitajte licencu prije uklanjanja programa $(^NameDA). Ukoliko prihvaæate sve uvjete ugovora, odaberite prvu donju opciju. $_CLICK
+# ^Custom
+Posebna
+# ^ComponentsText
+Oznaèite komponente koje želite instalirati i uklonite oznaku s onih koje ne želite instalirati. $_CLICK
+# ^ComponentsSubText1
+Izaberite tip instalacije:
+# ^ComponentsSubText2_NoInstTypes
+Odaberite komponente za instalaciju:
+# ^ComponentsSubText2
+Ili po izboru oznaèite komponente koje želite instalirati:
+# ^UnComponentsText
+Oznaèite komponente koje želite ukloniti i uklonite oznaku s onih koje ne želite ukloniti. $_CLICK
+# ^UnComponentsSubText1
+Izaberite tip uklanjanja:
+# ^UnComponentsSubText2_NoInstTypes
+Odaberite komponente za uklanjanje:
+# ^UnComponentsSubText2
+Ili po izboru oznaèite komponente koje želite ukloniti:
+# ^DirText
+Program $(^NameDA) æe biti instaliran u slijedeæu mapu. Za instalaciju na drugo odredište odaberite 'Pregledaj' i oznaèite drugu mapu. $_CLICK
+# ^DirSubText
+Odredišna mapa
+# ^DirBrowseText
+Odaberite mapu u koju želite instalirati program $(^NameDA):
+# ^UnDirText
+Program $(^NameDA) æe biti uklonjen iz slijedeæe mape. Za uklanjanje s drugog mjesta odaberite 'Pregledaj' i oznaèite drugu mapu. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Mapa iz koje æe program $(^NameDA) biti uklonjen:
+# ^SpaceAvailable
+"Slobodno prostora na disku: "
+# ^SpaceRequired
+"Potrebno prostora na disku: "
+# ^UninstallingText
+Program $(^NameDA) æe biti uklonjen iz slijedeæe mape. $_CLICK
+# ^UninstallingSubText
+Uklanjam iz:
+# ^FileError
+Greška prilikom otvaranja datoteke za zapisivanje: \r\n\t"$0"\r\n\"Abort\" za prekid instalacije,\r\n\"Retry\" za ponovni pokušaj zapisivanja, ili\r\n\"Ignore\" za zanemarenje te datoteke
+# ^FileError_NoIgnore
+Greška prilikom otvaranja datoteke za zapisivanje: \r\n\t"$0"\r\n\"Retry\" za ponovni pokušaj zapisivanja, ili\r\n\"Cancel\" za prekid instalacije
+# ^CantWrite
+"Ne mogu zapisati: "
+# ^CopyFailed
+Greška prilikom kopiranja
+# ^CopyTo
+"Kopiraj u "
+# ^Registering
+"Prijava: "
+# ^Unregistering
+"Odjava: "
+# ^SymbolNotFound
+"Ne mogu naæi simbol: "
+# ^CouldNotLoad
+"Ne mogu uèitati: "
+# ^CreateFolder
+"Stvori mapu: "
+# ^CreateShortcut
+"Stvori preèac: "
+# ^CreatedUninstaller
+"Program za uklanjanje: "
+# ^Delete
+"Obriši datoteku: "
+# ^DeleteOnReboot
+"Obriši prilikom ponovnog pokretanja: "
+# ^ErrorCreatingShortcut
+"Greška prilikom stvaranja preèaca: "
+# ^ErrorCreating
+"Greška prilikom stvaranja: "
+# ^ErrorDecompressing
+Greška dekompresije podataka! Ošteæena instalacijska datoteka?
+# ^ErrorRegistering
+Greška prilikom prijavljivanja DLLa
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Izvrši: "
+# ^Extract
+"Otpakiraj: "
+# ^ErrorWriting
+"Otpakiranje: greška zapisivanja u datoteku "
+# ^InvalidOpcode
+Ošteæena instalacijska datoteka: neispravni opkod
+# ^NoOLE
+"Nema OLE za: "
+# ^OutputFolder
+"Izlazna mapa: "
+# ^RemoveFolder
+"Obriši mapu: "
+# ^RenameOnReboot
+"Preimenuj prilikom ponovnog pokretanja: "
+# ^Rename
+"Preimenuj: "
+# ^Skipped
+"Preskoèeno: "
+# ^CopyDetails
+Kopiraj detalje u Clipboard
+# ^LogInstall
+Logiraj instalacijski proces
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Turkish.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Turkish.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Turkish.nsh	(revision 728)
@@ -0,0 +1,122 @@
+;Language: Turkish (1055)
+;By Çagatay Dilsiz(Chagy)
+;Updated by Fatih BOY (fatih_boy@yahoo.com)
+
+!insertmacro LANGFILE "Turkish" "Türkçe"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "$(^NameDA) Kurulum sihirbazýna hoþ geldiniz"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Bu sihirbaz size $(^NameDA) kurulumu boyunca rehberlik edecektir.$\r$\n$\r$\nKurulumu baþlatmadan önce çalýþan diðer programlari kapatmanýzý öneririz. Böylece bilgisayarýnýzý yeniden baþlatmadan bazý sistem dosyalarý sorunsuz kurulabilir.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "$(^NameDA) Programýný Kaldýrma Sihirbazýna Hoþ Geldiniz"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Bu sihirbaz size $(^NameDA) programýnýn kadýrýlýmý boyunca rehberlik edecektir.$\r$\n$\r$\nKaldýrým iþlemeni baþlatmadan önce çalýþan diðer programlari kapatmanýzý öneririz. Böylece bilgisayarýnýzý yeniden baþlatmadan bazý sistem dosyalarý sorunsuz kaldýrýlabilir.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Lisans Sözleþmesi"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Lütfen $(^NameDA) programýný kurmadan önce sözleþmeyi okuyunuz."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Sözleþme koþullarýný kabul ediyorsanýz, 'Kabul Ediyorum'a basýnýz. $(^NameDA) programýný kurmak için sözleþme koþullarýný kabul etmelisiniz."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Sözleþme koþullarýný kabul ediyorsanýz, aþaðýdaki onay kutusunu doldurunuz. $(^NameDA) programýný kurmak için sözleþme koþullarýný kabul etmelisiniz. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Sözleþme koþullarýný kabul ediyorsanýz, asagidaki onay düðmesini seçiniz. $(^NameDA) programýný kurmak için sözleþme koþullarýný kabul etmelisiniz. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Lisans Sözleþmesi"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Lütfen $(^NameDA) programýný sisteminizden kaldýrmadan önce sözleþmeyi okuyunuz."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Sözleþme koþullarýný kabul ediyorsanýz, 'Kabul Ediyorum'a basýnýz. $(^NameDA) programýný sisteminizden kaldýrmak için sözleþme koþullarýný kabul etmelisiniz."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Sözleþme koþullarýný kabul ediyorsanýz, aþaðýdaki onay kutusunu doldurunuz. $(^NameDA) programýný sisteminizden kaldýrmak için sözleþme koþullarýný kabul etmelisiniz. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Sözleþme koþullarýný kabul ediyorsanýz, asagidaki onay düðmesini seçiniz. $(^NameDA) programýný sisteminizden kaldýrmak için sözleþme koþullarýný kabul etmelisiniz. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Sözleþmenin geri kalanýný okumak için 'page down' tuþuna basabilirsiniz."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Bileþen seçimi"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Lütfen $(^NameDA) için kurmak istediginiz bileþenleri seçiniz."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Bileþen Þeçimi"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Lütfen kaldýrmak istediðiniz $(^NameDA) program bileþenini seçiniz."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Açýklama"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Bileþenlerin açýklamalarýný görmek için imleci bileþen üzerine götürün."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Bileþenlerin açýklamalarýný görmek için imleci bileþen üzerine götürün."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Hedef dizini seçimi"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "$(^NameDA) programýný kurmak istediðiniz dizini þeçiniz."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Kaldýrýlýcak Dizin Seçimi"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "$(^NameDA) programýný kaldýrmak istediginiz dizini seçiniz."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Kuruluyor"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Lütfen $(^NameDA) kurulurken bekleyiniz."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Kurulum Tamamlandý"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Kurulum baþarýyla tamamlandý."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Kurulum Ýptal Edildi"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Kurulum tam olarak tamamlanmadý."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Kaldýrýlýyor"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Litfen $(^NameDA) programý sisteminizden kaldýrýlýrken bekleyiniz."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Kaldýrma Ýþlemi Tamamlandýr"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Kaldýrma iþlemi baþarýyla tamamlandý."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Kaldýrma Ýþlemi Ýptal Edildi"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Kaldýrma Ýþlemi tamamlanamadý."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "$(^NameDA) Kurulum sihirbazý tamamlanýyor."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA)  bilgisayariniza yüklendi.$\r$\n$\r$\nLütfen 'Bitir'e basarak kurulumu sonlandýrýn."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "$(^NameDA) kurulumunun tamamlanmasý için bilgisayarýnýzý yeniden baþlatmanýz gerekiyor.Bilgisayarýnýzý yeniden baþlatmak istiyor musunuz?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "$(^NameDA) Programý Kaldýrma Sihirbazý Tamamlanýyor"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) programý sisteminizden kaldýrýldý.$\r$\n$\r$\nSihirbazý kapatmak için 'bitir'e basýnýz."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "$(^NameDA) programýný kaldýrma iþleminin tamamlanmasý için bilgisayarýnýzýn yeniden baþlatýlmasý gerekiyor. Bilgisayarýnýzýn þimdi yeniden baþlatýlmasýný ister misiniz?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Yeniden baþlat"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Bilgisayarýmý daha sonra baþlatacaðým."
+  ${LangFileString} MUI_TEXT_FINISH_RUN "$(^NameDA) programýný çalýþtýr"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "beni oku/readme dosyasýný &göster"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Bitir"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Baþlat Menüsü Klasör Seçimi"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "$(^NameDA) kýsayollarýnýn konulacagý baþlat menüsü klasörünü seçiniz."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Programýn kýsayollarýnýn konulacaðý baþlat menüsü klasörünü seçiniz. Farklý bir isim girerek yeni bir klasör yaratabilirsiniz."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Kýsayollarý oluþturmadan devam et"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "$(^NameDA) Programýný Kaldýr"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "$(^NameDA) programýný sisteminizden kaldýrma."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "$(^Name) kurulumundan çýkmak istediðinize emin misiniz?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "$(^Name) Programi Kaldýrma iþleminden çýkmak istediðinize emin misiniz?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Bosnian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Bosnian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Bosnian.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Bosnian (5146)
+;By Salih Èavkiæ, cavkic@skynet.be
+
+!insertmacro LANGFILE "Bosnian" "Bosanski"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Dobrodošli u program za instalaciju $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Ovaj program æe instalirati $(^NameDA) na Vaš sistem. $\r$\n$\r$\nPreporuèujemo da neizostavno zatvorite sve druge otvorene programe prije nego što definitivno zapoènete sa instaliranjem. To æe omoguæiti bolju nadogradnju odreðenih sistemskih datoteka bez potrebe da Vaš raèunar ponovo startujete. Instaliranje programa možete prekinuti pritiskom na dugme 'Odustani'.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Dobrodošli u postupak uklanjanja programa $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Ovaj æe Vas vodiè provesti kroz postupak uklanjanja programa $(^NameDA).$\r$\n$\r$\nPrije samog poèetka, molim zatvorite program $(^NameDA) ukoliko je sluèajno otvoren.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Licencni ugovor"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Molim proèitajte licencni ugovor $(^NameDA) prije instalacije programa."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Ako prihvatate uslove licence, odaberite 'Prihvatam' za nastavak. Morate prihvatiti licencu za instalaciju programa $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Ako prihvatate uslove licence, oznaèite donji kvadratiæ. Morate prihvatiti licencu za instalaciju programa $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Ako prihvatate uslove licence, odaberite prvu donju opciju. Morate prihvatiti licencu za instalaciju programa $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Licencni ugovor o pravu korištenja"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Molim proèitajte licencu prije uklanjanja programa $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Ako prihvatate uslove licence, odaberite 'Prihvatam' za nastavak. Morate prihvatiti licencu za uklanjanje programa $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Ako prihvatate uslove licence, oznaèite donji kvadratiæ. Morate prihvatiti licencu za uklanjanje programa $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Ako prihvatate uslove licence, odaberite prvu donju opciju. Morate prihvatiti licencu za uklanjanje programa $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Pritisnite 'Page Down' na tastaturi za ostatak licence."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Izbor komponenti za instalaciju"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Izaberite komponente programa $(^NameDA) koje želite instalirati."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Izbor komponenti za uklanjanje"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Izaberite komponente programa $(^NameDA) koje želite ukloniti."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Opis"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Postavite kursor od miša iznad komponente da biste vidjeli njezin opis."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Postavite kursor od miša iznad komponente da biste vidjeli njezin opis."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Odaberite odredište za instalaciju"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Odaberite mapu u koju želite instalirati program $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Izaberite polazište za uklanjanje"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Selektirajte mapu iz koje želite ukloniti program $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Instaliranje"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Molim prièekajte na završetak instalacije programa $(^NameDA)."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Kraj instalacije"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Instalacija je u potpunosti uspješno završila."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Instalacija je prekinuta"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Instalacija nije završila uspješno."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Uklanjanje"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Molim Vas prièekajte da vodiè završi uklanjanje $(^NameDA) programa."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Uklanjanje je završeno"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Uklanjanje je u potpunosti završilo uspješno."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Uklanjanje je prekinuto"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Uklanjanje nije završilo uspješno."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Dovršavanje instalacije programa $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Program $(^NameDA) je instaliran na Vaše raèunar.$\r$\n$\r$\nPritisnite dugme 'Kraj' za završetak."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Raèunar treba ponovno startovati za dovršavanje instalacije programa $(^NameDA). Želite li to uèiniti sada?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Završetak uklanjanja programa $(^NameDA) sa Vašeg sistema."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "Program $(^NameDA) je uklonjen sa Vašeg raèunara.$\r$\n$\r$\nPritisnite dugme 'Kraj' za zatvaranje ovog prozora."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Vaš raèunar trebate ponovno startovati da dovršite uklanjanje programa $(^NameDA). Želite li da odmah sad ponovo startujete raèunar?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Startuj raèunar odmah sad"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Ponovno æu pokrenuti raèunar kasnije"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Pokreni program $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Prikaži datoteku &Readme"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Kraj"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Izbor mape u Start meniju"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Izaberite ime za programsku mapu unutar Start menija."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Izaberite jednu mapu u Start meniju u kojoj želite da se kreiraju preèice programa. Možete takoðer unijeti ime za novu mapu ili selektirati veæ postojeæu."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Nemojte praviti preèice"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Uklanjanje programa $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Program $(^NameDA) æe biti uklonjen sa Vašeg raèunara."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Jeste li sigurni da želite prekinuti instalaciju programa $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Jeste li sigurni da želite prekinuti uklanjanje $(^Name) programa?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Breton.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Breton.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Breton.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Breton (1150)
+;By KAD-Korvigelloù An Drouizig
+
+!insertmacro LANGFILE "Breton" "Brezhoneg"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Degemer mat e skoazeller staliañ $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Sturiet e viot gant ar skoazeller-mañ evit staliañ $(^NameDA).$\r$\n$\r$\nGwelloc'h eo serriñ pep arload oberiant er reizhiad a-raok mont pelloc'h gant ar skoazeller-mañ. Evel-se e c'heller nevesaat ar restroù reizhiad hep rankout adloc'hañ hoc'h urzhiataer.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Degemer mat er skoazeller distaliañ $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Sturiet e viot gant ar skoazeller-mañ a-benn distaliañ $(^NameDA).$\r$\n$\r$\nEn em asurit n'eo ket lañset $(^NameDA) a-raok mont pelloc'h gant an distaliañ.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Lañvaz emglev"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Bezit aketus en ur lenn pep term eus al lañvaz a-raok staliañ $(^NameDA), mar plij."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Mar degemerit pep term eus al lañvaz, klikit war « War-lerc'h ». Ret eo deoc'h degemer al lañvaz evit staliañ $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Mar degemerit pep term eus al lañvaz, klikit war al log a-zindan. Ret eo deoc'h degemer al lañvaz a-benn staliañ $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Mar degemerit pep term eus al lañvaz, diuzit an dibab kentañ a-zindan. Ret eo deoc'h degemer al lañvaz a-benn staliañ $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Lañvaz emglev"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Trugarez da lenn al lañvaz a-raok distaliañ $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Mar degemerit pep term eus al lañvaz, klikit war « A-du emaon » evit kenderc'hel. Ret eo deoc'h degemer al lañvaz evit distaliañ $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Mar degemerit pep term eus al lañvaz, klikit war al log a-zindan. Ret eo deoc'h degemer al lañvaz evit distaliañ $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Mar degemerit pep term eus al lañvaz, dizuit an dibab kentañ a-zindan. Ret eo deoc'h degemer al lañvaz evit distaliañ $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Pouezit war « Pajenn a-raok » evit lenn ar pajennoù eus al lañvaz da-heul."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Dibab elfennoù"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Dibabit pe elfenn(où) $(^NameDA) a fell deoc'h staliañ."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Dibabit elfennoù"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Dibabit pe elfenn(où) $(^NameDA) a fell deoc'h distaliañ."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Deskrivadenn"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Lakait ho logodenn a-zioc'h an elfenn evit gwelout he deskrivadenn."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Lakait ho logodenn a-zioc'h an elfenn evit gwelout he deskrivadenn."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Dibabit al lec'hiadur staliañ"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Dibabit ar c'havlec'h ma vo lakaet $(^NameDA) ennañ."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Dibabit al lec'hiadur distaliañ"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Dibabit ar c'havlec'h e vo dilamet $(^NameDA) dioutañ."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "O staliañ"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Gortozit mar plij, emañ $(^NameDA) o vezañ staliet."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Echu eo gant ar staliañ"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Kaset eo bet da benn mat ar staliañ."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Staliañ paouezet"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "N'eo ket bet kaset da benn mat ar staliañ."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "O tistaliañ"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Gortozit mar plij, emañ $(^NameDA) o vezañ distaliet."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Echu eo gant an distaliañ"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Gant berzh eo bet kaset da benn an distaliañ."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Distaliañ paouezet"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "N'eo ket bet kaset da benn mat an distaliañ."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Oc'h echuiñ staliañ $(^NameDA) gant ar skoazeller"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Staliet eo bet $(^NameDA) war hoc'h urzhiataer.$\r$\n$\r$\nKlikit war « Echuiñ » evit serriñ ar skoazeller-mañ."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Ret eo hoc'h urzhiataer bezañ adloc'het evit ma vez kaset da benn staliañ $(^NameDA). Ha fellout a ra deoc'h adloc'hañ diouzhtu ?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Oc'h echuiñ distaliañ $(^NameDA) gant ar skoazeller"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "Distaliet eo bet $(^NameDA) diouzh hoc'h urzhiataer.$\r$\n$\r$\nKlikit war « Echuiñ » evit serriñ ar skoazeller-mañ."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Ret eo hoc'h urzhiataer bezañ adloc'het evit ma vez kaset da benn distaliañ $(^NameDA). Ha fellout a ra deoc'h adloc'hañ diouzhtu ?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Adloc'hañ diouzhtu"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Fellout a ra din adloc'hañ diwezatoc'h dre zorn"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Lañsañ $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Diskouez ar restr Malennit"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Echuiñ"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Diskouez kavlec'h al Lañser loc'hañ"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Dibabit ur c'havlec'h Lañser loc'hañ evit berradennoù $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Diuzit ar c'havlec'h Lañser loc'hañ e vo savet ennañ berradennoù ar goulevioù. Gallout a rit ingal reiñ un anv evit sevel ur c'havlec'h nevez."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Chom hep sevel berradennoù"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Distaliañ $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Dilemel $(^NameDA) adalek hoc'h urzhiataer."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Ha sur oc'h e fell deoc'h kuitaat staliañ $(^Name) ?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Ha sur oc'h e fell deoc'h kuitaat distaliañ $(^Name) ?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Malay.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Malay.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Malay.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1086
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+-
+# RTL - anything else than RTL means LTR
+-
+# Translation muhammadazwa@yahoo.com
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+Setup $(^Name)
+# ^UninstallCaption
+Uninstall $(^Name)
+# ^LicenseSubCaption
+: Perlesenan
+# ^ComponentsSubCaption
+: Pilihan kemasukan
+# ^DirSubCaption
+: Folder kemasukan
+# ^InstallingSubCaption
+: Memasang
+# ^CompletedSubCaption
+: Selesai
+# ^UnComponentsSubCaption
+: Pilihan membuang
+# ^UnDirSubCaption
+: Folder Uninstal
+# ^ConfirmSubCaption
+: Kepastian
+# ^UninstallingSubCaption
+: Membuang
+# ^UnCompletedSubCaption
+: Tidak Selesai
+# ^BackBtn
+< &Ke Belakang
+# ^NextBtn
+&Ke Depan >
+# ^AgreeBtn
+Saya &setuju
+# ^AcceptBtn
+Saya s&etuju dengan Perlesenan
+# ^DontAcceptBtn
+Saya &tidak setuju dengan Perlesenan
+# ^InstallBtn
+&Masukkan
+# ^UninstallBtn
+&Buang
+# ^CancelBtn
+Batal
+# ^CloseBtn
+&Tutup
+# ^BrowseBtn
+S&elusur...
+# ^ShowDetailsBtn
+Buka &lagi
+# ^ClickNext
+Klik Ke Depan untuk teruskan.
+# ^ClickInstall
+Klik Masukkan untuk kemasukkan.
+# ^ClickUninstall
+Klik Uninstall untuk membuang.
+# ^Name
+Nama
+# ^Completed
+Selesai
+# ^LicenseText
+Sila baca lesen sebelum memasukkan $(^NameDA). Jika anda terima perlesenan, klik Saya setuju.
+# ^LicenseTextCB
+Sila baca lesen sebelum memasukkan $(^NameDA). Jika terima, beri tanda dicheckbox. $_CLICK
+# ^LicenseTextRB
+Sila baca lesen sebelum sebelum membuang $(^NameDA). Jika anda terima perlesenan, pilihlah salah satu item dibawah ini. $_CLICK
+# ^UnLicenseText
+Sila baca lesen sebelum sebelum membuang $(^NameDA). Jika anda terima perlesenan, klik Saya setuju.
+# ^UnLicenseTextCB
+Sila baca lesen sebelum memasukkan $(^NameDA). Jika terima, beri tanda dicheckbox. $_CLICK
+# ^UnLicenseTextRB
+Sila baca lesen sebelum sebelum membuang $(^NameDA).Jika anda terima perlesenan, pilihlah salah satu item dibawah ini. $_CLICK
+# ^Custom
+Custom
+# ^ComponentsText
+Beri tanda dicheckbox pada komponen yang ingin dimasukkan and hilangkan tanda pada komponen yang tidak perlu dimasukkan. $_CLICK
+# ^ComponentsSubText1
+Pilih kemasukan:
+# ^ComponentsSubText2_NoInstTypes
+Pilih komponen-komponen untuk dimasukkan:
+# ^ComponentsSubText2
+Atau, pilih komponen berikut untuk dimasukkan:
+# ^UnComponentsText
+Beri tanda dicheckbox pada komponen yang ingin dimasukkan and hilangkan tanda pada komponen yang tidak perlu dimasukkan. $_CLICK
+# ^UnComponentsSubText1
+Pilih tipe un-kemasukan:
+# ^UnComponentsSubText2_NoInstTypes
+Pilih komponen-komponen untuk di buang:
+# ^UnComponentsSubText2
+Atau, pilih komponen berikut untuk di buang:
+# ^DirText
+Setup akan memasukkan $(^NameDA) pada folder berikut. Untuk memilih folder lainnya, klik Selusur dan pilih folder pilihan anda. $_CLICK
+# ^DirSubText
+Folder tujuan
+# ^DirBrowseText
+Pilih folder untuk memasukkan $(^NameDA):
+# ^UnDirText
+Setup akan membuang $(^NameDA) dari folder berikut. Untuk memilih folder lainnya, klik Selusur dan pilih folder pilihan anda. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Pilih folder untuk dibuang $(^NameDA):
+# ^SpaceAvailable
+"Ruang cakera keras yang ada: "
+# ^SpaceRequired
+"Ruang cakera keras yang diperlukan: "
+# ^UninstallingText
+$(^NameDA) akan buang dari folder berikut. $_CLICK
+# ^UninstallingSubText
+Membuang:
+# ^FileError
+Tidak dapat menulis pada fail: \r\n\t"$0"\r\nKlik abort untuk membatalkan kemasukan,\r\nretry untuk cuba lagi, atau\r\nignore untuk abaikan fail ini.
+# ^FileError_NoIgnore
+Tidak dapat menulis pada fail: \r\n\t"$0"\r\nKlik retry untuk cuba lagi, atau\r\ncancel untuk batalkan kemasukan
+# ^CantWrite
+"Gagal menulis pada: "
+# ^CopyFailed
+Gagal menyalin
+# ^CopyTo
+"Menyalin ke "
+# ^Registering
+"Mendaftarkan modul: "
+# ^Unregistering
+"Melepaskan modul: "
+# ^SymbolNotFound
+"Symbol tidak jumpa : "
+# ^CouldNotLoad
+"Tidak dapat membuka: "
+# ^CreateFolder
+"Membuat folder: "
+# ^CreateShortcut
+"Membuat pintasan: "
+# ^CreatedUninstaller
+"Membuat program unistall: "
+# ^Delete
+"Memadam fail: "
+# ^DeleteOnReboot
+"Akan dipadam ketika reboot: "
+# ^ErrorCreatingShortcut
+"Tidak dapat membuat pintasan: "
+# ^ErrorCreating
+"Ralat penciptaan: "
+# ^ErrorDecompressing
+Ralat ketika membuka data! Program Installer rosak
+# ^ErrorRegistering
+Ralat mendaftarkan modul DLL
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Menjalankan: "
+# ^Extract
+"Mengekstrak: "
+# ^ErrorWriting
+"Ekstrak: ralat ketika menulis ke fail "
+# ^InvalidOpcode
+Installer rosak: opcode tidak lengkap
+# ^NoOLE
+"OLE tidak ditemukan: "
+# ^OutputFolder
+"Folder tujuan: "
+# ^RemoveFolder
+"Menghapuskan folder: "
+# ^RenameOnReboot
+"Menamakan semula pada reboot: "
+# ^Rename
+"Menamakan semula: "
+# ^Skipped
+"Diabaikan: "
+# ^CopyDetails
+Salin terperinci ke clipboard
+# ^LogInstall
+Catat proses kemasukan
+# ^Byte
+Bait
+# ^Kilo
+Kilo
+# ^Mega
+Mega
+# ^Giga
+Giga
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Bulgarian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Bulgarian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Bulgarian.nlf	(revision 728)
@@ -0,0 +1,194 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+1026
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1251
+# RTL - anything else than RTL means LTR
+-
+# Translation by Asparouh Kalyandjiev <acnapyx@computers.bg>
+# Updated v2 to v6 by Plamen Penkov <plamen71@hotmail.com>
+# Updated by Êèðèë Êèðèëîâ (DumpeR)<dumper@data.bg>
+# 
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+Èíñòàëèðàíå íà $(^Name) 
+# ^UninstallCaption
+Èçòðèâàíå íà $(^Name) 
+#^LicenseSubCaption
+: Ëèöåíçèîííî ñïîðàçóìåíèå
+#^ComponentsSubCaption
+: Îïöèè çà èíñòàëèðàíå
+# ^DirSubCaption
+: Èíñòàëèðàíå â ïàïêà
+#^InstallingSubCaption
+: Èíñòàëèðàíå
+#^CompletedSubCaption
+: Çàâúðøâàíå
+# ^UnComponentsSubCaption
+: Îïöèè çà èçòðèâàíå
+# ^UnDirSubCaption
+: Èçòðèâàíå îò ïàïêà
+# ^ConfirmSubCaption
+: Ïîòâúðæäåíèå
+#^UninstallingSubCaption
+: Èçòðèâàíå
+#^UnCompletedSubCaption
+: Çàâúðøâàíå
+# ^BackBtn
+< &Íàçàä
+#^NextBtn
+Í&àïðåä >
+# ^AgreeBtn
+&Ñúãëàñåí
+# ^AcceptBtn
+&Ñúãëàñåí ñúì ñ óñëîâèÿòà íà Ëèöåíçèîííîòî ñïîðàçóìåíèå.
+# ^DontAcceptBtn
+&Íå ñúì ñúãëàñåí ñ óñëîâèÿòà íà Ëèöåíçèîííîòî ñïîðàçóìåíèå.
+# ^InstallBtn
+&Èíñòàëèðàé
+#^UninstallBtn
+&Èçòðèé
+# ^CancelBtn
+&Îòêàç
+#^CloseBtn
+&Çàòâîðè
+#^BrowseBtn
+Ï&ðåãëåä...
+#^ShowDetailsBtn
+&Äåòàéëè
+# ^ClickNext
+Íàòèñíåòå "Íàïðåä", çà äà ïðîäúëæèòå.
+# ^ClickInstall
+Íàòèñíåòå "Èíñòàëèðàé", çà äà çàïî÷íå èíñòàëèðàíåòî.
+# ^ClickUninstall
+Íàòèñíåòå "Èçòðèé", çà äà çàïî÷íå èçòðèâàíåòî.
+# ^Name
+Èìå
+#^Completed
+Êðàé
+# ^LicenseText
+Ìîëÿ ïðî÷åòåòå Ëèöåíçèîííîòî ñïîðàçóìåíèå ïðåäè äà èíñòàëèðàòå $(^NameDA). Àêî ïðèåìàòå âñè÷êè óñëîâèÿ íà ñïîðàçóìåíèåòî, íàòèñíåòå "Ñúãëàñåí".
+# ^LicenseTextCB
+Ìîëÿ ïðî÷åòåòå Ëèöåíçèîííîòî ñïîðàçóìåíèå ïðåäè äà èíñòàëèðàòå $(^NameDA). Àêî ïðèåìàòå âñè÷êè óñëîâèÿ íà ñïîðàçóìåíèåòî, ñëîæåòå îòìåòêà â ïîëåòî ïî-äîëó. $_CLICK
+# ^LicenseTextRB
+Ìîëÿ ïðî÷åòåòå Ëèöåíçèîííîòî ñïîðàçóìåíèå ïðåäè äà èíñòàëèðàòå $(^NameDA). Àêî ïðèåìàòå âñè÷êè óñëîâèÿ íà ñïîðàçóìåíèåòî, èçáåðåòå ïúðâàòà îïöèÿ ïî-äîëó. $_CLICK
+# ^UnLicenseText
+Ìîëÿ ïðî÷åòåòå Ëèöåíçèîííîòî ñïîðàçóìåíèå ïðåäè äà èçòðèåòå $(^NameDA). Àêî ïðèåìàòå âñè÷êè óñëîâèÿ íà ñïîðàçóìåíèåòî, íàòèñíåòå "Ñúãëàñåí".
+# ^UnLicenseTextCB
+Ìîëÿ ïðî÷åòåòå Ëèöåíçèîííîòî ñïîðàçóìåíèå ïðåäè äà èçòðèåòå $(^NameDA). Àêî ïðèåìàòå âñè÷êè óñëîâèÿ íà ñïîðàçóìåíèåòî, ñëîæåòå îòìåòêà â ïîëåòî ïî-äîëó. $_CLICK
+# ^UnLicenseTextRB
+Ìîëÿ ïðî÷åòåòå Ëèöåíçèîííîòî ñïîðàçóìåíèå ïðåäè äà èçòðèåòå $(^NameDA). Àêî ïðèåìàòå âñè÷êè óñëîâèÿ íà ñïîðàçóìåíèåòî, èçáåðåòå ïúðâàòà îïöèÿ ïî-äîëó. $_CLICK
+# ^Custom
+Èíñòàëèðàíå ïî èçáîð
+#^ComponentsText
+Èçáåðåòå êîìïîíåíòèòå, êîèòî èñêàòå äà áúäàò èíñòàëèðàíè. $_CLICK
+#^ComponentsSubText1
+Èçáåðåòå òèï èíñòàëèðàíå:
+#^ComponentsSubText2_NoInstTypes
+Èçáåðåòå êîìïîíåíòè:
+#^ComponentsSubText2
+Èëè èçáåðåòå êîìïîíåíòèòå, êîèòî èñêàòå äà áúäàò èíñòàëèðàíè:
+# ^UnComponentsText
+Ñëîæåòå îòìåòêà ïðåä êîìïîíåíòèòå, êîèòî èñêàòå äà èçòðèåòå, à òåçè êîèòî íå èñêàòå äà èçòðèåòå îñòàâåòå áåç îòìåòêà. $_CLICK
+# ^UnComponentsSubText1
+Èçáåðåòå òèïà íà èçòðèâàíå:
+# ^UnComponentsSubText2_NoInstTypes
+Èçáåðåòå êîìïîíåíòèòå çà èçòðèâàíå:
+# ^UnComponentsSubText2
+Èëè, èçáåðåòå äîïúëíèòåëíè êîìïîíåíòè çà èçòðèâàíå:
+# ^DirText
+Ïðîãðàìàòà ùå èíñòàëèðà $(^NameDA) â ïîñî÷åíàòà ïàïêà. Çà äà èíñòàëèðàòå â äðóãà ïàïêà, íàòèñíåòå "Ïðåãëåä" è èçáåðåòå äðóãà ïàïêà. $_CLICK
+# ^DirSubText
+Öåëåâà ïàïêà
+# ^DirBrowseText
+Èçáåðåòå ïàïêà, â êîÿòî äà ñå èíñòàëèðà $(^NameDA):
+# ^UnDirText
+Ïðîãðàìàòà ùå èçòðèå $(^NameDA) îò ñëåäíàòà ïàïêà. Çà äà èçòðèåòå îò äðóãà ïàïêà, íàòèñíåòå "Ïðåãëåä" è èçáåðåòå äðóãà ïàïêà. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Èçáåðåòå ïàïêàòà îò êîÿòî äà ñå èçòðèå $(^NameDA):
+# ^SpaceAvailable
+"Ñâîáîäíî ïðîñòðàíñòâî: "
+#^SpaceRequired
+"Íåîáõîäèìî ïðîñòðàíñòâî: "
+# ^UninstallingText
+$(^NameDA) ùå áúäå èçòðèòà îò ñëåäíàòà ïàïêà. $_CLICK
+# ^UninstallingSubText
+Èçòðèâàíå îò:
+# ^FileError
+Ãðåøêà ïðè îòâàðÿíå íà ôàéëà çà çàïèñ: \r\n\t"$0"\r\nÍàòèñíåòå "Ïðåêðàòè", çà äà ïðåêðàòèòå èíñòàëèðàíåòî, "Ïîâòîðè", çà äà îïèòàòå îòíîâî èëè "Èãíîðèðàé", çà äà ïðîïóñíåòå òîçè ôàéë
+# ^FileError_NoIgnore
+Ãðåøêà ïðè îòâàðÿíå íà ôàéëà çà çàïèñ: \r\n\t"$0"\r\nÍàòèñíåòå "Ïîâòîðè", çà äà îïèòàòå îòíîâî èëè "Ïðåêðàòè", çà äà ïðåêðàòèòå èíñòàëèðàíåòî.
+# ^CantWrite
+"Íåóñïåøíî çàïèñâàíå íà: "
+#^CopyFailed
+Êîïèðàíåòî íåóñïåøíî
+# ^CopyTo
+"Êîïèðàíå íà "
+# ^Registering
+"Ðåãèñòðèðàíå íà: "
+# ^Unregistering
+"Äåðåãèñòðèðàíå íà: "
+#^SymbolNotFound
+"Ñèìâîëúò íå å íàìåðåí: "
+# ^CouldNotLoad
+"Íåóñïåøíî çàðåæäàíå íà: "
+# ^CreateFolder
+"Ñúçäàâàíå íà ïàïêà: "
+# ^CreateShortcut
+"Ñúçäàâàíå íà ïðÿê ïúò: "
+#^CreatedUninstaller
+"Ñúçäàâàíå íà ïðîãðàìà çà èçòðèâàíå: "
+# ^Delete
+"Èçòðèâàíå íà: "
+#^DeleteOnReboot
+"Èçòðèâàíå ñëåä ðåñòàðò: "
+#^ErrorCreatingShortcut
+"Ãðåøêà ïðè ñúçäàâàíå íà ïðåêèÿ ïúò: "
+#^ErrorCreating
+"Ãðåøêà ïðè ñúçäàâàíå íà: "
+# ^ErrorDecompressing
+Ãðåøêà ïðè äåêîìïðåñèðàíå íà äàííèòå! Âåðîÿòíî èíñòàëàöèîííèÿ ïàêåò å ïîâðåäåí.
+# ^ErrorRegistering
+Ãðåøêà ïðè ðåãèñòðèðàíå íà DLL
+#^ExecShell
+"ExecShell: "
+#^Exec
+"Èçïúëíåíèå íà: "
+#^Extract
+"Èçâëè÷àíå íà: "
+#^ErrorWriting
+"Èçâëè÷àíå íà: ãðåøêà ïðè çàïèñ âúâ ôàéë "
+#^InvalidOpcode
+Ïàêåòà å ïîâðåäåí: ãðåøåí êîä íà îïåðàöèÿ
+# ^NoOLE
+"Íÿìà OLE çà: "
+#^OutputFolder
+"Èíñòàëèðàíå â ïàïêà: "
+#^RemoveFolder
+"Èçòðèâàíå íà ïàïêà: "
+#^RenameOnReboot
+"Ïðåèìåíóâàíå ïðè ðåñòàðò: "
+# ^Rename
+"Ïðåèìåíóâàíå íà: "
+#^Skipped
+"Ïðîïóñêàíå íà: "
+# ^CopyDetails
+Êîïèðàíå íà äàííèòå â áóôåðà
+# ^LogInstall
+Çàïèñâàíå íà îò÷åò çà èíñòàëèðàíåòî
+# ^Byte
+Á
+# ^Kilo
+ Ê
+# ^Mega
+ Ì
+# ^Giga
+ Ã 
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/French.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/French.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/French.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1036
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by the French NSIS team <veekee@winampfr.com> - http://www.winampfr.com/nsis.
+# Updated to v6 by Jerome Charaoui (lavamind@inetflex.com)
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+Installation de $(^Name)
+# ^UninstallCaption
+Désinstallation de $(^Name)
+# ^LicenseSubCaption
+: Licence
+# ^ComponentsSubCaption
+: Options d'installation
+# ^DirSubCaption
+: Dossier d'installation
+# ^InstallingSubCaption
+: Installation des fichiers
+# ^CompletedSubCaption
+: Terminé
+# ^UnComponentsSubCaption
+: Options de désinstallation
+# ^UnDirSubCaption
+: Dossier de désinstallation
+# ^ConfirmSubCaption
+: Confirmation
+# ^UninstallingSubCaption
+: Désinstallation des fichiers
+# ^UnCompletedSubCaption
+: Terminé
+# ^BackBtn
+< &Précédent
+# ^NextBtn
+&Suivant >
+# ^AgreeBtn
+J'a&ccepte
+# ^AcceptBtn
+J'a&ccepte les termes de la licence
+# ^DontAcceptBtn
+Je &n'accepte pas les termes de la licence
+# ^InstallBtn
+&Installer
+# ^UninstallBtn
+&Désinstaller
+# ^CancelBtn
+Annuler
+# ^CloseBtn
+&Fermer
+# ^BrowseBtn
+P&arcourir...
+# ^ShowDetailsBtn
+P&lus d'infos
+# ^ClickNext
+Cliquez sur Suivant pour continuer.
+# ^ClickInstall
+Cliquez sur Installer pour démarrer l'installation.
+# ^ClickUninstall
+Cliquez sur Désinstaller pour démarrer la désinstallation.
+# ^Name
+Nom
+# ^Completed
+Terminé
+# ^LicenseText
+Veuillez examiner le contrat de licence avant d'installer $(^NameDA). Si vous acceptez tous les termes du contrat, cliquez sur J'accepte.
+# ^LicenseTextCB
+Veuillez examiner le contrat de licence avant d'installer $(^NameDA). Si vous acceptez tous les termes du contrat, cochez la boîte de contrôle ci-dessous. $_CLICK
+# ^LicesnseTextRB
+Veuillez examiner le contrat de licence avant d'installer $(^NameDA). Si vous acceptez tous les termes du contrat, sélectionnez la première option ci-dessous. $_CLICK
+# ^UnLicenseText
+Veuillez examiner le contrat de licence avant de désinstaller $(^NameDA). Si vous acceptez tous les termes du contrat, cliquez sur J'accepte.
+# ^UnLicenseTextCB
+Veuillez examiner le contrat de licence avant de désinstaller $(^NameDA). Si vous acceptez tous les termes du contrat, cochez la boîte de contrôle ci-dessous. $_CLICK
+# ^UnLicesnseTextRB
+Veuillez examiner le contrat de licence avant de désinstaller $(^NameDA). Si vous acceptez tous les termes du contrat, sélectionnez la première option ci-dessous. $_CLICK
+# ^Custom
+Personnalisée
+# ^ComponentsText
+Cochez les composants que vous désirez installer et décochez ceux que vous ne désirez pas installer. $_CLICK
+# ^ComponentsSubText1
+Type d'installation :
+# ^ComponentsSubText2_NoInstTypes
+Sélectionnez les composants à installer :
+# ^ComponentsSubText2
+Ou, sélectionnez les composants optionnels que vous voulez installer :
+# ^UnComponentsText
+Cochez les composants que vous désirez désinstaller et décochez ceux que vous ne désirez pas désinstaller. $_CLICK
+# ^UnComponentsSubText1
+Sélectionnez le type de désinstallation :
+# ^UnComponentsSubText2_NoInstTypes
+Sélectionnez les composants à désinstaller :
+# ^UnComponentsSubText2
+Ou, sélectionnez les composants optionnels que vous voulez désinstaller :
+# ^DirText
+Ceci installera $(^NameDA) dans le dossier suivant. Pour installer dans un autre dossier, cliquez sur Parcourir et choisissez un autre dossier. $_CLICK
+# ^DirSubText
+Dossier d'installation
+# ^DirBrowseText
+Sélectionnez le dossier d'installation pour $(^NameDA) :
+# ^UnDirText
+Ceci désinstallera $(^NameDA) du dossier suivant. Pour désinstaller d'un autre dossier, cliquez sur Parcourir et choisissez un autre dossier. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Sélectionnez le dossier de désinstallation pour $(^NameDA) :
+# ^SpaceAvailable
+"Espace disponible : "
+# ^SpaceRequired
+"Espace requis : "
+# ^UninstallingText
+Ce programme désinstallera $(^NameDA) de votre ordinateur. $_CLICK
+# ^UninstallingSubText
+Désinstallation à partir de :
+# ^FileError
+Erreur lors de l'ouverture du fichier en écriture : \r\n\t"$0"\r\nAppuyez sur Abandonner pour annuler l'installation,\r\nRéessayer pour réessayer l'écriture du fichier, ou\r\nIgnorer pour passer ce fichier
+# ^FileError_NoIgnore
+Erreur lors de l'ouverture du fichier en écriture : \r\n\t"$0"\r\nAppuyez sur Réessayez pour re-écrire le fichier, ou\r\nAnnuler pour abandonner l'installation
+# ^CantWrite
+"Impossible d'écrire : "
+# ^CopyFailed
+Échec de la copie
+# ^CopyTo
+"Copier vers "
+# ^Registering
+"Enregistrement : "
+# ^Unregistering
+"Suppression de l'enregistrement : "
+# ^SymbolNotFound
+"Impossible de trouver un symbole : "
+# ^CouldNotLoad
+"Impossible de charger : "
+# ^CreateFolder
+"Création du dossier : "
+# ^CreateShortcut
+"Création du raccourci : "
+# ^CreatedUninstaller
+"Création de la désinstallation : "
+# ^Delete
+"Suppression : "
+# ^DeleteOnReboot
+"Suppression au redémarrage : "
+# ^ErrorCreatingShortcut
+"Erreur lors de la création du raccourci : "
+# ^ErrorCreating
+"Erreur de la création : "
+# ^ErrorDecompressing
+Erreur lors de la décompression des données ! Installation corrompue ?
+# ^ErrorRegistering
+Erreur lors de l'enregistrement de la DLL
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Exécution : "
+# ^Extract
+"Extraction : "
+# ^ErrorWriting
+"Extraction : erreur d'écriture du fichier "
+# ^InvalidOpcode
+Installation corrompue : opcode incorrect
+# ^NoOLE
+"Pas de OLE pour : "
+# ^OutputFolder
+"Destination : "
+# ^RemoveFolder
+"Suppression du dossier : "
+# ^RenameOnReboot
+"Renommer au redémarrage : "
+# ^Rename
+"Renommer : "
+# ^Skipped
+"Passé : "
+# ^CopyDetails
+Copier les Détails dans le Presse-papier
+# ^LogInstall
+Enregistrer le déroulement de l'installation
+# ^Byte
+o
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SpanishInternational.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SpanishInternational.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SpanishInternational.nsh	(revision 728)
@@ -0,0 +1,130 @@
+;Language: Spanish International (3082)
+;By Darwin Rodrigo Toledo Cáceres - www.winamp-es.com - niwrad777@gmail.com
+;Base by Monki y Joel
+
+!insertmacro LANGFILE "SpanishInternational" "Español (Alfabetización Internacional)"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Bienvenido al Asistente de Instalación de $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Este asistente le guiará a través de la instalación de $(^NameDA).$\r$\n$\r$\nSe recomienda que cierre todas la demás aplicaciones antes de iniciar la instalación. Esto hará posible actualizar archivos de sistema sin tener que reiniciar su computadora.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Bienvenido al Asistente de Desinstalación de $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Este asistente le guiará durante la desinstalación de $(^NameDA).$\r$\n$\r$\nAntes de iniciar la desinstalación, asegúrese de que $(^NameDA) no se está ejecutando.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Acuerdo de licencia"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Por favor revise el acuerdo de licencia antes de instalar $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Si acepta todas las condiciones del acuerdo, seleccione Acepto para continuar. Debe aceptar el acuerdo para instalar $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Si acepta las condiciones del acuerdo, marque abajo la casilla. Debe aceptar las condiciones para instalar $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Si acepta las condiciones del acuerdo, seleccione abajo la primera opción. Debe aceptar las condiciones para instalar $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Acuerdo de licencia"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Por favor revise el acuerdo de licencia antes de desinstalar $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Si acepta todas las condiciones del acuerdo, seleccione Acepto para continuar. Debe aceptar el acuerdo para desinstalar $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Si acepta los términos del acuerdo, marque abajo la casilla. Debe aceptar los términos para desinstalar $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Si acepta los términos del acuerdo, seleccione abajo la primera opción. Debe aceptar los términos para desinstalar $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Presione Avanzar Página para ver el resto del acuerdo."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Selección de componentes"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Seleccione qué características de $(^NameDA) desea instalar."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Selección de componentes"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Seleccione qué características de $(^NameDA) desea desinstalar."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Descripción"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Sitúe el ratón encima de un componente para ver su descripción."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Sitúe el ratón encima de un componente para ver su descripción."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Elegir lugar de instalación"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Elija la carpeta para instalar $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Elegir lugar de desinstalación"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Elija la carpeta desde la cual desinstalará $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Instalando"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Por favor espere mientras $(^NameDA) se instala."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Instalación Finalizada"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "La instalación se ha finalizado correctamente."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Instalación Abortada"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "La instalación no se terminó correctamente."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Desinstalando"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Por favor espere mientras $(^NameDA) se desinstala."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Desinstalación Finalizada"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "La desinstalación se ha finalizado correctamente."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Desinstalación Abortada"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "La desinstalación no se terminó correctamente."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Finalizando el Asistente de Instalación de $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) ha sido instalado en su sistema.$\r$\n$\r$\nPresione Terminar para cerrar este asistente."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Su sistema debe ser reiniciado para poder finalizar la instalación de $(^NameDA). ¿Desea reiniciar ahora?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Completando el Asistente de Desinstalación de $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) ha sido desinstalado de su sistema.$\r$\n$\r$\nPresione Terminar para cerrar este asistente."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Su computadora debe ser reiniciada para finalizar la desinstalación de $(^NameDA). ¿Desea reiniciar ahora?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Reiniciar ahora"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Deseo reiniciar manualmente más tarde"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Ejecutar $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Mostrar Léame"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Terminar"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Elegir Carpeta del Menú Inicio"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Elija una Carpeta del Menú Inicio para los accesos directos de $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Seleccione una carpeta del Menú Inicio en la que quiera crear los accesos directos del programa. También puede introducir un nombre para crear una nueva carpeta."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "No crear accesos directos"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Desinstalar $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Elimina $(^NameDA) de su sistema."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "¿Está seguro de que desea salir de la instalación de $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "¿Está seguro de que desea salir de la desinstalación de $(^Name)?"
+!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "Elegir Usuarios"
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "Elija los usuarios para los cuales Ud. desea instalar $(^NameDA)."
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "Elija una opción si desea instalar $(^NameDA) para sólo para Ud., o para todos los usuarios de esta computadora.$(^ClickNext)"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "Instación para cualquier usuario de esta computadora"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Instalación solo para mí"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Greek.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Greek.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Greek.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Greek (1032)
+;By Makidis N. Michael - http://dias.aueb.gr/~p3010094/
+
+!insertmacro LANGFILE "Greek" "Greek"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Êáëþò Þëèáôå óôçí ÅãêáôÜóôáóç ôïõ '$(^NameDA)'"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Ï ïäçãüò áõôüò èá óáò êáèïäçãÞóåé êáôÜ ôç äéÜñêåéá ôçò åãêáôÜóôáóçò ôïõ '$(^NameDA)'.$\r$\n$\r$\nÓõíéóôÜôáé íá êëåßóåôå üëåò ôéò Üëëåò åöáñìïãÝò ðñéí îåêéíÞóåôå ôçí ÅãêáôÜóôáóç. Áõôü èá åðéôñÝøåé óôçí ÅãêáôÜóôáóç íá åíçìåñþóåé ôá ó÷åôéêÜ áñ÷åßá óõóôÞìáôïò ÷ùñßò ôçí åðáíåêêßíçóç ôïõ õðïëïãéóôÞ óáò.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Êáëþò Þëèáôå óôïí ïäçãü áðåãêáô. ôïõ '$(^NameDA)'"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Ï ïäçãüò áõôüò èá óáò êáèïäçãÞóåé êáôÜ ôç äéÜñêåéá ôçò áðåãêáôÜóôáóçò ôïõ '$(^NameDA)'.$\r$\n$\r$\nÐñéí îåêéíÞóåôå ôçí áðåãêáôÜóôáóç, âåâáéùèåßôå üôé ôï '$(^NameDA)' äåí ôñÝ÷åé.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Óõìöùíßá ¢äåéáò ×ñÞóçò"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "ÅëÝãîôå ôçí Üäåéá ÷ñÞóçò ðñéí åãêáôáóôÞóåôå ôï '$(^NameDA)'."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "ÅÜí áðïäÝ÷åóôå ôïõò üñïõò ôçò Üäåéáò ÷ñÞóçò, êÜíôå êëéê óôï Óõìöùíþ ãéá íá óõíå÷ßóåôå. ÐñÝðåé íá áðïäå÷èåßôå ôç óõìöùíßá ãéá íá åãêáôáóôÞóåôå ôï '$(^NameDA)'."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "ÅÜí áðïäÝ÷åóôå ôïõò üñïõò ôçò Üäåéáò ÷ñÞóçò, êÜíôå êëéê óôçí åðéëïãÞ ðáñáêÜôù. ÐñÝðåé íá áðïäå÷èåßôå ôç óõìöùíßá ãéá íá åãêáôáóôÞóåôå ôï '$(^NameDA)'. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "ÅÜí áðïäÝ÷åóôå ôïõò üñïõò ôçò Üäåéáò ÷ñÞóçò, êÜíôå êëéê óôçí ðñþôç åðéëïãÞ ðáñáêÜôù. ÐñÝðåé íá áðïäå÷èåßôå ôç óõìöùíßá ãéá íá åãêáôáóôÞóåôå ôï '$(^NameDA)'. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Óõìöùíßá ¢äåéáò ×ñÞóçò"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "ÅëÝãîôå ôçí Üäåéá ÷ñÞóçò ðñéí áðåãêáôáóôÞóåôå ôï '$(^NameDA)'."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "ÅÜí áðïäÝ÷åóôå ôïõò üñïõò ôçò Üäåéáò ÷ñÞóçò, êÜíôå êëéê óôï Óõìöùíþ ãéá íá óõíå÷ßóåôå. ÐñÝðåé íá áðïäå÷èåßôå ôç óõìöùíßá ãéá íá áðåãêáôáóôÞóåôå ôï '$(^NameDA)'."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "ÅÜí áðïäÝ÷åóôå ôïõò üñïõò ôçò Üäåéáò ÷ñÞóçò, êÜíôå êëéê óôçí åðéëïãÞ ðáñáêÜôù. ÐñÝðåé íá áðïäå÷èåßôå ôç óõìöùíßá ãéá íá áðåãêáôáóôÞóåôå ôï '$(^NameDA)'. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "ÅÜí áðïäÝ÷åóôå ôïõò üñïõò ôçò Üäåéáò ÷ñÞóçò, êÜíôå êëéê óôçí ðñþôç åðéëïãÞ ðáñáêÜôù. ÐñÝðåé íá áðïäå÷èåßôå ôç óõìöùíßá ãéá íá áðåãêáôáóôÞóåôå ôï '$(^NameDA)'. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "ÐáôÞóôå ôï Page Down ãéá íá äåßôå ôï õðüëïéðï ôçò Üäåéáò ÷ñÞóçò."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "ÅðéëïãÞ Óôïé÷åßùí"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "ÅðéëÝîôå ôá óôïé÷åßá ôïõ '$(^NameDA)' ðïõ èÝëåôå íá åãêáôáóôÞóåôå."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "ÅðéëïãÞ Óôïé÷åßùí"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "ÅðéëÝîôå ôá óôïé÷åßá ôïõ '$(^NameDA)' ðïõ èÝëåôå íá áðåãêáôáóôÞóåôå."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "ÐåñéãñáöÞ"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "ÐåñÜóôå ôï äåßêôç ôïõ ðïíôéêéïý ðÜíù áðü Ýíá óôïé÷åßï ãéá íá äåßôå ôçí ðåñéãñáöÞ ôïõ."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "ÐåñÜóôå ôï äåßêôç ôïõ ðïíôéêéïý ðÜíù áðü Ýíá óôïé÷åßï ãéá íá äåßôå ôçí ðåñéãñáöÞ ôïõ."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "ÅðéëïãÞ ÈÝóçò ÅãêáôÜóôáóçò"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "ÅðéëÝîôå ôï öÜêåëï ìÝóá óôïí ïðïßï èá åãêáôáóôáèåß ôï '$(^NameDA)'."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "ÅðéëïãÞ ÈÝóçò ÁðåãêáôÜóôáóçò"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "ÅðéëÝîôå ôï öÜêåëï áðü ôïí ïðïßï èá áðåãêáôáóôáèåß ôï '$(^NameDA)'."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "ÅãêáôÜóôáóç Óå ÅîÝëéîç"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Ðáñáêáëþ ðåñéìÝíåôå üóï ôï '$(^NameDA)' åãêáèßóôáôáé."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Ç ÅãêáôÜóôáóç Ïëïêëçñþèçêå"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Ç åãêáôÜóôáóç ïëïêëçñþèçêå åðéôõ÷þò."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Ç ÅãêáôÜóôáóç Äéáêüðçêå"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Ç åãêáôÜóôáóç äåí ïëïêëçñþèçêå åðéôõ÷þò."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "ÁðåãêáôÜóôáóç Óå ÅîÝëéîç"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Ðáñáêáëþ ðåñéìÝíåôå üóï ôï '$(^NameDA)' áðåãêáèßóôáôáé."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Ç ÁðåãêáôÜóôáóç Ïëïêëçñþèçêå"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Ç áðåãêáôÜóôáóç ïëïêëçñþèçêå åðéôõ÷þò."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Ç ÁðåãêáôÜóôáóç Äéáêüðçêå"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Ç áðåãêáôÜóôáóç äåí ïëïêëçñþèçêå åðéôõ÷þò."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "ÏëïêëÞñùóç ôçò ÅãêáôÜóôáóçò ôïõ '$(^NameDA)'"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Ôï '$(^NameDA)' åãêáôáóôÜèçêå óôïí õðïëïãéóôÞ óáò.$\r$\n$\r$\nÊÜíôå êëéê óôï ÔÝëïò ãéá íá êëåßóåôå áõôüí ôïí ïäçãü."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "ÐñÝðåé íá ãßíåé åðáíåêêßíçóç ôïõ õðïëïãéóôÞ óáò ãéá íá ïëïêëçñùèåß ç åãêáôÜóôáóç ôïõ '$(^NameDA)'. ÈÝëåôå íá åðáíåêêéíÞóåôå ôïí õðïëïãéóôÞ óáò ôþñá;"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "ÏëïêëÞñùóç ôçò ÁðåãêáôÜóôáóçò ôïõ '$(^NameDA)'"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "Ôï '$(^NameDA)' áðåãêáôáóôÜèçêå áðü ôïí õðïëïãéóôÞ óáò.$\r$\n$\r$\nÊÜíôå êëéê óôï ÔÝëïò ãéá íá êëåßóåôå áõôüí ôïí ïäçãü."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "ÐñÝðåé íá ãßíåé åðáíåêêßíçóç ôïõ õðïëïãéóôÞ óáò ãéá íá ïëïêëçñùèåß ç áðåãêáôÜóôáóç ôïõ '$(^NameDA)'. ÈÝëåôå íá åðáíåêêéíÞóåôå ôïí õðïëïãéóôÞ óáò ôþñá;"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Íá ãßíåé åðáíåêêßíçóç ôþñá"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Èá åðáíåêêéíÞóù ôïí õðïëïãéóôÞ ìïõ áñãüôåñá"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&ÅêôÝëåóç ôïõ '$(^NameDA)'"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "ÅìöÜíéóç ôïõ &áñ÷åßïõ Readme"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&ÔÝëïò"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "ÅðéëïãÞ ÖáêÝëïõ ãéá ôï Ìåíïý ¸íáñîç"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "ÅðéëÝîôå Ýíá öÜêåëï ôïõ ìåíïý ¸íáñîç ãéá ôéò óõíôïìåýóåéò ôïõ '$(^NameDA)'."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "ÅðéëÝîôå Ýíá öÜêåëï ôïõ ìåíïý ¸íáñîç ãéá ôéò óõíôïìåýóåéò ôïõ ðñïãñÜììáôïò. Ìðïñåßôå åðßóçò íá åéóÜãåôå Ýíá üíïìá ãéá íá äçìéïõñãÞóåôå Ýíá íÝï öÜêåëï."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Íá ìç äçìéïõñãçèïýí óõíôïìåýóåéò"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "ÁðåãêáôÜóôáóç ôïõ '$(^NameDA)'"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Áöáßñåóç ôïõ '$(^NameDA)' áðü ôïí õðïëïãéóôÞ óáò."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Åßóôå óßãïõñïé ðùò èÝëåôå íá ôåñìáôßóåôå ôçí åãêáôÜóôáóç ôïõ '$(^Name)';"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Åßóôå óßãïõñïé ðùò èÝëåôå íá ôåñìáôßóåôå ôçí áðåãêáôÜóôáóç ôïõ '$(^Name)';"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Finnish.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Finnish.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Finnish.nsh	(revision 728)
@@ -0,0 +1,123 @@
+;Compatible with Modern UI 1.86
+;Language: Finnish (1035)
+;By Eclipser (Jonne Lehtinen) <Eclipser at pilvikaupunki dot com>
+;Updated by Puuhis (puuhis@puuhis.net)
+
+!insertmacro LANGFILE "Finnish" "Suomi"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Tervetuloa ohjelman $(^NameDA) asennukseen"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Tämä avustaja ohjaa sinut ohjelman $(^NameDA) asennuksen läpi.$\r$\n$\r$\nOn suositeltavaa sulkea kaikki muut ohjelmat ennen asennuksen aloittamista, jotta asennus voisi päivittää tiettyjä järjestelmätiedostoja käynnistämättä konetta uudelleen.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Tervetuloa $(^NameDA) -ohjelmiston poisto-ohjelmaan"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Tämä velho auttaa sinut läpi $(^NameDA) -ohjelmiston poistamisen.$\r$\n$\r$\nEnnen poisto-ohjelman aloitusta, varmista ettei $(^NameDA) ole käynnissä.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Lisenssisopimus"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Lue lisenssiehdot tarkasti ennen ohjelman $(^NameDA) asentamista."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Jos hyväksyt ehdot, valitse Hyväksyn jatkaaksesi. Sinun pitää hyväksyä ehdot asentaaksesi ohjelman $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Jos hyväksyt ehdot, laita rasti alla olevaan ruutuun. Sinun pitää hyväksyä ehdot asentaaksesi ohjelman $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Jos hyväksyt ehdot, valitse ensimmäinen vaihtoehto alapuolelta. Sinun pitää hyväksyä ehdot asentaaksesi ohjelman $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Lisenssisopimus"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Lue huolellisesti lisenssiehdot ennen $(^NameDA) -ohjelmiston poistoa."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Jos hyväksyt säännöt ja ehdot, paina Hyväksyn -nappia jatkaakseni. Sinun täytyy hyväksyä ehdot poistaaksesi $(^NameDA) -ohjelmiston."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Jos hyväksyt ehdot, klikkaa valintaruutua alhaalla. Sinun täytyy hyväksyä ehdot poistaaksesi $(^NameDA) -ohjelmiston. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Jos hyväksyt ehdot, valitse ensimmäinen vaihtoehto alhaalta. Sinun täytyy hyväksyä ehdot poistaaksesi $(^NameDA) -ohjelmiston. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Paina Page Down nähdäksesi loput sopimuksesta."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Valitse komponentit"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Valitse toiminnot, jotka haluat asentaa ohjelmaan $(^NameDA)."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Valitse komponentit"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Valitse $(^NameDA) toiminnot, jotka haluat poistaa."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Selitys"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Siirrä hiiri komponentin nimen päälle saadaksesi sen selityksen."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Siirrä hiiri komponentin nimen päälle saadaksesi sen selityksen."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Valitse asennuskohde"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Valitse hakemisto, johon haluat asentaa ohjelman $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Valitse paikka mistä poistetaan"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Valitse kansio mistä $(^NameDA) poistetaan."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Asennetaan"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Odota... $(^NameDA) asennetaan..."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Asennus valmis"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Asennus valmistui onnistuneesti."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Asennus keskeytettiin"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Asennus ei onnistunut."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Poistetaan"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Odota... Ohjelmaa $(^NameDA) poistetaan."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Poisto valmis"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Ohjelma poistettiin onnistuneesti."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Poisto lopetettu"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Ohjelmaa poisto epäonnistuneesti."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Viimeistellään ohjelman $(^NameDA) asennusta"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) on asennettu koneellesi.$\r$\n$\r$\nValitse Valmis sulkeaksesi avustajan."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Tietokoneesi pitää käynnistää uudelleen jotta ohjelman $(^NameDA) asennus saataisiin valmiiksi. Haluatko käynnistää koneen uudelleen nyt?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Viimeistellään $(^NameDA) -ohjelmiston poistamista"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) on poistettu koneeltasi.$\r$\n$\r$\nPaina Lopeta -nappia sulkeaksesi tämän velhon."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Jotta $(^NameDA) -ohjelmiston poistaminen olisi valmis, tulee tietokone käynnistää uudelleen. Haluatko uudelleenkäynnistää nyt?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Käynnistä uudelleen nyt"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Käynnistän koneen myöhemmin uudelleen"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "Käynnistä $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Näytä LueMinut"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Valmis"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Valitse Käynnistä-valikon hakemisto"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Valitse Käynnistä-valikon hakemisto ohjelman pikakuvakkeille."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Valitse Käynnistä-valikon hakemisto, johon haluaisit luoda ohjelman pikakuvakkeet. Voit myös kirjoittaa uuden nimen."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Älä luo pikakuvakkeita"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Poista $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Poista $(^NameDA) tietokoneestasi."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Haluatko varmasti lopettaa $(^Name) Asennuksen?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Oletko varma että haluat poistua $(^Name) poisto-ohjelmasta?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/German.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/German.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/German.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1031
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by L.King, changes by R. Bisswanger, Tim Kosse
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) Installation
+# ^UninstallCaption
+$(^Name) Deinstallation
+# ^LicenseSubCaption
+: Lizenzabkommen
+# ^ComponentsSubCaption
+: Installations-Optionen
+# ^DirSubCaption
+: Zielverzeichnis
+# ^InstallingSubCaption
+: Installiere
+# ^CompletedSubCaption
+: Fertig
+# ^UnComponentsSubCaption
+: Deinstallations-Optionen
+# ^UnDirSubCaption
+: Quellverzeichnis
+# ^ConfirmSubCaption
+: Bestätigung
+# ^UninstallingSubCaption
+: Entferne
+# ^UnCompletedSubCaption
+: Fertig
+# ^BackBtn
+< &Zurück
+# ^NextBtn
+&Weiter >
+# ^AgreeBtn
+&Annehmen
+# ^AcceptBtn
+Ich &akzeptiere das Lizenzabkommen.
+# ^DontAcceptBtn
+Ich &lehne das Lizenzabkommen ab.
+# ^InstallBtn
+&Installieren
+# ^UninstallBtn
+&Deinstallieren
+# ^CancelBtn
+Abbrechen
+# ^CloseBtn
+&Beenden
+# ^BrowseBtn
+&Durchsuchen...
+# ^ShowDetailsBtn
+&Details anzeigen
+# ^ClickNext
+Klicken Sie auf Weiter, um fortzufahren.
+# ^ClickInstall
+Klicken Sie auf Installieren, um die Installation zu starten.
+# ^ClickUninstall
+Klicken Sie auf Deinstallieren, um die Deinstallation zu starten.
+# ^Name
+Name
+# ^Completed
+Fertig
+# ^LicenseText
+Bitte lesen Sie das Lizenzabkommen, bevor Sie $(^NameDA) installieren. Wenn Sie alle Bedingungen des Abkommens akzeptieren, klicken Sie auf Annehmen.
+# ^LicenseTextCB
+Bitte lesen Sie das Lizenzabkommen, bevor Sie $(^NameDA) installieren. Wenn Sie alle Bedingungen des Abkommens akzeptieren, aktivieren Sie das Kontrollkästchen. $_CLICK
+# ^LicenseTextRB
+Bitte lesen Sie das Lizenzabkommen, bevor Sie $(^NameDA) installieren. Wenn Sie alle Bedingungen des Abkommens akzeptieren, wählen Sie die entsprechende Option. $_CLICK
+# ^UnLicenseText
+Bitte lesen Sie das Lizenzabkommen, bevor Sie $(^NameDA) entfernen. Wenn Sie alle Bedingungen des Abkommens akzeptieren, klicken Sie auf Annehmen.
+# ^UnLicenseTextCB
+Bitte lesen Sie das Lizenzabkommen, bevor Sie $(^NameDA) entfernen. Wenn Sie alle Bedingungen des Abkommens akzeptieren, aktivieren Sie das Kontrollkästchen. $_CLICK
+# ^UnLicenseTextRB
+Bitte lesen Sie das Lizenzabkommen, bevor Sie $(^NameDA) entfernen. Wenn Sie alle Bedingungen des Abkommens akzeptieren, wählen Sie die entsprechende Option. $_CLICK
+# ^Custom
+Benutzerdefiniert
+# ^ComponentsText
+Wählen Sie die Komponenten aus, die Sie installieren möchten und wählen Sie diejenigen ab, die Sie nicht installieren wollen. $_CLICK
+# ^ComponentsSubText1
+Installations-Typ bestimmen:
+# ^ComponentsSubText2_NoInstTypes
+Wählen Sie die Komponenten aus, die Sie installieren möchten:
+# ^ComponentsSubText2
+oder wählen Sie zusätzliche Komponenten aus, die Sie installieren möchten:
+# ^UnComponentsText
+Wählen Sie die Komponenten aus, die Sie entfernen möchten und wählen Sie diejenigen ab, die Sie nicht entfernen wollen. $_CLICK
+# ^UnComponentsSubText1
+Deinstallations-Typ bestimmen:
+# ^UnComponentsSubText2_NoInstTypes
+Wählen Sie die Komponenten aus, die Sie entfernen möchten:
+# ^UnComponentsSubText2
+oder wählen Sie zusätzliche Komponenten aus, die Sie entfernen möchten:
+# ^DirText
+$(^NameDA) wird in das unten angegebene Verzeichnis installiert. Falls Sie in ein anderes Verzeichnis installieren möchten, klicken Sie auf Durchsuchen und wählen Sie ein anderes Verzeichnis aus. $_CLICK
+# ^DirSubText
+Zielverzeichnis
+# ^DirBrowseText
+Wählen Sie das Verzeichnis aus, in das Sie $(^NameDA) installieren möchten:
+# ^UnDirText
+$(^NameDA) wird aus dem unten angegebenen Verzeichnis entfernt. Falls sich $(^NameDA) in einem anderen Verzeichnis befindet, klicken Sie auf Durchsuchen und wählen Sie das richtige Verzeichnis aus. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Wählen Sie das Verzeichnis aus, in dem sich $(^NameDA) befindet:
+# ^SpaceAvailable
+"Verfügbarer Speicher: "
+# ^SpaceRequired
+"Benötigter Speicher: "
+# ^UninstallingText
+$(^NameDA) wird aus dem unten angegebenen Verzeichnis entfernt. $_CLICK
+# ^UninstallingSubText
+Entferne aus:
+# ^FileError
+Fehler beim Überschreiben der Datei: \r\n\t"$0"\r\nKlicken Sie auf Abbrechen, um abzubrechen,\r\nauf Wiederholen, um den Schreibvorgang erneut zu versuchen\r\noder auf Ignorieren, um diese Datei zu überspringen.
+# ^FileError_NoIgnore
+Fehler beim Überschreiben der Datei: \r\n\t"$0"\r\nKlicken Sie auf Wiederholen, um den Schreibvorgang erneut zu versuchen\r\noder auf Abbrechen, um die Installation zu beenden.
+# ^CantWrite
+"Fehler beim Schreiben: "
+# ^CopyFailed
+Kopieren fehlgeschlagen
+# ^CopyTo
+"Kopiere nach "
+# ^Registering
+"Registriere: "
+# ^Unregistering
+"Deregistriere: "
+# ^SymbolNotFound
+"Symbol ist nicht vorhanden: "
+# ^CouldNotLoad
+"Fehler beim Laden von "
+# ^CreateFolder
+"Erstelle Verzeichnis: "
+# ^CreateShortcut
+"Erstelle Verknüpfung: "
+# ^CreatedUninstaller
+"Erstelle Deinstallations-Programm: "
+# ^Delete
+"Lösche Datei: "
+# ^DeleteOnReboot
+"Lösche Datei nach Neustart: "
+# ^ErrorCreatingShortcut
+"Fehler beim Erstellen der Verknüpfung: "
+# ^ErrorCreating
+"Fehler beim Erstellen: "
+# ^ErrorDecompressing
+Fehler beim Dekomprimieren. Beschädigtes Installations-Programm?
+# ^ErrorRegistering
+Fehler beim Registrieren der DLL
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Starte: "
+# ^Extract
+"Dekomprimiere: "
+# ^ErrorWriting
+"Dekomprimierung: Fehler beim Schreiben der Datei "
+# ^InvalidOpcode
+Beschädigtes Installations-Programm: ungültiger Befehlscode
+# ^NoOLE
+"Kein OLE für: "
+# ^OutputFolder
+"Zielverzeichnis: "
+# ^RemoveFolder
+"Entferne Verzeichnis: "
+# ^RenameOnReboot
+"Umbenennen nach Neustart: "
+# ^Rename
+"Umbenennen: "
+# ^Skipped
+"Übersprungen: "
+# ^CopyDetails
+Details in die Zwischenablage kopieren
+# ^LogInstall
+Installationsverlauf protokollieren
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Hungarian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Hungarian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Hungarian.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1038
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1250
+# RTL - anything else than RTL means LTR
+-
+# Translation by Soft-Trans Bt. (V2)
+# Translation by Orfanik Kft.   (V3-V6)
+# ^Branding
+Nullsoft Telepítõrendszer %s
+# ^SetupCaption
+$(^Name) Telepítõ
+# ^UninstallCaption
+$(^Name) Eltávolító
+# ^LicenseSubCaption
+: Licencszerzõdés
+# ^ComponentsSubCaption
+: Telepítési lehetõségek
+# ^DirSubCaption
+: Célmappa
+# ^InstallingSubCaption
+: Fájlok telepítése
+# ^CompletedSubCaption
+: Kész
+# ^UnComponentsSubCaption
+: Eltávolítási lehetõségek
+# ^UnDirSubCaption
+: Eltávolítás mappája
+# ^ConfirmSubCaption
+: Megerõsítés
+# ^UninstallingSubCaption
+: Fájlok eltávolítása
+# ^UnCompletedSubCaption
+: Kész
+# ^BackBtn
+< &Vissza
+# ^NextBtn
+&Tovább >
+# ^AgreeBtn
+&Elfogadom
+# ^AcceptBtn
+&Elfogadom a Licencszerzõdés feltételeit
+# ^DontAcceptBtn
+&Nem fogadom el a Licencszerzõdés feltételeit
+# ^InstallBtn
+&Telepítés
+# ^UninstallBtn
+&Eltávolítás
+# ^CancelBtn
+&Mégse
+# ^CloseBtn
+&Bezárás
+# ^BrowseBtn
+&Tallózás...
+# ^ShowDetailsBtn
+&Részletek
+# ^ClickNext
+Kattintson a Tovább-ra a folytatáshoz.
+# ^ClickInstall
+Kattintson a Telepítésre a telepítéshez.
+# ^ClickUninstall
+Kattintson az Eltávolításra az eltávolításhoz.
+# ^Name
+Név
+# ^Completed
+Kész
+# ^LicenseText
+A(z) $(^NameDA) telepítése elõtt tekintse át a szerzõdés feltételeit. Ha elfogadja a szerzõdés valamennyi feltételét, az Elfogadom gombbal folytathatja.
+# ^LicenseTextCB
+A(z) $(^NameDA) telepítése elõtt tekintse át a szerzõdés feltételeit. Ha elfogadja a szerzõdés valamennyi feltételét, jelölje be a Jelölõnégyzeten. $_CLICK
+# ^LicenseTextRB
+A(z) $(^NameDA) telepítése elõtt tekintse át a szerzõdés feltételeit. Ha elfogadja a szerzõdés valamennyi feltételét, válassza az elsõ lehetõséget. $_CLICK
+# ^UnLicenseText
+A(z) $(^NameDA) eltávolítása elõtt tekintse át a szerzõdés feltételeit. Ha elfogadja a szerzõdés valamennyi feltételét, az Elfogadom gombbal folytathatja.
+# ^UnLicenseTextCB
+A(z) $(^NameDA) eltávolítása elõtt tekintse át a szerzõdés feltételeit. Ha elfogadja a szerzõdés valamennyi feltételét, jelölje be a Jelölõnégyzeten. $_CLICK
+# ^UnLicenseTextRB
+A(z) $(^NameDA) eltávolítása elõtt tekintse át a szerzõdés feltételeit. Ha elfogadja a szerzõdés valamennyi feltételét, válassza az elsõ lehetõséget. $_CLICK
+# ^Custom
+Egyéni
+# ^ComponentsText
+Jelölje be azokat az összetevõket amelyeket telepíteni kíván és törölje a jelölést a nem kívánt összetevõknél. $_CLICK
+# ^ComponentsSubText1
+Válassza ki a telepítés típusát:
+# ^ComponentsSubText2_NoInstTypes
+Válassza ki a telepítendõ összetevõket:
+# ^ComponentsSubText2
+vagy, jelölje ki a választható összetevõk közül a telepíteni kívánta(ka)t:
+# ^UnComponentsText
+Jelölje be azokat az összetevõket amelyeket el kíván távolítani és törölje a jelölést az eltávolítani nem kívánt összetevõknél. $_CLICK
+# ^UnComponentsSubText1
+Válassza ki az Eltávolítás típusát:
+# ^UnComponentsSubText2_NoInstTypes
+Válassza ki az eltávolítandó összetevõket:
+# ^UnComponentsSubText2
+vagy, jelölje ki a választható összetevõk közül az eltávolítani kívánta(ka)t:
+# ^DirText
+A $(^NameDA) a következõ mappába kerül. Másik mappa választásához kattintson a Tallózás gombra. $_CLICK
+# ^DirSubText
+Telepítés helye
+# ^DirBrowseText
+A(z) $(^NameDA) telepítési helyének kiválasztása:
+# ^UnDirText
+A(z) $(^NameDA) eltávolítása a következõ mappából. Másik mappa választásához kattintson a Tallózás gombra. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Válassza ki, hogy a $(^NameDA) melyik mappából kerüljön eltávolításra:
+# ^SpaceAvailable
+"Szabad terület: "
+# ^SpaceRequired
+"Helyigény: "
+# ^UninstallingText
+A(z) $(^NameDA) eltávolítása következik a számítógéprõl. $_CLICK
+# ^UninstallingSubText
+Eltávolítás helye:
+# ^FileError
+Hiba történt a fájl írásra történõ megnyitásakor: \r\n\t"$0"\r\nA Mégse gomb megnyomásával megszakíthatja a telepítést,\r\naz Ismét gombbal megismételheti a fájl írását,\r\na Kihagyás gombbal kihagyhatja ezt a fájlt.
+# ^FileError_NoIgnore
+Hiba történt a fájl írásra történõ megnyitásakor:  \r\n\t"$0"\r\nAz Újra gomb megnyomásával megismételheti a mûveletet, vagy \r\na Mégse gombbal megszakíthatja a telepítést.
+# ^CantWrite
+"Nem írható: "
+# ^CopyFailed
+A másolás megszakadt
+# ^CopyTo
+"Másolás ide: "
+# ^Registering
+"Bejegyzés: "
+# ^Unregistering
+"Eltávolítás: "
+# ^SymbolNotFound
+"A következõ szimbólum nem található: "
+# ^CouldNotLoad
+"Nem tölthetõ be: "
+# ^CreateFolder
+"Mappa létrehozás: "
+# ^CreateShortcut
+"Parancsikon létrehozása: "
+# ^CreatedUninstaller
+"Létrehozott eltávolító: "
+# ^Delete
+"Törölt fájl: "
+# ^DeleteOnReboot
+"Rendszerindításkor törlendõ: "
+# ^ErrorCreatingShortcut
+"Hiba a parancsikon létrehozásakor: "
+# ^ErrorCreating
+"Hiba a létrehozáskor: "
+# ^ErrorDecompressing
+Hiba az adatok kibontásakor! Megsérült a Telepítõ?
+# ^ErrorRegistering
+Hiba a DLL regisztrálásakor
+# ^ExecShell
+"Végrehajtás a hozzárendeléseken keresztül: "
+# ^Exec
+"Végrehajtás: "
+# ^Extract
+"Kibontás: "
+# ^ErrorWriting
+"Kibontás: Hiba a fájl írásakor "
+# ^InvalidOpcode
+Sérült a telepítõ: hibás utasítás
+# ^NoOLE
+"Nincs OLE: "
+# ^OutputFolder
+"Kimeneti mappa: "
+# ^RemoveFolder
+"Mappa eltávolítása: "
+# ^RenameOnReboot
+"Átnevezés rendszerindításkor: "
+# ^Rename
+"Átnevezés: "
+# ^Skipped
+"Kihagyott: "
+# ^CopyDetails
+Adatok vágólapra másolása
+# ^LogInstall
+Telepítõ ellenõrzõlista
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Korean.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Korean.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Korean.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+1042
+# Font and size - dash (-) means default
+±¼¸²
+9
+# Codepage - dash (-) means ANSI code page
+949
+# RTL - anything else than RTL means LTR
+-
+# Translation by dTomoyo dtomoyo@empal.com ( ~V2.0 BETA2 ) / By hardkoder@gmail.com (V2.0 BETA3 ~ )
+# ^Branding
+³Î¼ÒÇÁÆ® ¼³Ä¡ ½Ã½ºÅÛ %s
+# ^SetupCaption
+$(^Name) ¼³Ä¡
+# ^UninstallCaption
+$(^Name) Á¦°Å
+# ^LicenseSubCaption
+: »ç¿ë±Ç °è¾à µ¿ÀÇ
+# ^ComponentsSubCaption
+: ¼³Ä¡ ¿É¼Ç
+# ^DirSubCaption
+: Æú´õ ÁöÁ¤
+# ^InstallingSubCaption
+: ÆÄÀÏ ¼³Ä¡Áß
+# ^CompletedSubCaption
+: ¼³Ä¡ ¿Ï·á
+# ^UnComponentsSubCaption
+: Á¦°Å ¿É¼Ç
+# ^UnDirSubCaption
+: Á¦°Å Æú´õ
+# ^ConfirmSubCaption
+: È®ÀÎ 
+# ^UninstallingSubCaption
+: Á¦°ÅÁß
+# ^UnCompletedSubCaption
+: Á¦°Å ¿Ï·á
+# ^BackBtn
+< µÚ·Î
+# ^NextBtn
+´ÙÀ½ >
+# ^AgreeBtn
+µ¿ÀÇÇÔ
+# ^AcceptBtn
+À§ »çÇ×¿¡ µ¿ÀÇÇÕ´Ï´Ù.
+# ^DontAcceptBtn
+µ¿ÀÇÇÏÁö ¾Ê½À´Ï´Ù.
+# ^InstallBtn
+¼³Ä¡
+# ^UninstallBtn
+Á¦°Å
+# ^CancelBtn
+Ãë¼Ò
+# ^CloseBtn
+´ÝÀ½
+# ^BrowseBtn
+Ã£¾Æº¸±â...
+# ^ShowDetailsBtn
+ÀÚ¼¼È÷ º¸±â
+# ^ClickNext
+°è¼ÓÇÏ½Ã·Á¸é '´ÙÀ½' ¹öÆ°À» ´­·¯ ÁÖ¼¼¿ä.
+# ^ClickInstall
+¼³Ä¡¸¦ ½ÃÀÛÇÏ½Ã·Á¸é '¼³Ä¡' ¹öÆ°À» ´­·¯ ÁÖ¼¼¿ä.
+# ^ClickUninstall
+'Á¦°Å' ¹öÆ°À» ´©¸£¸é Á¦°Å°¡ ½ÃÀÛµË´Ï´Ù.
+# ^Name
+ÀÌ¸§
+# ^Completed
+¿Ï·á
+# ^LicenseText
+$(^NameDA)(À»)¸¦ ¼³Ä¡ÇÏ±â Àü¿¡ »ç¿ë±Ç °è¾à ³»¿ëÀ» »ìÆìº¸½Ã±â ¹Ù¶ø´Ï´Ù. ³»¿ë¿¡ µ¿ÀÇÇÏ¼Ì´Ù¸é 'µ¿ÀÇÇÔ'À» ´­·¯ ÁÖ¼¼¿ä.
+# ^LicenseTextCB
+$(^NameDA)(À»)¸¦ ¼³Ä¡ÇÏ±â Àü¿¡ »ç¿ë±Ç °è¾à ³»¿ëÀ» »ìÆìº¸½Ã±â ¹Ù¶ø´Ï´Ù. ³»¿ë¿¡ µ¿ÀÇÇÏ¼Ì´Ù¸é ¾Æ·¡ »çÇ×À» Ã¼Å©ÇØ ÁÖ¼¼¿ä. $_CLICK
+# ^LicesnseTextRB
+$(^NameDA)(À»)¸¦ ¼³Ä¡ÇÏ±â Àü¿¡ »ç¿ë±Ç °è¾à ³»¿ëÀ» »ìÆìº¸½Ã±â ¹Ù¶ø´Ï´Ù. ³»¿ë¿¡ µ¿ÀÇÇÏ¼Ì´Ù¸é ¾Æ·¡ ¿É¼ÇÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä. $_CLICK
+# ^UnLicenseText
+$(^NameDA)(À»)¸¦ Á¦°ÅÇÏ±â Àü¿¡ »ç¿ë±Ç °è¾à ³»¿ëÀ» »ìÆìº¸½Ã±â ¹Ù¶ø´Ï´Ù. ³»¿ë¿¡ µ¿ÀÇÇÏ¼Ì´Ù¸é 'µ¿ÀÇÇÔ'À» ´­·¯ ÁÖ¼¼¿ä.
+# ^UnLicenseTextCB
+$(^NameDA)(À»)¸¦ Á¦°ÅÇÏ±â Àü¿¡ »ç¿ë±Ç °è¾à ³»¿ëÀ» »ìÆìº¸½Ã±â ¹Ù¶ø´Ï´Ù. ³»¿ë¿¡ µ¿ÀÇÇÏ¼Ì´Ù¸é ¾Æ·¡ »çÇ×À» Ã¼Å©ÇØ ÁÖ¼¼¿ä. $_CLICK
+# ^UnLicesnseTextRB
+$(^NameDA)(À»)¸¦ Á¦°ÅÇÏ±â Àü¿¡ »ç¿ë±Ç °è¾à ³»¿ëÀ» »ìÆìº¸½Ã±â ¹Ù¶ø´Ï´Ù. ³»¿ë¿¡ µ¿ÀÇÇÏ¼Ì´Ù¸é ¾Æ·¡ ¿É¼ÇÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä. $_CLICK
+# ^Custom
+»ç¿ëÀÚ Á¤ÀÇ
+# ^ComponentsText
+¼³Ä¡¸¦ ¿øÇÏ½Ã´Â ±¸¼º ¿ä¼Ò¸¦ ¼±ÅÃÇÏ¿© ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù. $_CLICK
+# ^ComponentsSubText1
+¼³Ä¡ ÇüÅÂ ¼±ÅÃ:
+# ^ComponentsSubText2_NoInstTypes
+¼³Ä¡ÇÏ·Á´Â ±¸¼º ¿ä¼Ò ¼±ÅÃ:
+# ^ComponentsSubText2
+±¸¼º¿ä¼Ò Á÷Á¢ ¼±ÅÃ:
+# ^UnComponentsText
+Á¦°Å¸¦ ¿øÇÏ´Â ±¸¼º ¿ä¼Ò¸¦ Ã¼Å©ÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù. $_CLICK
+# ^UnComponentsSubText1
+Á¦°Å ÇüÅÂ ¼±ÅÃ:
+# ^UnComponentsSubText2_NoInstTypes
+Á¦°ÅÇÏ·Á´Â ±¸¼º ¿ä¼Ò ¼±ÅÃ:
+# ^UnComponentsSubText2
+Á¦°ÅÇÏ·Á´Â ±¸¼º¿ä¼Ò Á÷Á¢ ¼±ÅÃ:
+# ^DirText
+$(^NameDA)(À»)¸¦ ´ÙÀ½ Æú´õ¿¡ ¼³Ä¡ÇÒ ¿¹Á¤ÀÔ´Ï´Ù. \r\n´Ù¸¥ Æú´õ¿¡ ¼³Ä¡ÇÏ°í ½ÍÀ¸½Ã¸é 'Ã£¾Æº¸±â' ¹öÆ°À» ´­·¯¼­ ´Ù¸¥ Æú´õ¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä. $_CLICK
+# ^DirSubText
+¼³Ä¡ Æú´õ
+# ^DirBrowseText
+$(^NameDA)(À»)¸¦ ´ÙÀ½ Æú´õ¿¡ ¼³Ä¡ÇÕ´Ï´Ù:
+# ^UnDirText
+$(^NameDA)(À»)¸¦ ´ÙÀ½ Æú´õ¿¡¼­ Á¦°ÅÇÒ ¿¹Á¤ÀÔ´Ï´Ù. \r\n´Ù¸¥ Æú´õ¿¡¼­ Á¦°ÅÇÏ°í ½ÍÀ¸½Ã¸é 'Ã£¾Æº¸±â' ¹öÆ°À» ´­·¯¼­ ´Ù¸¥ Æú´õ¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+$(^NameDA)(À»)¸¦ ´ÙÀ½ Æú´õ¿¡¼­ Á¦°Å ÇÕ´Ï´Ù:
+# ^SpaceAvailable
+"³²Àº µð½ºÅ© °ø°£: "
+# ^SpaceRequired
+"ÇÊ¿äÇÑ µð½ºÅ© °ø°£: "
+# ^UninstallingText
+½Ã½ºÅÛ¿¡¼­ $(^NameDA)(À»)¸¦ Á¦°Å ÇÒ °ÍÀÔ´Ï´Ù. $_CLICK
+# ^UninstallingText
+Á¦°Å ´ë»ó:
+# ^FileError
+´ÙÀ½ ÆÄÀÏÀ» ¿­ ¼ö ¾ø½À´Ï´Ù.: \r\n\t"$0"\r\n'Áß´Ü'À» ´­·¯ ¼³Ä¡¸¦ Á¾·áÇÏ°Å³ª,\r'´Ù½Ã ½Ãµµ'¸¦ ´­·¯ ´Ù½Ã ½ÃµµÇØ º¸°Å³ª,\r'¹«½Ã'¸¦ ´­·¯ ÀÌ ÆÄÀÏÀ» °Ç³Ê ¶Ù¼¼¿ä.
+# ^FileError_NoIgnore
+´ÙÀ½ ÆÄÀÏÀ» ¿­ ¼ö ¾ø½À´Ï´Ù.: \r\n\t"$0"\r\n'´Ù½Ã ½Ãµµ'¸¦ ´­·¯ ´Ù½Ã ½ÃµµÇØ º¸°Å³ª,\r'Ãë¼Ò'¸¦ ´­·¯ ¼³Ä¡¸¦ Á¾·áÇÏ¼¼¿ä.
+# ^CantWrite
+"±â·ÏÇÒ ¼ö ¾øÀ½: "
+# ^CopyFailed
+º¹»ç ½ÇÆÐ
+# ^CopyTo
+"ÆÄÀÏ º¹»ç "
+# ^Registering
+"µî·ÏÁß: "
+# ^Unregistering
+"µî·Ï ÇØÁ¦Áß: "
+# ^SymbolNotFound
+"½Éº¼À» Ã£À» ¼ö ¾øÀ½: "
+# ^CouldNotLoad
+"ºÒ·¯¿Ã ¼ö ¾øÀ½: "
+# ^CreateFolder
+"Æú´õ »ý¼º: "
+# ^CreateShortcut
+"¹Ù·Î °¡±â »ý¼º: "
+# ^CreatedUninstaller
+"¾ðÀÎ½ºÅç·¯ »ý¼º: "
+# ^Delete
+"ÆÄÀÏ »èÁ¦: "
+# ^DeleteOnReboot
+"ÀçºÎÆÃ½Ã »èÁ¦: "
+# ^ErrorCreatingShortcut
+"¹Ù·Î °¡±â »ý¼º ¿À·ù: "
+# ^ErrorCreating
+"»ý¼º ½ÇÆÐ: "
+# ^ErrorDecompressing
+¾ÐÃà ÇØÁ¦Áß ¿À·ù ¹ß»ý! ¼³Ä¡ ÆÄÀÏÀÌ ¼Õ»óµÇ¾ú½À´Ï´Ù.
+# ^ErrorRegistering
+DLL µî·Ï ½ÇÆÐ
+# ^ExecShell
+"½© ½ÇÇà: "
+# ^Exec
+"½ÇÇà: "
+# ^Extract
+"¾ÐÃà ÇØÁ¦: "
+# ^ErrorWriting
+"¾ÐÃà ÇØÁ¦: ÆÄÀÏÀ» ±â·ÏÇÏ´Â µµÁß ¿À·ù ¹ß»ý "
+# ^InvalidOpcode
+ÀÎ½ºÅç·¯ ¼Õ»óµÊ: Àß¸øµÈ ½ÇÇàÄÚµå
+# ^NoOLE
+"OLE Á¤º¸ ¾øÀ½: "
+# ^OutputFolder
+"´ë»ó Æú´õ: "
+# ^RemoveFolder
+"Æú´õ »èÁ¦: "
+# ^RenameOnReboot
+"ÀçºÎÆÃ½Ã ÀÌ¸§ º¯°æ: "
+# ^Rename
+"ÀÌ¸§ º¯°æ: "
+# ^Skipped
+"°Ç³Ê¶Ü: "
+# ^CopyDetails
+ÀÚ¼¼ÇÑ ³»¿ëÀ» Å¬¸³º¸µå·Î º¹»ç
+# ^LogInstall
+¼³Ä¡ ·Î±× ÀÛ¼º
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SimpChinese.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SimpChinese.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SimpChinese.nsh	(revision 728)
@@ -0,0 +1,123 @@
+;Language: 'Chinese (Simplified)' (2052)
+;Translator: Kii Ali <kiiali@cpatch.org>
+;Revision date: 2004-12-15
+;Verified by: QFox <qfox99@gmail.com>
+
+!insertmacro LANGFILE "SimpChinese" "Chinese (Simplified)"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "»¶Ó­Ê¹ÓÃ¡°$(^NameDA)¡±°²×°Ïòµ¼"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Õâ¸öÏòµ¼½«Ö¸ÒýÄãÍê³É¡°$(^NameDA)¡±µÄ°²×°½ø³Ì¡£$\r$\n$\r$\nÔÚ¿ªÊ¼°²×°Ö®Ç°£¬½¨ÒéÏÈ¹Ø±ÕÆäËûËùÓÐÓ¦ÓÃ³ÌÐò¡£Õâ½«ÔÊÐí¡°°²×°³ÌÐò¡±¸üÐÂÖ¸¶¨µÄÏµÍ³ÎÄ¼þ£¬¶ø²»ÐèÒªÖØÐÂÆô¶¯ÄãµÄ¼ÆËã»ú¡£$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "»¶Ó­Ê¹ÓÃ¡°$(^NameDA)¡±Ð¶ÔØÏòµ¼"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Õâ¸öÏòµ¼½«È«³ÌÖ¸ÒýÄã¡°$(^NameDA)¡±µÄÐ¶ÔØ½ø³Ì¡£$\r$\n$\r$\nÔÚ¿ªÊ¼Ð¶ÔØÖ®Ç°£¬È·ÈÏ¡°$(^NameDA)¡±²¢Î´ÔËÐÐµ±ÖÐ¡£$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Ðí¿ÉÖ¤Ð­Òé"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "ÔÚ°²×°¡°$(^NameDA)¡±Ö®Ç°£¬ÇëÔÄ¶ÁÊÚÈ¨Ð­Òé¡£"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Èç¹ûÄã½ÓÊÜÐ­ÒéÖÐµÄÌõ¿î£¬µ¥»÷ [ÎÒ½ÓÊÜ(I)] ¼ÌÐø°²×°¡£Èç¹ûÄãÑ¡¶¨ [È¡Ïû(C)] £¬°²×°³ÌÐò½«»á¹Ø±Õ¡£±ØÐë½ÓÊÜÐ­Òé²ÅÄÜ°²×°¡°$(^NameDA)¡±¡£"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Èç¹ûÄã½ÓÊÜÐ­ÒéÖÐµÄÌõ¿î£¬µ¥»÷ÏÂ·½µÄ¹´Ñ¡¿ò¡£±ØÐëÒª½ÓÊÜÐ­Òé²ÅÄÜ°²×° $(^NameDA)¡£$_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Èç¹ûÄã½ÓÊÜÐ­ÒéÖÐµÄÌõ¿î£¬Ñ¡ÔñÏÂ·½µÚÒ»¸öÑ¡Ïî¡£±ØÐëÒª½ÓÊÜÐ­Òé²ÅÄÜ°²×° $(^NameDA)¡£$_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Ðí¿ÉÖ¤Ð­Òé"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "ÔÚÐ¶ÔØ¡°$(^NameDA)¡±Ö®Ç°£¬Çë¼ìÔÄÊÚÈ¨Ìõ¿î¡£"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Èç¹ûÄã½ÓÊÜÐ­ÒéÖÐµÄÌõ¿î£¬µ¥»÷ [ÎÒ½ÓÊÜ(I)] ¼ÌÐøÐ¶ÔØ¡£Èç¹ûÄãÑ¡¶¨ [È¡Ïû(C)] £¬°²×°³ÌÐò½«»á¹Ø±Õ¡£±ØÐëÒª½ÓÊÜÐ­Òé²ÅÄÜÐ¶ÔØ¡°$(^NameDA)¡±¡£"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Èç¹ûÄã½ÓÊÜÐ­ÒéÖÐµÄÌõ¿î£¬µ¥»÷ÏÂ·½µÄ¹´Ñ¡¿ò¡£±ØÐëÒª½ÓÊÜÐ­Òé²ÅÄÜÐ¶ÔØ $(^NameDA)¡£$_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Èç¹ûÄã½ÓÊÜÐ­ÒéÖÐµÄÌõ¿î£¬Ñ¡ÔñÏÂ·½µÚÒ»¸öÑ¡Ïî¡£±ØÐëÒª½ÓÊÜÐ­Òé²ÅÄÜÐ¶ÔØ $(^NameDA)¡£$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "°´ [PgDn] ÔÄ¶Á¡°ÊÚÈ¨Ð­Òé¡±µÄÆäÓà²¿·Ö¡£"
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Ñ¡Ôñ×é¼þ"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Ñ¡ÔñÄãÏëÒª°²×°¡°$(^NameDA)¡±µÄÄÇÐ©¹¦ÄÜ¡£"
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Ñ¡¶¨×é¼þ"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Ñ¡¶¨¡°$(^NameDA)¡±µ±ÖÐÄãÏëÒªÐ¶ÔØµÄ¹¦ÄÜ¡£"
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "ÃèÊö"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "ÒÆ¶¯ÄãµÄÊó±êÖ¸Õëµ½×é¼þÖ®ÉÏ£¬±ã¿É¼ûµ½ËüµÄÃèÊö¡£"
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "ÒÆ¶¯ÄãµÄÊó±êÖ¸Õëµ½×é¼þÖ®ÉÏ£¬±ã¿É¼ûµ½ËüµÄÃèÊö¡£"
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Ñ¡Ôñ°²×°Î»ÖÃ"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Ñ¡Ôñ¡°$(^NameDA)¡±µÄ°²×°ÎÄ¼þ¼Ð¡£"
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Ñ¡¶¨Ð¶ÔØÎ»ÖÃ"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Ñ¡¶¨¡°$(^NameDA)¡±ÒªÐ¶ÔØµÄÎÄ¼þ¼Ð¡£"
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "ÕýÔÚ°²×°"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "¡°$(^NameDA)¡±ÕýÔÚ°²×°£¬ÇëµÈºò..."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "°²×°Íê³É"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "°²×°ÒÑ³É¹¦Íê³É¡£"
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "°²×°¼ºÖÐÖ¹"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "°²×°Ã»ÓÐ³É¹¦¡£"
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "ÕýÔÚÐ¶ÔØ"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "¡°$(^NameDA)¡±ÕýÔÚÐ¶ÔØ£¬ÇëµÈºò..."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Ð¶ÔØÒÑÍê³É"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Ð¶ÔØÒÑ³É¹¦µØÍê³É¡£"
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Ð¶ÔØÒÑÖÐÖ¹"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Ð¶ÔØ³ÌÐò²¢Î´³É¹¦µØÍê³É¡£"
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "ÕýÔÚÍê³É¡°$(^NameDA)¡±°²×°Ïòµ¼"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "¡°$(^NameDA)¡±ÒÑ°²×°ÔÚÄãµÄÏµÍ³¡£$\r$\nµ¥»÷ [Íê³É(F)] ¹Ø±Õ´ËÏòµ¼¡£"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "ÄãµÄÏµÍ³ÐèÒªÖØÐÂÆô¶¯£¬ÒÔ±ãÍê³É¡°$(^NameDA)¡±µÄ°²×°¡£ÏÖÔÚÒªÖØÐÂÆô¶¯Âð£¿"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "ÕýÔÚÍê³É¡°$(^NameDA)¡±Ð¶ÔØÏòµ¼"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "¡°$(^NameDA)¡±ÒÑ´ÓÄãµÄ¼ÆËã»úÐ¶ÔØ¡£$\r$\n$\r$\nµ¥»÷ [Íê³É] ¹Ø±ÕÕâ¸öÏòµ¼¡£"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "¼ÆËã»úÐèÒªÖØÐÂÆô¶¯£¬ÒÔ±ãÍê³É¡°$(^NameDA)¡±µÄÐ¶ÔØ¡£ÏÖÔÚÏëÒªÖØÐÂÆô¶¯Âð£¿"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "ÊÇ£¬ÏÖÔÚÖØÐÂÆô¶¯(&Y)"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "·ñ£¬ÎÒÉÔºóÔÙ×ÔÐÐÖØÐÂÆô¶¯(&N)"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "ÔËÐÐ $(^NameDA)(&R)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "ÏÔÊ¾¡°×ÔÊöÎÄ¼þ¡±(&M)"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "Íê³É(&F)"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Ñ¡Ôñ¡°¿ªÊ¼²Ëµ¥¡±ÎÄ¼þ¼Ð"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Ñ¡Ôñ¡°¿ªÊ¼²Ëµ¥¡±ÎÄ¼þ¼Ð£¬ÓÃÓÚ³ÌÐòµÄ¿ì½Ý·½Ê½¡£"
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Ñ¡Ôñ¡°¿ªÊ¼²Ëµ¥¡±ÎÄ¼þ¼Ð£¬ÒÔ±ã´´½¨³ÌÐòµÄ¿ì½Ý·½Ê½¡£ÄãÒ²¿ÉÒÔÊäÈëÃû³Æ£¬´´½¨ÐÂÎÄ¼þ¼Ð¡£"
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "²»Òª´´½¨¿ì½Ý·½Ê½(&N)"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Ð¶ÔØ $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "´ÓÄãµÄ¼ÆËã»úÐ¶ÔØ¡°$(^NameDA)¡±"
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "ÄãÈ·ÊµÒªÍË³ö¡°$(^Name)¡±°²×°³ÌÐò£¿"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "ÄãÈ·ÊµÒªÍË³ö¡°$(^Name)¡±Ð¶ÔØÂð£¿"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Arabic.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Arabic.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Arabic.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1025
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1256
+# RTL - anything else than RTL means LTR
+RTL
+# Translation by asdfuae@msn.com, updated by Rami Kattan
+# ^Branding
+äÙÇã ÇáÊäÕíÈ äáÓæÝÊ %s
+# ^SetupCaption
+ÊäÕíÈ $(^Name)
+# ^UninstallCaption
+ÅÒÇáÉ $(^Name)
+# ^LicenseSubCaption
+ÅÊÝÇÞíÉþ ÇáÊÑÎíÕ :
+# ^ComponentsSubCaption
+ÎíÇÑÇÊ ÇáÊäÕíÈ :
+# ^DirSubCaption
+ãÌáÏ ÇáÊäÕíÈ :
+# ^InstallingSubCaption
+ÊäÕíÈ :
+# ^CompletedSubCaption
+ÅäÊåì :
+# ^UnComponentsSubCaption
+ÎíÇÑÇÊ ÇáÅÒÇáÉ :
+# ^UnDirSubCaption
+ãÌáÏ ÇáÅÒÇáÉ :
+# ^ConfirmSubCaption
+ÊÃßíÏ :
+# ^UninstallingSubCaption
+ÅÒÇáÉ :
+# ^UnCompletedSubCaption
+ÅäÊåì :
+# ^BackBtn
+< Çá&ÓÇÈÞ
+# ^NextBtn
+Çá&ÊÇáí >
+# ^AgreeBtn
+ãæÇÝÞ&
+# ^AcceptBtn
+&ÃæÇÝÞ Úáì ÔÑæØ ÇÊÝÇÞíÉ ÇáÊÑÎíÕ
+# ^DontAcceptBtn
+&áÇ ÃæÇÝÞ Úáì ÔÑæØ ÇÊÝÇÞíÉ ÇáÊÑÎíÕ
+# ^InstallBtn
+&ÊäÕíÈ
+# ^UninstallBtn
+&ÅÒÇáÉ
+# ^CancelBtn
+ÅáÛÇÁ
+# ^CloseBtn
+Å&ÛáÇÞ
+# ^BrowseBtn
+&ÚÑÖ...
+# ^ShowDetailsBtn
+Å&ÙåÇÑ ÇáÊÝÇÕíá
+# ^ClickNext
+ÅÖÛØ Úáì ÇáÊÇáí ááãÊÇÈÚÉ.
+# ^ClickInstall
+ÅÖÛØ Úáì ÊäÕíÈ áÊÔÛíá ÇáÊäÕíÈ.
+# ^ClickUninstall
+ÅÖÛØ Úáì ÅÒÇáÉ áÊÔÛíá ÇáÅÒÇáÉ.
+# ^Name
+ÇáÅÓã
+# ^Completed
+ÅäÊåì
+# ^LicenseText
+ÇáÑÌÇÁ ãÑÇÌÚÉ ÅÊÝÇÞíÉ ÇáÊÑÎíÕ ÞÈá ÊäÕíÈ $(^NameDA). ÚäÏ ÇáãæÇÝÞÉ Úáì ÌãíÚ ÔÑæØ ÇáÅÊÝÇÞíÉ¡ ÅÖÛØ ãæÇÝÞ.
+# ^LicenseTextCB
+ÇáÑÌÇÁ ãÑÇÌÚÉ ÅÊÝÇÞíÉ ÇáÊÑÎíÕ ÞÈá ÊäÕíÈ $(^NameDA). ÚäÏ ÇáãæÇÝÞÉ Úáì ÌãíÚ ÔÑæØ ÇáÅÊÝÇÞíÉ¡ ÅÖÛØ Úáì ãÑÈÚ ÇáãÄÔÑ ÇáÊÇáí. $_CLICK.
+# ^LicenseTextRB
+ÇáÑÌÇÁ ãÑÇÌÚÉ ÅÊÝÇÞíÉ ÇáÊÑÎíÕ ÞÈá ÊäÕíÈ $(^NameDA). ÚäÏ ÇáãæÇÝÞÉ Úáì ÌãíÚ ÔÑæØ ÇáÅÊÝÇÞíÉ¡ ÅÎÊÑ ÇáÎíÇÑ ÇáÃæá ÇáÊÇáí. $_CLICK
+# ^UnLicenseText
+ÇáÑÌÇÁ ãÑÇÌÚÉ ÅÊÝÇÞíÉ ÇáÊÑÎíÕ ÞÈá ÅÒÇáÉ $(^NameDA). ÚäÏ ÇáãæÇÝÞÉ Úáì ÌãíÚ ÔÑæØ ÇáÅÊÝÇÞíÉ¡ ÅÖÛØ ãæÇÝÞ.
+# ^UnLicenseTextCB
+ÇáÑÌÇÁ ãÑÇÌÚÉ ÅÊÝÇÞíÉ ÇáÊÑÎíÕ ÞÈá ÅÒÇáÉ $(^NameDA). ÚäÏ ÇáãæÇÝÞÉ Úáì ÌãíÚ ÔÑæØ ÇáÅÊÝÇÞíÉ¡ ÇÖÛØ Úáì ãÑÈÚ ÇáãÄÔÑ ÇáÊÇáí. $_CLICK
+# ^UnLicenseTextRB
+ÇáÑÌÇÁ ãÑÇÌÚÉ ÅÊÝÇÞíÉ ÇáÊÑÎíÕ ÞÈá ÅÒÇáÉ $(^NameDA). ÚäÏ ÇáãæÇÝÞÉ Úáì ÌãíÚ ÔÑæØ ÇáÅÊÝÇÞíÉ¡ ÅÎÊÑ ÇáÎíÇÑ ÇáÃæá ÇáÊÇáí. $_CLICK
+# ^Custom
+ÅÎÊíÇÑí
+# ^ComponentsText
+Úáøã ÇáãßæäÇÊ ÇáãÑÇÏ ÊäÕíÈåÇ æÅÒá ÇáÚáÇãÉ Úä ÇáãßæäÇÊ ÇáÛíÑ ãÑÇÏ ÊäÕíÈåÇ. $_CLICK
+# ^ComponentsSubText1
+ÅÎÊÑ äæÚ ÇáÊäÕíÈ:
+# ^ComponentsSubText2_NoInstTypes
+ÅÎÊÑ ÇáãßæäÇÊ ááÊäÕíÈ:
+# ^ComponentsSubText2
+Ãæ¡ Þã ÈÅÎÊíÇÑ ÇáãßæäÇÊ ÇáÅÎÊíÇÑíÉ ÇáãÑÇÏ ÊäÕíÈåÇ:
+# ^UnComponentsText
+Úáøã ÇáãßæäÇÊ ÇáãÑÇÏ ÅÒÇáÊåÇ æÃÒá ÇáÚáÇãÉ Úä ÇáãßæäÇÊ ÇáÛíÑ ãÑÇÏ ÅÒÇáÊåÇ. $_CLICK
+# ^UnComponentsSubText1
+ÅÎÊÑ äæÚ ÇáÅÒÇáÉ:
+# ^UnComponentsSubText2_NoInstTypes
+ÅÎÊÑ ÇáãßæäÇÊ ááÅÒÇáÉ:
+# ^UnComponentsSubText2
+Ãæ¡ ÅÎÊÑ ÇáãßæäÇÊ ÇáÅÎÊíÇÑíÉ ÇáãÑÇÏ ÅÒÇáÊåÇ:
+# ^DirText
+ÓíÊã ÊäÕíÈ $(^NameDA) Ýí ÇáãÌáÏ ÇáÊÇáí. ááÊäÕíÈ Ýí ãÌáÏ ÂÎÑ¡ ÅÖÛØ ÚÑÖ æÅÎÊÑ ãÌáÏ ÂÎÑ. $_CLICK
+# ^DirSubText
+ãÌáÏ ÇáåÏÝ
+# ^DirBrowseText
+ÅÎÊÑ ÇáãÌáÏ áÊäÕíÈ $(^NameDA) Ýíå:
+# ^UnDirText
+ÓíÊã ÅÒÇáÉ $(^NameDA) ãä ÇáãÌáÏ ÇáÊÇáí. ááÅÒÇáÉ ãä ãÌáÏ ÂÎÑ¡ ÅÖÛØ ÚÑÖ æÃÎÊÑ ãÌáÏ ÂÎÑ. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+ÅÎÊÑ ÇáãÌáÏ áÅÒÇáÉ $(^NameDA) ãäå:
+# ^SpaceAvailable
+"ÇáãÓÇÍÉ ÇáãÊæÝÑÉ: "
+# ^SpaceRequired
+"ÇáãÓÇÍÉ ÇáãØáæÈÉ: "
+# ^UninstallingText
+ÓíÊã ÅÒÇáÉ $(^NameDA) ãä ÇáãÌáÏ ÇáÊÇáí. $_CLICK
+# ^UninstallingSubText
+ÅÒÇáÉ ãä:
+# ^FileError
+ÍÏË Îáá ÃËäÇÁ ÝÊÍ ãáÝ ááßÊÇÈÉ: \r\n\t\"$0\"\r\nÅÖÛØ ÅáÛÇÁ áÅáÛÇÁ ÇáÊäÕíÈ¡\r\nãÍÇæáÉ áÅÚÇÏÉ ãÍÇæáÉ ßÊÇÈÉ ÇáãáÝ¡\r\n ÊÌÇåá áÊÎØí ÇáãáÝ
+# ^FileError_NoIgnore
+ÍÏË Îáá ÃËäÇÁ ÝÊÍ ãáÝ ááßÊÇÈÉ: \r\n\t\"$0\"\r\nÅÖÛØ ãÍÇæáÉ áÅÚÇÏÉ ãÍÇæáÉ ßÊÇÈÉ ÇáãáÝ¡ Ãæ\r\nÅáÛÇÁ áÅáÛÇÁ ÇáÊäÕíÈ
+# ^CantWrite
+"áÇ íÓÊØíÚ ÇáßÊÇÈÉ: "
+# ^CopyFailed
+ÝÔá ÇáäÓÎ
+# ^CopyTo
+"äÓÎ Åáì"
+# ^Registering
+"ÊÓÌíá: "
+# ^Unregistering
+"ÅáÛÇÁ ÊÓÌíá: "
+# ^SymbolNotFound
+"áã íÊãßä ãä ÅíÌÇÏ ÇáÑãÒ :"
+# ^CouldNotLoad
+"áã íÊãßä ãä ÊÍãíá :"
+# ^CreateFolder
+"ÅäÔÇÁ ãÌáÏ"
+# ^CreateShortcut
+"ÅäÔÇÁ ÅÎÊÕÇÑ: "
+# ^CreatedUninstaller
+"ÅäÔÇÁ ãÒíá: "
+# ^Delete
+"ÍÐÝ ãáÝ: "
+# ^DeleteOnReboot
+"ÍÐÝ ÈÚÏ ÅÚÇÏÉ ÇáÊÔÛíá: "
+# ^ErrorCreatingShortcut
+"Îáá ÃËäÇÁ ÅäÔÇÁ ÅÎÊÕÇÑ: "
+# ^ErrorCreating
+"Îáá ÃËäÇÁ ÅäÔÇÁ :"
+# ^ErrorDecompressing
+Îáá ÃËäÇÁ ÝÊÍ ÇáÈíÇäÇÊ ÇáãÖÛæØÉ! ãäÕÈ ÊÇáÝ¿
+# ^ErrorRegistering
+Îáá ÃËäÇÁ ÊÓÌíá DLL
+# ^ExecShell
+"ÊäÝíÐ ExecShell:"
+# ^Exec
+"ÊäÝíÐ: "
+# ^Extract
+"ÅÓÊÎÑÇÌ: "
+# ^ErrorWriting
+"ÅÓÊÎÑÇÌ: Îáá ÃËäÇÁ ÇáßÊÇÈÉ Åáì ãáÝ "
+# ^InvalidOpcode
+ÇáãäÕøÈ ÊÇáÝ: ÔÝÑÉ ÛíÑ ÕÇáÍÉ
+# ^NoOLE
+"áÇ ÊæÌÏ OLE áÜö: "
+# ^OutputFolder
+"ãÌáÏ ÇáÅÎÑÇÌ: "
+# ^RemoveFolder
+"ÅÒÇáÉ ãÌáÏ: "
+# ^RenameOnReboot
+"ÅÚÇÏÉ ÊÓãíÉ ÈÚÏ ÅÚÇÏÉ ÇáÊÔÛíá: "
+# ^Rename
+"ÅÚÇÏÉ ÊÓãíÉ: "
+# ^Skipped
+"ÊÎØì: "
+# ^CopyDetails
+äÓÎ ÇáÊÝÇÕíá Åáì ÇáÐÇßÑÉ
+# ^LogInstall
+ÓÌøá ÚãáíÉ ÇáÊäÕíÈ
+# ^Byte
+ÈÇíÊ
+# ^Kilo
+ßíáæ
+# ^Mega
+ãíÛÇ
+# ^Giga
+ÌíÛÇ
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Ukrainian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Ukrainian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Ukrainian.nlf	(revision 728)
@@ -0,0 +1,192 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1058
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1251
+# RTL - anything else than RTL means LTR
+-
+# Translation by Yuri Holubow, Nash-Soft.com <http://www.Nash-Soft.com>
+# Corrections by Dmitriy Kononchuk [http://gri3ly.kiev.ua]
+# New corrections by Osidach Vitaly
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) Âñòàíîâëåííÿ
+# ^UninstallCaption
+$(^Name) Âèäàëåííÿ
+# ^LicenseSubCaption
+: Ë³öåíç³éíà óãîäà
+# ^ComponentsSubCaption
+: Îïö³¿ âñòàíîâëåííÿ
+# ^DirSubCaption
+: Òåêà âñòàíîâëåííÿ
+# ^InstallingSubCaption
+: Êîï³þâàííÿ ôàéë³â
+# ^CompletedSubCaption
+: Çàâåðøåíî
+# ^UnComponentsSubCaption
+: Îïö³¿ âèäàëåííÿ
+# ^UnDirSubCaption
+: Òåêà âèäàëåííÿ
+# ^ConfirmSubCaption
+: Ï³äòâåðæäåííÿ
+# ^UninstallingSubCaption
+: Âèäàëåííÿ ôàéë³â
+# ^UnCompletedSubCaption
+: Çàâåðøåíî
+# ^BackBtn
+< &Íàçàä
+# ^NextBtn
+&Äàë³ >
+# ^AgreeBtn
+&Çãîäåí
+# ^AcceptBtn
+ß &ïðèéìàþ óìîâè Ë³öåíç³éíî¿ óãîäè
+# ^DontAcceptBtn
+ß &íå ïðèéìàþ óìîâè Ë³öåíç³éíî¿ óãîäè
+# ^InstallBtn
+&Âñòàíîâèòè
+# ^UninstallBtn
+Âèäàëèòè
+# ^CancelBtn
+Ñêàñóâàòè
+# ^CloseBtn
+&Çàêðèòè
+# ^BrowseBtn
+Î&ãëÿä...
+# ^ShowDetailsBtn
+Ïîäðîáèö³
+# ^ClickNext
+Íàòèñí³òü Äàë³ ùîá ïðîäîâæèòè
+# ^ClickInstall
+Íàòèñí³òü Âñòàíîâèòè äëÿ ïî÷àòêó ïðîöåññó âñòàíîâëåííÿ
+# ^ClickUninstall
+Íàòèñí³òü Âèäàëèòü äëÿ ïî÷àòêó ïðîöåññó âèäàëåííÿ
+# ^Name
+²ì'ÿ
+# ^Completed
+Çàâåðøåíî
+# ^LicenseText
+Ïðî÷èòàéòå óìîâè ë³öåíç³éíî¿ óãîäè ïåðåä âñòàíîâëåííÿì $(^NameDA). ßêùî Âè ïðèéìàºòå óìîâè óãîäè, íàòèñí³òü íà êíîïêó Çãîäåí.
+# ^LicenseTextCB
+Ïðî÷èòàéòå óìîâè ë³öåíç³éíî¿ óãîäè ïåðåä âñòàíîâëåííÿì $(^NameDA). ßêùî Âè ïðèéìàºòå óìîâè óãîäè, âñòàíîâ³òü â³äì³òêó ó êâàäðàòèêó íèæ÷å. $_CLICK
+# ^LicenseTextRB
+Ïðî÷èòàéòå óìîâè ë³öåíç³éíî¿ óãîäè ïåðåä âñòàíîâëåííÿì $(^NameDA). ßêùî Âè ïðèéìàºòå óìîâè óãîäè, âèáåð³òü ïåðøèé âàð³àíò. $_CLICK
+# ^UnLicenseText
+Ïðî÷èòàéòå óìîâè ë³öåíç³éíî¿ óãîäè ïåðåä âñòàíîâëåííÿì $(^NameDA). ßêùî Âè ïðèéìàºòå óìîâè ë³öåíç³éíî¿ óãîäè, íàòèñí³òü íà êíîïêó Çãîäåí.
+# ^UnLicenseTextCB
+Ïðî÷èòàéòå óìîâè ë³öåíç³éíî¿ óãîäè ïåðåä âñòàíîâëåííÿì $(^NameDA). ßêùî Âè ïðèéìàºòå óìîâè óãîäè, âñòàíîâ³òü â³äì³òêó ó êâàäðàòèêó íèæ÷å. $_CLICK
+# ^UnLicenseTextRB
+Ïðî÷èòàéòå óìîâè ë³öåíç³éíî¿ óãîäè ïåðåä âèäàëåííÿì $(^NameDA). ßêùî Âè ïðèéìàºòå óìîâè óãîäè, âèáåð³òü ïåðøèé âàð³àíò. $_CLICK
+# ^Custom
+Ïî âèáîðó
+# ^ComponentsText
+Âèáåð³òü ÿê³ êîìïîíåíòè ïðîãðàìè Âè áàæàºòå âñòàíîâèòè. $_CLICK
+# ^ComponentsSubText1
+Âèáåð³òü òèï âñòàíîâëåííÿ:
+# ^ComponentsSubText2_NoInstTypes
+Âèáåð³òü êîìïîíåíòè äëÿ âñòàíîâëåííÿ:
+# ^ComponentsSubText2
+×è, âèáåð³òü âðó÷íó êîìïîíåíòè, ÿê³ Âè õî÷åòå âñòàíîâèòè:
+# ^UnComponentsText
+Âèáåð³òü ÿê³ êîìïîíåíòè Âè áàæàºòå âèäàëèòè. Â³äì³òüòå êîìïîíåíòè äëÿ âèäàëåííÿ ³ çí³ì³òü â³äì³òêó ç òèõ, ÿê³ Âè âèäàëÿòè íå áàæàºòå. $_CLICK
+# ^UnComponentsSubText1
+Âèáåð³òü òèï âèäàëåííÿ:
+# ^UnComponentsSubText2_NoInstTypes
+Âèá³ð êîìïîíåíò³â äëÿ âèäàëåííÿ:
+# ^UnComponentsSubText2
+×è âèáåð³òü êîìïîíåíòè ïðîãðàìè äëÿ âèäàëåííÿ ïî ñâîºìó áàæàíí³:
+# ^DirText
+Ïðîãðàììà âñòàíîâèòü $(^NameDA) ó âêàçàíó òåêó. Äëÿ òîãî, ùîá âñòàíîâèòè ïðîãðàììó â ³íøó òåêó, íàòèñí³òü Îãëÿä ³ âêàæ³òü ïîòð³áíó òåêó. $_CLICK
+# ^DirSubText
+Òåêà ïðèçíà÷åííÿ
+# ^DirBrowseText
+Âèáåð³òü òåêó äëÿ âñòàíîâëåííÿ $(^NameDA):
+# ^UnDirText
+Ïðîãðàììà âñòàíîâëåííÿ âèäàëèòü $(^NameDA) ³ç âêàçàííî¿ òåêè. Äëÿ òîãî, ùîá ïðîâåñòè âèäàëåííÿ ç ³íøî¿ òåêè, íàòèñí³òü Îãëÿä ³ âêàæ³òü ïîòð³áíó òåêó. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Âèáåð³òü òåêó, ç ÿêî¿ Âè áàæàºòå âèäàëèòè $(^NameDA):
+# ^SpaceAvailable
+"Äîñòóïíî ì³ñöÿ: "
+# ^SpaceRequired
+"Íåîáõ³äíî ì³ñöÿ: "
+# ^UninstallingText
+Ìàéñòåð âñòàíîâëåííÿ äîïîìîæå Âàì âèäàëèòè $(^NameDA) ç Âàøîãî êîìï'þòåðà. $_CLICK
+# ^UninstallingSubText
+Âèäàëåííÿ ç:
+# ^FileError
+Íåìîæëèâî â³äêðèòè ôàéë äëÿ çàïèñó: \r\n\t"$0"\r\nÍàòèñí³òü Ïåðåðâàòè äëÿ òîãî, ùîá ïåðåðâàòè âñòàíîâëåííÿ,\r\nÏîâòîðèòè äëÿ òîãî, ùîá ïîâòîðèòè ñïðîáó çàïèñó ó ôàéë, ÷è\r\n²ãíîðóâàòè äëÿ òîãî, ùîá ïðîïóñòèòè öþ ä³þ
+# ^FileError_NoIgnore
+Íåìîæëèâî â³äêðèòè ôàéë äëÿ çàïèñó: \r\n\t"$0"\r\nÍàòèñí³òü Ïîâòîðèòè äëÿ òîãî, ùîá ïîâòîðèòè ñïðîáó çàïèñó ó ôàéë, ÷è\r\nÑêàñóâàòè äëÿ òîãî, ùîá ïåðåðâàòè âñòàíîâëåííÿ
+# ^CantWrite
+"Íåìîæëèâî çàïèñàòè: "
+# ^CopyFailed
+Êîï³þâàííÿ íåâä³ëå
+# ^CopyTo
+"Êîï³þâàííÿ â "
+# ^Registering
+"Ðåºñòðàö³ÿ: "
+# ^Unregistering
+"Âèäàëåííÿ ðåºñòðàö³¿: "
+# ^SymbolNotFound
+"Íåìîæëèâî çíàéòè ñèìâîë: "
+# ^CouldNotLoad
+"Íåìîæëèâî çàâàíòàæèòè: "
+# ^CreateFolder
+"Ñòâîðåííÿ òåêè: "
+# ^CreateShortcut
+"Ñòâîðåííÿ ÿðëèêà: "
+# ^CreatedUninstaller
+"Ñòâîðåííÿ ïðîãðàìè âèäàëåííÿ: "
+# ^Delete
+"Âèäàëåííÿ ôàéëó: "
+# ^DeleteOnReboot
+"Âèäàëåííÿ ï³ñëÿ ïåðåçàâàíòàæåííÿ: "
+# ^ErrorCreatingShortcut
+"Ïîìèëêà ñòâîðåííÿ ÿðëèêà: " 
+# ^ErrorCreating
+"Ïîìèëêà ñòâîðåííÿ: "
+# ^ErrorDecompressing
+Íåìîæëèâî âèòÿãíóòè äàí³. Ìîæëèâî ïîøêîäæåíèé äèñòðèáóòèâ.
+# ^ErrorRegistering
+Íåìîæëèâî çàðåºñòðóâàòè á³áë³îòåêó (DLL)
+# ^ExecShell
+"Âèêîíàííÿ êîìàíäè îáîëîíêè: " 
+# ^Exec
+"Âèêîíàííÿ: "
+# ^Extract
+"Âèòÿãíåííÿ: "
+# ^ErrorWriting
+"Âèòÿãíåííÿ: ïîìèëêà çàïèñó ôàéëà"
+# ^InvalidOpcode
+Äèñòðèáóòèâ ïîøêîäæåíèé: ïîìèëêîâèé êîä â³äïîâ³ä³
+# ^NoOLE
+"Íåìàº OLE äëÿ: " 
+# ^OutputFolder
+"Òåêà ïðèçíà÷åííÿ: "
+# ^RemoveFolder
+"Âèäàëåííÿ òåêè: "
+# ^RenameOnReboot
+"Ïåðå³ìåíóâàííÿ ï³ñëÿ ïåðåçàâàíàæåííÿ: "
+# ^Rename
+"Ïåðåéìåíóâàííÿ: "
+# ^Skipped
+"Ïðîïóùåíî: "
+# ^CopyDetails
+Êîï³þâàòè äåòàë³ ó áóôåð îáì³íó 
+# ^LogInstall
+Çàïèñóâàòè â ëîã ïðîöåñ âñòíîâëåííÿ
+# byte
+á
+# kilo
+Ê
+# mega
+Ì
+# giga
+Ã
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Kurdish.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Kurdish.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Kurdish.nsh	(revision 728)
@@ -0,0 +1,122 @@
+;Language: Kurdish
+;By Rêzan Tovjîn
+;Updated by Erdal Ronahî (erdal.ronahi@gmail.com)
+
+!insertmacro LANGFILE "Kurdish" "Kurdî"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "$(^NameDA) Tu bi xêr hatî sêrbaziya sazkirinê"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Ev sêrbaz dê di dema sazkirina $(^NameDA) de rêberiya te bike.$\r$\n$\r$\nBerî tu dest bi sazkirinê bikî, em pêþniyar dikin tu hemû bernameyên vekirî bigirî. Bi vî rengî beyî tu komputera ji nû ve vekî dê hinek dosiyên pergalê bêpirsgirêk werin sazkirin.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Tu bi xêr hatî sêrbaziya rakirina bernameya $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Ev sêrbaz ji bo rakirina bernameya $(^NameDA) dê alîkariya te bike.$\r$\n$\r$\nBerî tu dest bi rakirina bernameyê bikî, bernameyên vekirî hemûyan bigire. Bi vî rengî dû re tu mecbûr namînî ku komputera xwe bigirî û ji nû ve veki.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Peymana Lîsansê"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Ji kerema xwe re berî tu bernameya $(^NameDA) saz bikî, peymana lîsansê bixwîne."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Heke tu þertên peymanê dipejirînî, 'Ez Dipejirînim'ê bitikîne. Ji bo sazkirina bernameya $(^NameDA) divê tu þertên peymanê bipejirînî."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Heke tu þertên peymanê dipejirînî, zeviya piþtrastkirinê ya jêrîn dagire. Ji bo tu bikarî bernameya $(^NameDA) saz bikî divê tu þertên peymanê bipejirînî. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Heke tu þertên peymanê dipejirînî, biþkojka erêkirinê ya jêrîn bitikîne. Ji bo sazkirina bernameya $(^NameDA) divê tu þertên peymanê bipejirînî. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Peymana Lîsansê"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Berî tu bernameya $(^NameDA) ji pergala xwe rakî peymanê bixwîne."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Heke tu þertên peymanê dipejirînî, 'Dipejirînim'ê bitikîne. Ji bo rakirina bernameya  $(^NameDA) divê tu þertên peymanê bipejirînî."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Heke tu þertên peymanê dipejirînî, zeviya erêkirinê ya jêrîn dagire. Ji bo tu bernameya $(^NameDA) ji pergala xwe rakî divê tu peymanê bipejirînî. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Heke tu þertên peymanê dipejirînî, biþkojka erêkirinê ya jêrîn hilbijêre. Ji bo tu bernameya  $(^NameDA) ji pergala xwe rakî divê tu þertên peymanê bipejirînî. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Ji bo dûmahîka peymanê biþkojka 'page down' bitikîne."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Hilbijartina pareyan"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Ji bo sazkirina $(^NameDA) pareyên tu dixwazî hilbijêre."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Hilbijartina Pareyan"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Pareya bernameya $(^NameDA) ku tu dixwazî rakî hilbijêre."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Dazanîn"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Ji bo tu der barê pareyan de agahiyan bistînî nîþanekê bibe ser pareyekê."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Ji bo tu der barê pareyan de agahiyan bistînî nîþanekê bibe ser pareyekê."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Hilbijartina peldanka armanckirî"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Peldanka tu dixwazî bernameya $(^NameDA) tê de were sazkirin hilbijêre."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Hilbijartina Peldanka Dê Were Rakirin"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Peldanka bernameya $(^NameDA) ku tudixwazî rakî hilbijêre."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Tê sazkirin"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Ji kerema xwe re heta sazkirina $(^NameDA) biqede raweste."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Sazkirin Qediya"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Sazkirin bi serkeftinî qediya."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Sazkirin hate betalkirin"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Sazkirin be tevahî qediya."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Tê rakirin"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Heta bernameya $(^NameDA) ji pergala te were rakirin raweste."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Rakirina Bernameyê Biqedîne"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Rakirina bernameyê bi serkeftin pêk hat."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Rakirina bernameyê hate betalkirin"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Rakirina bernameyê neqediya."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Sêrbaziya sazkirina $(^NameDA) diqede."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) li komputera te hate barkirin.$\r$\n$\r$\n'Biqedîne'yê bitikîne û sazkirinê bi dawî bîne."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Ji bo bidawîkirina sazkirina $(^NameDA) divê tu komputerê ji nû ve vekî.Tu dixwazî komputerê ji nû ve vekî?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Sêrbaziya Rakirina Bernameya $(^NameDA) Tê Temamkirin"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "Bernameya $(^NameDA) ji pergale hate rakirin.$\r$\n$\r$\nJi bo girtina sêrbaz 'biqedîne'yê bitikîne."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Ji bo rakirina bernameya $(^NameDA) biqede divê tu komputera xwe ji nû ve vekî. Tu dixwazî niha komputera te were girtin û ji nû ve dest pê bike?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Ji nû ve veke"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Ezê paþê ji nû ve vekim."
+  ${LangFileString} MUI_TEXT_FINISH_RUN "Bernameya $(^NameDA) bixebitîne"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Dosiya min bixwîne/readme &nîþan bide"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Biqedîne"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Hilbijartina Peldanka Pêþeka Destpêkê"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Peldanka pêþeka destpêkê ya ku dê kineriya $(^NameDA) tê de were bikaranîn hilbijêre."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Peldanka pêþeka destpêkê ya ku dê kineriya bernameyê tê de were bicihkirin hilbijêre.  Tu dikarî bi navekî nû peldankeke nû ava bikî."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Bêyî çêkirina kineriyê bidomîne"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Bernameya $(^NameDA) Rake"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Rakirina bernameya $(^NameDA) ji pergala te."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Tu bawer î ku dixwazî ji sazkirina $(^Name) derkevî?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Tu bawer î ku dixwazî dest ji rakirina bernameya $(^Name) berdî?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Serbian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Serbian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Serbian.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+3098
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1251
+# RTL - anything else than RTL means LTR
+-
+# Translation by Ñð�àí Îáóžèíà <obucina@srpskijezik.edu.yu>
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) Èíñòàëàöè¼à
+# ^UninstallCaption
+$(^Name) Äåèíñòàëàöè¼à
+# ^LicenseSubCaption
+: Äîãîâîð î ïðàâó êîðèøžåœà
+# ^ComponentsSubCaption
+: Îïöè¼å èíñòàëàöè¼å
+# ^DirSubCaption
+: Èçáîð ôîëäåðà çà èíñòàëàöè¼ó
+# ^InstallingSubCaption
+: Èíñòàëàöè¼à
+# ^CompletedSubCaption
+: Çàâðøåíà èíñòàëàöè¼à
+# ^UnComponentsSubCaption
+: Îïöè¼å äåèíñòàëàöè¼å
+# ^UnDirSubCaption
+: Èçáîð ôîëäåðà çà äåèíñòàëàöè¼ó
+# ^ConfirmSubCaption
+: Ïîòâð�èâàœå
+# ^UninstallingSubCaption
+: Äåèíñòàëàöè¼à
+# ^UnCompletedSubCaption
+: Çàâðøåíà äåèíñòàëàöè¼à
+# ^BackBtn
+< Íàçàä
+# ^NextBtn
+Íàïðåä >
+# ^AgreeBtn
+Ïðèõâàòàì
+# ^AcceptBtn
+Ïðèõâàòàì óñëîâå äîãîâîðà î ïðàâó êîðèøžåœà
+# ^DontAcceptBtn
+Íå ïðèõâàòàì óñëîâå äîãîâîðà î ïðàâó êîðèøžåœà
+# ^InstallBtn
+Èíñòàëèðà¼
+# ^UninstallBtn
+Äåèíñòàëèðà¼
+# ^CancelBtn
+Îäóñòàíè
+# ^CloseBtn
+Çàòâîðè
+# ^BrowseBtn
+Èçáîð...
+# ^ShowDetailsBtn
+Äåòàšè
+# ^ClickNext
+Ïðèòèñíèòå äóãìå „Íàïðåä“ çà íàñòàâàê.
+# ^ClickInstall
+Ïðèòèñíèòå äóãìå „Èíñòàëèðà¼“ çà ïî÷åòàê èíñòàëàöè¼å.
+# ^ClickUninstall
+Ïðèòèñíèòå äóãìå „Äåèíñòàëèðà¼“ çà ïî÷åòàê äåèíñòàëàöè¼å.
+# ^Name
+Èìå
+# ^Completed
+Çàâðøåíî
+# ^LicenseText
+Ïàæšèâî ïðî÷èòà¼òå äîãîâîð î ïðàâó êîðèøžåœà ïðå èíñòàëàöè¼å ïðîãðàìà $(^NameDA). Àêî ïðèõâàòàòå ñâå óñëîâå äîãîâîðà, ïðèòèñíèòå äóãìå „Ïðèõâàòàì“.
+# ^LicenseTextCB
+Ïàæšèâî ïðî÷èòà¼òå äîãîâîð î ïðàâó êîðèøžåœà ïðå èíñòàëàöè¼å ïðîãðàìà $(^NameDA). Àêî ïðèõâàòàòå ñâå óñëîâå äîãîâîðà, îáåëåæèòå êâàäðàòèž èñïîä. $_CLICK
+# ^LicenseTextRB
+Ïàæšèâî ïðî÷èòà¼òå äîãîâîð î ïðàâó êîðèøžåœà ïðå èíñòàëàöè¼å ïðîãðàìà $(^NameDA). Àêî ïðèõâàòàòå ñâå óñëîâå äîãîâîðà, èçàáåðèòå ïðâó îïöè¼ó èñïîä. $_CLICK
+# ^UnLicenseText
+Ïàæšèâî ïðî÷èòà¼òå äîãîâîð î ïðàâó êîðèøžåœà ïðå äåèíñòàëàöè¼å ïðîãðàìà $(^NameDA). Àêî ïðèõâàòàòå ñâå óñëîâå äîãîâîðà, ïðèòèñíèòå äóãìå „Ïðèõâàòàì“.
+# ^UnLicenseTextCB
+Ïàæšèâî ïðî÷èòà¼òå äîãîâîð î ïðàâó êîðèøžåœà ïðå äåèíñòàëàöè¼å ïðîãðàìà $(^NameDA). Àêî ïðèõâàòàòå ñâå óñëîâå äîãîâîðà, îáåëåæèòå êâàäðàòèž èñïîä. $_CLICK
+# ^UnLicenseTextRB
+Ïàæšèâî ïðî÷èòà¼òå äîãîâîð î ïðàâó êîðèøžåœà ïðå äåèíñòàëàöè¼å ïðîãðàìà $(^NameDA). Àêî ïðèõâàòàòå ñâå óñëîâå äîãîâîðà, èçàáåðèòå ïðâó îïöè¼ó èñïîä. $_CLICK
+# ^Custom
+Ïðèëàãî�àâàœå
+# ^ComponentsText
+Èçàáåðèòå êîìïîíåíòå çà èíñòàëàöè¼ó. Èíñòàëèðà¼ó ñå ñàìî îçíà÷åíå êîìïîíåíòå. $_CLICK
+# ^ComponentsSubText1
+Èçàáåðèòå òèï èíñòàëàöè¼å:
+# ^ComponentsSubText2_NoInstTypes
+Èçàáåðèòå êîìïîíåíòå çà èíñòàëàöè¼ó: 
+# ^ComponentsSubText2
+Èëè, èçàáåðèòå îïöèîíå êîìïîíåíòå êî¼å æåëèòå äà èíñòàëèðàòå: 
+# ^UnComponentsText
+Èçàáåðèòå êîìïîíåíòå çà äåèíñòàëàöè¼ó. Äåèíñòàëèðà¼ó ñå ñàìî îçíà÷åíå êîìïîíåíòå. $_CLICK
+# ^UnComponentsSubText1
+Èçàáåðèòå òèï äåèíñòàëàöè¼å: 
+# ^UnComponentsSubText2_NoInstTypes
+Èçàáåðèòå êîìïîíåíòå çà äåèíñòàëàöè¼ó: 
+# ^UnComponentsSubText2
+Èëè, èçàáåðèòå îïöèîíå êîìïîíåíòå êî¼å æåëèòå äà äåèíñòàëèðàòå: 
+# ^DirText
+Ïðîãðàì $(^NameDA) žå áèòè èíñòàëèðàí ó íàâåäåíè ôîëäåð. Çà èíñòàëàöè¼ó ó äðóãè ôîëäåð ïðèòèñíèòå äóãìå „Èçáîð...“ è èçàáåðèòå ôîëäåð. $_CLICK
+# ^DirSubText
+Ôîëäåð
+# ^DirBrowseText
+Èçàáåðèòå ôîëäåð ó êî¼è žåòå èíñòàëèðàòè ïðîãðàì $(^NameDA):
+# ^UnDirText
+Ïðîãðàì $(^NameDA) žå áèòè äåèíñòàëèðàí èç íàâåäåíîã ôîëäåðà. Çà äåèíñòàëàöè¼ó èç äðóãîã ôîëäåðà ïðèòèñíèòå äóãìå „Èçáîð...“ è èçàáåðèòå ôîëäåð. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Èçàáåðèòå ôîëäåð èç êîãà žåòå äåèíñòàëèðàòè ïðîãðàì $(^NameDA):
+# ^SpaceAvailable
+"Ñëîáîäàí ïðîñòîð: "
+# ^SpaceRequired
+"Ïîòðåáàí ïðîñòîð: "
+# ^UninstallingText
+Ïðîãðàì $(^NameDA) žå áèòè äåèíñòàëèðàí èç íàâåäåíîã ôîëäåðà. $_CLICK
+# ^UninstallingSubText
+Äåèíñòàëàöè¼à èç: 
+# ^FileError
+Ãðåøêà ïðè îòâàðàœó ôà¼ëà çà ïèñàœå: \r\n\t"$0"\r\nÏðèòèñíèòå äóãìå „Îäóñòàíè“ çà ïðåêèä èíñòàëàöè¼å,\r\n„Ïîíîâè“ çà ïîíîâíè ïîêóøà¼ ïèñàœà ó ôà¼ë, èëè\r\n„Èãíîðèøè“ çà ïðåñêàêàœå îâîã ôà¼ëà.
+# ^FileError_NoIgnore
+Ãðåøêà ïðè îòâàðàœó ôà¼ëà çà ïèñàœå: \r\n\t"$0"\r\nÏðèòèñíèòå äóãìå „Ïîíîâè“ çà ïîíîâíè ïîêóøà¼ ïèñàœà ó ôà¼ë, èëè\r\n„Îäóñòàíè“ çà ïðåêèä èíñòàëèðàœà.
+# ^CantWrite
+"Íåìîãóžå ïèñàœå: "
+# ^CopyFailed
+Íåóñïåøíî êîïèðàœå
+# ^CopyTo
+"Êîïèðàœå ó "
+# ^Registering
+"Ðåãèñòðîâàœå: "
+# ^Unregistering
+"Äåðåãèñòðîâàœå: "
+# ^SymbolNotFound
+"Ñèìáîë íè¼å íà�åí: "
+# ^CouldNotLoad
+"Íåìîãóžå ó÷èòàâàœå: "
+# ^CreateFolder
+"Êðåèðàœå ôîëäåðà: "
+# ^CreateShortcut
+"Êðåèðàœå ïðå÷èöå: "
+# ^CreatedUninstaller
+"Êðåèðàœå äåèíñòàëåðà: "
+# ^Delete
+"Áðèñàœå ôà¼ëà: "
+# ^DeleteOnReboot
+"Áðèñàœå ïðè ðåñòàðòó: "
+# ^ErrorCreatingShortcut
+"Ãðåøêà ïðè êðåèðàœó ïðå÷èöå: "
+# ^ErrorCreating
+"Ãðåøêà ïðè êðåèðàœó: "
+# ^ErrorDecompressing
+Ãðåøêà ïðè îòïàêèâàœó ïîäàòàêà! Îøòåžåí èíñòàëàöèîíè ïðîãðàì?
+# ^ErrorRegistering
+Ãðåøêà ïðè ðåãèñòðîâàœó áèáëèîòåêå
+# ^ExecShell
+"Èçâðøàâàœå ó îêðóæåœó: "
+# ^Exec
+"Èçâðøàâàœå: "
+# ^Extract
+"Îòïàêèâàœå: "
+# ^ErrorWriting
+"Îòïàêèâàœå: ãðåøêà ïðè óïèñó ó ôà¼ë "
+# ^InvalidOpcode
+Îøòåžåí èíñòàëàöèîíè ïðîãðàì: íåèñïðàâíà êîìàíäà 
+# ^NoOLE
+"Íåìà OLE ïîäðøêå çà: "
+# ^OutputFolder
+"Èçëàçíè ôîëäåð: "
+# ^RemoveFolder
+"Áðèñàœå ôîëäåðà: "
+# ^RenameOnReboot
+"Ïðåèìåíîâàœå ïðè ðåñòàðòîâàœó: "
+# ^Rename
+"Ïðåèìåíîâàí: "
+# ^Skipped
+"Ïðåñêî÷åí: "
+# ^CopyDetails
+Êîïèðà¼ äåòàšå ó êëèïáîðä
+# ^LogInstall
+Âîäè çàïèñíèê î ïðîöåñó èíñòàëàöè¼å
+# ^Byte
+B
+# ^Kilo
+k
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Mongolian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Mongolian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Mongolian.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1104
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1251
+# RTL - anything else than RTL means LTR
+-
+# Translation by Bayarsaikhan Enkhtaivan. ebayaraa@gmail.com
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) Ñóóëãàö
+# ^UninstallCaption
+$(^Name) Ñóóëãàñíûã óñòãàõ
+# ^LicenseSubCaption
+: Ëèöåíçèéí çºâøººðºë
+# ^ComponentsSubCaption
+: Ñóóëãàõ ñîíãîëò
+# ^DirSubCaption
+: Ñóóëãàõ Õàâòàñ
+# ^InstallingSubCaption
+:Ñóóëãàæ áàéíà
+# ^CompletedSubCaption
+: Äóóñëàà
+# ^UnComponentsSubCaption
+: Ñóóëãàñíûã óñòãàõûí Ñîíãîëò
+# ^UnDirSubCaption
+: Ñóóëãàñíûã óñòãàõ Õàâòàñ
+# ^ConfirmSubCaption
+: Áàòëàìæ
+# ^UninstallingSubCaption
+: Ñóóëãàñíûã óñòãàæ áàéíà
+# ^UnCompletedSubCaption
+: Äóóñëàà
+# ^BackBtn
+< &Áóöàõ
+# ^NextBtn
+&Öààø>
+# ^AgreeBtn
+&Çºâøººðëºº
+# ^AcceptBtn
+Áè Ëèöåíçèéí Çºâøººðëèéí ç¿éë¿¿äèéã  &çºâøººð÷ áàéíà
+# ^DontAcceptBtn
+Áè Ëèöåíçèéí Çºâøººðëèéí ç¿éë¿¿äèéã  &çºâøººðºõã¿é áàéíà
+# ^InstallBtn
+&Ñóóëãà
+# ^UninstallBtn
+&Óñòãà
+# ^CancelBtn
+Áîëèõ
+# ^CloseBtn
+&Xaax
+# ^BrowseBtn
+Õ&ºòëºõ...
+# ^ShowDetailsBtn
+&Äýëãýðýíã¿é
+# ^ClickNext
+Öààø äýýð äàðâàë ¿ðãýëæèëíý.
+# ^ClickInstall
+Ñóóëãà äýýð äàðâàë ñóóëãàö ýõýëíý.
+# ^ClickUninstall
+Óñòãà äýýð äàðâàë ñóóëãàöûí óñòãàëò ýõýëíý.
+# ^Name
+Íýð
+# ^Completed
+Äóóñëàà
+# ^LicenseText
+$(^NameDA)-ã ñóóëãàõûí ºìíº Ëèöåíçèéí Çºâøººðëèéã óíøèíà óó. Õýðýâ òà çºâøèëöëèéí ç¿éë¿¿äèéã çºâøººð÷ áàéâàë, Çºâøººðëºº-ã äàðíà óó.
+# ^LicenseTextCB
+$(^NameDA)-ã ñóóëãàõûí ºìíº Ëèöåíçèéí Çºâøººðëèéã óíøèíà óó. Õýðýâ òà çºâøèëöëèéí ç¿éë¿¿äèéã çºâøººð÷ áàéâàë, äîîðõ í¿äèéã ÷àãòàëíà óó. $_CLICK
+# ^LicenseTextRB
+$(^NameDA)-ã ñóóëãàõûí ºìíº Ëèöåíçèéí Çºâøººðëèéã óíøèíà óó. Õýðýâ òà çºâøèëöëèéí ç¿éë¿¿äèéã çºâøººð÷ áàéâàë, äîîðõ ýõíèé ñîíãîëòûã ñîíãîíî óó. $_CLICK
+# ^UnLicenseText
+$(^NameDA)-ã ñóóëãàõûí ºìíº Ëèöåíçèéí Çºâøººðëèéã óíøèíà óó. Õýðýâ òà çºâøèëöëèéí ç¿éë¿¿äèéã çºâøººð÷ áàéâàë, Çºâøººðëºº-ã äàðíà óó.
+# ^UnLicenseTextCB
+$(^NameDA)-ã ñóóëãàõûí ºìíº Ëèöåíçèéí Çºâøººðëèéã óíøèíà óó. Õýðýâ òà çºâøèëöëèéí ç¿éë¿¿äèéã çºâøººð÷ áàéâàë, äîîðõ í¿äèéã ÷àãòàëíà óó. $_CLICK
+# ^UnLicenseTextRB
+$(^NameDA)-ã ñóóëãàõûí ºìíº Ëèöåíçèéí Çºâøººðëèéã óíøèíà óó. Õýðýâ òà çºâøèëöëèéí ç¿éë¿¿äèéã çºâøººð÷ áàéâàë, äîîðõ ýõíèé ñîíãîëòûã ñîíãîíî óó. $_CLICK
+# ^Custom
+Áóñàä
+# ^ComponentsText
+Ñóóëãàõûã õ¿ññýí íýãäëýý ÷àãòëààä, ñóóëãàõûã õ¿ñýõã¿é áóéãàà á¿¿ ÷àãòëààðàé. $_CLICK
+# ^ComponentsSubText1
+Ñóóëãàõ òºðëèéã ñîíãîíî óó:
+# ^ComponentsSubText2_NoInstTypes
+Ñóóëãàõ íýãäëèéã ñîíãîíî óó:
+# ^ComponentsSubText2
+Ýñâýë, çààâàë ñóóëãàõã¿é áàéõ íýãäë¿¿äèéã ñîíãî:
+# ^UnComponentsText
+Óñòãàõûã õ¿ññýí íýãäëýý ÷àãòëààä, óñòãàõûã õ¿ñýõã¿é áàéãààãàà á¿¿ ÷àãòëààðàé. $_CLICK
+# ^UnComponentsSubText1
+Óñòãàõ òºðëèéã ñîíãîíî óó:
+# ^UnComponentsSubText2_NoInstTypes
+Óñòãàõ íýãäë¿¿äèéã ñîíãîíî óól:
+# ^UnComponentsSubText2
+Ýñâýë, çààâàë óñòãàõã¿é áàéõ íýãäë¿¿äèéã ñîíãî:
+# ^DirText
+$(^NameDA) íü äàðààõ õàâòñàíä ñóóíà. ªºð ãàçàð ñóóëãàõûã õ¿ñâýë Õºòëºõ òîâ÷ äýýð äàðàí ººð õàâòàñ ñîíãîíî óó. $_CLICK
+# ^DirSubText
+Çîðèëòîò Õàâòàñ
+# ^DirBrowseText
+$(^NameDA)-ûã ñóóëãàõ õàâòñûã ñîíãîõ:
+# ^UnDirText
+$(^NameDA)-ã óã õàâòàñíààñ óñòãàíà. ªºð ãàçðààñ óñòãàõûã õ¿ñâýë Õºòëºõ òîâ÷ äýýð äàðàí ººð õàâòàñ ñîíãîíî óó. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+$(^NameDA)-ã óñòãàõ õàâòñûã ñîíãîõ:
+# ^SpaceAvailable
+"Áîëîìæèò çàé: "
+# ^SpaceRequired
+"Øààðäàãäàõ çàé: "
+# ^UninstallingText
+$(^NameDA) íü óã õàâòàñíààñ óñòãàãäëàà. $_CLICK
+# ^UninstallingSubText
+Óñòãàãäàõ ãàçàð:
+# ^FileError
+Ôàéë áè÷èõýýð íýýõýä àëäëàà: \r\n\t"$0"\r\nÒàñëàõ äàðâàë ñóóëãàëò òàñëàãäàíà,\r\nÄàõüÿ äàðâàë ôàéëûã áè÷èõýýð äàõèí îðîëäîíî,\r\nýñâýë ¯ë òîîõ äàðâàë óã ôàéëûã àëãàñíà
+# ^FileError_NoIgnore
+Ôàéë áè÷èõýýð íýýõýä àëäëàà: \r\n\t"$0"\r\nÄàõèÿ äàðâàë ôàéëûã áè÷èõýýð äàõèí îðîëäîíî, \r\nýñâýë áîëèõ äàðâàë ñóóëãàëò òàñëàãäàíà
+# ^CantWrite
+"Áè÷èæ ÷àäñàíã¿é: "
+# ^CopyFailed
+Õóóëàëò á¿òñýíã¿é
+# ^CopyTo
+"Õóóëàõ íü "
+# ^Registering
+"Á¿ðòãýæ áàéíà: "
+# ^Unregistering
+"Á¿ðòãýëèéã àðèëãàæ áàéíà: "
+# ^SymbolNotFound
+"Òýìäýã õàéãäñàíã¿é: "
+# ^CouldNotLoad
+"Äóóäàãäñàíã¿é: "
+# ^CreateFolder
+"¯¿ñãýõ õàâòàñ: "
+# ^CreateShortcut
+"¯¿ñãýõ shortcut: "
+# ^CreatedUninstaller
+"¯¿ññýí uninstaller: "
+# ^Delete
+"Ôàéë óñòãàõ: "
+# ^DeleteOnReboot
+"Ä.à÷ààëàõàä óñòãàõ: "
+# ^ErrorCreatingShortcut
+"Shortcut ¿¿ñãýõýä àëäëàà: "
+# ^ErrorCreating
+"¯¿ñãýõ àëäàà: "
+# ^ErrorDecompressing
+ªãºãäºë çàäëàõàä àëäëàà! Ñóóëãàö ýâäýð÷ýý?
+# ^ErrorRegistering
+DLL á¿ðòã¿¿ëýõýä àëäëàà
+# ^ExecShell
+"Àæèëëóóëàõ êîìàíä(ExecShell): "
+# ^Exec
+"Àæèëëóóëàõ: "
+# ^Extract
+"Çàäëàõ: "
+# ^ErrorWriting
+"Çàäëàëò:ôàéë ðóó áè÷èõýä àëäàà "
+# ^InvalidOpcode
+Ñóóëãàö ýâäýð÷ýý: çàäëàõ êîä áóðóó
+# ^NoOLE
+"OLE áàéõã¿é: "
+# ^OutputFolder
+"Ãàðãàõ õàâòàñ: "
+# ^RemoveFolder
+"Óñòãàõ õàâòàñ: "
+# ^RenameOnReboot
+"Ä.à÷ààëàõàä äàõèí íýðëýõ: "
+# ^Rename
+"Äàõèí íýðëýõ: "
+# ^Skipped
+"Àëãàññàí: "
+# ^CopyDetails
+Äýëãýðýíã¿éã Clipboard ðóó õóóëàõ
+# ^LogInstall
+Ñóóëãàõ ÿâöûí áàðèìò
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SerbianLatin.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SerbianLatin.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SerbianLatin.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Serbian Latin (2074)
+;Translation by Srðan Obuæina <obucina@srpskijezik.edu.yu>
+
+!insertmacro LANGFILE "SerbianLatin" "Serbian Latin"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Dobrodošli u vodiè za instalaciju programa $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Biæete voðeni kroz proces instalacije programa $(^NameDA).$\r$\n$\r$\nPreporuèljivo je da iskljuèite sve druge programe pre poèetka instalacije. Ovo može omoguæiti ažuriranje sistemskih fajlova bez potrebe za ponovnim pokretanjem raèunara.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Dobrodošli u deinstalaciju programa $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Biæete voðeni kroz proces deinstalacije programa $(^NameDA).$\r$\n$\r$\nPre poèetka deinstalacije, uverite se da je program $(^NameDA) iskljuèen. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Dogovor o pravu korišæenja"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Pažljivo proèitajte dogovor o pravu korišæenja pre instalacije programa $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Ako prihvatate sve uslove dogovora, pritisnite dugme „Prihvatam“ za nastavak. Morate prihvatiti dogovor da biste instalirali program $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Ako prihvatate sve uslove dogovora, obeležite kvadratiæ ispod. Morate prihvatiti dogovor da biste instalirali program $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Ako prihvatate sve uslove dogovora, izaberite prvu opciju ispod. Morate prihvatiti dogovor da biste instalirali program $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Dogovor o pravu korišæenja"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Pažlivo proèitajte dogovor o pravu korišæenja pre deinstalacije programa $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Ako prihvatate sve uslove dogovora, pritisnite dugme „Prihvatam“ za nastavak. Morate prihvatiti dogovor da biste deinstalirali program $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Ako prihvatate sve uslove dogovora, obeležite kvadratiæ ispod. Morate prihvatiti dogovor da biste deinstalirali program $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Ako prihvatate sve uslove dogovora, izaberite prvu opciju ispod. Morate prihvatiti dogovor da biste deinstalirali program $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Pritisnite Page Down da biste videli ostatak dogovora."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Izbor komponenti za instalaciju"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Izaberite komponente za instalaciju. Instaliraju se samo oznaèene komponente."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Izbor komponenti za deinstalaciju"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Izaberite komponente za deinstalaciju. Deinstaliraju se samo oznaèene komponente."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Opis"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Preðite kursorom miša preko imena komponente da biste videli njen opis."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Preðite kursorom miša preko imena komponente da biste videli njen opis."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Izbor foldera za instalaciju"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Izaberite folder u koji æete instalirati program $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Izbor foldera za deinstalaciju"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Izaberite folder iz koga æete deinstalirati program $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Instalacija"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Saèekajte dok se program $(^NameDA) instalira."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Završena instalacija"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Instalacija je uspešno završena."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Prekinuta instalacija"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Instalacija je prekinuta i nije uspešno završena."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Deinstalacija"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Saèekajte dok se program $(^NameDA) deinstalira."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Završena deinstalacija"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Deinstalacija je uspešno završena."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Prekinuta deinstalacija"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Deinstalacija je prekinuta i nije uspešno završena."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Završena instalacija programa $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Program $(^NameDA) je instaliran na raèunar.$\r$\n$\r$\nPritisnite dugme „Kraj“ za zatvaranje ovog prozora."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Raèunar mora biti ponovo pokrenut da bi se proces instalacije programa $(^NameDA) uspešno završio. Želite li to odmah da uradite?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Završena deinstalacija programa $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "Program $(^NameDA) je deinstaliran sa raèunara.$\r$\n$\r$\nPritisnite dugme „Kraj“ za zatvaranje ovog prozora."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Raèunar mora biti ponovo pokrenut da bi se proces deinstalacije programa $(^NameDA) uspešno završio. Želite li to da uradite odmah?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Odmah ponovo pokreni raèunar"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Bez ponovnog pokretanja"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "Pokreni program $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Prikaži ProèitajMe fajl"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "Kraj"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Izbor foldera u Start meniju"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Izaberite folder u Start meniju u kome æete kreirati preèice."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Izaberite folder u Start meniju u kome želite da budu kreirane preèice programa. Možete upisati i ime za kreiranje novog foldera."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Bez kreiranja preèica"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Deinstalacija programa $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Deinstalacija programa $(^NameDA) sa raèunara."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Sigurno želite da prekinete instalaciju programa $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Sigurno želite da prekinete deinstalaciju programa $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Thai.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Thai.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Thai.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+1054
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+874
+# RTL - anything else than RTL means LTR
+-
+# Translation by SoKoOLz, TuW@nNu (asdfuae)
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) µÔ´µÑé§
+# ^UninstallCaption
+$(^Name) Â¡àÅÔ¡¡ÒÃµÔ´µÑé§
+# ^LicenseSubCaption
+: ¢éÍµ¡Å§àÃ×èÍ§ÅÔ¢ÊÔ·¸Ôì
+# ^ComponentsSubCaption
+: µÑÇàÅ×Í¡¡ÒÃµÔ´µÑé§
+# ^DirSubCaption
+: á¿éÁ·ÕèµÔ´µÑé§
+# ^InstallingSubCaption
+: ¡ÓÅÑ§µÔ´µÑé§
+# ^CompletedSubCaption
+: àÊÃç¨ÊÔé¹
+# ^UnComponentsSubCaption
+: µÑÇàÅ×Í¡Â¡àÅÔ¡¡ÒÃµÔ´µÑé§
+# ^UnDirSubCaption
+: á¿éÁ·ÕèÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§
+# ^ConfirmSubCaption
+: Â×¹ÂÑ¹
+# ^UninstallingSubCaption
+: ¡ÓÅÑ§Â¡àÅÔ¡¡ÒÃµÔ´µÑé§
+# ^UnCompletedSubCaption
+: àÊÃç¨ÊÔé¹
+# ^BackBtn
+< &¡ÅÑºä»
+# ^NextBtn
+&µèÍä» >
+# ^AgreeBtn
+&µ¡Å§
+# ^AcceptBtn
+&µ¡Å§ÂÍÁÃÑº¢éÍµèÒ§æã¹ËÑÇ¢éÍÅÔ¢ÊÔ·¸Ôì 
+# ^DontAcceptBtn
+&äÁèÂÍÁÃÑº¢éÍµèÒ§æã¹ËÑÇ¢éÍÅÔ¢ÊÔ·¸Ôì
+# ^InstallBtn
+&µÔ´µÑé§
+# ^UninstallBtn
+&Â¡àÅÔ¡¡ÒÃµÔ´µÑé§
+# ^CancelBtn
+Â¡àÅÔ¡
+# ^CloseBtn
+&»Ô´
+# ^BrowseBtn
+à&ÃÕÂ¡´Ù...
+# ^ShowDetailsBtn
+&ÃÒÂÅÐàÍÕÂ´
+# ^ClickNext
+¡´ µèÍä» à¾×èÍàÃÔèÁÃÐººÍÑµÔâ¹ÁÑµÔ
+# ^ClickInstall
+¡´  µÔ´µÑé§ à¾×èÍ·Ó¡ÒÃµÔ´µÑé§
+# ^ClickUninstall
+¡´  Â¡àÅÔ¡¡ÒÃµÔ´µÑé§ à¾×èÍÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§
+# ^Name
+ª×èÍ
+# ^Completed
+àÊÃç¨ÊÔé¹áÅéÇ
+# ^LicenseText
+â»Ã´ÍèÒ¹·Ç¹àÃ×èÍ§¡ÒÃÂÍÁÃÑºã¹ÅÔ¢ÊÔ·¸Ôì¡èÍ¹·Õè¤Ø³¨Ð·Ó¡ÒÃµÔ´µÑé§ $(^NameDA). ¶éÒ¤Ø³ÂÍÁÃÑº¢éÍµ¡Å§ã¹·Ø¡æ´éÒ¹, ¡´ ©Ñ¹ÂÍÁÃÑº
+# ^LicenseTextCB
+â»Ã´ÍèÒ¹·Ç¹àÃ×èÍ§¡ÒÃÂÍÁÃÑºã¹ÅÔ¢ÊÔ·¸Ôì¡èÍ¹·Õè¤Ø³¨Ð·Ó¡ÒÃµÔ´µÑé§ $(^NameDA). ¶éÒ¤Ø³ÂÍÁÃÑº¢éÍµ¡Å§ã¹·Ø¡æ´éÒ¹, ¡´àÅ×Í¡·Õè¡ÅèÍ§´éÒ¹ÅèÒ§. $_CLICK
+# ^LicenseTextRB
+â»Ã´ÍèÒ¹·Ç¹àÃ×èÍ§¡ÒÃÂÍÁÃÑºã¹ÅÔ¢ÊÔ·¸Ôì¡èÍ¹·Õè¤Ø³¨Ð·Ó¡ÒÃµÔ´µÑé§ $(^NameDA). ¶éÒ¤Ø³ÂÍÁÃÑº¢éÍµ¡Å§ã¹·Ø¡æ´éÒ¹, àÅ×Í¡µÑÇàÅ×Í¡áÃ¡¢éÒ§ÅèÒ§. $_CLICK
+# ^UnLicenseText
+â»Ã´ÍèÒ¹·Ç¹àÃ×èÍ§¡ÒÃÂÍÁÃÑºã¹ÅÔ¢ÊÔ·¸Ôì¡èÍ¹·Õè¤Ø³¨Ð·Ó¡ÒÃÂ¡àÅÔ¡µÔ´µÑé§ $(^NameDA). ¶éÒ¤Ø³ÂÍÁÃÑº¢éÍµ¡Å§ã¹·Ø¡æ´éÒ¹, ¡´ ©Ñ¹ÂÍÁÃÑº
+# ^UnLicenseTextCB
+â»Ã´ÍèÒ¹·Ç¹àÃ×èÍ§¡ÒÃÂÍÁÃÑºã¹ÅÔ¢ÊÔ·¸Ôì¡èÍ¹·Õè¤Ø³¨Ð·Ó¡ÒÃÂ¡àÅÔ¡µÔ´µÑé§ $(^NameDA). ¶éÒ¤Ø³ÂÍÁÃÑº¢éÍµ¡Å§ã¹·Ø¡æ´éÒ¹, ¡´àÅ×Í¡·Õè¡ÅèÍ§´éÒ¹ÅèÒ§. $_CLICK
+# ^UnLicenseTextRB
+â»Ã´ÍèÒ¹·Ç¹àÃ×èÍ§¡ÒÃÂÍÁÃÑºã¹ÅÔ¢ÊÔ·¸Ôì¡èÍ¹·Õè¤Ø³¨Ð·Ó¡ÒÃÂ¡àÅÔ¡µÔ´µÑé§ $(^NameDA). ¶éÒ¤Ø³ÂÍÁÃÑº¢éÍµ¡Å§ã¹·Ø¡æ´éÒ¹, àÅ×Í¡µÑÇàÅ×Í¡áÃ¡¢éÒ§ÅèÒ§. $_CLICK
+# ^Custom
+¡ÓË¹´àÍ§
+# ^ComponentsText
+àÅ×èÍ¡ÊÔè§·Õè¤Ø³µéÍ§¡ÒÃµÔ´µÑé§áÅÐäÁèàÅ×Í¡ÊÔè§·Õè¤Ø³äÁèµéÍ§¡ÒÃµÔ´µÑé§ $_CLICK
+# ^ComponentsSubText1
+àÅ×Í¡ÇÔ¸Õ¡ÒÃ¡ÒÃµÔ´µÑé§:
+# ^ComponentsSubText2_NoInstTypes
+àÅ×Í¡ÊÔè§·Õè¤Ø³µéÍ§¡ÒÃµÔ´µÑé§:
+# ^ComponentsSubText2
+ËÃ×Í, àÅ×Í¡µÑÇàÅ×Í¡·Õè¤Ø³µéÍ§¡ÒÃµÔ´µÑé§:
+# ^UnComponentsText
+àÅ×Í¡µÑÇàÅ×Í¡·Õè¤Ø³µéÍ§¡ÒÃ¨ÐÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§áÅÐäÁèàÅ×Í¡ÊÔè§·Õè¤Ø³äÁèµéÍ§¡ÒÃ¨ÐÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§ $_CLICK
+# ^UnComponentsSubText1
+àÅ×Í¡ÇÔ¸Õ¡ÒÃÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§:
+# ^UnComponentsSubText2_NoInstTypes
+àÅ×Í¡µÑÇàÅ×Í¡·ÕèµéÍ§¡ÒÃ¨ÐÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§:
+# ^UnComponentsSubText2
+ËÃ×Í, àÅ×Í¡¨Ò¡µÑÇàÅ×Í¡Í×è¹æ·Õè¤Ø³µéÍ§¡ÒÃ¨ÐÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§:
+# ^DirText
+µÑÇµÔ´µÑé§¨Ð·Ó¡ÒÃµÔ´µÑé§ $(^NameDA) Å§ã¹á¿éÁ´Ñ§µèÍä»¹Õé, ¶éÒµéÍ§¡ÒÃµÔ´µÑé§Å§ã¹á¿éÁÍ×è¹, ¡´ àÃÕÂ¡´ÙáÅÐàÅ×Í¡á¿éÁÍ×è¹ $_CLICK
+# ^DirSubText
+á¿éÁ·ÕèµéÍ§¡ÒÃµÔ´µÑé§
+# ^DirBrowseText
+àÅ×Í¡á¿éÁ·ÕèµéÍ§¡ÒÃµÔ´µÑé§ $(^NameDA) ã¹:
+# ^UnDirText
+µÑÇµÔ´µÑé§¨Ð·Ó¡ÒÃÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§ $(^NameDA) ¨Ò¡á¿éÁ´Ñ§µèÍä»¹Õé, ¶éÒµéÍ§¡ÒÃÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§¨Ò¡á¿éÁÍ×è¹, ¡´ àÃÕÂ¡´Ù áÅÐàÅ×Í¡á¿éÁÍ×è¹ $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+àÅ×Í¡á¿éÁ·ÕèµéÍ§¡ÒÃÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§ $(^NameDA) ¨Ò¡:
+# ^SpaceAvailable
+"ÁÕ¾×é¹·ÕèàËÅ×Í: "
+# ^SpaceRequired
+"µéÍ§¡ÒÃ¾×é¹·Õè: "
+# ^UninstallingText
+$(^NameDA) ¨Ð¶Ù¡Â¡àÅÔ¡¡ÒÃµÔ´µÑé§¨Ò¡á¿éÁµèÍä»¹Õé. $_CLICK
+# ^UninstallingSubText
+Â¡àÅÔ¡¡ÒÃµÔ´µÑé§¨Ò¡:
+# ^FileError
+äÁèÊÒÁÒÃ¶à»Ô´ä¿ÅìÊÓËÃÑºà¢ÕÂ¹ä´é: \r\n\r\n$0\r\n\r\n¡´ Â¡àÅÔ¡ à¾×èÍËÂØ´¡ÒÃµÔ´µÑé§,\r\nÅÍ§ÍÕ¡¤ÃÑé§ à¾×èÍÅÍ§ÍÕ¡¤ÃÑé§, ËÃ×Í\r\nà¾Ô¡à©Â à¾×èÍ¢éÒÁä¿Åì¹Õé.
+# ^FileError_NoIgnore
+äÁèÊÒÁÒÃ¶à»Ô´ä¿ÅìÊÓËÃÑºà¢ÕÂ¹ä´é: \r\n\r\n$0\r\n\r\n¡´ ÅÍ§ÍÕ¡¤ÃÑé§ à¾×èÍÅÍ§ÍÕ¡¤ÃÑé§, ËÃ×Í\r\nÂ¡àÅÔ¡à¾×èÍËÂØ´¡ÒÃµÔ´µÑé§
+# ^CantWrite
+"äÁèÊÒÁÒÃ¶à¢ÕÂ¹: "
+# ^CopyFailed
+¤Ñ´ÅÍ¡¼Ô´¾ÅÒ´
+# ^CopyTo
+"¤Ñ´ÅÍ¡ä»ÂÑ§ "
+# ^Registering
+"¡ÓÅÑ§Å§·ÐàºÕÂ¹: "
+# ^Unregistering
+"Â¡àÅÔ¡¡ÒÃÅ§·ÐàºÕÂ¹: "
+# ^SymbolNotFound
+"äÁèÊÒÁÒÃ¶ËÒÊÑ­ÅÑ¡É³ìä´é: "
+# ^CouldNotLoad
+"äÁèÊÒÁÒÃ¶âËÅ´ä´é: "
+# ^CreateFolder
+"ÊÃéÒ§á¿éÁ: "
+# ^CreateShortcut
+"ÊÃéÒ§ªÍÃìµ¤Ñ·: "
+# ^CreatedUninstaller
+"ÊÃéÒ§µÑÇÂ¡àÅÔ¡¡ÒÃµÔ´µÑé§: "
+# ^Delete
+"Åºä¿Åì: "
+# ^DeleteOnReboot
+"ÅºµÍ¹ÃÕºÙ·: "
+# ^ErrorCreatingShortcut
+"ÁÕ»Ñ­ËÒÊÃéÒ§ä¿ÅìªÍÃìµ¤Ñ·: "
+# ^ErrorCreating
+"ÁÕ»Ñ­ËÒã¹¡ÒÃÊÃéÒ§ä¿Åì: "
+# ^ErrorDecompressing
+ÁÕ»Ñ­ËÒã¹¡ÒÃ¤ÅÒÂ¢éÍÁÙÅ! à¡Ô´¢éÍ¼Ô´¾ÅÒ´¨Ò¡µÑÇµÔ´µÑé§?
+# ^ErrorRegistering
+ÁÕ»Ñ­ËÒã¹¡ÒÃÅ§·ÐàºÕÂ¹ DLL
+# ^ExecShell
+"ÃÑ¹àªÅÅìä¿Åì: "
+# ^Exec
+"ÃÑ¹ä¿Åì: "
+# ^Extract
+"áµ¡ä¿Åì: "
+# ^ErrorWriting
+"áµ¡ä¿Åì: à¡Ô´»Ñ­ËÒã¹¡ÒÃà¢ÕÂ¹ä¿Åì"
+# ^InvalidOpcode
+µÑÇµÔ´µÑé§ÁÕ»Ñ­ËÒ: ÃËÑÊ opcode ¼Ô´¾ÅÒ´
+# ^NoOLE
+"äÁèÁÕ OLE ÊÓËÃÑº: "
+# ^OutputFolder
+"á¿éÁ·ÕµÔ´µÑé§: "
+# ^RemoveFolder
+"Åºá¿éÁ: "
+# ^RenameOnReboot
+"à»ÅÕèÂ¹ª×èÍµÍ¹ÃÕºÙ·: "
+# ^Rename
+"à»ÅÕèÂ¹ª×èÍ: "
+# ^Skipped
+"¢éÒÁ: "
+# ^CopyDetails
+¤Ñ´ÅÍ¡ÃÒÂÅÐàÍÕÂ´Å§¤ÅÔ»ºÍÃì´
+# ^LogInstall
+ºÑ¹·Ö¡¡ÒÃµÔ´µÑé§
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/PortugueseBR.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/PortugueseBR.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/PortugueseBR.nlf	(revision 728)
@@ -0,0 +1,192 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+1046
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by Diego Marcos
+# Corrections by Felipe
+# ^Branding
+Sistema de Instalação Nullsoft %s
+# ^SetupCaption
+Instalação do $(^Name)
+# ^UninstallCaption
+Desinstalação do $(^Name)
+# ^LicenseSubCaption
+: Acordo da Licença
+# ^ComponentsSubCaption
+: Opções da Instalação
+# ^DirSubCaption
+: Pasta da Instalação
+# ^InstallingSubCaption
+: Instalando
+# ^CompletedSubCaption
+: Completado
+# ^UnComponentsSubCaption
+: Opções da Desinstalação
+# ^UnDirSubCaption
+: Pasta da Desinstalação
+# ^ConfirmSubCaption
+: Confirmação
+# ^UninstallingSubCaption
+: Desinstalando
+# ^UnCompletedSubCaption
+: Completado
+# ^BackBtn
+< &Voltar
+# ^NextBtn
+&Próximo >
+# ^AgreeBtn
+Eu &Concordo
+# ^AcceptBtn
+Eu &aceito os termos no Acordo da Licença
+# ^DontAcceptBtn
+Eu &não aceito os termos no Acordo da Licença
+# ^InstallBtn
+&Instalar
+# ^UninstallBtn
+&Desinstalar
+# ^CancelBtn
+Cancelar
+# ^CloseBtn
+&Fechar
+# ^BrowseBtn
+P&rocurar...
+# ^ShowDetailsBtn
+Mostrar &detalhes
+# ^ClickNext
+Clique em Próximo para continuar.
+# ^ClickInstall
+Clique em Instalar para iniciar a instalação.
+# ^ClickUninstall
+Clique em Desinstalar para iniciar a desinstalação.
+# ^Name
+Nome
+# ^Completed
+Completado
+# ^LicenseText
+Por favor reveja o acordo da licença antes de instalar o $(^NameDA). Se você aceita todos os termos do acordo, clique em Eu Concordo.
+# ^LicenseTextCB
+Por favor reveja o acordo da licença antes de instalar o $(^NameDA). Se você aceita todos os termos do acordo, clique na caixa de seleção abaixo. $_CLICK
+# ^LicenseTextRB
+Por favor reveja o acordo da licença antes de instalar o $(^NameDA). Se você aceita todos os termos do acordo, selecione a primeira opção abaixo. $_CLICK
+# ^UnLicenseText
+Por favor reveja o acordo da licença antes de desinstalar o $(^NameDA). Se você aceita todos os termos do acordo, clique em Eu Concordo.
+# ^UnLicenseTextCB
+Por favor reveja o acordo da licença antes de desinstalar o $(^NameDA). Se você aceita todos os termos do acordo, clique na caixa de seleção abaixo. $_CLICK
+# ^UnLicenseTextRB
+Por favor reveja o acordo da licença antes de desinstalar o $(^NameDA). Se você aceita todos os termos do acordo, selecione a primeira opção abaixo. $_CLICK
+# ^Custom
+Personalizado
+# ^ComponentsText
+Marque os componentes que você quer instalar e desmarque os componentes que você não quer instalar. $_CLICK
+# ^ComponentsSubText1
+Selecione o tipo de instalação:
+# ^ComponentsSubText2_NoInstTypes
+Selecione os componentes a instalar:
+# ^ComponentsSubText2
+Ou, selecione os componentes opcionais que você deseja instalar:
+# ^UnComponentsText
+Marque os componentes que você quer desinstalar e desmarque os componentes que você não quer desinstalar. $_CLICK
+# ^UnComponentsSubText1
+Selecione o tipo de desinstalação:
+# ^UnComponentsSubText2_NoInstTypes
+Selecione os componentes a desinstalar:
+# ^UnComponentsSubText2
+Ou, selecione os componentes opcionais que você deseja desinstalar:
+# ^DirText
+O Instalador instalará o $(^NameDA) na seguinte pasta. Para instalar em uma pasta diferente, clique em Procurar e selecione outra pasta. $_CLICK
+# ^DirSubText
+Pasta Destino
+# ^DirBrowseText
+Selecione a pasta para instalar o $(^NameDA):
+# ^UnDirText
+O Instalador desinstalará o $(^NameDA) da seguinte pasta. Para desinstalar de uma pasta diferente, clique em Procurar e selecione outra pasta. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Selecione a pasta de onde desinstalar o $(^NameDA):
+# ^SpaceAvailable
+"Espaço disponível: "
+# ^SpaceRequired
+"Espaço requerido: "
+# ^UninstallingText
+O $(^NameDA) será desinstalado da seguinte pasta. $_CLICK
+# ^UninstallingSubText
+Desinstalando de:
+# ^FileError
+Erro ao abrir o arquivo para a gravação: \r\n\r\n$0\r\n\r\nClique em Abortar para parar a instalação,\r\nRepetir para tentar de novo, ou\r\nIgnorar para pular este arquivo.
+# ^FileError_NoIgnore
+Erro ao abrir o arquivo para a gravação: \r\n\r\n$0\r\n\r\nClique em Repetir para tentar de novo, ou\r\nCancelar para parar a instalação.
+# ^CantWrite
+"Não pode escrever: "
+# ^CopyFailed
+Falhou em copiar
+# ^CopyTo
+"Copiar para "
+# ^Registering
+"Registrando: "
+# ^Unregistering
+"Desfazendo o registro: "
+# ^SymbolNotFound
+"Não pôde achar o símbolo: "
+# ^CouldNotLoad
+"Não pôde carregar: "
+# ^CreateFolder
+"Criar pasta: "
+# ^CreateShortcut
+"Criar atalho: "
+# ^CreatedUninstaller
+"Desinstalador criado: "
+# ^Delete
+"Apagar o arquivo: "
+# ^DeleteOnReboot
+"Apagar ao reiniciar: "
+# ^ErrorCreatingShortcut
+"Erro ao criar o atalho: "
+# ^ErrorCreating
+"Erro ao criar: "
+# ^ErrorDecompressing
+Erro ao descompactar os dados! Instalador corrompido?
+# ^ErrorRegistering
+Erro ao registar a DLL
+# ^ExecShell
+"Executar pelo Shell: "
+# ^Exec
+"Executar: "
+# ^Extract
+"Extrair: "
+# ^ErrorWriting
+"Extrair: erro ao gravar o arquivo "
+# ^InvalidOpcode
+Instalador corrompido: opcode inválido
+# ^NoOLE
+"Sem OLE para: "
+# ^OutputFolder
+"Pasta de saída: "
+# ^RemoveFolder
+"Remover a pasta: "
+# ^RenameOnReboot
+"Renomear ao reiniciar: "
+# ^Rename
+"Renomear: "
+# ^Skipped
+"Ignorado: "
+# ^CopyDetails
+Copiar os Detalhes para a Área de Transferência
+# ^LogInstall
+Pôr no Log o processo de instalação
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Turkish.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Turkish.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Turkish.nlf	(revision 728)
@@ -0,0 +1,192 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+1055
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1254
+# RTL - anything else than RTL means LTR
+-
+# Translation by ?atay Dilsiz(chagy) (amigos_cagi@hotmail.com)
+# Corrections by Mozilla Türkiye Yerelleþtirme Topluluðu tarafýndan çevrilmiþtir. http://mozilla.org.tr
+# ^Branding
+Nullsoft Kurulum Sistemi %s
+# ^SetupCaption
+$(^Name) Kurulumu
+# ^UninstallCaption
+$(^Name) Kaldýrma
+# ^LicenseSubCaption
+: Lisans Sözleþmesi
+# ^ComponentsSubCaption
+: Kurulum Seçenekleri
+# ^DirSubCaption
+: Kurulum Dizini
+# ^InstallingSubCaption
+: Kuruluyor
+# ^CompletedSubCaption
+: Tamamlandý
+# ^UnComponentsSubCaption
+: Kaldýrma Seçenekleri
+# ^UnDirSubCaption
+: Kaldýrýlacak Dizin
+# ^ConfirmSubCaption
+: Onay
+# ^UninstallingSubCaption
+: Kaldýrýlýyor
+# ^UnCompletedSubCaption
+: Tamamlandý
+# ^BackBtn
+< &Geri
+# ^NextBtn
+Ý&leri >
+# ^AgreeBtn
+&Kabul Ediyorum
+# ^AcceptBtn
+Lisans Sözleþmesi'nin koþullarýný &kabul ediyorum
+# ^DontAcceptBtn
+Lisans Sözleþmesi'nin koþullarýný kabul et&miyorum
+# ^InstallBtn
+&Kur
+# ^UninstallBtn
+&Kaldýr
+# ^CancelBtn
+Vazgeç
+# ^CloseBtn
+&Kapat
+# ^BrowseBtn
+&Gözat...
+# ^ShowDetailsBtn
+&Ayrýntýlarý göster
+# ^ClickNext
+Devam etmek için Ýleri düðmesine basýn.
+# ^ClickInstall
+Kurulumu baþlatmak için Kur düðmesine basýn.
+# ^ClickUninstall
+Kaldýrmayý baþlatmak için Kaldýr düðmesine basýn.
+# ^Name
+Ad
+# ^Completed
+Tamamlandý
+# ^LicenseText
+Lütfen $(^NameDA) uygulamasýný kurmadan önce lisans sözleþmesini gözden geçirin. Sözleþmedeki bütün koþullarý kabul ediyorsanýz Kabul Ediyorum düðmesine basýn.
+# ^LicenseTextCB
+Lütfen $(^NameDA) uygulamasýný kurmadan önce lisans sözleþmesini gözden geçirin. Sözleþmedeki bütün koþullarý kabul ediyorsanýz aþaðýdaki kutuya iþaret koyun. $_CLICK
+# ^LicenseTextRB
+Lütfen $(^NameDA) uygulamasýný kurmadan önce lisans sözleþmesini gözden geçirin. Sözleþmedeki bütün koþullarý kabul ediyorsanýz aþaðýdaki ilk seçeneði seçin. $_CLICK
+# ^UnLicenseText
+Lütfen $(^NameDA) uygulamasýný kaldýrmadan önce lisans sözleþmesini gözden geçirin. Sözleþmedeki bütün koþullarý kabul ediyorsanýz Kabul Ediyorum düðmesine basýn.
+# ^UnLicenseTextCB
+Lütfen $(^NameDA) uygulamasýný kaldýrmadan önce lisans sözleþmesini gözden geçirin. Sözleþmedeki bütün koþullarý kabul ediyorsanýz aþaðýdaki kutuya iþaret koyun. $_CLICK
+# ^UnLicenseTextRB
+Lütfen $(^NameDA) uygulamasýný kaldýrmadan önce lisans sözleþmesini gözden geçirin. Sözleþmedeki bütün koþullarý kabul ediyorsanýz aþaðýdaki ilk seçeneði seçin. $_CLICK
+# ^Custom
+Özel
+# ^ComponentsText
+Kurmak istediðiniz bileþenleri iþaretleyip kurmak istemediklerinizi iþaretlemeden býrakýn. $_CLICK
+# ^ComponentsSubText1
+Kurulum türünü seçin:
+# ^ComponentsSubText2_NoInstTypes
+Kurulacak bileþenleri seçin:
+# ^ComponentsSubText2
+ya da isteðe baðlý olarak kurmak istediðiniz bileþenleri seçin:
+# ^UnComponentsText
+Kaldýrmak istediðiniz bileþenleri iþaretleyip kaldýrmak istemediklerinizi iþaretlemeden býrakýn. $_CLICK
+# ^UnComponentsSubText1
+Kaldýrma türünü seçin:
+# ^UnComponentsSubText2_NoInstTypes
+Kaldýrýlacak bileþenleri seçin:
+# ^UnComponentsSubText2
+ya da isteðe baðlý olarak kaldýrmak istediðiniz bileþenleri seçin:
+# ^DirText
+$(^NameDA) aþaðýdaki dizinde kurulacak. Farklý bir dizinde kurmak için Gözat düðmesine basýp baþka bir dizin seçin. $_CLICK
+# ^DirSubText
+Hedef Dizin
+# ^DirBrowseText
+$(^NameDA) uygulamasýnýn kurulacaðý dizini seçin:
+# ^UnDirText
+$(^NameDA) aþaðýdaki dizinden kaldýrýlacak. Farklý bir dizinden kaldýrmak için Gözat düðmesine basýp baþka bir dizin seçin. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+$(^NameDA) uygulamasýnýn kaldýrýlacaðý dizini seçin:
+# ^SpaceAvailable
+"Kullanýlabilir boþ alan: "
+# ^SpaceRequired
+"Gereken boþ alan: "
+# ^UninstallingText
+$(^NameDA) aþaðýdaki dizinden kaldýrýlacak. $_CLICK
+# ^UninstallingSubText
+Kaldýrýlan yer:
+# ^FileError
+Dosya yazmak için açýlýrken hata meydana geldi: \r\n\r\n$0\r\n\r\nKurulumu durdurmak için Dur düðmesine,\r\nyeniden denemek için Yeniden Dene düðmesine,\r\nbu dosyayý atlamak için Yoksay düðmesine basýn.
+# ^FileError_NoIgnore
+Dosya yazmak için açýlýrken hata meydana geldi: \r\n\r\n$0\r\n\r\nYeniden denemek için Yeniden Dene düðmesine,\r\nkurulumu durdurmak için Vazgeç düðmesine basýn.
+# ^CantWrite
+"Yazýlamadý: "
+# ^CopyFailed
+Kopyalama baþarýsýz oldu
+# ^CopyTo
+"Kayýt: "
+# ^Registering
+"Kaydediliyor: "
+# ^Unregistering
+"Kayýt siliniyor: "
+# ^SymbolNotFound
+"Simge bulunamadý: "
+# ^CouldNotLoad
+"Yüklenemedi: "
+# ^CreateFolder
+"Dizin oluþtur: "
+# ^CreateShortcut
+"Kýsayol oluþtur: "
+# ^CreatedUninstaller
+"Kaldýrma uygulamasý oluþtur: "
+# ^Delete
+"Dosya sil: "
+# ^DeleteOnReboot
+"Açýlýþta sil: "
+# ^ErrorCreatingShortcut
+"Kýsayol oluþturulurken hata meydana geldi: "
+# ^ErrorCreating
+"Oluþturma hatasý: "
+# ^ErrorDecompressing
+Veriyi açarken hata meydana geldi! Acaba kurulum uygulamasý mý bozuk?
+# ^ErrorRegistering
+DLL kaydedilirken hata meydana geldi
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Çalýþtýr: "
+# ^Extract
+"Aç: "
+# ^ErrorWriting
+"Açma: Dosyaya yazarken hata meydana geldi "
+# ^InvalidOpcode
+Kurulum bozuk: Geçersiz kod
+# ^NoOLE
+"OLE yok: "
+# ^OutputFolder
+"Çýktý dizini: "
+# ^RemoveFolder
+"Dizini sil: "
+# ^RenameOnReboot
+"Açýlýþta adýný deðiþtir: "
+# ^Rename
+"Ad deðiþtir: "
+# ^Skipped
+"Atlandý: "
+# ^CopyDetails
+Ayrýntýlarý panoya kopyala
+# ^LogInstall
+Kurulum sürecinin kaydýný tut
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Bosnian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Bosnian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Bosnian.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Language ID
+5146
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1250
+# RTL - anything else than RTL means LTR
+-
+# Translation by Salih CAVKIC, cavkic@skynet.be
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) Instalacija
+# ^UninstallCaption
+$(^Name) Uklanjanje
+# ^LicenseSubCaption
+: Licencno pravo korištenja
+# ^ComponentsSubCaption
+: Opcije instalacije
+# ^DirSubCaption
+: Izbor mape za instalaciju
+# ^InstallingSubCaption
+: Instaliranje
+# ^CompletedSubCaption
+: Završeno
+# ^UnComponentsSubCaption
+: Opcije uklanjanja
+# ^UnDirSubCaption
+: Mapa uklanjanja
+# ^ConfirmSubCaption
+: Potvrda
+# ^UninstallingSubCaption
+: Uklanjanje
+# ^UnCompletedSubCaption
+: Završeno uklanjanje
+# ^BackBtn
+< &Nazad
+# ^NextBtn
+&Dalje >
+# ^AgreeBtn
+&Prihvatam
+# ^AcceptBtn
+&Prihvatam uvjete licencnog ugovora
+# ^DontAcceptBtn
+&Ne prihvatam uvjete licencnog ugovora
+# ^InstallBtn
+&Instaliraj
+# ^UninstallBtn
+&Ukloni
+# ^CancelBtn
+Odustani
+# ^CloseBtn
+&Zatvori
+# ^BrowseBtn
+&Pregledaj...
+# ^ShowDetailsBtn
+Prikaži &detalje
+# ^ClickNext
+Pritisnite dugme 'Dalje' za nastavak.
+# ^ClickInstall
+Pritisnite dugme 'Instaliraj' za poèetak instalacije.
+# ^ClickUninstall
+Pritisnite dugme 'Ukloni' za poèetak uklanjanja.
+# ^Name
+Ime
+# ^Completed
+Završeno
+# ^LicenseText
+Molim proèitajte licencu prije instaliranja programa $(^NameDA). Ukoliko prihvatate sve uvjete ugovora, odaberite 'Prihvatam'.
+# ^LicenseTextCB
+Molim proèitajte licencu prije instaliranja programa $(^NameDA). Ukoliko prihvatate sve uvjete ugovora, oznaèite donji kvadratiæ. $_CLICK
+# ^LicenseTextRB
+Molim proèitajte licencu prije instaliranja programa $(^NameDA). Ukoliko prihvatate sve uvjete ugovora, odaberite prvu donju opciju. $_CLICK
+# ^UnLicenseText
+Molim proèitajte licencu prije uklanjanja programa $(^NameDA). Ukoliko prihvatate sve uvjete ugovora, odaberite 'Prihvatam'.
+# ^UnLicenseTextCB
+Molim proèitajte licencu prije uklanjanja programa $(^NameDA). Ako prihvatate sve uvjete ugovora, obilježite donji kvadratiæ. $_CLICK
+# ^UnLicenseTextRB
+Molim proèitajte licencu prije uklanjanja programa $(^NameDA). Ukoliko prihvatate sve uvjete ugovora, odaberite prvu opciju ispod. $_CLICK
+# ^Custom
+Podešavanje
+# ^ComponentsText
+Oznaèite komponente koje želite instalirati. Instaliraju se samo oznaèene komponente. Uklonite oznaku sa onih koje ne želite instalirati. $_CLICK
+# ^ComponentsSubText1
+Izaberite tip instalacije:
+# ^ComponentsSubText2_NoInstTypes
+Odaberite komponente za instalaciju:
+# ^ComponentsSubText2
+Ili po izboru oznaèite komponente koje želite instalirati:
+# ^UnComponentsText
+Oznaèite komponente koje želite ukloniti. Uklonite oznaku sa onih koje ne želite ukloniti. $_CLICK
+# ^UnComponentsSubText1
+Izaberite tip uklanjanja:
+# ^UnComponentsSubText2_NoInstTypes
+Izaberite komponente za uklanjanje:
+# ^UnComponentsSubText2
+Ili po izboru odaberite komponente koje želite da uklonite:
+# ^DirText
+Program $(^NameDA) æe biti instaliran u sljedeæu mapu. Za instalaciju na neku drugu mapu odaberite 'Pregledaj...' i odaberite drugu mapu. $_CLICK
+# ^DirSubText
+Odredišna mapa
+# ^DirBrowseText
+Izaberite mapu u koju želite instalirati program $(^NameDA):
+# ^UnDirText
+Program $(^NameDA) æe biti uklonjen iz navedene mape. Za uklanjanje iz druge mape odaberite 'Pregledaj...' i oznaèite drugu mapu. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Izaberite mapu iz koje æete program $(^NameDA) ukloniti:
+# ^SpaceAvailable
+"Slobodno prostora na disku: "
+# ^SpaceRequired
+"Potrebno prostora na disku: "
+# ^UninstallingText
+Program $(^NameDA) æe biti uklonjen iz sljedeæe mape. $_CLICK
+# ^UninstallingSubText
+Uklanjanje iz:
+# ^FileError
+Greška prilikom otvaranja datoteke za upisivanje: \r\n\t"$0"\r\n\"Odustani\" za prekid instalacije,\r\n\"Ponovi\" za ponovni pokušaj upisivanja, ili\r\n\"Ignoriši\" za zanemarenje te datoteke
+# ^FileError_NoIgnore
+Greška prilikom otvaranja datoteke za upisivanje: \r\n\t"$0"\r\n\"Ponovi\" za ponovni pokušaj zapisivanja, ili\r\n\"Odustani\" za prekid instalacije
+# ^CantWrite
+"Nemoguæe upisati: "
+# ^CopyFailed
+Greška prilikom kopiranja
+# ^CopyTo
+"Kopiraj u "
+# ^Registering
+"Prijava: "
+# ^Unregistering
+"Odjava: "
+# ^SymbolNotFound
+"Nemoguæe naæi simbol: "
+# ^CouldNotLoad
+"Nemoguæe uèitavanje: "
+# ^CreateFolder
+"Napravi mapu: "
+# ^CreateShortcut
+"Napravi preèicu: "
+# ^CreatedUninstaller
+"Program za uklanjanje: "
+# ^Delete
+"Obriši datoteku: "
+# ^DeleteOnReboot
+"Obriši prilikom ponovnog pokretanja: "
+# ^ErrorCreatingShortcut
+"Greška prilikom kreiranja preèica: "
+# ^ErrorCreating
+"Greška prilikom kreiranja: "
+# ^ErrorDecompressing
+Greška prilikom otpakivanja podataka! Ošteæen instalacijski program?
+# ^ErrorRegistering
+Greška prilikom prijavljivanja DLLa
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Izvrši: "
+# ^Extract
+"Otpakuj: "
+# ^ErrorWriting
+"Otpakivanje: greška upisivanja u datoteku "
+# ^InvalidOpcode
+Ošteæena instalacijska datoteka: neispravna opkoda
+# ^NoOLE
+"Nema OLE za: "
+# ^OutputFolder
+"Izlazna mapa: "
+# ^RemoveFolder
+"Obriši mapu: "
+# ^RenameOnReboot
+"Preimenuj prilikom ponovnog startovanja: "
+# ^Rename
+"Preimenuj: "
+# ^Skipped
+"Preskoèeno: "
+# ^CopyDetails
+Kopiraj detalje na Klembord
+# ^LogInstall
+Logiraj zapisnik procesa instalacije
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
+
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Breton.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Breton.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Breton.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+1150
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by KAD-Korvigelloù an Drouizig (drouizig@drouizig.org)
+# ^Branding
+Reizhiad staliañ Nullsoft %s
+# ^SetupCaption
+Staliañ ha kefluniañ $(^Name)
+# ^UninstallCaption
+Distaliañ $(^Name)
+# ^LicenseSubCaption
+: Aotre arverañ
+# ^ComponentsSubCaption
+: Dibaboù staliañ
+# ^DirSubCaption
+: Kavlec'h staliañ
+# ^InstallingSubCaption
+: O staliañ ar restroù
+# ^CompletedSubCaption
+: Echu eo
+# ^UnComponentsSubCaption
+: Dibaboù distaliañ
+# ^UnDirSubCaption
+: Kavlec'h distaliañ
+# ^ConfirmSubCaption
+: Kadarnañ
+# ^UninstallingSubCaption
+: O tistaliañ ar restroù
+# ^UnCompletedSubCaption
+: Echu eo
+# ^BackBtn
+< &Kent
+# ^NextBtn
+&War-lerc'h >
+# ^AgreeBtn
+&A-du emaon
+# ^AcceptBtn
+&Degemer holl dermoù al lañvaz emglev
+# ^DontAcceptBtn
+&Chom hep degemer termoù al lañvaz emglev
+# ^InstallBtn
+&Staliañ
+# ^UninstallBtn
+&Distaliañ
+# ^CancelBtn
+Nullañ
+# ^CloseBtn
+&Serriñ
+# ^BrowseBtn
+F&urchal...
+# ^ShowDetailsBtn
+Muioc'h a &ditouroù
+# ^ClickNext
+Klikit war « War-lerc'h » evit mont war-raok.
+# ^ClickInstall
+Klikit war « Staliañ » evit kregiñ gant ar staliadur.
+# ^ClickUninstall
+Klikit war « Distaliañ » evit kregiñ gant an distaliadur.
+# ^Name
+Anv
+# ^Completed
+Echu eo
+# ^LicenseText
+Bezit aketus en ur lenn an aotre arverañ a-raok staliañ $(^NameDA) mar plij. Mar degemerit pep term eus an aotre, klikit war « A-du emaon ».
+# ^LicenseTextCB
+Bezit aketus en ur lenn an aotre arverañ a-raok staliañ $(^NameDA) mar plij. Mar degemerit pep term eus an aotre, klikit war al log a-zindan. $_CLICK
+# ^LicenseTextRB
+Bezit aketus en ur lenn an aotre arverañ a-raok staliañ $(^NameDA) mar plij. Mar degemerit pep term eus an aotre, dizuzit an dibab kentañ a-zindan. $_CLICK
+# ^UnLicenseText
+Bezit aketus en ur lenn an aotre arverañ a-raok distaliañ $(^NameDA) mar plij. Mar degemerit pep term eus an aotre, klikit war « A-du emaon ».
+# ^UnLicenseTextCB
+Bezit aketus en ur lenn an aotre arverañ a-raok distaliañ $(^NameDA) mar plij. Mar degemerit pep term eus an aotre, klikit war al log a-zindan. $_CLICK
+# ^UnLicenseTextRB
+Bezit aketus en ur lenn an aotre arverañ a-raok distaliañ $(^NameDA) mar plij. Mar degemerit pep term eus an aotre, diuzit an dibab kentañ a-zindan. $_CLICK
+# ^Custom
+Diouzh ho kiz
+# ^ComponentsText
+Dibabit an elfennoù a fell deoc'h staliañ pe diziuzit an elfennoù a fell deoc'h leuskel a-gostez. $_CLICK
+# ^ComponentsSubText1
+Dibabit pe seurt staliañ a vo :
+# ^ComponentsSubText2_NoInstTypes
+Dibabit an elfennoù da staliañ :
+# ^ComponentsSubText2
+Pe dibabit an elfennoù diret a fell deoc'h staliañ :
+# ^UnComponentsText
+Dibabit an elfennoù a fell deoc'h distaliañ pe diziuzit an elfennoù a fell deoc'h mirout. $_CLICK
+# ^UnComponentsSubText1
+Dibabit peseurt distaliañ a vo :
+# ^UnComponentsSubText2_NoInstTypes
+Dibabit an elfennoù da zistaliañ :
+# ^UnComponentsSubText2
+Pe dibabit an elfennoù diret a fell deoc'h distaliañ :
+# ^DirText
+Staliet e vo $(^NameDA) gant ar goulev-mañ er c'havlec'h da-heul. Mar fell deoc'h dibab ur c'havlec'h all, klikit war « Furchal » ha dibabit ur c'havlec'h all. $_CLICK
+# ^DirSubText
+Kavlec'h bukenn
+# ^DirBrowseText
+Dibabit ar c'havlec'h e vo diazezet $(^NameDA) ennañ :
+# ^UnDirText
+Distaliet e vo $(^NameDA) gant ar goulev-mañ adalek ar c'havlec'h da heul. Ma fell deoc'h distaliañ adalek ur c'havlec'h all, klikit war « Furchal » ha diuzit ur c'havlec'h all. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Diuzit ar c'havlec'h evit distaliañ $(^NameDA) adalek :
+# ^SpaceAvailable
+"Egor kantenn vak : "
+# ^SpaceRequired
+"Egor kantenn rekis : "
+# ^UninstallingText
+Distaliet e vo $(^NameDA) adalek ar c'havelec'h da-heul. $_CLICK
+# ^UninstallingSubText
+Distaliañ adalek :
+# ^FileError
+Fazi en ur zigeriñ ur restr evit skrivañ : \r\n\r\n$0\r\n\r\nKlikit war « Paouez » evit paouez gant ar staliañ,\r\n« Adober » evit eseañ en-dro, pe\r\n« Tremen » evit leuskel a-gostez ar restr-mañ.
+# ^FileError_NoIgnore
+Fazi en ur zigeriñ ur restr a-benn skrivañ : \r\n\r\n$0\r\n\r\nKlikit war « Adober » evit esaeañ en-dro, pe\r\nwar « Nullañ » evit paouez gant ar staliañ.
+# ^CantWrite
+"N'haller ket skrivañ : "
+# ^CopyFailed
+Kopiañ faziet
+# ^CopyTo
+"Kopiañ da "
+# ^Registering
+"Oc'h enskrivañ : "
+# ^Unregistering
+"O tienskrivañ : "
+# ^SymbolNotFound
+"N'haller ket kavout ur simbolenn : "
+# ^CouldNotLoad
+"N'haller ket kargañ : "
+# ^CreateFolder
+"Krouiñ kavlec'h : "
+# ^CreateShortcut
+"Krouiñ berradenn : "
+# ^CreatedUninstaller
+"Skoazeller distaliañ krouet : "
+# ^Delete
+"Dilemel restr : "
+# ^DeleteOnReboot
+"Dilemel en ur adloc'hañ : "
+# ^ErrorCreatingShortcut
+"Fazi en ur grouiñ berradenn : "
+# ^ErrorCreating
+"Fazi en ur grouiñ : "
+# ^ErrorDecompressing
+Fazi en ur ziwaskañ stlenn ! Skoazeller staliañ gwastet ?
+# ^ErrorRegistering
+Fazi en ur enskrivañ an DLL
+# ^ExecShell
+"ExecShell : "
+# ^Exec
+"Lañsañ : "
+# ^Extract
+"Eztennañ : "
+# ^ErrorWriting
+"Eztennañ : fazi en ur skrivañ restr "
+# ^InvalidOpcode
+Skoazeller staliañ gwastet : opcode direizh
+# ^NoOLE
+"OLE ebet evit : "
+# ^OutputFolder
+"Kavlec'h ec'hank : "
+# ^RemoveFolder
+"Dilemel ar c'havlec'h : "
+# ^RenameOnReboot
+"Adenvel pa vez adloc'het : "
+# ^Rename
+"Adenvel : "
+# ^Skipped
+"Laosket a-gostez: "
+# ^CopyDetails
+Kopiañ ar munudoù er golver
+# ^LogInstall
+Tresañ an argerzh staliañ
+# ^Byte
+E
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Italian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Italian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Italian.nsh	(revision 728)
@@ -0,0 +1,131 @@
+;Language: Italian (1040)
+;By SANFACE Software <sanface@sanface.com> v1.67 accents
+;Review and update from v1.65 to v1.67 by Alessandro Staltari < staltari (a) geocities.com >
+;Review and update from v1.67 to v1.68 by Lorenzo Bevilacqua < meow811@libero.it >
+
+!insertmacro LANGFILE "Italian" "Italiano"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Benvenuti nel programma di installazione di $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Questo programma installerà $(^NameDA) nel vostro computer.$\r$\n$\r$\nSi raccomanda di chiudere tutte le altre applicazioni prima di iniziare l'installazione. Questo permetterà al programma di installazione di aggiornare i file di sistema senza dover riavviare il computer.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Benvenuti nella procedura guidata di disinstallazione di $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Questa procedura vi guiderà nella disinstallazione di $(^NameDA).$\r$\n$\r$\nPrima di iniziare la disinstallazione, assicuratevi che $(^Name) non sia in esecuzione.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Licenza d'uso"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Prego leggere le condizioni della licenza d'uso prima di installare $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Se si accettano i termini della licenza d'uso scegliere Accetto per continuare. È necessario accettare i termini della licenza d'uso per installare $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Se si accettano i termini della licenza d'uso, selezionare la casella sottostante. È necessario accettare i termini della licenza d'uso per installare $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Se si accettano i termini della licenza d'uso, selezionare la prima opzione sottostante. È necessario accettare i termini della licenza d'uso per installare $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Licenza d'uso"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Prego leggere le condizioni della licenza d'uso prima di disinstallare $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Se si accettano i termini della licenza d'uso scegliere Accetto per continuare. È necessario accettare i termini della licenza d'uso per disinstallare $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Se si accettano i termini della licenza d'uso, selezionare la casella sottostante. È necessario accettare i termini della licenza d'uso per disinstallare $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Se si accettano i termini della licenza d'uso, selezionare la prima opzione sottostante. È necessario accettare i termini della licenza d'uso per disinstallare $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Premere Page Down per vedere il resto della licenza d'uso."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Selezione dei componenti"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Selezionare i componenti di $(^NameDA) che si desidera installare."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Selezione componenti"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Scegliere i componenti di $(^NameDA) che si desidera disinstallare."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Descrizione"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Posizionare il puntatore del mouse sul componente per vederne la descrizione."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Posizionare il puntatore del mouse sul componente per vederne la descrizione."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Scelta della cartella di installazione"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Scegliere la cartella nella quale installare $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Scelta della cartella da cui disinstallare"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Scegliere la cartella dalla quale disinstallare $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Installazione in corso"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Prego attendere mentre $(^NameDA) viene installato."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Installazione completata"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "L'installazione è stata completata con successo."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Installazione interrotta"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "L'installazione non è stata completata correttamente."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Disinstallazione in corso"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Prego attendere mentre $(^NameDA) viene disinstallato."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Disinstallazione completata"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "La disinstallazione è stata completata con successo."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Disinstallazione interrotta"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "La disintallazione non è stata completata correttamente."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Completamento dell'installazione di $(^NameDA)."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) è stato installato sul vostro computer.$\r$\n$\r$\nScegliere Fine per chiudere il programma di installazione."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Il computer deve essere riavviato per completare l'installazione di $(^NameDA). Vuoi riavviarlo ora?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Completamento della disinstallazione di $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) è stato disinstallato dal computer.$\r$\n$\r$\nSelezionare Fine per terminare questa procedura."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Il computer deve essere riavviato per completare l'installazione di $(^NameDA). Vuoi riavviarlo ora?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Riavvia adesso"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Preferisco riavviarlo manualmente più tardi"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "Esegui $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Mostra il file Readme"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Fine"
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Scelta della cartella del menu Start"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Scegliere una cartella del menu Start per i collegamenti del programma."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Scegliere la cartella del menu Start in cui verranno creati i collegamenti del programma. È possibile inserire un nome per creare una nuova cartella."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Non creare i collegamenti al programma."
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Disinstalla $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Rimuove $(^NameDA) dal computer."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Sei sicuro di voler interrompere l'installazione di $(^Name) ?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Sei sicuro di voler interrompere la disinstallazione di $(^Name)?"
+!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "Scelta degli Utenti"
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "Scegliete per quali utenti volete installare $(^NameDA)."
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "Scegliete se volete installare $(^NameDA) solo per voi o per tutti gli utenti di questo sistema. $(^ClickNext)"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "Installazione per tutti gli utenti"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Installazione personale"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SpanishInternational.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SpanishInternational.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SpanishInternational.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit ;Español (Alfabetización Internacional)
+NLF v6
+# Language ID
+3082
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by Darwin Rodrigo Toledo Cáceres - www.winamp-es.com - nwrad777@gmail.com
+# Base traslation by MoNKi & Joel
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+Instalación de $(^Name)
+# ^UninstallCaption
+Desinstalación de $(^Name)
+# ^LicenseSubCaption
+: Acuerdo de Licencia
+# ^ComponentsSubCaption
+: Opciones de Instalación
+# ^DirSubCaption
+: Carpeta de Instalación
+# ^InstallingSubCaption
+: Instalando
+# ^CompletedSubCaption
+: Finalizado
+# ^UnComponentsSubCaption
+: Opciones de Desinstalación
+# ^UnDirSubCaption
+: Carpeta de Desinstalación
+# ^ConfirmSubCaption
+: Confirmación
+# ^UninstallingSubCaption
+: Desinstalando
+# ^UnCompletedSubCaption
+: Finalizado
+# ^BackBtn
+< &Atrás
+# ^NextBtn
+&Siguiente >
+# ^AgreeBtn
+&Acepto
+# ^AcceptBtn
+&Acepto las condiciones del Acuerdo de Licencia
+# ^DontAcceptBtn
+No &acepto las condiciones del Acuerdo de Licencia
+# ^InstallBtn
+&Instalar
+# ^UninstallBtn
+&Desinstalar
+# ^CancelBtn
+Cancelar
+# ^CloseBtn
+&Cerrar
+# ^BrowseBtn
+&Examinar...
+# ^ShowDetailsBtn
+Mostrar &detalles
+# ^ClickNext
+Presione Siguiente para continuar.
+# ^ClickInstall
+Presione Instalar para iniciar la instalación.
+# ^ClickUninstall
+Presione Desinstalar para iniciar la desinstalación.
+# ^Name
+Nombre
+# ^Completed
+Finalizado
+# ^LicenseText
+Por favor, revise el acuerdo de licencia antes de instalar $(^NameDA). Si usted acepta todas las condiciones del acuerdo, presione Acepto.
+# ^LicenseTextCB
+Por favor, revise el acuerdo de licencia antes de instalar $(^NameDA). Si usted acepta todas las condiciones del acuerdo, marque abajo la casilla. $_CLICK
+# ^LicenseTextRB
+Por favor, revise el acuerdo de licencia antes de instalar $(^NameDA). Si usted acepta todas las condiciones del acuerdo, seleccione abajo la primera opción. $_CLICK
+# ^UnLicenseText
+Por favor, revise el acuerdo de licencia antes de desinstalar $(^NameDA). Si usted acepta todas las condiciones del acuerdo, presione Acepto.
+# ^UnLicenseTextCB
+Por favor, revise el acuerdo de licencia antes de desinstalar $(^NameDA). Si usted acepta todas las condiciones del acuerdo, marque abajo la casilla. $_CLICK
+# ^UnLicenseTextRB
+Por favor, revise el acuerdo de licencia antes de desinstalar $(^NameDA). Si usted acepta todas las condiciones del acuerdo, seleccione abajo la primera opción. $_CLICK
+# ^Custom
+Personalizada
+# ^ComponentsText
+Marque los componentes que desee instalar y desmarque los componentes que no desee instalar. $_CLICK
+# ^ComponentsSubText1
+Seleccione el tipo de instalación:
+# ^ComponentsSubText2_NoInstTypes
+Seleccione los componentes a instalar:
+# ^ComponentsSubText2
+O seleccione los componentes opcionales que desee instalar:
+# ^UnComponentsText
+Marque los componentes que desee desinstalar y desmarque los componentes que no desee desinstalar. $_CLICK
+# ^UnComponentsSubText1
+Seleccione el tipo de desinstalación:
+# ^UnComponentsSubText2_NoInstTypes
+Seleccione los componentes a desinstalar:
+# ^UnComponentsSubText2
+O seleccione los componentes opcionales que desee desinstalar:
+# ^DirText
+El programa de instalación instalará $(^NameDA) en la siguiente carpeta. Para instalar en una carpeta diferente, presione Examinar y seleccione otra carpeta. $_CLICK
+# ^DirSubText
+Carpeta de Destino
+# ^DirBrowseText
+Seleccione la carpeta en la que instalará $(^NameDA):
+# ^UnDirText
+El programa de instalación desinstalará $(^NameDA) de la siguiente carpeta. Para desinstalar de una carpeta diferente, presione Examinar y seleccione otra carpeta. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Seleccione la carpeta desde la que desinstalará $(^NameDA):
+# ^SpaceAvailable
+Espacio disponible:
+# ^SpaceRequired
+Espacio requerido:
+# ^UninstallingText
+$(^NameDA) será desinstalado de la siguiente carpeta. $_CLICK
+# ^UninstallingSubText
+Desinstalando desde:
+# ^FileError
+Error abriendo archivo para escribir: \r\n\r\n$0\r\n\r\nPresione Abortar para detener la instalación,\r\nReintentar para probar otra vez, o\r\nOmitir para ignorar este archivo.
+# ^FileError_NoIgnore
+Error abriendo archivo para escribir: \r\n\r\n$0\r\n\r\nPresione Reintentar para probar otra vez, o\r\nCancelar para detener la instalación.
+# ^CantWrite
+"No pudo escribirse: "
+# ^CopyFailed
+Copia fallida
+# ^CopyTo
+"Copiar a "
+# ^Registering
+"Registrando: "
+# ^Unregistering
+"Eliminando registro: "
+# ^SymbolNotFound
+"No se encontró simbolo: "
+# ^CouldNotLoad
+"No pudo cargarse: "
+# ^CreateFolder
+"Crear carpeta: "
+# ^CreateShortcut
+"Crear acceso directo: "
+# ^CreatedUninstaller
+"Crear desinstalador: "
+# ^Delete
+"Borrar archivo: "
+# ^DeleteOnReboot
+"Borrar al reinicio: "
+# ^ErrorCreatingShortcut
+"Error creando acceso directo: "
+# ^ErrorCreating
+"Error creando: "
+# ^ErrorDecompressing
+¡Error descomprimiendo datos! ¿Instalador corrupto?
+# ^ErrorRegistering
+Error registrando DLL
+# ^ExecShell
+"Ejecutar comando: "
+# ^Exec
+"Ejecutar: "
+# ^Extract
+"Extraer: "
+# ^ErrorWriting
+"Extraer: error escribiendo al archivo "
+# ^InvalidOpcode
+Instalador corrupto: código de operación no válido
+# ^NoOLE
+"Sin OLE para: "
+# ^OutputFolder
+"Carpeta de salida: "
+# ^RemoveFolder
+"Eliminar carpeta: "
+# ^RenameOnReboot
+"Renombrar al reinicio: "
+# ^Rename
+"Renombrar: "
+# ^Skipped
+"Omitido: "
+# ^CopyDetails
+Copiar Detalles al Portapapeles
+# ^LogInstall
+Registrar proceso de instalación
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Greek.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Greek.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Greek.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1032
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1253
+# RTL - anything else than RTL means LTR
+-
+# Translation by Makidis N. Michael - http://dias.aueb.gr/~p3010094/
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+ÅãêáôÜóôáóç ôïõ '$(^Name)'
+# ^UninstallCaption
+ÁðåãêáôÜóôáóç ôïõ '$(^Name)'
+# ^LicenseSubCaption
+: Óõìöùíßá ¢äåéáò ×ñÞóçò
+# ^ComponentsSubCaption
+: ÅðéëïãÝò ÅãêáôÜóôáóçò
+# ^DirSubCaption
+: ÖÜêåëïò ÅãêáôÜóôáóçò
+# ^InstallingSubCaption
+: ÅãêáôÜóôáóç óå åîÝëéîç
+# ^CompletedSubCaption
+: Ïëïêëçñþèçêå
+# ^UnComponentsSubCaption
+: ÅðéëïãÝò ÁðåãêáôÜóôáóçò
+# ^UnDirSubCaption
+: ÖÜêåëïò ÁðåãêáôÜóôáóçò
+# ^ConfirmSubCaption
+: Åðéâåâáßùóç
+# ^UninstallingSubCaption
+: ÁðåãêáôÜóôáóç óå åîÝëéîç
+# ^UnCompletedSubCaption
+: Ïëïêëçñþèçêå
+# ^BackBtn
+< &Ðßóù
+# ^NextBtn
+&Åðüìåíï >
+# ^AgreeBtn
+&Óõìöùíþ
+# ^AcceptBtn
+&ÁðïäÝ÷ïìáé ôïõò üñïõò ôçò Üäåéáò ÷ñÞóçò
+# ^DontAcceptBtn
+&Äåí áðïäÝ÷ïìáé ôïõò üñïõò ôçò Üäåéáò ÷ñÞóçò
+# ^InstallBtn
+&ÅãêáôÜóôáóç
+# ^UninstallBtn
+Áðå&ãêáôÜóô.
+# ^CancelBtn
+¢êõñï
+# ^CloseBtn
+&Êëåßóéìï
+# ^BrowseBtn
+Á&íáæÞôçóç...
+# ^ShowDetailsBtn
+&ËåðôïìÝñåéåò
+# ^ClickNext
+ÊÜíôå êëéê óôï Åðüìåíï ãéá íá óõíå÷ßóåôå.
+# ^ClickInstall
+ÊÜíôå êëéê óôï ÅãêáôÜóôáóç ãéá íá áñ÷ßóåôå ôçí åãêáôÜóôáóç.
+# ^ClickUninstall
+ÊÜíôå êëéê óôï ÁðåãêáôÜóôáóç ãéá íá áñ÷ßóåôå ôçí áðåãêáôÜóôáóç.
+# ^Name
+¼íïìá
+# ^Completed
+Ïëïêëçñþèçêå
+# ^LicenseText
+ÅëÝãîôå ôçí Üäåéá ÷ñÞóçò ðñéí åãêáôáóôÞóåôå ôï '$(^NameDA)'. ÅÜí áðïäÝ÷åóôå üëïõò ôïõò üñïõò, êÜíôå êëéê óôï Óõìöùíþ.
+# ^LicenseTextCB
+ÅëÝãîôå ôçí Üäåéá ÷ñÞóçò ðñéí åãêáôáóôÞóåôå ôï '$(^NameDA)'. ÅÜí áðïäÝ÷åóôå üëïõò ôïõò üñïõò, êÜíôå êëéê óôçí åðéëïãÞ ðáñáêÜôù. $_CLICK
+# ^LicenseTextRB
+ÅëÝãîôå ôçí Üäåéá ÷ñÞóçò ðñéí åãêáôáóôÞóåôå ôï '$(^NameDA)'. ÅÜí áðïäÝ÷åóôå üëïõò ôïõò üñïõò, êÜíôå êëéê óôçí ðñþôç åðéëïãÞ ðáñáêÜôù. $_CLICK
+# ^UnLicenseText
+ÅëÝãîôå ôçí Üäåéá ÷ñÞóçò ðñéí áðåãêáôáóôÞóåôå ôï '$(^NameDA)'. ÅÜí áðïäÝ÷åóôå üëïõò ôïõò üñïõò, êÜíôå êëéê óôï Óõìöùíþ.
+# ^UnLicenseTextCB
+ÅëÝãîôå ôçí Üäåéá ÷ñÞóçò ðñéí áðåãêáôáóôÞóåôå ôï '$(^NameDA)'. ÅÜí áðïäÝ÷åóôå üëïõò ôïõò üñïõò, êÜíôå êëéê óôçí åðéëïãÞ ðáñáêÜôù. $_CLICK
+# ^UnLicenseTextRB
+ÅëÝãîôå ôçí Üäåéá ÷ñÞóçò ðñéí áðåãêáôáóôÞóåôå ôï '$(^NameDA)'. ÅÜí áðïäÝ÷åóôå üëïõò ôïõò üñïõò, êÜíôå êëéê óôçí ðñþôç åðéëïãÞ ðáñáêÜôù. $_CLICK
+# ^Custom
+ÐñïóáñìïóìÝíç
+# ^ComponentsText
+ÅðéëÝîôå ôá óôïé÷åßá ðïõ èÝëåôå íá åãêáôáóôÞóåôå êáé áðïåðéëÝîôå ôá óôïé÷åßá ðïõ äå èÝëåôå íá åãêáôáóôÞóåôå. $_CLICK
+# ^ComponentsSubText1
+ÅðéëÝîôå ôýðï åãêáôÜóôáóçò:
+# ^ComponentsSubText2_NoInstTypes
+ÅðéëÝîôå ôá óôïé÷åßá ðïõ èÝëåôå íá åãêáôáóôÞóåôå:
+# ^ComponentsSubText2
+¹, åðéëÝîôå ôá ðñïáéñåôéêÜ óôïé÷åßá ðïõ èÝëåôå íá åãêáôáóôÞóåôå:
+# ^UnComponentsText
+ÅðéëÝîôå ôá óôïé÷åßá ðïõ èÝëåôå íá áðåãêáôáóôÞóåôå êáé áðïåðéëÝîôå ôá óôïé÷åßá ðïõ äå èÝëåôå íá áðåãêáôáóôÞóåôå. $_CLICK
+# ^UnComponentsSubText1
+ÅðéëÝîôå ôýðï áðåãêáôÜóôáóçò:
+# ^UnComponentsSubText2_NoInstTypes
+ÅðéëÝîôå ôá óôïé÷åßá ðïõ èÝëåôå íá áðåãêáôáóôÞóåôå:
+# ^UnComponentsSubText2
+¹, åðéëÝîôå ôá ðñïáéñåôéêÜ óôïé÷åßá ðïõ èÝëåôå íá áðåãêáôáóôÞóåôå:
+# ^DirText
+Ôï ðñüãñáììá åãêáôÜóôáóçò èá åãêáôáóôÞóåé ôï '$(^NameDA)' óôïí ðáñáêÜôù öÜêåëï. Ãéá íá ôï åãêáôáóôÞóåôå óå Ýíáí Üëëï öÜêåëï, êÜíôå êëéê óôï ÁíáæÞôçóç êáé åðéëÝîôå êÜðïéïí Üëëï öÜêåëï. $_CLICK
+# ^DirSubText
+ÖÜêåëïò ÅãêáôÜóôáóçò
+# ^DirBrowseText
+ÅðéëÝîôå ôï öÜêåëï åãêáôÜóôáóçò ãéá ôï '$(^NameDA)':
+# ^UnDirText
+Ôï ðñüãñáììá åãêáôÜóôáóçò èá áðåãêáôáóôÞóåé ôï '$(^NameDA)' áðü ôïí ðáñáêÜôù öÜêåëï. Ãéá íá áðåãêáôáóôÞóåôå áðü Ýíáí Üëëï öÜêåëï, êÜíôå êëéê óôï ÁíáæÞôçóç êáé åðéëÝîôå êÜðïéïí Üëëï öÜêåëï. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+ÅðéëÝîôå ôï öÜêåëï áðåãêáôÜóôáóçò ãéá ôï '$(^NameDA)':
+# ^SpaceAvailable
+"ÄéáèÝóéìïò ÷þñïò: "
+# ^SpaceRequired
+"Áðáéôïýìåíïò ÷þñïò: "
+# ^UninstallingText
+Ôï '$(^NameDA)' èá áðåãêáôáóôáèåß áðü ôïí áêüëïõèï öÜêåëï. $_CLICK
+# ^UninstallingSubText
+ÁðåãêáôÜóô. áðü:
+# ^FileError
+ÓöÜëìá êáôÜ ôï Üíïéãìá áñ÷åßïõ ãéá åããñáöÞ: \r\n\t"$0"\r\nÅðéëÝîôå ìáôáßùóç ãéá íá ìáôáéþóåôå ôçí åãêáôÜóôáóç,\r\nåðáíÜëçøç ãéá íá äïêéìÜóåôå íá ãñÜøåôå ôï áñ÷åßï ðÜëé, Þ\r\nðáñÜâëåøç ãéá íá ðáñáëåßøåôå áõôü ôï áñ÷åßï.
+# ^FileError_NoIgnore
+ÓöÜëìá êáôÜ ôï Üíïéãìá áñ÷åßïõ ãéá åããñáöÞ: \r\n\t"$0"\r\nÅðéëÝîôå åðáíÜëçøç ãéá íá äïêéìÜóåôå íá ãñÜøåôå ôï áñ÷åßï ðÜëé, Þ\r\nìáôáßùóç ãéá íá ìáôáéþóåôå ôçí åãêáôÜóôáóç.
+# ^CantWrite
+"Áäõíáìßá åããñáöÞò: "
+# ^CopyFailed
+ÁíôéãñáöÞ áðÝôõ÷å
+# ^CopyTo
+"ÁíôéãñáöÞ óôï "
+# ^Registering
+"Êáôá÷þñçóç: "
+# ^Unregistering
+"ÊáôÜñãçóç êáôá÷þñçóçò: "
+# ^SymbolNotFound
+"Áäõíáìßá åýñåóçò óõìâüëïõ: "
+# ^CouldNotLoad
+"Áäõíáìßá öüñôùóçò: "
+# ^CreateFolder
+"Äçìéïõñãßá öáêÝëïõ: "
+# ^CreateShortcut
+"Äçìéïõñãßá óõíôüìåõóçò: "
+# ^CreatedUninstaller
+"Äçìéïõñãßá ðñïãñÜììáôïò áðåãêáôÜóôáóçò: "
+# ^Delete
+"ÄéáãñáöÞ áñ÷åßïõ: "
+# ^DeleteOnReboot
+"ÄéáãñáöÞ óôçí åðáíåêêßíçóç: "
+# ^ErrorCreatingShortcut
+"ÓöÜëìá óôç äçìéïõñãßá óõíôüìåõóçò: "
+# ^ErrorCreating
+"ÓöÜëìá óôç äçìéïõñãßá: "
+# ^ErrorDecompressing
+ÓöÜëìá óôçí áðïóõìðßåóç äåäïìÝíùí! ÊáôåóôñáììÝíï ðñüãñáììá åãêáôÜóôáóçò;
+# ^ErrorRegistering
+ÓöÜëìá êáôá÷þñçóçò ôïõ DLL
+# ^ExecShell
+"ÅêôÝëåóç (ExecShell): "
+# ^Exec
+"ÅêôÝëåóç: "
+# ^Extract
+"Áðïóõìðßåóç: "
+# ^ErrorWriting
+"Áðïóõìðßåóç: óöÜëìá åããñáöÞò óôï áñ÷åßï "
+# ^InvalidOpcode
+ÅãêáôÜóôáóç êáôåóôñáììÝíç: ìç-Ýãêõñï opcode
+# ^NoOLE
+"¼÷é OLE ãéá ôï: "
+# ^OutputFolder
+"ÖÜêåëïò åîüäïõ: "
+# ^RemoveFolder
+"ÄéáãñáöÞ öáêÝëïõ: "
+# ^RenameOnReboot
+"Ìåôïíïìáóßá óôçí åðáíåêêßíçóç: "
+# ^Rename
+"Ìåôïíïìáóßá: "
+# ^Skipped
+"Ðáñáëåßöèçêå: "
+# ^CopyDetails
+ÁíôéãñáöÞ ëåðôïìåñåéþí óôï Ðñü÷åéñï
+# ^LogInstall
+ÊáôáãñáöÞ äéáäéêáóßáò åãêáôÜóôáóçò
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Finnish.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Finnish.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Finnish.nlf	(revision 728)
@@ -0,0 +1,192 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+1035
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by Eclipser (Jonne Lehtinen) <Eclipser at pilvikaupunki dot net>
+# Corrections by the Mozilla.fi crew
+# ^Branding
+Nullsoftin asennusjärjestelmä %s
+# ^SetupCaption
+$(^Name) Asennus
+# ^UninstallCaption
+$(^Name) Poisto
+# ^LicenseSubCaption
+: Lisenssisopimus
+# ^ComponentsSubCaption
+: Asennusvaihtoehdot
+# ^DirSubCaption
+: Asennuskansio
+# ^InstallingSubCaption
+: Asennetaan
+# ^CompletedSubCaption
+: Valmis
+# ^UnComponentsSubCaption
+: Poistovaihtoehdot
+# ^UnDirSubCaption
+: Poistokansio
+# ^ConfirmSubCaption
+: Varmistus
+# ^UninstallingSubCaption
+: Poistetaan
+# ^UnCompletedSubCaption
+: Valmis
+# ^BackBtn
+< &Takaisin
+# ^NextBtn
+&Seuraava >
+# ^AgreeBtn
+&Hyväksyn
+# ^AcceptBtn
+Hyväksyn lisenssisopimuksen ehdot
+# ^DontAcceptBtn
+En hyväksy sopimuksen ehtoja
+# ^InstallBtn
+&Asenna
+# ^UninstallBtn
+&Poista
+# ^CancelBtn
+Peruuta
+# ^CloseBtn
+&Sulje
+# ^BrowseBtn
+S&elaa...
+# ^ShowDetailsBtn
+&Näytä tiedot
+# ^ClickNext
+Valitse Seuraava jatkaaksesi.
+# ^ClickInstall
+Valitse Asenna aloittaaksesi asennuksen.
+# ^ClickUninstall
+Valitse Poista poistaaksesi asennuksen.
+# ^Name
+Nimi
+# ^Completed
+Valmis
+# ^LicenseText
+Lue lisenssisopimus ennen asentamista. Jos hyväksyt sopimuksen kaikki ehdot, valitse Hyväksyn.
+# ^LicenseTextCB
+Lue lisenssisopimus ennen asentamista. Jos hyväksyt sopimuksen kaikki ehdot, laita rasti ruutuun. $_CLICK
+# ^LicenseTextRB
+Lue lisenssisopimus ennen asentamista. Jos hyväksyt sopimuksen kaikki ehdot, valitse ensimmäinen vaihtoehto alapuolelta. $_CLICK
+# ^UnLicenseText
+Lue lisenssisopimus ennen poistamista. Jos hyväksyt sopimuksen kaikki ehdot, valitse Hyväksyn.
+# ^UnLicenseTextCB
+Lue lisenssisopimus ennen poistamista. Jos hyväksyt sopimuksen kaikki ehdot, laita rasti ruutuun. $_CLICK
+# ^UnLicenseTextRB
+Lue lisenssisopimus ennen poistamista. Jos hyväksyt sopimuksen kaikki ehdot, valitse ensimmäinen vaihtoehto alapuolelta. $_CLICK
+# ^Custom
+Oma
+# ^ComponentsText
+Valitse komponentit, jotka haluat asentaa, ja poista valinta komponenteista, joita et halua asentaa. $_CLICK
+# ^ComponentsSubText1
+Valitse asennustyyppi:
+# ^ComponentsSubText2_NoInstTypes
+Valitse asennettavat komponentit:
+# ^ComponentsSubText2
+Tai, valitse valinnaiset komponentit, jotka haluat asentaa:
+# ^UnComponentsText
+Valitse komponentit, jotka haluat poistaa, ja poista valinta komponenteista, joita et haluat poistaa. $_CLICK
+# ^UnComponentsSubText1
+Valitse poistotyyppi:
+# ^UnComponentsSubText2_NoInstTypes
+Valitse poistettavat komponentit:
+# ^UnComponentsSubText2
+Tai, valitse valinnaiset komponentit, jotka haluat poistaa
+# ^DirText
+Asennus asentaa ohjelman $(^NameDA) seuraavaan kansioon. Jos haluat asentaa sen johonkin muuhun kansioon, valitse Selaa, ja valitse toinen kansio. $_CLICK
+# ^DirSubText
+Kohdekansio
+# ^DirBrowseText
+Valitse kansio, johon haluat asentaa ohjelman $(^NameDA):
+# ^UnDirText
+Asennus poistaa ohjelman $(^NameDA) seuraavasta kansiosta. Jos haluat poistaa sen jostakin muusta kansiosta, valitse Selaa, ja valitse toinen kansio. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Valitse kansio, josta haluat poistaa ohjelman $(^NameDA):
+# ^SpaceAvailable
+"Tilaa vapaana: "
+# ^SpaceRequired
+"Tarvittava tila: "
+# ^UninstallingText
+Tämä ohjelma poistaa ohjelman $(^NameDA) tietokoneelta. $_CLICK
+# ^UninstallingSubText
+Poistetaan kansiosta:
+# ^FileError
+Tiedostoon ei voitu kirjoittaa: \r\n\t"$0"\r\nLopeta asennus valitsemalla Hylkää,\r\nyritä uudelleen valitsemalla Uudelleen, tai\r\nohita tiedosto valitsemalla Ohita
+# ^FileError_NoIgnore
+Tiedostoon ei voitu kirjoittaa: \r\n\t"$0"\r\nYritä uudelleen valitsemalla Uudelleen, tai\r\nlopeta asennus valitsemalla Hylkää
+# ^CantWrite
+"Ei voi kirjoittaa: "
+# ^CopyFailed
+Kopiointi epäonnistui
+# ^CopyTo
+"Kopioidaan kohteeseen "
+# ^Registering
+"Rekisteröidään: "
+# ^Unregistering
+"Poistetaan rekisteröinti: "
+# ^SymbolNotFound
+"Symbolia ei löytynyt: "
+# ^CouldNotLoad
+"Ei voitu ladata: "
+# ^CreateFolder
+"Luo kansio: "
+# ^CreateShortcut
+"Luo pikakuvake: "
+# ^CreatedUninstaller
+"Poisto-ohjelma luotiin: "
+# ^Delete
+"Poista: "
+# ^DeleteOnReboot
+"Poista käynnistyksen yhteydessä: "
+# ^ErrorCreatingShortcut
+"Virhe luotaessa pikakuvaketta: "
+# ^ErrorCreating
+"Virhe luotaessa: "
+# ^ErrorDecompressing
+Pakettia ei voitu purkaa. Korruptoitunut asennusohjelma?
+# ^ErrorRegistering
+Virhe rekisteröidessä DLL-tiedostoa
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Suorita: "
+# ^Extract
+"Pura: "
+# ^ErrorWriting
+"Pura: tiedostoon ei voitu kirjoittaa "
+# ^InvalidOpcode
+Asennuspaketti on vioittunut: virheellinen opcode
+# ^NoOLE
+"Ei OLEa: "
+# ^OutputFolder
+"Kansio: "
+# ^RemoveFolder
+"Poista kansio: "
+# ^RenameOnReboot
+"Muuta nimi uudelleenkäynnistyksen yhteydessä: "
+# ^Rename
+"Muuta nimi: "
+# ^Skipped
+"Ohitettiin: "
+# ^CopyDetails
+Kopioi tiedot leikepöydälle
+# ^LogInstall
+Tallenna asennusloki
+# ^Byte
+t
+# ^Kilo
+k
+# ^Mega
+M
+# ^Giga
+G
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/English.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/English.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/English.nsh	(revision 728)
@@ -0,0 +1,129 @@
+;Language: English (1033)
+;By Joost Verburg
+
+!insertmacro LANGFILE "English" "English"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Welcome to the $(^NameDA) Setup Wizard"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "This wizard will guide you through the installation of $(^NameDA).$\r$\n$\r$\nIt is recommended that you close all other applications before starting Setup. This will make it possible to update relevant system files without having to reboot your computer.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Welcome to the $(^NameDA) Uninstall Wizard"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "This wizard will guide you through the uninstallation of $(^NameDA).$\r$\n$\r$\nBefore starting the uninstallation, make sure $(^NameDA) is not running.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "License Agreement"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Please review the license terms before installing $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "If you accept the terms of the agreement, click I Agree to continue. You must accept the agreement to install $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "If you accept the terms of the agreement, click the check box below. You must accept the agreement to install $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "If you accept the terms of the agreement, select the first option below. You must accept the agreement to install $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "License Agreement"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Please review the license terms before uninstalling $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "If you accept the terms of the agreement, click I Agree to continue. You must accept the agreement to uninstall $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "If you accept the terms of the agreement, click the check box below. You must accept the agreement to uninstall $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "If you accept the terms of the agreement, select the first option below. You must accept the agreement to uninstall $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Press Page Down to see the rest of the agreement."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Choose Components"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Choose which features of $(^NameDA) you want to install."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Choose Components"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Choose which features of $(^NameDA) you want to uninstall."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Description"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Position your mouse over a component to see its description."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Position your mouse over a component to see its description."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Choose Install Location"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Choose the folder in which to install $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Choose Uninstall Location"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Choose the folder from which to uninstall $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Installing"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Please wait while $(^NameDA) is being installed."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Installation Complete"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Setup was completed successfully."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Installation Aborted"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Setup was not completed successfully."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Uninstalling"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Please wait while $(^NameDA) is being uninstalled."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Uninstallation Complete"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Uninstall was completed successfully."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Uninstallation Aborted"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Uninstall was not completed successfully."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Completing the $(^NameDA) Setup Wizard"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) has been installed on your computer.$\r$\n$\r$\nClick Finish to close this wizard."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Your computer must be restarted in order to complete the installation of $(^NameDA). Do you want to reboot now?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Completing the $(^NameDA) Uninstall Wizard"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) has been uninstalled from your computer.$\r$\n$\r$\nClick Finish to close this wizard."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Your computer must be restarted in order to complete the uninstallation of $(^NameDA). Do you want to reboot now?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Reboot now"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "I want to manually reboot later"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Run $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Show Readme"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Finish"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Choose Start Menu Folder"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Choose a Start Menu folder for the $(^NameDA) shortcuts."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Select the Start Menu folder in which you would like to create the program's shortcuts. You can also enter a name to create a new folder."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Do not create shortcuts"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Uninstall $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Remove $(^NameDA) from your computer."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Are you sure you want to quit $(^Name) Setup?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Are you sure you want to quit $(^Name) Uninstall?"
+!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "Choose Users"
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "Choose for which users you want to install $(^NameDA)."
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "Select whether you want to install $(^NameDA) for yourself only or for all users of this computer. $(^ClickNext)"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "Install for anyone using this computer"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Install just for me"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Norwegian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Norwegian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Norwegian.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Norwegian (2068)
+;By Jonas Lindsrøm (jonasc_88@hotmail.com) Reviewed and fixed by Jan Ivar Beddari, d0der at online.no
+
+!insertmacro LANGFILE "Norwegian" "Norwegian"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Velkommen til veiviseren for installasjon av $(^NameDA) "
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Denne veiviseren vil lede deg gjennom installasjonen av $(^NameDA).$\r$\n$\r$\nDet anbefales at du avslutter alle andre programmer før du fortsetter. Dette vil la installasjonsprogrammet forandre på systemfiler uten at du må starte datamaskinen på nytt.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Velkommen til veiviseren for avinstallasjon av $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Denne veiviseren vil lede deg gjennom avinstallasjonen av $(^NameDA).$\r$\n$\r$\nFør du fortsetter må du forsikre deg om at $(^NameDA) ikke kjører.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Lisensavtale"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Vennligst les gjennom lisensavtalen før du starter installasjonen av $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Hvis du godtar lisensavtalen trykk Godta for å fortsette. Du må godta lisensavtalen for å installere $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Hvis du godtar lisensavtalen, kryss av på merket under. Du må godta lisensavtalen for å installere $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Hvis du godtar lisensavtalen, velg det første alternativet ovenfor. Du må godta lisensavtalen for å installere $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Lisensavtale"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Vennligst les gjennom lisensavtalen før du avinstallerer $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Hvis du godtar lisensavtalen trykk Godta for å fortsette.  Du må godta lisensavtalen for å avintallere $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Hvis du godtar lisensavtalen, kryss av på merket under. Du må godta lisensavtalen for å avinstallere $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Hvis du godtar lisensavtalen, velg det første alternativet ovenfor. Du må godta lisensavtalen for å avinstallere $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Trykk Page Down knappen for å se resten av lisensavtalen."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Velg komponenter"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Velg hvilke deler av $(^NameDA) du ønsker å installere."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Velg komponenter"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Velg hvilke deler av $(^NameDA) du ønsker å avinstallere."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Beskrivelse"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Beveg musen over komponentene for å se beskrivelsen."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Beveg musen over komponentene for å se beskrivelsen."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Velg installasjonsmappe"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Velg hvilken mappe du vil installere $(^NameDA) i."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Velg mappe for avinstallasjon"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Velg mappen du vil avinstallere $(^NameDA) fra."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Installasjonen pågår"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Vennligst vent mens $(^NameDA) blir installert."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Installasjonen er ferdig"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Installasjonen ble fullført uten feil."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Installasjonen er avbrutt"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Installasjonen ble ikke fullført riktig."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Avinstallasjon pågår"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Vennligst vent mens $(^NameDA) blir avinstallert."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Avinstallasjon ferdig"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Avinstallasjonen ble utført uten feil."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Avinstallasjon avbrutt"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Avinstallasjonen ble ikke utført riktig."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Avslutter $(^NameDA) installasjonsveiviser"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) er klart til bruk på din datamskin.$\r$\n$\r$\nTrykk Ferdig for å avslutte installasjonsprogrammet."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Du må starte datamaskinen på nytt for å fullføre installasjonen av $(^NameDA). Vil du starte datamaskinen på nytt nå?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Fullfører avinstallasjonen av $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) har blitt avinstallert fra din datamaskin.$\r$\n$\r$\nTrykk på ferdig for å avslutte denne veiviseren."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Datamaskinen må starte på nytt for å fullføre avinstallasjonen av $(^NameDA). Vil du starte datamaskinen på nytt nå?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Ja. Start datamaskinen på nytt nå"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Nei. Jeg vil starte datamaskinen på nytt senere"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Kjør $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Vis Readme filen"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Ferdig"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Velg plassering på startmenyen"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Velg hvilken mappe snarveiene til $(^NameDA) skal ligge i."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Velg mappe for snarveiene til programmet. Du kan også skrive inn et nytt navn for å lage en ny mappe."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Ikke lag snarveier"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Avinstaller $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Fjern $(^NameDA) fra din datamaskin."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Er du sikker på at du vil avslutte installasjonen av $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Er du sikker på at du vil avbryte avinstallasjonen av $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SimpChinese.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SimpChinese.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SimpChinese.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+2052
+# Font and size - dash (-) means default ×ÖÌåÃû³ÆÓë´óÐ¡
+ËÎÌå
+9
+# Codepage - dash (-) means ANSI code page ANSI ×ÖÂëÒ³
+936
+# RTL - anything else than RTL means LTR ÓÉÓÒÖÁ×óÊéÐ´
+-
+# Translator: Kii Ali <kiiali@cpatch.org>;Revision date: 2004-12-15
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) °²×°
+# ^UninstallCaption
+$(^Name) Ð¶ÔØ
+# ^LicenseSubCaption
+: Ðí¿ÉÖ¤Ð­Òé
+# ^ComponentsSubCaption
+: °²×°Ñ¡Ïî
+# ^DirSubCaption
+: °²×°ÎÄ¼þ¼Ð
+# ^InstallingSubCaption
+: ÕýÔÚ°²×°
+# ^CompletedSubCaption
+: ÒÑÍê³É
+# ^UnComponentsSubCaption
+: Ð¶ÔØÑ¡Ïî
+# ^UnDirSubCaption
+: Ð¶ÔØÎÄ¼þ¼Ð
+# ^ConfirmSubCaption
+: È·ÈÏ
+# ^UninstallingSubCaption
+: ÕýÔÚÐ¶ÔØ
+# ^UnCompletedSubCaption
+: Íê³É
+# ^BackBtn
+< ÉÏÒ»²½(&P)
+# ^NextBtn
+ÏÂÒ»²½(&N) >
+# ^AgreeBtn
+ÎÒ½ÓÊÜ(&I)
+# ^AcceptBtn
+ÎÒ½ÓÊÜ¡°Ðí¿ÉÖ¤Ð­Òé¡±ÖÐµÄÌõ¿î(&A)
+# ^DontAcceptBtn
+ÎÒ²»½ÓÊÜ¡°Ðí¿ÉÖ¤Ð­Òé¡±ÖÐµÄÌõ¿î(&N)
+# ^InstallBtn
+°²×°(&I)
+# ^UninstallBtn
+Ð¶ÔØ(&U)
+# ^CancelBtn
+È¡Ïû(&C)
+# ^CloseBtn
+¹Ø±Õ(&L)
+# ^BrowseBtn
+ä¯ÀÀ(&B)...
+# ^ShowDetailsBtn
+ÏÔÊ¾Ï¸½Ú(&D)
+# ^ClickNext
+µ¥»÷ [ÏÂÒ»²½(N)] ¼ÌÐø¡£
+# ^ClickInstall
+µ¥»÷ [°²×°(I)] ¿ªÊ¼°²×°½ø³Ì¡£
+# ^ClickUninstall
+µ¥»÷ [Ð¶ÔØ(U)] ¿ªÊ¼½â³ý°²×°½ø³Ì¡£
+# ^Name
+Ãû³Æ
+# ^Completed
+ÒÑÍê³É
+# ^LicenseText
+ÔÚ°²×° $(^NameDA) Ö®Ç°Çë¼ìÔÄÐí¿ÉÖ¤Ð­Òé¡£Èç¹ûÄã½ÓÊÜÐ­ÒéÖÐËùÓÐÌõ¿î£¬µ¥»÷ [ÎÒ½ÓÊÜ(I)] ¡£
+# ^LicenseTextCB
+ÔÚ°²×° $(^NameDA) Ö®Ç°Çë¼ìÔÄÐí¿ÉÖ¤Ð­Òé¡£Èç¹ûÄã½ÓÊÜÐ­ÒéÖÐËùÓÐÌõ¿î£¬µ¥»÷ÏÂ·½µÄ¹´Ñ¡¿ò¡£ $_CLICK
+# ^LicenseTextRB
+ÔÚ°²×° $(^NameDA) Ö®Ç°Çë¼ìÔÄÐí¿ÉÖ¤Ð­Òé¡£Èç¹ûÄã½ÓÊÜÐ­ÒéÖÐËùÓÐÌõ¿î£¬Ñ¡ÔñÏÂ·½µÄµÚÒ»¸öÑ¡Ïî¡£ $_CLICK
+# ^UnLicenseText
+ÔÚÐ¶ÔØ $(^NameDA) Ö®Ç°Çë¼ìÔÄÐí¿ÉÖ¤Ð­Òé¡£Èç¹ûÄã½ÓÊÜÐ­ÒéÖÐËùÓÐÌõ¿î£¬µ¥»÷ [ÎÒ½ÓÊÜ(I)] ¡£
+# ^UnLicenseTextCB
+ÔÚÐ¶ÔØ $(^NameDA) Ö®Ç°Çë¼ìÔÄÐí¿ÉÖ¤Ð­Òé¡£Èç¹ûÄã½ÓÊÜÐ­ÒéÖÐËùÓÐÌõ¿î£¬µ¥»÷ÏÂ·½µÄ¹´Ñ¡¿ò¡£ $_CLICK
+# ^UnLicenseTextRB
+ÔÚÐ¶ÔØ $(^NameDA) Ö®Ç°Çë¼ìÔÄÐí¿ÉÖ¤Ð­Òé¡£Èç¹ûÄã½ÓÊÜÐ­ÒéÖÐËùÓÐÌõ¿î£¬Ñ¡ÔñÏÂ·½µÄµÚÒ»¸öÑ¡Ïî¡£ $_CLICK
+# ^Custom
+×Ô¶¨Òå
+# ^ComponentsText
+¹´Ñ¡ÄãÏëÒª°²×°µÄ×é¼þ£¬²¢½â³ý¹´Ñ¡Äã²»Ï£Íû°²×°µÄ×é¼þ¡£ $_CLICK
+# ^ComponentsSubText1
+Ñ¡¶¨°²×°µÄÀàÐÍ: 
+# ^ComponentsSubText2_NoInstTypes
+Ñ¡¶¨°²×°µÄ×é¼þ: 
+# ^ComponentsSubText2
+»òÕß£¬×Ô¶¨ÒåÑ¡¶¨Ïë°²×°µÄ×é¼þ: 
+# ^UnComponentsText
+¹´Ñ¡ÄãÏëÒªÐ¶ÔØµÄ×é¼þ£¬²¢½â³ý¹´Ñ¡Äã²»Ï£ÍûÐ¶ÔØµÄ×é¼þ¡£ $_CLICK
+# ^UnComponentsSubText1
+Ñ¡ÔñÐ¶ÔØµÄÀàÐÍ: 
+# ^UnComponentsSubText2_NoInstTypes
+Ñ¡ÔñÒªÐ¶ÔØµÄ×é¼þ: 
+# ^UnComponentsSubText2
+»òÊÇ£¬Ñ¡ÔñÏëÒªÐ¶ÔØµÄ¿ÉÑ¡Ïî×é¼þ: 
+# ^DirText
+Setup ½«°²×° $(^NameDA) ÔÚÏÂÁÐÎÄ¼þ¼Ð¡£Òª°²×°µ½²»Í¬ÎÄ¼þ¼Ð£¬µ¥»÷ [ä¯ÀÀ(B)] ²¢Ñ¡ÔñÆäËûµÄÎÄ¼þ¼Ð¡£ $_CLICK
+# ^DirSubText
+Ä¿±êÎÄ¼þ¼Ð
+# ^DirBrowseText
+Ñ¡ÔñÒª°²×° $(^NameDA) µÄÎÄ¼þ¼ÐÎ»ÖÃ: 
+# ^UnDirText
+Setup ½«Ð¶ÔØ $(^NameDA) ÔÚÏÂÁÐÎÄ¼þ¼Ð¡£ÒªÐ¶ÔØµ½²»Í¬ÎÄ¼þ¼Ð£¬µ¥»÷ [ä¯ÀÀ(B)] ²¢Ñ¡ÔñÆäËûµÄÎÄ¼þ¼Ð¡£ $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Ñ¡ÔñÒªÐ¶ÔØ $(^NameDA) µÄÎÄ¼þ¼ÐÎ»ÖÃ: 
+# ^SpaceAvailable
+"¿ÉÓÃ¿Õ¼ä: "
+# ^SpaceRequired
+"ËùÐè¿Õ¼ä: "
+# ^UninstallingText
+Õâ¸öÏòµ¼½«´ÓÄãµÄ¼ÆËã»úÐ¶ÔØ $(^NameDA) ¡£ $_CLICK
+# ^UninstallingSubText
+Ð¶ÔØÄ¿Â¼: 
+# ^FileError
+²»ÄÜ´ò¿ªÒªÐ´ÈëµÄÎÄ¼þ: \r\n\t"$0"\r\nµ¥»÷ [Abort] ·ÅÆú°²×°£¬\r\n [Retry] ÖØÐÂ³¢ÊÔÐ´ÈëÎÄ¼þ£¬»ò\r\n [Ignore] ºöÂÔÕâ¸öÎÄ¼þ¡£
+# ^FileError_NoIgnore
+²»ÄÜ´ò¿ªÒªÐ´ÈëµÄÎÄ¼þ: \r\n\t"$0"\r\nµ¥»÷ [Retry] ÖØÐÂ³¢ÊÔÐ´ÈëÎÄ¼þ£¬»ò\r\n [Cancel] È¡Ïû°²×°¡£
+# ^CantWrite
+"ÎÞ·¨Ð´Èë: "
+# ^CopyFailed
+"¸´ÖÆÊ§°Ü "
+# ^CopyTo
+"¸´ÖÆµ½: "
+# ^Registering
+"ÕýÔÚ×¢²á: "
+# ^Unregistering
+"ÕýÔÚ½â³ý×¢²á: "
+# ^SymbolNotFound
+"ÎÞ·¨ÕÒµ½·ûºÅ: "
+# ^CouldNotLoad
+"ÎÞ·¨¼ÓÔØ: "
+# ^CreateFolder
+"´´½¨ÎÄ¼þ¼Ð: " 
+# ^CreateShortcut
+"´´½¨¿ì½Ý·½Ê½: "
+# ^CreatedUninstaller
+"´´½¨Ð¶ÔØ³ÌÐò: "
+# ^Delete
+"É¾³ýÎÄ¼þ: "
+# ^DeleteOnReboot
+"ÖØÐÂÆô¶¯ºóÉ¾³ý: "
+# ^ErrorCreatingShortcut
+"ÕýÔÚ´´½¨¿ì½Ý·½Ê½Ê±·¢Éú´íÎó: "
+# ^ErrorCreating
+"ÕýÔÚ´´½¨Ê±·¢Éú´íÎó: "
+# ^ErrorDecompressing
+"ÕýÔÚ½âÑ¹ËõÊý¾Ý·¢Éú´íÎó£¡ÒÑËð»µµÄ°²×°³ÌÐò£¿"
+# ^ErrorRegistering
+"ÕýÔÚ×¢²á DLL Ê±·¢Éú´íÎó"
+# ^ExecShell
+"ÔËÐÐÍâ²¿³ÌÐò: "
+# ^Exec
+"ÔËÐÐ: "
+# ^Extract
+"³éÈ¡: "
+# ^ErrorWriting
+"³éÈ¡: ÎÞ·¨Ð´ÈëÎÄ¼þ "
+# ^InvalidOpcode
+"°²×°Ëð»Ù: ÎÞÐ§µÄ²Ù×÷´úÂë "
+# ^NoOLE
+"Ã»ÓÐ OLE ÓÃÓÚ: "
+# ^OutputFolder
+"Êä³öÄ¿Â¼: "
+# ^RemoveFolder
+"ÒÆ³ýÄ¿Â¼: "
+# ^RenameOnReboot
+"ÖØÐÂÆô¶¯ºóÖØÃüÃû: "
+# ^Rename
+"ÖØÃüÃû: "
+# ^Skipped
+"ÒÑÌø¹ý: "
+# ^CopyDetails
+"¸´ÖÆÏ¸½Úµ½¼ôÌù°å "
+# ^LogInstall
+"ÈÕÖ¾°²×°½ø³Ì"
+# byte
+B
+# kilo
+K
+# mega
+M
+# giga
+G
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Macedonian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Macedonian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Macedonian.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Macedonian (1071)
+;By Sasko Zdravkin [wingman2083@yahoo.com]
+
+!insertmacro LANGFILE "Macedonian" "Macedonian"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Äîáðî äî¼äîâòå âî èíñòàëàöè¼àòà íà $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Îâî¼ ïðîãðàì �å âå âîäè íèç èíñòàëàöè¼àòà íà $(^NameDA).$\r$\n$\r$\nÏðåïîðà÷àíî å äà ãè çàòâîðèòå ñèòå ïðîãðàìè ïðåä äà èíñòàëèðàòå. Îâà �å äîçâîëè èíñòàëàöèîíèîò ïðîãðàì äà îáíîâè íåêîè ñèñòåìñêè äàòîòåêè áåç äà ãî ðåñòàðòèðà êîìï¼óòåðîò.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Äîáðî äî¼äîâòå âî äåèíñòàëàöè¼àòà íà $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Îâî¼ ïðîãðàì �å âå âîäè íèç äåèíñòàëàöè¼àòà íà $(^NameDA).$\r$\n$\r$\nÏðåä äà ¼à ïî÷íåòå äåèíñòàëàöè¼àòà íà $(^NameDA) ïðîâåðåòå äàëè å èñêëó÷åíà ïðîãðàìàòà.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Ëèöåíöåí Äîãîâîð"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Âå ìîëèìå ïðîâåðåòå ãè ëèöåíöíèòå óñëîâè ïðåä äà ãî èíñòàëèðàòå $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Àêî ãè ïðèôà�àòå óñëîâèòå îä äîãîâîðîò, ïðèòèñíåòå 'Äà' çà äà ïðîäîëæèòå. Ìîðà äà ãî ïðèôàòèòå äîãîâîðîò çà äà ãî èíñòàëèðàòå $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Àêî ãè ïðèôà�àòå óñëîâèòå îä äîãîâîðîò, ÷åêèðà¼òå ãî check box-îò ïîäîëå. Ìîðà äà ãî ïðèôàòèòå äîãîâîðîò çà ãî èíñòàëèðàòå $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Àêî ãè ïðèôà�àòå óñëîâèòå îä äîãîâîðîò, îäáåðåòå ¼à ïðâàòà îïöè¼à ïîäîëå. Ìîðà äà ãî ïðèôàòèòå äîãîâîðîò çà ãî èíñòàëèðàòå $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Ëèöåíöåí Äîãîâîð"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Âå ìîëèìå ïðîâåðåòå ãè ëèöåíöíèòå óñëîâè ïðåä äà ãî äåèíñòàëèðàòå $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Àêî ãè ïðèôà�àòå óñëîâèòå îä äîãîâîðîò, ïðèòèñíåòå 'Äà' çà äà ïðîäîëæèòå. Ìîðà äà ãî ïðèôàòèòå äîãîâîðîò çà äà ãî äåèíñòàëèðàòå $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Àêî ãè ïðèôà�àòå óñëîâèòå îä äîãîâîðîò, ÷åêèðà¼òå ãî check box-îò ïîäîëå. Ìîðà äà ãî ïðèôàòèòå äîãîâîðîò çà ãî äåèíñòàëèðàòå $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Àêî ãè ïðèôà�àòå óñëîâèòå îä äîãîâîðîò, îäáåðåòå ¼à ïðâàòà îïöè¼à ïîäîëå. Ìîðà äà ãî ïðèôàòèòå äîãîâîðîò çà ãî äåèíñòàëèðàòå $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Ïðèòèñíåòå 'Page Down' çà äà ãî âèäåòå îñòàíàòèîò äåë îä äîãîâîðîò."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Îäáåðåòå Êîìïîíåíòè"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Îäáåðåòå êîè ðàáîòè îä $(^NameDA) ñàêàòå äà ñå èíñòàëèðààò."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Îäáåðåòå Êîìïîíåíòè"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Îäáåðåòå êîè ðàáîòè îä $(^NameDA) ñàêàòå äà ñå äåèíñòàëèðààò."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Îá¼àñíåíèå"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Îäíåñåòå ãî êóðñîðîò äî êîìïîíåíòàòà çà äà ãî âèäåòå íå¼çèíîòî îá¼àñíåíèå."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Îäíåñåòå ãî êóðñîðîò äî êîìïîíåíòàòà çà äà ãî âèäåòå íå¼çèíîòî îá¼àñíåíèå."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Îäáåðåòå ¼à ëîêàöè¼àòà çà èíñòàëèðàœå"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Îäáåðåòå ãî äèðåêòîðèóìîò êàäå øòî ñàêàòå äà ñå èíñòàëèðà $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Îäáåðåòå ¼à ëîêàöè¼àòà çà äåèíñòàëèðàœå"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Îäáåðåòå ãî äèðåêòîðèóìîò îä êî¼ ñàêàòå äà ñå äåèíñòàëèðà $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Èíñòàëèðà"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Âå ìîëèìå ïî÷åêà¼òå äîäåêà $(^NameDA) ñå èíñòàëèðà."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Èíñòàëàöè¼àòà å çàâðøåíà"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Èíñòàëèðàœåòî áåøå óñïåøíî."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Èíñòàëàöè¼àòà å îòêàæàíà"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Èíñòàëèðàœåòî íå áåøå óñïåøíî çàâðøåíî."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Äåèíñòàëèðà"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Âå ìîëèìå ïî÷åêà¼òå äîäåêà $(^NameDA) ñå äåèíñòàëèðà."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Äåèíñòàëàöè¼àòà å çàâðøåíà"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Äåèíñòàëèðàœåòî áåøå óñïåøíî."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Äåèíñòàëàöè¼àòà å îòêàæàíà"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Äåèíñòàëèðàœåòî íå áåøå óñïåøíî çàâðøåíî."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Çàâðøóâà èíñòàëèðàœåòî íà $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) å èíñòàëèðàí íà âàøèîò êîìï¼óòåð.$\r$\n$\r$\nÏðèòèñíåòå 'Êðà¼' çà äà ãî çàòâîðèòå èíñòàëàöèîíèîò ïðîãðàì."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Âàøèîò êîìï¼óòåð ìîðà äà ñå ðåñòàðòèðà çà äà çàâðøè èíñòàëàöè¼àòà íà $(^NameDA). Äàëè ñàêàòå äà ñå ðåñòàðòèðà ñåãà?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Çàâðøóâà äåèíñòàëèðàœåòî íà $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) å äåèíñòàëèðàí îä âàøèîò êîìï¼óòåð.$\r$\n$\r$\nÏðèòèñíåòå 'Êðà¼' çà äà ãî çàòâîðèòå äåèíñòàëàöèîíèîò ïðîãðàì."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Âàøèîò êîìï¼óòåð ìîðà äà ñå ðåñòàðòèðà çà äà çàâðøè äåèíñòàëàöè¼àòà íà $(^NameDA). Äàëè ñàêàòå äà ñå ðåñòàðòèðà ñåãà?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Ðåñòàðòèðà¼ ñåãà"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Àêî ñàêàòå äà ãî ðåñòàðòèðàòå ïîäîöíà"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "Ïîê&ðåíè ãî $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Îòâîð&è 'Ïðî÷èòà¼ Ìå'"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Êðà¼"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Îäáåðåòå äèðåêòîðèóì çà Ñòàðò Ìåíèòî"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Îäáåðåòå äèðåêòîðèóì âî Ñòàðò Ìåíèòî çà êðåèðàœå ñêðàòåíèöà íà $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Îäáåðåòå ãî äèðåêòîðèóìîò âî Ñòàðò Ìåíèòî âî êî¼ ñàêàòå äà ñå êðåèðà ñêðàòåíèöà çà ïðîãðàìàòà. Èñòî òàêà ìîæåòå äà âíåñåòå äðóãî èìå çà äà ñå êðåèðà íîâ äèðåêòîðèóì."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Íå êðåèðà¼ ñêðàòåíèöà"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Äåèíñòàëèðà¼ ãî $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Îäñòðàíåòå ãî $(^NameDA) îä âàøèîò êîìï¼óòåð."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Ñèãóðíè ëè ñòå äåêà ñàêàòå äà ñå îòêàæåòå îä èíñòàëàöè¼àòà íà $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Ñèãóðíè ëè ñòå äåêà ñàêàòå äà ñå îòêàæåòå îä äåèíñòàëàöè¼àòà íà $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Polish.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Polish.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Polish.nsh	(revision 728)
@@ -0,0 +1,132 @@
+;Language: Polish (1045)
+;By Piotr Murawski & Rafa³ Lampe
+;Updated by cube and SYSTEMsoft Group
+;Updated by Pawe³ Porwisz, http://www.pepesoft.tox.pl
+;Corrected by Mateusz Gola (aka Prozac) - http://www.videopedia.pl/avirecomp
+
+!insertmacro LANGFILE "Polish" "Polski"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Witamy w kreatorze instalacji programu $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Kreator ten pomo¿e Ci zainstalowaæ program $(^NameDA).$\r$\n$\r$\nZalecane jest zamkniêcie wszystkich uruchomionych programów przed rozpoczêciem instalacji. Pozwoli to na uaktualnienie niezbêdnych plików systemowych bez koniecznoœci ponownego uruchamiania komputera.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Witamy w kreatorze deinstalacji $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Kreator poprowadzi Ciê przez proces deinstalacji $(^NameDA).$\r$\n$\r$\nPrzed rozpoczêciem deinstalacji programu, upewnij siê, czy $(^NameDA) NIE jest w³aœnie uruchomiony.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Umowa licencyjna"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Przed instalacj¹ programu $(^NameDA) zapoznaj siê z warunkami licencji."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Je¿eli akceptujesz warunki umowy, wybierz Zgadzam siê, aby kontynuowaæ. Musisz zaakceptowaæ warunki umowy, aby zainstalowaæ $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Je¿eli akceptujesz warunki umowy, zaznacz pole wyboru poni¿ej, aby kontynuowaæ. Musisz zaakceptowaæ warunki umowy, aby zainstalowaæ $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Je¿eli akceptujesz warunki umowy, wybierz pierwsz¹ opcjê poni¿ej, aby kontynuowaæ. Musisz zaakceptowaæ warunki umowy, aby zainstalowaæ $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Umowa licencyjna"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Przed deinstalacj¹ programu $(^NameDA) zapoznaj siê z warunkami licencji."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Je¿eli akceptujesz warunki umowy, wybierz Zgadzam siê, aby kontynuowaæ. Musisz zaakceptowaæ warunki umowy, aby odinstalowaæ $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Je¿eli akceptujesz warunki umowy, zaznacz pole wyboru poni¿ej, aby kontynuowaæ. Musisz zaakceptowaæ warunki umowy, aby odinstalowaæ $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Je¿eli akceptujesz warunki umowy, wybierz pierwsz¹ opcjê poni¿ej, aby kontynuowaæ. Musisz zaakceptowaæ warunki umowy, aby odinstalowaæ $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Naciœnij klawisz Page Down, aby zobaczyæ resztê umowy."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Wybierz komponenty"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Wybierz komponenty programu $(^NameDA), które chcesz zainstalowaæ."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Wybierz komponenty"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Wybierz, które elementy $(^NameDA) chcesz odinstalowaæ."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Opis"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Przesuñ kursor myszy nad komponent, aby zobaczyæ jego opis."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Przesuñ kursor myszy nad komponent, aby zobaczyæ jego opis."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Wybierz lokalizacjê dla instalacji"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Wybierz folder, w którym ma byæ zainstalowany $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Wybór miejsca deinstalacji"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Wybierz folder, z którego chcesz odinstalowaæ $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Instalacja"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Proszê czekaæ, podczas gdy $(^NameDA) jest instalowany."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Zakoñczono instalacjê"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Instalacja zakoñczona pomyœlnie."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Instalacja przerwana"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Instalacja nie zosta³a zakoñczona pomyœlnie."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Deinstalacja"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Proszê czekaæ, $(^NameDA) jest odinstalowywany."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Zakoñczono odinstalowanie"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Odinstalowanie zakoñczone pomyœlnie."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Deinstalacja przerwana"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Deinstalacja nie zosta³a zakoñczona pomyœlnie."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Koñczenie pracy kreatora instalacji $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) zosta³ pomyœlnie zainstalowany na Twoim komputerze.$\r$\n$\r$\nKliknij Zakoñcz, aby zakoñczyæ dzia³anie kreatora."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Twój komputer musi zostaæ ponownie uruchomiony, aby zakoñczyæ instalacjê programu $(^NameDA). Czy chcesz zrobiæ to teraz?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Koñczenie pracy kreatora deinstalacji $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) zosta³ odinstalowany z Twojego komputera.$\r$\n$\r$\nKliknij Zakoñcz, aby zakoñczyæ dzia³anie kreatora."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Twój komputer musi zostaæ ponownie uruchomiony w celu zakoñczenia deinstalacji programu $(^NameDA). Czy chcesz zrobiæ to teraz?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Uruchom ponownie teraz"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Sam uruchomiê ponownie komputer póŸniej"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Uruchom program $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Poka¿ plik ReadMe"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Zakoñcz"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Wybierz folder w menu Start"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Wybierz folder menu Start, w którym zostan¹ umieszczone skróty do programu"
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Wybierz folder w menu Start, w którym chcia³byœ umieœciæ skróty do programu. Mo¿esz tak¿e utworzyæ nowy folder wpisuj¹c jego nazwê."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Nie twórz skrótów"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Odinstaluj $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Usuñ $(^NameDA) z Twojego komputera."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Czy na pewno chcesz zakoñczyæ dzia³anie instalatora $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Czy na pewno chcesz przerwaæ proces deinstalacji $(^Name)?"
+!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "Wybierz u¿ytkowników"
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "Wybierz, dla których u¿ytkowników chcesz zainstalowaæ program $(^NameDA)."
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "Wybierz, czy chcesz zainstalowaæ program $(^NameDA) tylko dla siebie, czy dla wszystkich u¿ytkowników tego komputera. $(^ClickNext)"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "Zainstaluj dla wszystkich u¿ytkowników tego komputera"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Zainstaluj tylko dla mnie"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Slovak.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Slovak.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Slovak.nsh	(revision 728)
@@ -0,0 +1,133 @@
+;Language: Slovak (1051)
+;Translated by:
+;  Kypec (peter.dzugas@mahe.sk)
+;edited by:
+;  Marián Hikaník (podnety@mojepreklady.net)
+;  Ivan Masár <helix84@centrum.sk>, 2008.
+
+!insertmacro LANGFILE "Slovak" "Slovensky"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Vitajte v sprievodcovi inštaláciou programu $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Tento sprievodca vás prevedie inštaláciou $(^NameDA).$\r$\n$\r$\nPred zaèiatkom inštalácie sa odporúèa ukonèi� všetky ostatné programy. Tým umožníte aktualizovanie systémových súborov bez potreby reštartovania vášho poèítaèa.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Vitajte v sprievodcovi odinštalovaním programu $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Tento sprievodca vás prevedie procesom odinštalovania programu $(^NameDA).$\r$\n$\r$\nPred spustením procesu odinštalovania sa uistite, že program $(^NameDA) nie je práve aktívny.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Licenèná zmluva"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Pred inštaláciou $(^NameDA) si prosím preštudujte licenèné podmienky."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Ak súhlasíte s podmienkami zmluvy, kliknite na tlaèidlo Súhlasím a môžete pokraèova� v inštalácii. Ak chcete v inštalácii pokraèova�, musíte odsúhlasi� podmienky licenènej zmluvy $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Ak súhlasíte s podmienkami zmluvy, zaškrtnite nižšie uvedené políèko. Ak chcete v inštalácii pokraèova�, musíte odsúhlasi� podmienky licenènej zmluvy $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Ak súhlasíte s podmienkami zmluvy, oznaète prvú z nižšie uvedených možností. Ak chcete v inštalácii pokraèova�, musíte odsúhlasi� podmienky licenènej zmluvy $(^NameDA)."
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Licenèná zmluva"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Pred odinštalovaním programu $(^NameDA) si prosím preèítajte licenèné podmienky."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Ak súhlasíte s podmienkami zmluvy, zvo¾te Súhlasím. Licenènú zmluvu musíte odsúhlasi�, ak chcete v odinštalovaní programu $(^NameDA) pokraèova�."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Ak súhlasíte s podmienkami zmluvy, zaškrtnite nižšie uvedené políèko. Licenènú zmluvu musíte odsúhlasi�, ak chcete pokraèova� v odinštalovaní programu $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Ak súhlasíte s podmienkami licenènej zmluvy, oznaète prvú z nižšie uvedených možností. Licenènú zmluvu musíte odsúhlasi�, ak chcete pokraèova� v odinštalovaní programu $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Stlaèením klávesu Page Down posuniete text licenènej zmluvy."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Vo¾ba súèastí programu"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Zvo¾te si tie súèasti programu $(^NameDA), ktoré chcete nainštalova�."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Vo¾ba súèastí"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Zvo¾te súèasti programu $(^NameDA), ktoré chcete odinštalova�."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Popis"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Pri prejdení kurzorom myši nad názvom súèasti sa zobrazí jej popis."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Pri prejdení kurzorom myši nad názvom súèasti sa zobrazí jej popis."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Vo¾ba umiestnenia programu"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Vyberte si prieèinok, do ktorého chcete nainštalova� program $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Umiestenie programu pre odinštalovanie"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Vyberte si prieèinok, z ktorého chcete odinštalova� program $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Inštalácia"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Poèkajte prosím, kým prebehne inštalácia programu $(^NameDA)."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Ukonèenie inštalácie"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Inštalácia bola dokonèená úspešne."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Prerušenie inštalácie"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Inštaláciu sa nepodarilo dokonèi�."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Odinštalovanie"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Èakajte prosím, kým prebehne odinštalovanie programu $(^NameDA)."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Ukonèenie odinštalovania"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Odinštalovanie bolo úspešne dokonèené."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Prerušenie odinštalovania"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Odinštalovanie sa neukonèilo úspešne."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Dokonèenie inštalácie programu $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Program $(^NameDA) bol nainštalovaný do vášho poèítaèa.$\r$\nKliknite na tlaèidlo Dokonèi� a tento sprievodca sa ukonèí."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Pre úplné dokonèenie inštalácie programu $(^NameDA) je potrebné reštartova� váš poèítaè. Chcete ho reštartova� ihneï?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Dokonèenie sprievodcu odinštalovaním"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "Program $(^NameDA) bol odinštalovaný z vášho poèítaèa.$\r$\n$\r$\nKliknite na tlaèidlo Dokonèi� a tento sprievodca sa ukonèí."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Pre úplné dokonèenie odinštalovania programu $(^NameDA) je nutné reštartova� váš poèítaè. Chcete ho reštartova� ihneï?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Reštartova� teraz"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Reštartova� neskôr (manuálne)"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Spusti� program $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Zobrazi� súbor s informáciami"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Dokonèi�"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Vo¾ba umiestnenia v ponuke Štart"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Vyberte si prieèinok v ponuke Štart, kam sa umiestnia odkazy na program $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Vyberte si prieèinok v ponuke Štart, v ktorom chcete vytvori� odkazy na program. Takisto môžete napísa� názov nového prieèinka."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Nevytvára� odkazy"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Odinštalovanie programu $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Odstránenie programu $(^NameDA) z vášho poèítaèa."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Naozaj chcete ukonèi� inštaláciu programu $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Naozaj chcete ukonèi� proces odinštalovania programu $(^Name)?"
+!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "Vybra� používate¾ov"
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "Vyberte pre ktorých používate¾ov chcete nainštalova� $(^NameDA)."
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "Vyberte, èi chcete nainštalova� program $(^NameDA) iba pre seba alebo pre všetkých používate¾ov tohto poèítaèa. $(^ClickNext)"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "Nainštalova� pre všetkých používate¾ov tohto poèítaèa"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Nainštalova� iba pre mòa"
+!endif
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Kurdish.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Kurdish.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Kurdish.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID (none exists for Kurdish at this time)
+9999
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+-
+# RTL - anything else than RTL means LTR
+-
+# Translation by Rêzan Tovjîn(chagy) (retovjin@hotmail.com.com)
+# ^Branding
+Nullsoft Pergala Sazkirinê %s
+# ^SetupCaption
+$(^Name) Sazkirin
+# ^UninstallCaption
+$(^Name) Rakirin
+# ^LicenseSubCaption
+: Peymana Lîsansê
+# ^ComponentsSubCaption
+: Vebijêrkên Sazkirinê
+# ^DirSubCaption
+: Peldanka Sazkirinê
+# ^InstallingSubCaption
+: Tê Sazkirin
+# ^CompletedSubCaption
+: Qediya
+# ^UnComponentsSubCaption
+: Vebijêrkên Rakirinê
+# ^UnDirSubCaption
+: Peldanka Rakirinê
+# ^ConfirmSubCaption
+: Erêkirin
+# ^UninstallingSubCaption
+: Tê Rakirin
+# ^UnCompletedSubCaption
+: Qediya
+# ^BackBtn
+< &Vegere
+# ^NextBtn
+&Bidomîne >
+# ^AgreeBtn
+&Ez Dipejirînim
+# ^AcceptBtn
+Þertên Peymanê &Dipejirînim
+# ^DontAcceptBtn
+Þertên Peymanê Napejirînim
+# ^InstallBtn
+&Saz Bike
+# ^UninstallBtn
+&Rake
+# ^CancelBtn
+Betal
+# ^CloseBtn
+&Bigire
+# ^BrowseBtn
+&Çavlêgerîn...
+# ^ShowDetailsBtn
+Hûragahiyan &Nîþan Bide
+# ^ClickNext
+Ji bo berdewamê 'Bidomîne'yê bitikîne.
+# ^ClickInstall
+Ji bo destpêka sazkirinê 'Saz Bike'yê bitikîne.
+# ^ClickUninstall
+Ji bo destpêka rakirinê 'Rake' bitikîne.
+# ^Name
+nav
+# ^Completed
+Qediya
+# ^LicenseText
+Ji kerema xwe re berî tu bernameya $(^NameDA) saz bikî, çavekî li peymana lîsansê bigerîne. Heke tu hemû þertên peymanê dipejirînî, 'Ez Dipejirînim'ê bitikîne.
+# ^LicenseTextCB
+Ji kerema xwe re berî tu bernameya $(^NameDA) saz bikî, çavekî li peymana lîsansê bigerîne. Heke tu hemû þertan dipejirînî, zeviya erêkirinê ya jêrîn dagire. $_CLICK
+# ^LicenseTextRB
+Ji kerema xwe re berî tu bernameya $(^NameDA) saz bikî çavekî li peymana lîsansê bigerîne. Heke tu hemû þertên peymanê dipejirînî, zeviya vebijêrkê ya jêrîn dagire. $_CLICK
+# ^UnLicenseText
+Ji kerema xwe re berî tu bernameya $(^NameDA) rakî, çavekî li peymana lîsansê bigerîne. Heke tu hemû þertên peymanê dipejirînî, 'Ez Dipejirînim'ê bitikîn.
+# ^UnLicenseTextCB
+Ji kerema xwe re berî tu bernameya $(^NameDA) ji pergala xwe rakî, çavekî li peymana lîsansê bigerîne. Heke tu hemû þertên peymanê dipejirînî, zeviya jêrîn a erêkirinê dagire. $_CLICK
+# ^UnLicenseTextRB
+Ji kerema xwe re berî tu bernameya $(^NameDA) ji pergala xwe rakî, çavekî li peymana lîsansê bigerîne. Heke tu hemû þertên peymanê dipejirînî, zeviya vebijêrkê ya jêrîn dagire. $_CLICK
+# ^Custom
+Taybet
+# ^ComponentsText
+Beþên tu dixwazî saz bikî hilbijêre û niqirên 'check' beþên tu naxwazî werin sazkirin rake. $_CLICK
+# ^ComponentsSubText1
+Awayê sazkirinê hilbijêre:
+# ^ComponentsSubText2_NoInstTypes
+Beþên dê werin sazkirin hilbijêre:
+# ^ComponentsSubText2
+an jî, beþên beþên tu dixwazî werin sazkirin hilbijêre:
+# ^UnComponentsText
+Beþên tu dixwazî rakî hilbijêre, an jî niqira 'check'a ber beþên tu daxwazî were rakirin, rake. $_CLICK
+# ^UnComponentsSubText1
+Awayê rakirinê hilbijêre:
+# ^UnComponentsSubText2_NoInstTypes
+Beþên dê werin rakirin hilbijêre:
+# ^UnComponentsSubText2
+an jî beþên tu dixwazî werin rakirin hilbijêre:
+# ^DirText
+$(^NameDA) dê ji aliyê sazkirinê ve li peldanka jêrîn were sazkirin. Ji bo tu li peldankeke din saz bikî 'Çavlêgerîn'ê bitikîne û peldankeke din hilbijêre. $_CLICK
+# ^DirSubText
+Peldanka Armanckirî
+# ^DirBrowseText
+Peldanka tu dixwazî bernameya $(^NameDA) lê were sazkirin hilbijêre:
+# ^UnDirText
+$(^NameDA) dê ji aliyê sazkirinê ve ji peldanka jêrîn were rakirin. Ji bo tu ji peldankeke cuda rakî 'Çavlêgerîn'ê bitikîne û peldankeke din hilbijêre. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Peldanka tu dixwazî bernameya $(^NameDA) jê were rakirin hilbijêre:
+# ^SpaceAvailable
+"Herêma vala ku dikare were bikaranîn: "
+# ^SpaceRequired
+"Herêma vala ya pêwist: "
+# ^UninstallingText
+Bernameya $(^NameDA) dê ji peldanka jêrîn were rakirin. $_CLICK
+# ^UninstallingSubText
+tê rakirin:
+# ^FileError
+Dosya ji bo nivîsandinê venebû: \r\n\t"$0"\r\nJi bo destjêberdana sazkirinê abort'ê bitikîne,\r\nji bo ceribandina ji nû ve  retry'ê , an jî\r\nji bo tu dosiyê tune bihesibînî û berdewam bikî ignore'yê bitikîne
+# ^FileError_NoIgnore
+Dosya ji bo nivîsandinê vebenebû: \r\n\t"$0"\r\nJi bo nivîsandina ji nû ve retry'yê, an jî\r\nJi bo destjêberdana sazkirinê abort'ê hilbijêre
+# ^CantWrite
+"Nehate Nivîsandin: "
+# ^CopyFailed
+Çewtiya Jibergirtinê
+# ^CopyTo
+"Ji Ber Bigire "
+# ^Registering
+"Tê Tomarkirin: "
+# ^Unregistering
+"Tomarî Tê Jêbirin: "
+# ^SymbolNotFound
+"Dawêr Nehate Dîtin: "
+# ^CouldNotLoad
+"Nehate Barkirin: "
+# ^CreateFolder
+"Peldankê Çêke: "
+# ^CreateShortcut
+"Kineriyê Çêke: "
+# ^CreatedUninstaller
+"Sêrbazê Rakirinê Hate Çêkirin: "
+# ^Delete
+"Dosyayê Jê Bibe: "
+# ^DeleteOnReboot
+"Dema ji nû ve dest pê kir dosiyê jê bibe: "
+# ^ErrorCreatingShortcut
+"Dema çêkirina kineriyê çewtî derket: "
+# ^ErrorCreating
+"Çewtiya çêkirinê: "
+# ^ErrorDecompressing
+Di dema vekirina daneyan de çewtî derket! Sazkirina Çewt?
+# ^ErrorRegistering
+Çewtiya tomariya DLL
+# ^ExecShell
+"Qalikê Xebatê: "
+# ^Exec
+"Bixebitîne: "
+# ^Extract
+"Veke: "
+# ^ErrorWriting
+"Veke: Dema li dosiyê hate nivîsîn çewtiyek derket "
+# ^InvalidOpcode
+Sazkirina Xirabe: koda nerast pêkanînê
+# ^NoOLE
+"OLE nehate dîtin: "
+# ^OutputFolder
+"Peldanka derketinê: "
+# ^RemoveFolder
+"Peldankê jê bibe: "
+# ^RenameOnReboot
+"Dema ji nû hate destpêkirin ji nû ve bi nav bike: "
+# ^Rename
+"Nav Biguhere: "
+# ^Skipped
+"Hate gavkirin: "
+# ^CopyDetails
+Hûragahiyan li Pano'yê binivîse
+# ^LogInstall
+Pêkanîna sazkirinê li lênûska rewþê binivîse
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Portuguese.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Portuguese.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Portuguese.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Portuguese (2070)
+;By Ramon <ramon@netcabo.pt>
+
+!insertmacro LANGFILE "Portuguese" "Português"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Bem vindo ao Assistente de Instalação do $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Este assistente ajudá-lo-á durante a instalação do $(^NameDA).$\r$\n$\r$\nÉ recomendado que feche todas as outras aplicações antes de iniciar a Instalação. Isto permitirá que o Instalador actualize ficheiros relacionados com o sistema sem necessidade de reiniciar o computador.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Bem vindo ao Assistente de desinstalação do $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Este assistente ajudá-lo-á durante a desinstalação do $(^NameDA).$\r$\n$\r$\nAntes de iniciar a desinstalação, certifique-se de que o $(^NameDA) não está em execução.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Contrato de Licença"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Por favor, verifique os termos da licença antes de instalar o $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Se aceitar os termos da licença, clique em 'Aceito' para continuar. Deverá aceitar o contrato para instalar o $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Se aceitar os termos da licença, clique na caixa de seleção abaixo. Deverá aceitar o contrato para instalar o $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Se aceitar os termos da licença, selecione a primeira opção abaixo. Você deve aceitar o contrato para instalar o $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Contrato de Licença"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Por favor, verifique os termos da licença antes de desinstalar o $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Se aceitar os termos da licença, clique em 'Aceito' para continuar. Deverá aceitar o contrato para desinstalar o $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Se aceitar os termos da licença, clique na caixa de seleção abaixo. Deverá aceitar o contrato para desinstalar o $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Se aceitar os termos da licença, selecione a primeira opção abaixo. Você deve aceitar o contrato para desinstalar o $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Tecle Page Down para ver o restante da licença."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Escolha de Componentes"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Escolha quais as características do $(^NameDA) que deseja instalar."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Escolher Componentes"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Escolha quais as características do $(^NameDA) que deseja desinstalar."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Descrição"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Posicione o rato sobre um componente para ver a sua descrição."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Posicione o rato sobre um componente para ver a sua descrição."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Escolha do Local da Instalação"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Escolha a pasta na qual deseja instalar o $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Escolha o Local de desinstalação"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Escolha a pasta de onde pretende desinstalar o $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Instalando"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Por favor, aguarde enquanto o $(^NameDA) está sendo instalado."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Instalação Completa"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "A instalação foi concluída com sucesso."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Instalação Abortada"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "A instalação não foi concluída com sucesso."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Desinstalando"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Por favor, aguarde enquanto o $(^NameDA) está sendo desinstalado."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Desinstalação Completa"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "A desinstalação foi concluída com sucesso."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Desinstalação Abortada"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "A desinstalação não foi concluída com sucesso"
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Concluindo o Assistente de Instalação do $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) foi instalado no seu computador.$\r$\n$\r$\nClique em Terminar para fechar este assistente."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "O seu computador deve ser reiniciado para concluír a instalação do $(^NameDA). Deseja reiniciar agora?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Concluíndo o assistente de desisntalação do $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) foi removido do seu computador.$\r$\n$\r$\nClique em Terminar para fechar este assistente."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "O seu computador deve ser reiniciado para concluír a desinstalação do $(^NameDA). Deseja reiniciar agora?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Reiniciar Agora"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Eu quero reiniciar manualmente depois"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Executar $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Mostrar Leiame"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Terminar"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Escolha uma Pasta do Menu Iniciar"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Escolha uma pasta do Menu Iniciar para os atalhos do programa."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Selecione uma pasta do Menu Iniciar em que deseja criar os atalhos do programa. Você pode também digitar um nome para criar uma nova pasta. "
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Não criar atalhos"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Desinstalar $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Remover o $(^NameDA) do seu computador."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Deseja realmente cancelar a instalação do $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Deseja realmente cancelar a desinstalação do $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SerbianLatin.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SerbianLatin.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/SerbianLatin.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+2074
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1250
+# RTL - anything else than RTL means LTR
+-
+# Translation by Srðan Obuæina <obucina@srpskijezik.edu.yu>
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) Instalacija
+# ^UninstallCaption
+$(^Name) Deinstalacija
+# ^LicenseSubCaption
+: Dogovor o pravu korišæenja
+# ^ComponentsSubCaption
+: Opcije instalacije
+# ^DirSubCaption
+: Izbor foldera za instalaciju
+# ^InstallingSubCaption
+: Instalacija
+# ^CompletedSubCaption
+: Završena instalacija
+# ^UnComponentsSubCaption
+: Opcije deinstalacije
+# ^UnDirSubCaption
+: Izbor foldera za deinstalaciju
+# ^ConfirmSubCaption
+: Potvrðivanje
+# ^UninstallingSubCaption
+: Deinstalacija
+# ^UnCompletedSubCaption
+: Završena deinstalacija
+# ^BackBtn
+< Nazad
+# ^NextBtn
+Napred >
+# ^AgreeBtn
+Prihvatam
+# ^AcceptBtn
+Prihvatam uslove dogovora o pravu korišæenja
+# ^DontAcceptBtn
+Ne prihvatam uslove dogovora o pravu korišæenja
+# ^InstallBtn
+Instaliraj
+# ^UninstallBtn
+Deinstaliraj
+# ^CancelBtn
+Odustani
+# ^CloseBtn
+Zatvori
+# ^BrowseBtn
+Izbor...
+# ^ShowDetailsBtn
+Detalji
+# ^ClickNext
+Pritisnite dugme „Napred“ za nastavak.
+# ^ClickInstall
+Pritisnite dugme „Instaliraj“ za poèetak instalacije.
+# ^ClickUninstall
+Pritisnite dugme „Deinstaliraj“ za poèetak deinstalacije.
+# ^Name
+Ime
+# ^Completed
+Završeno
+# ^LicenseText
+Pažlivo proèitajte dogovor o pravu korišæenja pre instalacije programa $(^NameDA). Ako prihvatate sve uslove dogovora, pritisnite dugme „Prihvatam“.
+# ^LicenseTextCB
+Pažlivo proèitajte dogovor o pravu korišæenja pre instalacije programa $(^NameDA). Ako prihvatate sve uslove dogovora, obeležite kvadratiæ ispod. $_CLICK
+# ^LicenseTextRB
+Pažlivo proèitajte dogovor o pravu korišæenja pre instalacije programa $(^NameDA). Ako prihvatate sve uslove dogovora, izaberite prvu opciju ispod. $_CLICK
+# ^UnLicenseText
+Pažlivo proèitajte dogovor o pravu korišæenja pre deinstalacije programa $(^NameDA). Ako prihvatate sve uslove dogovora, pritisnite dugme „Prihvatam“.
+# ^UnLicenseTextCB
+Pažlivo proèitajte dogovor o pravu korišæenja pre deinstalacije programa $(^NameDA). Ako prihvatate sve uslove dogovora, obeležite kvadratiæ ispod. $_CLICK
+# ^UnLicenseTextRB
+Pažlivo proèitajte dogovor o pravu korišæenja pre deinstalacije programa $(^NameDA). Ako prihvatate sve uslove dogovora, izaberite prvu opciju ispod. $_CLICK
+# ^Custom
+Prilagoðavanje
+# ^ComponentsText
+Izaberite komponente za instalaciju. Instaliraju se samo oznaèene komponente. $_CLICK
+# ^ComponentsSubText1
+Izaberite tip instalacije:
+# ^ComponentsSubText2_NoInstTypes
+Izaberite komponente za instalaciju: 
+# ^ComponentsSubText2
+Ili, izaberite opcione komponente koje želite da instalirate: 
+# ^UnComponentsText
+Izaberite komponente za deinstalaciju. Deinstaliraju se samo oznaèene komponente. $_CLICK
+# ^UnComponentsSubText1
+Izaberite tip deinstalacije: 
+# ^UnComponentsSubText2_NoInstTypes
+Izaberite komponente za deinstalaciju: 
+# ^UnComponentsSubText2
+Ili, izaberite opcione komponente koje želite da deinstalirate: 
+# ^DirText
+Program $(^NameDA) æe biti instaliran u navedeni folder. Za instalaciju u drugi folder pritisnite dugme „Izbor...“ i izaberite folder. $_CLICK
+# ^DirSubText
+Folder
+# ^DirBrowseText
+Izaberite folder u koji æete instalirati program $(^NameDA):
+# ^UnDirText
+Program $(^NameDA) æe biti deinstaliran iz navedenog foldera. Za deinstalaciju iz drugog foldera pritisnite dugme „Izbor...“ i izaberite folder. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Izaberite folder iz koga æete deinstalirati program $(^NameDA):
+# ^SpaceAvailable
+"Slobodan prostor: "
+# ^SpaceRequired
+"Potreban prostor: "
+# ^UninstallingText
+Program $(^NameDA) æe biti deinstaliran iz navedenog foldera. $_CLICK
+# ^UninstallingSubText
+Deinstalacija iz: 
+# ^FileError
+Greška pri otvaranju fajla za pisanje: \r\n\t"$0"\r\nPritisnite dugme „Odustani“ za prekid instalacije,\r\n„Ponovi“ za ponovni pokušaj pisanja u fajl, ili\r\n„Ignoriši“ za preskakanje ovog fajla.
+# ^FileError_NoIgnore
+Greška pri otvaranju fajla za pisanje: \r\n\t"$0"\r\nPritisnite dugme „Ponovi“ za ponovni pokušaj pisanja u fajl, ili\r\n„Odustani“ za prekid instaliranja.
+# ^CantWrite
+"Nemoguæe pisanje: "
+# ^CopyFailed
+Neuspešno kopiranje
+# ^CopyTo
+"Kopiranje u "
+# ^Registering
+"Registrovanje: "
+# ^Unregistering
+"Deregistrovanje: "
+# ^SymbolNotFound
+"Simbol nije naðen: "
+# ^CouldNotLoad
+"Nemoguæe uèitavanje: "
+# ^CreateFolder
+"Kreiranje foldera: "
+# ^CreateShortcut
+"Kreiranje preèice: "
+# ^CreatedUninstaller
+"Kreiranje deinstalera: "
+# ^Delete
+"Brisanje fajla: "
+# ^DeleteOnReboot
+"Brisanje pri restartu: "
+# ^ErrorCreatingShortcut
+"Greška pri kreiranju preèice: "
+# ^ErrorCreating
+"Greška pri kreiranju: "
+# ^ErrorDecompressing
+Greška pri otpakivanju podataka! Ošteæen instalacioni program?
+# ^ErrorRegistering
+Greška pri registrovanju biblioteke
+# ^ExecShell
+"Izvršavanje u okruženju: "
+# ^Exec
+"Izvršavanje: "
+# ^Extract
+"Otpakivanje: "
+# ^ErrorWriting
+"Otpakivanje: greška pri upisu u fajl "
+# ^InvalidOpcode
+Ošteæen instalacioni program: neispravna komanda 
+# ^NoOLE
+"Nema OLE podrške za: "
+# ^OutputFolder
+"Izlazni folder: "
+# ^RemoveFolder
+"Brisanje foldera: "
+# ^RenameOnReboot
+"Preimenovanje pri restartu: "
+# ^Rename
+"Preimenovan: "
+# ^Skipped
+"Preskoèen: "
+# ^CopyDetails
+Kopiraj detalje u klipbord
+# ^LogInstall
+Vodi zapisnik o procesu instalacije
+# ^Byte
+B
+# ^Kilo
+k
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Farsi.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Farsi.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Farsi.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Farsi (1065)
+;By FzerorubigD - FzerorubigD@gmail.com - Thanx to all people help me in forum.persiantools.com
+
+!insertmacro LANGFILE "Farsi" "Farsi"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Èå ÈÑäÇãå äÕÈ  $(^NameDA) ÎæÔ ÂãÏíÏ."
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Çíä ÈÑäÇãå ÔãÇ ÑÇ ÏÑ äÕÈ  $(^NameDA) íÇÑí ãíßäÏ.$\r$\n$\r$\nÊæÕíå ãíßäíã ßáíå ÈÑäÇãå åÇí ÏÑ ÍÇá ÇÌÑÇ ÑÇ ÈÈäÏíÏ. Çíä Èå ÈÑäÇãå äÕÈ ÇÌÇÒå ãíÏåÏ ßå ÝÇíáåÇí áÇÒã ÑÇ ÈÏæä äíÇÒ Èå ÑÇå ÇäÏÇÒí ÏæÈÇÑå ßÇã�íæÊÑ ÔãÇ Èå ÑæÒ ßäÏ.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Èå ÈÑäÇãå ÍÐÝ $(^NameDA) ÎæÔ ÂãÏíÏ."
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT " Çíä ÈÑäÇãå ÈÑÇí ÍÐÝ $(^NameDA) Èå ÔãÇ ßãß ãíßäÏ.$\r$\n$\r$\nÞÈá ÇÒ ÍÐÝ  $(^NameDA) ãØãÆä ÔæíÏ Çíä ÈÑäÇãå ÏÑ ÍÇá ÇÌÑÇ äÈÇÔÏ.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "ÊæÇÝÞäÇãå äÕÈ"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "áØÝÇ �íÔ ÇÒ äÕÈ $(^NameDA) ãÝÇÏ ÊæÇÝÞäÇãå ÑÇ ãÑæÑ ßäíÏ."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Ç�Ñ ßáíå ÈäÏåÇí ÊæÇÝÞäÇãå ÑÇ ÞÈæá ÏÇÑíÏ Ïßãå ãæÇÝÞã ÑÇ ÈÝÔÇÑíÏ. ÈÑÇí äÕÈ  $(^NameDA) ÔãÇ ÈÇíÓÊ Çíä ÊæÇÝÞäÇãå ÑÇ ÞÈæá ßäíÏ."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Ç�Ñ ßáíå ÈäÏåÇí ÊæÇÝÞäÇãå ÑÇ ÞÈæá ÏÇÑíÏ Êíß ÒíÑ ÑÇ ÇäÊÎÇÈ ßäíÏ. ÈÑÇí äÕÈ  $(^NameDA) ÔãÇ ÈÇíÓÊ Çíä ÊæÇÝÞäÇãå ÑÇ ÞÈæá ßäíÏ. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Ç�Ñ ßáíå ÈäÏåÇí ÊæÇÝÞäÇãå ÑÇ ÞÈæá ÏÇÑíÏ �Òíäå Çæá ÑÇ ÇäÊÎÇÈ ßäíÏ. ÈÑÇí äÕÈ  $(^NameDA) ÔãÇ ÈÇíÓÊ Çíä ÊæÇÝÞäÇãå ÑÇ ÞÈæá ßäíÏ. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "ÊæÇÝÞäÇãå ÍÐÝ"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "áØÝÇ ßáíå ÈäÏåÇí Çíä ÊæÇÝÞäÇãå ÑÇ ÞÈá ÇÑ ÍÐÝ $(^NameDA) ãÑæÑ ßäíÏ."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Ç�Ñ ßáíå ÈäÏåÇí ÊæÇÝÞäÇãå ÑÇ ÞÈæá ÏÇÑíÏ Ïßãå ãæÇÝÞã ÑÇ ÈÝÔÇÑíÏ. ÈÑÇí ÍÐÝ $(^NameDA) ÔãÇ ÈÇíÓÊ Çíä ÊæÇÝÞäÇãå ÑÇ ÞÈæá ßäíÏ."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Ç�Ñ ßáíå ÈäÏåÇí ÊæÇÝÞäÇãå ÑÇ ÞÈæá ÏÇÑíÏ Êíß ÒíÑ ÑÇ ÇäÊÎÇÈ ßäíÏ. ÈÑÇí ÍÐÝ $(^NameDA) ÔãÇ ÈÇíÓÊ Çíä ÊæÇÝÞäÇãå Ñ ÞÈæá ßäíÏ. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Ç�Ñ ßáíå ÈäÏåÇí ÊæÇÝÞäÇãå ÑÇ ÞÈæá ÏÇÑíÏ �Òíäå Çæá ÑÇ ÇäÊÎÇÈ ßäíÏ. ÈÑÇí ÍÐÝ $(^NameDA) ÔãÇ ÈÇíÓÊ Çíä ÊæÇÝÞäÇãå Ñ ÞÈæá ßäíÏ. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "ÈÑÇí ÏíÏä ãÊä Èå ÕæÑÊ ßÇãá ÇÒ ßáíÏ Page Down ÇÓÊÝÇÏå ßäíÏ."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "ÇäÊÎÇÈ ÇÌÒÇí ÈÑäÇãå "
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "ÇÌÒÇíí ÇÒ  $(^NameDA) ßå ãíÎæÇåíÏ äÕÈ ÔæäÏ ÑÇ ÇäÊÎÇÈ ßäíÏ."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "ÇäÊÎÇÈ ÇÌÒÇí ÈÑäÇãå"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "ÇÌÒÇíí ÇÒ $(^NameDA) ÑÇ ßå ãíÎæÇåíÏ ÍÐÝ ßäíÏ ÇäÊÎÇÈ ßäíÏ."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "ÊæÖíÍÇÊ"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "äÔÇä�Ñ ãÇæÓ ÑÇ ÈÑ Ñæí  ÇÌÒÇíí ßå ãíÎæÇåíÏ ÈÈÑíÏ ÊÇ ÊæÖíÍÇÊ Âä ÑÇ ÈÈíäíÏ."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "äÔÇä�Ñ ãÇæÓ ÑÇ ÈÑ Ñæí  ÇÌÒÇíí ßå ãíÎæÇåíÏ ÈÈÑíÏ ÊÇ ÊæÖíÍÇÊ Âä ÑÇ ÈÈíäíÏ."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "ÇäÊÎÇÈ �æÔå äÕÈ"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "�æÔå Çí ßå ãíÎæÇåíÏ  $(^NameDA) ÏÑ Âä äÕÈ ÔæÏ ÑÇ ÇäÊÎÇÈ ßäíÏ."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "�æÔå ÍÐÝ ÑÇ ÇäÊÎÇÈ ßäíÏ"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "�æÔå Çí ßå ãíÎæÇåíÏ $(^NameDA) ÑÇ ÇÒ Âä ÍÐÝ ßäíÏ ÇäÊÎÇÈ ßäíÏ."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "äÕÈ ÈÑäÇãå"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "áØÝÇ ãÏÊ ÒãÇäí ßå  $(^NameDA) ÏÑ ÍÇá äÕÈ ÇÓÊ ÑÇ ÕÈÑ ßäíÏ."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "äÕÈ �ÇíÇä íÇÝÊ"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "ÈÑäÇãå äÕÈ ÈÇ ãæÝÞíÊ �ÇíÇä íÇÝÊ."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "ÈÑäÇãå äÕÈ áÛæ ÔÏ."
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "ÈÑäÇãå äÕÈ Èå ÕæÑÊ äíãå ÊãÇã �ÇíÇä íÇÝÊ."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "ÍÐÝ ÈÑäÇãå"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "áØÝÇ ãÏÊ ÒãÇäí ßå  $(^NameDA) ÏÑ ÍÇá ÍÐÝ ÇÓÊ ÑÇ ÕÈÑ ßäíÏ."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "ÍÐÝ �ÇíÇä íÇÝÊ"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "ÈÑäÇãå ÍÐÝ ÈÇ ãæÝÞíÊ �ÇíÇä íÇÝÊ."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "ÈÑäÇãå ÍÐÝ áÛæ ÔÏ"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "ÈÑäÇãå ÍÐÝ Èå ÕæÑÊ äíãå ÊãÇã �ÇíÇä íÇÝÊ"
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "ÈÑäÇãå äÕÈ  $(^NameDA) �ÇíÇä íÇÝÊ"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) ÈÑ Ñæí ßÇã�íæÊÑ ÔãÇ äÕÈ ÔÏ.$\r$\n$\r$\nÈÑ Ñæí Ïßãå �ÇíÇä ÈÑÇí ÎÑæÌ ÇÒ Çíä ÈÑäÇãå ßáíß ßäíÏ."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "ßÇã�íæÊÑ ÔãÇ ÈÑÇí Êßãíá äÕÈ $(^NameDA) ÈÇíÓÊí ÏæÈÇÑå ÑÇå ÇäÏÇÒí ÔæÏ. ÂíÇ ãíÎæÇåíÏ Çíä ßÇÑ ÑÇ ÇáÇä ÇäÌÇã ÏåíÏ¿"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "ÈÑäÇãå ÍÐÝ $(^NameDA) �ÇíÇä íÇÝÊ"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) ÇÒ Ñæí ßÇã�íæÊÑ ÔãÇ ÍÐÝ ÔÏ.$\r$\n$\r$\nÈÑ Ñæí Ïßãå �ÇíÇä ÈÑÇí ÎÑæÌ ÇÒ Çíä ÈÑäÇãå ßáíß ßäíÏ."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "ßÇã�íæÊÑ ÔãÇ ÈÑÇí Êßãíá ÍÐÝ$(^NameDA) ÈÇíÓÊ ÏæÈÇÑå ÑÇå ÇäÏÇÒí ÔæÏ.ÂíÇ ãíÎæÇåíÏ Çíä ßÇÑ ÑÇ ÇáÇä ÇäÌÇã ÏåíÏ¿"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "ÑÇå ÇäÏÇÒí ãÌÏÏ."
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "ãä ÎæÏã Çíä ßÇÑ ÑÇ ÇäÌÇã ÎæÇåã ÏÇÏ."
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&ÇÌÑÇí  $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&äãÇíÔ ÝÇíá ÊæÖíÍÇÊ"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&�ÇíÇä"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "ÇäÊÎÇÈ �æÔå ÏÑ ãäæí ÈÑäÇãå åÇ"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "�æÔå Çí ßå ãíÎæÇåíÏ ãíÇäÈÑåÇí  $(^NameDA) ÏÑ Âä ÞÑÇÑ È�íÑäÏ ÑÇ ÇäÊÎÇÈ ßäíÏ."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "�æÔå Çí ÏÑ ãäæí ÈÑäÇãå åÇ ßå ãíÎæÇåíÏ ãíÇäÈÑåÇí ÈÑäÇãå ÏÑ ÂäÌÇ ÇíÌÇÏ ÔæäÏ ÑÇ ÇäÊÎÇÈ ßäíÏ. ÈÑÇí ÇíÌÇÏ íß �æÔå ÌÏíÏ ãíÊæÇäíÏ íß äÇã ÊÇí� ßäíÏ."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "ãíÇäÈÑí äÓÇÒ"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "ÍÐÝ $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "�Çß ßÑÏä $(^NameDA) ÇÒ Ñæí ßÇã�íæÊÑ ÔãÇ."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "ÂíÇ ãØãÆäíÏ ßå ãíÎæÇåíÏ ÇÒ ÈÑäÇãå äÕÈ $(^Name) ÎÇÑÌ ÔæíÏ¿"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "ÂíÇ ãØãÆäíÏ ßå ãíÎæÇåíÏ ÇÒ ÈÑäÇãå ÍÐÝ  $(^Name) ÎÇÑÌ ÔæíÏ¿"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Spanish.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Spanish.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Spanish.nsh	(revision 728)
@@ -0,0 +1,130 @@
+;Language: Spanish (1034)
+;By MoNKi & Joel
+;Updates & Review Darwin Rodrigo Toledo Cáceres - www.winamp-es.com - niwrad777@gmail.com
+
+!insertmacro LANGFILE "Spanish" "Español"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Bienvenido al Asistente de Instalación de $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Este programa instalará $(^NameDA) en su ordenador.$\r$\n$\r$\nSe recomienda que cierre todas las demás aplicaciones antes de iniciar la instalación. Esto hará posible actualizar archivos relacionados con el sistema sin tener que reiniciar su ordenador.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Bienvenido al Asistente de Desinstalación de $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Este asistente le guiará durante la desinstalación de $(^NameDA).$\r$\n$\r$\nAntes de comenzar la desinstalación, asegúrese de que $(^NameDA) no se está ejecutando.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Acuerdo de licencia"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Por favor revise los términos de la licencia antes de instalar $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Si acepta todos los términos del acuerdo, seleccione Acepto para continuar. Debe aceptar el acuerdo para instalar $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Si acepta los términos del acuerdo, marque abajo la casilla. Debe aceptar los términos para instalar $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Si acepta los términos del acuerdo, seleccione abajo la primera opción. Debe aceptar los términos para instalar $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Acuerdo de licencia"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Por favor revise los términos de la licencia antes de desinstalar $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Si acepta todos los términos del acuerdo, seleccione Acepto para continuar. Debe aceptar el acuerdo para desinstalar $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Si acepta los términos del acuerdo, marque abajo la casilla. Debe aceptar los términos para desinstalar $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Si acepta los términos del acuerdo, seleccione abajo la primera opción. Debe aceptar los términos para desinstalar $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Presione Avanzar Página para ver el resto del acuerdo."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Selección de componentes"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Seleccione qué características de $(^NameDA) desea instalar."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Selección de componentes"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Seleccione qué características de $(^NameDA) desea desinstalar."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Descripción"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Sitúe el ratón encima de un componente para ver su descripción."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Sitúe el ratón encima de un componente para ver su descripción."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Elegir lugar de instalación"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Elija el directorio para instalar $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Elegir lugar de desinstalación"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Elija el directorio desde el cual se desinstalará $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Instalando"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Por favor espere mientras $(^NameDA) se instala."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Instalación Completada"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "La instalación se ha completado correctamente."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Instalación Anulada"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "La instalación no se completó correctamente."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Desinstalando"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Por favor espere mientras $(^NameDA) se desinstala."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Desinstalación Completada"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "La desinstalación se ha completado correctamente."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Desinstalación Anulada"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "La desinstalación no se completó correctamente."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Completando el Asistente de Instalación de $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) ha sido instalado en su sistema.$\r$\n$\r$\nPresione Terminar para cerrar este asistente."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Su sistema debe ser reiniciado para que pueda completarse la instalación de $(^NameDA). ¿Desea reiniciar ahora?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Completando el Asistente de Desinstalación de $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) ha sido desinstalado de su sistema.$\r$\n$\r$\nPresione Terminar para cerrar este asistente."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Su ordenador debe ser reiniciado para completar la desinstalación de $(^NameDA). ¿Desea reiniciar ahora?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Reiniciar ahora"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Deseo reiniciar manualmente más tarde"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Ejecutar $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Ver Léame"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Terminar"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Elegir Carpeta del Menú Inicio"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Elija una Carpeta del Menú Inicio para los accesos directos de $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Seleccione una carpeta del Menú Inicio en la que quiera crear los accesos directos del programa. También puede introducir un nombre para crear una nueva carpeta."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "No crear accesos directos"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Desinstalar $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Elimina $(^NameDA) de su sistema."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "¿Está seguro de que desea salir de la instalación de $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "¿Está seguro de que desea salir de la desinstalación de $(^Name)?"
+!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "Elegir Usuarios"
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "Elija los usuarios para los cuales Ud. desea instalar $(^NameDA)."
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "Seleccione si desea instalar $(^NameDA) sólo para Ud. o para todos los usuarios de este Ordenador.$(^ClickNext)"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "Instación para cualquier usuario de este ordenador"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Instalación solo para mí"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Albanian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Albanian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Albanian.nsh	(revision 728)
@@ -0,0 +1,129 @@
+;Language: Albanian (1052)
+;Translation Besnik Bleta, besnik@programeshqip.org
+
+!insertmacro LANGFILE "Albanian" "Albanian"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Mirësevini te Rregullimi i $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Ky do t'ju udhëheqë gjatë instalimit të $(^NameDA).$\r$\n$\r$\nKëshillohet që të mbyllni tërë zbatimet e tjera para se të nisni Rregullimin. Kjo bën të mundur përditësimin e kartelave të rëndësishme të sistemit pa u dashur të riniset kompjuteri juaj.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Mirësevini te Çinstalimi i $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Ky do t'ju udhëheqë gjatë çinstalimit të $(^NameDA).$\r$\n$\r$\nPara nisjes së çinstalimit, sigurohuni që $(^NameDA) nuk është duke xhiruar.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Marrëveshje Licence"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Ju lutem shqyrtoni kushtet e licencës përpara se të instaloni $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Nëse i pranoni kushtet e marrëveshjes, klikoni Pajtohem për të vazhduar. Duhet ta pranoni marrëveshjen për të instaluar $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Nëse pranoni kushtet e marrëveshjes, klikoni kutizën më poshtë. Duhet të pranoni marrëveshjen për të instaluar $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Nëse pranoni kushtet e marrëveshjes, përzgjidhni më poshtë mundësinë e parë. Duhet të pranoni marrëveshjen për të instaluar $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Marrëveshje Licence"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Ju lutem shqyrtoni kushtet e licencës përpara çinstalimit të $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Nëse i pranoni kushtet e marrëveshjes, klikoni Pajtohem për të vazhduar. Duhet të pranoni marrëveshjen për të çinstaluar $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Nëse pranoni kushtet e marrëveshjes, klikoni kutizën më poshtë. Duhet të pranoni marrëveshjen për të çinstaluar $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Nëse pranoni kushtet e marrëveshjes, përzgjidhni mundësinë e parë më poshtë. Duhet të pranoni marrëveshjen për të çinstaluar $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Shtypni Page Down për të parë pjesën e mbetur të marrëveshjes."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Përzgjidhni Përbërës"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Zgjidhni cilat anë të $(^NameDA) doni të instalohen."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Zgjidhni Përbërësa"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Zgjidhni cilat anë të $(^NameDA) doni të çinstalohen."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Përshkrim"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Për të parë përshkrimin e një përbërësi, vendosni miun përsipër tij."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Për të parë përshkrimin e një përbërësi, vendosni miun përsipër tij."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Zgjidhni Vend Instalimi"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Zgjidhni dosjen tek e cila të instalohet $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Zgjidhni Vend Çinstalimi"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Zgjidhni dosjen prej së cilës të çinstalohet $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Po instalohet"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Ju lutem prisni ndërkohë që $(^NameDA) instalohet."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Instalim i Plotësuar"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Rregullimi u plotësua me sukses."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Instalimi u Ndërpre"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Rregullimi nuk u plotësua me sukses."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Çinstalim"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Ju lutem prisni ndërsa $(^NameDA) çinstalohet."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Çinstalim i Plotë"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Çinstalimi u plotësua me sukses."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Çinstalimi u Ndërpre"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Çinstalimi nuk plotësua me sukses."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Po plotësoj Rregullimin e $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) u instalua në kompjuterin tuaj.$\r$\n$\r$\nPër mbylljen e procesit, klikoni Përfundoje."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Që të mund të plotësohet instalimi i $(^NameDA) kompjuteri juaj duhet të riniset. Doni ta rinisni tani?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Po plotësoj Çinstalimin e $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) u çinstalua prej kompjuterit tuaj.$\r$\n$\r$\nPër mbylljen e procesit, klikoni Përfundoje."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Kompjuteri juaj duhet të riniset që të mund të plotësohet çinstalimi i $(^NameDA). Doni ta rinisni tani?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Rinise tani"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Dua ta rinis dorazi më vonë"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Nis $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Shfaq Readme"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Përfundoje"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Zgjidhni Dosje Menuje Start"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Zgjidhni një dosje Menuje Start për shkurtore $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Përzgjidhni dosjen e Menusë Start në të cilën do të donit të krijonit shkurtoret për programin. Mundeni edhe të jepni një emër për të krijuar një dosje të re."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Mos krijo shkurtore"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Çinstalo $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Hiqeni $(^NameDA) prej kompjuterit tuaj."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Jeni i sigurt që doni të dilni nga Rregullimi i $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Jeni i sigurt që doni të dilni nga Çinstalimi i $(^Name)?"
+!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "Zgjidhni Përdoruesa"
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "Zgjidhni për cilët përdoruesa doni të instalohet $(^NameDA)."
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "Përzgjidhni në doni të instalohet $(^NameDA) vetëm për veten tuaj apo për tërë përdoruesit e këtij kompjuteri. $(^ClickNext)"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "Instaloje për këdo në këtë kompjuter"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Instaloje vetëm për mua"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Dutch.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Dutch.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Dutch.nsh	(revision 728)
@@ -0,0 +1,129 @@
+;Language: Dutch (1043)
+;By Joost Verburg
+
+!insertmacro LANGFILE "Dutch" "Nederlands"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Welkom bij de $(^NameDA)-installatiewizard"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Deze wizard zal $(^NameDA) op uw systeem installeren.$\r$\n$\r$\nHet wordt aanbevolen alle overige toepassingen af te sluiten alvorens de installatie te starten. Dit maakt het mogelijk relevante systeembestanden bij te werken zonder uw systeem opnieuw op te moeten starten.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Welkom bij de $(^NameDA)-deïnstallatiewizard"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Deze wizard zal $(^NameDA) van uw syteem verwijderen.$\r$\n$\r$\nControleer voordat u begint met verwijderen of $(^NameDA) is afgesloten.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Licentieovereenkomst"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Lees de licentieovereenkomst voordat u $(^NameDA) installeert."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Klik op Akkoord om verder te gaan als u de overeenkomst accepteert. U moet de overeenkomst accepteren om $(^NameDA) te installeren."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Schakel het selectievakje hieronder in als u de overeenkomst accepteert. U moet de overeenkomst accepteren om $(^NameDA) te installeren."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Selecteer de eerste optie hieronder als u de overeenkomst accepteert. U moet de overeenkomst accepteren om $(^NameDA) te installeren."
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Licentieovereenkomst"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Lees de licentieovereenkomst voordat u $(^NameDA) verwijdert."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Klik op Akkoord op verder te gaan als u de overeenkomst accepteert. U moet de overeenkomst accepteren om $(^NameDA) te verwijderen."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Schakel het selectievakje hieronder in als u de overeenkomst accepteert. U moet de overeenkomst accepteren om $(^NameDA) te verwijderen."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Selecteer de eerste optie hieronder als u de overeenkomst accepteert. U moet de overeenkomst accepteren om $(^NameDA) te verwijderen."
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Druk op Page Down om de rest van de overeenkomst te zien."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Onderdelen kiezen"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Kies de onderdelen die u wilt installeren."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Onderdelen kiezen"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Kies de onderdelen die u wilt verwijderen."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Beschrijving"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Beweeg uw muis over een onderdeel om de beschrijving te zien."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Beweeg uw muis over een onderdeel om de beschrijving te zien."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Installatielocatie kiezen"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Kies de map waarin u $(^NameDA) wilt installeren."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Locatie kiezen"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Kies de map waaruit u $(^NameDA) wilt verwijderen."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Bezig met installeren"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Een ogenblik geduld terwijl $(^NameDA) wordt geïnstalleerd."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Installatie voltooid"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "De installatie is succesvol voltooid."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Installatie afgebroken"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "De installatie is niet voltooid."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Bezig met verwijderen"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Een ogenblik geduld terwijl $(^NameDA) van uw systeem wordt verwijderd."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Verwijderen gereed"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "$(^NameDA) is van uw systeem verwijderd."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Verwijderen afgebroken"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "$(^NameDA) is niet volledig van uw systeem verwijderd."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Voltooien van de $(^NameDA)-installatiewizard"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) is geïnstalleerd op uw systeem.$\r$\n$\r$\nKlik op Voltooien om deze wizard te sluiten."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Uw systeem moet opnieuw worden opgestart om de installatie van $(^NameDA) te voltooien. Wilt u nu herstarten?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Voltooien van de $(^NameDA)-deïnstallatiewizard"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) is van uw systeem verwijderd.$\r$\n$\r$\nKlik op Voltooien om deze wizard te sluiten."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Uw systeem moet opnieuw worden opgestart om het verwijderen van $(^NameDA) te voltooien. Wilt u nu herstarten?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Nu herstarten"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Ik wil later handmatig herstarten"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "$(^NameDA) &starten"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Leesmij weergeven"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Voltooien"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Startmenumap kiezen"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Kies een map in het menu Start voor de snelkoppelingen van $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Kies een map in het menu Start waarin de snelkoppelingen moeten worden aangemaakt. U kunt ook een naam invoeren om een nieuwe map te maken."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Geen snelkoppelingen aanmaken"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "$(^NameDA) verwijderen"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "$(^NameDA) van uw systeem verwijderen."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Weet u zeker dat u de $(^Name)-installatie wilt afsluiten?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Weet u zeker dat u de $(^Name)-deïnstallatie wilt afsluiten?"
+!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "Gebruikers kiezen"
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "Kies voor welke gebruikers u $(^NameDA) wilt installeren."
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "Selecteer of u $(^NameDA) alleen voor uzelf of voor alle gebruikers van deze computer wilt installeren. $(^ClickNext)"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "Installeer voor alle gebruikers van deze computer"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Installeer alleen voor mijzelf"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Italian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Italian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Italian.nlf	(revision 728)
@@ -0,0 +1,192 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1040
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation orginally started by Orfanik - http://www.orfanik.hu
+# Updated v2 to v6 by Alessandro Staltari < staltari (a) geocities.com >
+# corrected by < mdalco@gmail.com >
+# ^Branding
+Sistema di installazione Nullsoft %s
+# ^SetupCaption
+Installazione di $(^Name)
+# ^UninstallCaption
+Disinstallazione di $(^Name)
+# ^LicenseSubCaption
+: Licenza d'uso
+# ^ComponentsSubCaption
+: Opzioni di installazione
+# ^DirSubCaption
+: Cartella di installazione
+# ^InstallingSubCaption
+: Installazione dei file
+# ^CompletedSubCaption
+: Completata
+# ^UnComponentsSubCaption
+: Opzioni di disinstallazione
+# ^UnDirSubCaption
+: Cartella di disinstallazione
+# ^ConfirmSubCaption
+: Conferma
+# ^UninstallingSubCaption
+: Rimozione dei file
+# ^UnCompletedSubCaption
+: Completata
+# ^BackBtn
+< &Indietro
+# ^NextBtn
+&Avanti >
+# ^AgreeBtn
+&Accetto
+# ^AcceptBtn
+&Accetto le condizioni della licenza
+# ^DontAcceptBtn
+&Non accetto le condizioni della licenza
+# ^InstallBtn
+Ins&talla
+# ^UninstallBtn
+&Disinstalla
+# ^CancelBtn
+Annulla
+# ^CloseBtn
+&Fine
+# ^BrowseBtn
+S&foglia...
+# ^ShowDetailsBtn
+Mostra &dettagli
+# ^ClickNext
+Per proseguire, scegliere Avanti.
+# ^ClickInstall
+Per avviare l'installazione, selezionare Installa.
+# ^ClickUninstall
+Per avviare la disinstallazione, selezionare Disinstalla.
+# ^Name
+Nome
+# ^Completed
+Completata
+# ^LicenseText
+Leggere la licenza prima di procedere con l'installazione di $(^NameDA). Se si accettano le condizioni di licenza, selezionare Accetto.
+# ^LicenseTextCB
+Leggere la licenza prima di procedere con l'installazione di $(^NameDA). Se si accettano pienamente le condizioni di licenza, selezionare la casella sottostante. $_CLICK
+# ^LicesnseTextRB
+Leggere la licenza prima di procedere con l'installazione di $(^NameDA). Se si accettano pienamente le condizioni di licenza, selezionare la prima delle opzioni sottoindicate. $_CLICK
+# ^UnLicenseText
+Leggere la licenza prima di procedere con la disinstallazione di $(^NameDA). Se si accettano pienamente le condizioni di licenza, selezionare Accetto. $_CLICK
+# ^UnLicenseTextCB
+Leggere la licenza prima di procedere con la disinstallazione di $(^NameDA). Se si accettano pienamente le condizioni di licenza, selezionare la casella sottostante. $_CLICK
+# ^UnLicesnseTextRB
+Leggere la licenza prima di procedere con la disinstallazione di $(^NameDA). Se si accettano pienamente le condizioni di licenza, selezionare la prima delle opzioni sottoindicate. $_CLICK
+# ^Custom
+Personalizzata
+# ^ComponentsText
+Selezionare i componenti che si desidera installare.
+# ^ComponentsSubText1
+Selezionare il tipo d'installazione:
+# ^ComponentsSubText2_NoInstTypes
+Selezionare i componenti da installare:
+# ^ComponentsSubText2
+Oppure, selezionare i componenti opzionali che si desidera installare:
+# ^UnComponentsText
+Selezionare i componenti che si desidera disinstallare.
+# ^UnComponentsSubText1
+Selezionare il tipo di disinstallazione:
+# ^UnComponentsSubText2_NoInstTypes
+Selezionare i componenti da disinstallare:
+# ^UnComponentsSubText2
+Oppure, selezionare i componenti opzionali che si desidera disinstallare :
+# ^DirText
+Questa procedura installerà $(^NameDA) nella cartella seguente. Per installare in una cartella diversa, selezionare Sfoglia e sceglierne un'altra. $_CLICK
+# ^DirSubText
+Cartella di destinazione
+# ^DirBrowseText
+Selezionare la cartella dove installare $(^NameDA):
+# ^UnDirText
+Questa procedura disinstallerà $(^NameDA) nella cartella seguente. Per disinstallare da una cartella diversa, selezionare Sfoglia e sceglierene un'altra. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Selezionare la cartella dalla quale disinstallare $(^NameDA):
+# ^SpaceAvailable
+"Spazio disponibile: "
+# ^SpaceRequired
+"Spazio richiesto: "
+# ^UninstallingText
+$(^NameDA) verrà disinstallato dalla cartella seguente. $_CLICK
+# ^UninstallingSubText
+Rimozione da:
+# ^FileError
+Errore nell'apertura del file per la scrittura: \r\n\t"$0"\r\nSeleziona Termina per interrompere l'installazione,\r\nsu Riprova per ritentare, oppure\r\nsu Ignora per saltare questo file.
+# ^FileError_NoIgnore
+Errore nell'apertura del file per la scrittura: \r\n\t"$0"\r\nSeleziona Riprova per ritentare, oppure\r\nsu Termina per interrompere l'installazione
+# ^CantWrite
+"Impossibile scrivere: "
+# ^CopyFailed
+Copia fallita
+# ^CopyTo
+"Copia in "
+# ^Registering
+"Registrazione in corso: "
+# ^Unregistering
+"Deregistrazione in corso: "
+# ^SymbolNotFound
+"Impossibile trovare il simbolo: "
+# ^CouldNotLoad
+"Impossibile caricare: "
+# ^CreateFolder
+"Crea cartella: "
+# ^CreateShortcut
+"Crea collegamento: "
+# ^CreatedUninstaller
+"Creato il programma di disinstallazione: "
+# ^Delete
+"Elimina file: "
+# ^DeleteOnReboot
+"Elimina al riavvio: "
+# ^ErrorCreatingShortcut
+"Errore nella creazione del collegamento: "
+# ^ErrorCreating
+"Errore nella creazione: "
+# ^ErrorDecompressing
+Errore nella decompressione dei dati! Programma di installazione corrotto?
+# ^ErrorRegistering
+Errore nella registrazione della DLL
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Esecuzione: "
+# ^Extract
+"Estrazione: "
+# ^ErrorWriting
+"Estrazione: errore nella scrittura sul file "
+# ^InvalidOpcode
+Programma di installazione corrotto: opcode non valido
+# ^NoOLE
+"Nessuna OLE per: "
+# ^OutputFolder 
+"Cartella di destinazione: "
+# ^RemoveFolder
+"Rimuovi cartella: "
+# ^RenameOnReboot
+"Rinomina al riavvio: "
+# ^Rename
+Rinomina 
+# ^Skipped
+"Saltato: "
+# ^CopyDetails
+Copia i dettagli negli appunti
+# ^LogInstall
+Log del processo di installazione
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Icelandic.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Icelandic.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Icelandic.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Icelandic (15)
+;By Gretar Orri Kristinsson
+
+!insertmacro LANGFILE "Icelandic" "Icelandic"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Velkominn til $(^NameDA) uppsetningarhjálparinnar"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Þessi hjálp mun leiða þig í gegnum uppsetninguna á $(^NameDA).$\r$\n$\r$\nMælt er með því að þú lokir öllum öðrum forritum áður en uppsetningin hefst. Þetta mun gera uppsetningarforritinu kleyft að uppfæra kerfiskrár án þess að endurræsa tölvuna.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Velkomin(n) til $(^NameDA) fjarlægingarhjálparinnar"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Þessi hjálp mun leiða þig í gegnum fjarlæginguna á $(^NameDA).$\r$\n$\r$\nÁður en fjarlæging hefst skal ganga úr skugga um að $(^NameDA) sé ekki opið.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Notandaleyfissamningur"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Vinsamlegast skoðaðu Notandaleyfissamninginn vel áður en uppsetning á $(^NameDA) hefst."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Ef þú samþykkir skilmála samningsins, smelltu þá á 'Ég samþykki' til að halda áfram. Þú verður að samþykkja samninginn til þess að setja upp $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Ef þú samþykkir skilmála samningsins, hakaðu þá í kassann hér að neðan. Þú verður að samþykkja samninginn til þess að setja upp $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Ef þú samþykkir skilmála samningsins, veldu þá fyrsta valmöguleikann hér að neðan. Þú verður að samþykkja samninginn til þess að setja upp $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Leyfissamningur"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Vinsamlegast skoðaðu leyfissamninginn vel áður en fjarlæging á $(^NameDA) hefst."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Ef þú samþykkir skilmála samningsins, smelltu þá á 'Ég samþykki' til að halda áfram. Þú verður að samþykkja samninginn til þess að fjarlægja $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Ef þú samþykkir skilmála samningsins, hakaðu þá í kassann hér að neðan. Þú verður að samþykkja samninginn til þess að fjarlægja $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Ef þú samþykkir skilmála samningsins, veldu þá fyrsta valmöguleikann hér að neðan. Þú verður að samþykkja samninginn til þess að fjarlægja $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Smelltu á 'PageDown' takkann á lyklaborðinu til að sjá afganginn af samningnum."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Velja íhluti"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Veldu hvaða $(^NameDA) íhluti þú vilt setja upp."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Velja íhluti"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Velja hvaða $(^NameDA) íhluti þú vilt fjarlægja."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Lýsing"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Færðu músina yfir íhlut til að fá lýsinguna á honum."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Færðu músina yfir íhlut til að fá lýsinguna á honum."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Veldu uppsetningarskáarsafn"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Veldu það skráarsafn sem þú vilt setja $(^NameDA) upp í."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Velja fjarlægingarskáarsafn"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Veldu það skráarsafn sem þú vilt fjarlægja $(^NameDA) úr."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Set upp"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Vinsamlegast dokaðu við meðan $(^NameDA) er sett upp."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Uppsetningu lokið"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Uppsetning tókst."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Hætt við uppsetningu"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Uppsetningu lauk ekki sem skildi."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Fjarlægi"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Vinsamlegast dokaðu við á meðan $(^NameDA) er fjarlægt."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Fjarlægingu lokið"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Fjarlæging tókst."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Hætt við fjarlægingu"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Fjarlægingu lauk ekki sem skildi."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Ljúka $(^NameDA) uppsetningarhjálpinni"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) er nú upp sett á tölvunni þinni.$\r$\n$\r$\nSmelltu á 'Ljúka' til að loka þessari hjálp."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Til að ljúka uppsetningunni á $(^NameDA) verður að endurræsa tölvuna. Viltu endurræsa núna?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Ljúka $(^NameDA) fjarlægingarhjálpinni"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) hefur nú verið fjarlægt úr tölvunni.$\r$\n$\r$\nSmelltu á 'Ljúka' til að loka þessari hjálp."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Til að ljúka fjarlægingunni á $(^NameDA) verður að endurræsa tölvuna. Viltu endurræsa núna?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Endurræsa núna"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Ég vil endurræsa seinna"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Keyra $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Skoða LestuMig"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Ljúka"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Velja skráarsafn 'Start' valmyndar"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Veldu skráarsafn $(^NameDA) flýtileiða fyrir 'Start' valmyndina."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Veldu skráarsafn flýtileiða forritsins fyrir 'Start' valmyndina. Þú getur einnig búið til nýtt skráarsafn með því að setja inn nýtt nafn."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Ekki búa til flýtileiðir í 'Start' valmyndinni"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Fjarlægja $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Fjarlægja $(^NameDA) úr tölvunni."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Ertu viss um að þú viljir loka $(^Name) uppsetningarhjálpinni?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Ertu viss um að þú viljir loka $(^Name) fjarlægingarhjálpinni?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Basque.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Basque.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Basque.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Basque (1069)
+;By Iñaki San Vicente
+
+!insertmacro LANGFILE "Basque" "Euskera"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Ongi etorri $(^NameDA) -ren instalazio programara"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Programa honek $(^NameDA) zure ordenagailuan instalatuko du.$\r$\n$\r$\nAholkatzen da instalazioarekin hasi aurretik beste aplikazio guztiak ixtea. Honek sistemarekin erlazionatuta dauden fitxategien eguneratzea ahalbidetuko du, ordenagailua berrabiarazi beharrik izan gabe.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Ongi etorri $(^NameDA) -ren ezabaketa programara"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Laguntzaile honek $(^NameDA)-ren ezabaketa prozesuan zehar gidatuko zaitu.$\r$\n$\r$\nEzabaketa hasi aurretik, ziurtatu $(^NameDA) martxan ez dagoela .$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Lizentzia hitzarmena"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Mesedez aztertu lizentziaren baldintzak $(^NameDA) instalatu aurretik."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Baldintzak onartzen badituzu, sakatu Onartu aurrera egiteko. Hitzarmena onartzea ezinbestekoa da $(^NameDA) instalatzeko."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Baldintzak onartzen badituzu, nabarmendu azpiko laukitxoa. Hitzarmena onartzea ezinbestekoa da $(^NameDA) instalatzeko. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Baldintzak onartzen badituzu, hautatu azpian lehen aukera. Hitzarmena onartzea ezinbestekoa da $(^NameDA) instalatzeko. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Lizentzia hitzarmena"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Mesedez aztertu lizentziaren baldintzak $(^NameDA) ezabatu aurretik."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Baldintzak onartzen badituzu, sakatu Onartu aurrera egiteko. Hitzarmena onartzea ezinbestekoa da $(^NameDA) ezabatzeko."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Baldintzak onartzen badituzu, nabarmendu azpiko laukitxoa. Hitzarmena onartzea ezinbestekoa da $(^NameDA) ezabatzeko. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Baldintzak onartzen badituzu, hautatu azpian lehen aukera. Hitzarmena onartzea ezinbestekoa da $(^NameDA) ezabatzeko. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Sakatu Av Pág hitzarmenaren gainontzeko atalak ikusteko."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Osagaien hautatzea"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Hautatu $(^NameDA)-ren zein ezaugarri instalatu nahi duzun."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Osagaien hautatzea"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Hautatu $(^NameDA)-ren zein ezaugarri ezabatu nahi duzun."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Azalpena"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Jarri sagua osagai baten gainean dagokion azalpena ikusteko."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Jarri sagua osagai baten gainean dagokion azalpena ikusteko."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Hautatu instalazioaren lekua"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Aukeratu $(^NameDA) instalatzeko karpeta."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Aukeratu ezabatuko den karpeta"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Aukeratu $(^NameDA) zein karpetatik ezabatuko den."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Instalatzen"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Mesedez itxoin $(^NameDA) instalatzen den bitartean."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Instalazioa burututa"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Instalazioa zuzen burutu da."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Instalazioa ezeztatua"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Instalazioa ez da zuzen burutu."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Ezabatzen"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Mesedez itxoin $(^NameDA) ezabatzen den bitartean."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Ezabatzea burututa"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Ezabatzea zuzen burutu da."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Ezabatzea ezeztatuta"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Ezabatzea ez da zuzen burutu."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "$(^NameDA)-ren instalazio laguntzailea osatzen"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) zure sisteman instalatu da.$\r$\n$\r$\nSakatu Amaitu laguntzaile hau ixteko."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Zure sistema berrabiarazi behar duzu $(^NameDA)-ren instalazioa osatzeko. Orain Berrabiarazi nahi duzu?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "$(^NameDA)-ren ezabaketa laguntzailea osatzen"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) zure sistematik ezabatu da.$\r$\n$\r$\nSakatu Amaitu laguntzaile hau ixteko."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Zure ordenagailuak berrabiarazia izan behar du $(^NameDA)-ren ezabaketa osatzeko. Orain Berrabiarazi nahi duzu?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Berrabiarazi orain"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Neuk berrabiarazi geroago"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Exekutatu $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Ikusi Readme.txt"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Amaitu"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Aukeratu Hasiera Menuko karpeta"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Aukeratu Hasiera Menuko karpeta bat $(^NameDA)-ren lasterbideentzako."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Aukeratu Hasiera Menuko karpeta bat, non programaren lasterbideak instalatu nahi dituzun. Karpeta berri bat sortzeko izen bat ere adierazi dezakezu."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Ez sortu lasterbiderik"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Ezabatu $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "$(^NameDA) zure sistematik ezabatzen du."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Ziur zaude $(^Name)-ren instalaziotik irten nahi duzula?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Ziur zaude $(^Name)-ren ezabaketa laguntzailetik irten nahi duzula?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Norwegian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Norwegian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Norwegian.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1044
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by Jonas Lindstrøm (jonasc_88@hotmail.com). Reviewed and fixed by Jan Ivar Beddari <d0der at online.no>
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) installasjon
+# ^UninstallCaption
+$(^Name) avinstallasjon
+# ^LicenseSubCaption
+: Lisensavtale
+# ^ComponentsSubCaption
+: Installasjonsvalg
+# ^DirSubCaption
+: Installasjonsmappe
+# ^InstallingSubCaption
+: Installerer
+# ^CompletedSubCaption
+: Ferdig
+# ^UnComponentsSubCaption
+: Avinstallasjonsvalg
+# ^UnDirSubCaption
+: Avinstallasjonsmappe
+# ^ConfirmSubCaption
+: Bekreft
+# ^UninstallingSubCaption
+: Avinstallerer
+# ^UnCompletedSubCaption
+: Ferdig
+# ^BackBtn
+< &Tilbake
+# ^NextBtn
+&Neste >
+# ^AgreeBtn
+&Godta
+# ^AcceptBtn
+Jeg &godtar vilkårene i lisensavtalen
+# ^DontAcceptBtn
+Jeg godtar &ikke vilkårene i lisensavtalen
+# ^InstallBtn
+&Installer
+# ^UninstallBtn
+&Avinstaller
+# ^CancelBtn
+Avbryt
+# ^CloseBtn
+&Lukk
+# ^BrowseBtn
+Bla &gjennom...
+# ^ShowDetailsBtn
+Vis &detaljer
+# ^ClickNext
+Trykk Neste for å fortsette.
+# ^ClickInstall
+Trykk Installer for å starte installasjonen.
+# ^ClickUninstall
+Trykk Avinstaller for å starte avinstallasjonen.
+# ^Name
+Navn
+# ^Completed
+Ferdig
+# ^LicenseText
+Vennligst les gjennom lisensavtalen før du installerer $(^Name). Hvis du godtar vilkårene i avtalen, trykk på Godta.
+# ^LicenseTextCB
+Vennligst les gjennom lisensavtalen før du installerer $(^Name). Hvis du godtar vilkårene i avtalen, merk av under. $_CLICK
+# ^LicenseTextRB
+Vennligst les gjennom lisensavtalen før du installerer $(^Name). Hvis du godtar vilkårene i avtalen, velg det første alternativet. $_CLICK
+# ^UnLicenseText
+Vennligst les gjennom lisensavtalen før du avinstallerer $(^Name). Hvis du godtar vilkårene i avtalen, trykk på Godta.
+# ^UnLicenseTextCB
+Vennligst les gjennom lisensavtalen før du avinstallerer $(^Name). Hvis du godtar vilkårene i avtalen, merk av under. $_CLICK
+# ^UnLicenseTextRB
+Vennligst les gjennom lisensavtalen før du avinstallerer $(^Name). Hvis du godtar vilkårene i avtalen, velg det første alternativet. $_CLICK
+# ^Custom
+Egendefinert
+# ^ComponentsText
+Merk komponentene du vil installere og fjern merkingen for de du ikke vil installere. $_CLICK
+# ^ComponentsSubText1
+Velg hvilken måte du vil installere på:
+# ^ComponentsSubText2_NoInstTypes
+Merk komponenter du vil installere:
+# ^ComponentsSubText2
+Eller merk de valgfrie komponentene du ønsker å installere:
+# ^UnComponentsText
+Merk komponentene du vil avinstallere og fjern merkingen for de du vil beholde. $_CLICK
+# ^UnComponentsSubText1
+Velg hvilken måte du vil avinstallere på:
+# ^UnComponentsSubText2_NoInstTypes
+Merk komponenter du vil avinstallere:
+# ^UnComponentsSubText2
+Eller merk de valgfrie komponentene du ønsker å avinstallere:
+# ^DirText
+$(^Name) vil bli installert i følgende mappe. For å velge en annen mappe, trykk Bla gjennom. $_CLICK
+# ^DirSubText
+Målmappe
+# ^DirBrowseText
+Velg mappe du vil installere $(^Name) i:
+# ^UnDirText
+$(^Name) i følgende mappe vil bli avinstallert. For å velge en annen mappe, trykk Bla gjennom. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Velg mappe du vil avinstallere $(^Name) fra:
+# ^SpaceAvailable
+"Ledig plass: "
+# ^SpaceRequired
+"Nødvendig plass: "
+# ^UninstallingText
+Denne veiviseren vil avinstallere $(^Name) fra din datamaskin. $_CLICK
+# ^UninstallingSubText
+Avinstallerer fra:
+# ^FileError
+Feil under åpning av fil for skriving: \r\n\t\"$0\"\r\nTrykk Avbryt for å avbryte installasjonen,\r\nPrøv igjen for å prøve igjen, eller\r\nIgnorer for å hoppe over denne filen
+# ^FileError_NoIgnore
+Feil under åpning av fil for skriving: \r\n\t\"$0\"\r\nTrykk Prøv igjen for å prøve igjen, or\r\neller Avbryt for å avbryte installasjonen
+# ^CantWrite
+"Kan ikke skrive: "
+# ^CopyFailed
+Kopiering mislyktes
+# ^CopyTo
+"Kopier til "
+# ^Registering
+"Registrerer: "
+# ^Unregistering
+""Avregistrerer: "
+# ^SymbolNotFound
+"Kunne ikke finne symbol: "
+# ^CouldNotLoad
+"Kunne ikke laste: "
+# ^CreateFolder
+"Lag mappe: "
+# ^CreateShortcut
+"Lag snarvei: "
+# ^CreatedUninstaller
+"Avinstallasjon laget: "
+# ^Delete
+"Slett fil: "
+# ^DeleteOnReboot
+"Slett ved omstart: "
+# ^ErrorCreatingShortcut
+"Feil under opprettelse av snarvei: "
+# ^ErrorCreating
+"Feil under opprettelse av: "
+# ^ErrorDecompressing
+Feil under utpakking av data! Installasjonsprogrammet kan være skadet.
+# ^ErrorRegistering
+Feil under registrering av DLL
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Kjøre: "
+# ^Extract
+"Pakk ut: "
+# ^ErrorWriting
+"Pakk ut: Feil under skriving til fil "
+# ^InvalidOpcode
+Installasjonsprogrammet er skadet: ukjent kode
+# ^NoOLE
+"Ingen OLE for: "
+# ^OutputFolder
+"Ut-mappe: "
+# ^RemoveFolder
+"Fjern mappe: "
+# ^RenameOnReboot
+"Gi nytt navn ved omstart: "
+# ^Rename
+"Gi nytt navn: "
+# ^Skipped
+"Hoppet over: "
+# ^CopyDetails
+Kopier detaljer til utklippstavlen
+# ^LogInstall
+Loggfør installasjonsprosessen
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/English.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/English.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/English.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+1033
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+-
+# RTL - anything else than RTL means LTR
+-
+# Translation by ..... (any credits should go here)
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) Setup
+# ^UninstallCaption
+$(^Name) Uninstall
+# ^LicenseSubCaption
+: License Agreement
+# ^ComponentsSubCaption
+: Installation Options
+# ^DirSubCaption
+: Installation Folder
+# ^InstallingSubCaption
+: Installing
+# ^CompletedSubCaption
+: Completed
+# ^UnComponentsSubCaption
+: Uninstallation Options
+# ^UnDirSubCaption
+: Uninstallation Folder
+# ^ConfirmSubCaption
+: Confirmation
+# ^UninstallingSubCaption
+: Uninstalling
+# ^UnCompletedSubCaption
+: Completed
+# ^BackBtn
+< &Back
+# ^NextBtn
+&Next >
+# ^AgreeBtn
+I &Agree
+# ^AcceptBtn
+I &accept the terms of the License Agreement
+# ^DontAcceptBtn
+I &do not accept the terms of the License Agreement
+# ^InstallBtn
+&Install
+# ^UninstallBtn
+&Uninstall
+# ^CancelBtn
+Cancel
+# ^CloseBtn
+&Close
+# ^BrowseBtn
+B&rowse...
+# ^ShowDetailsBtn
+Show &details
+# ^ClickNext
+Click Next to continue.
+# ^ClickInstall
+Click Install to start the installation.
+# ^ClickUninstall
+Click Uninstall to start the uninstallation.
+# ^Name
+Name
+# ^Completed
+Completed
+# ^LicenseText
+Please review the license agreement before installing $(^NameDA). If you accept all terms of the agreement, click I Agree.
+# ^LicenseTextCB
+Please review the license agreement before installing $(^NameDA). If you accept all terms of the agreement, click the check box below. $_CLICK
+# ^LicenseTextRB
+Please review the license agreement before installing $(^NameDA). If you accept all terms of the agreement, select the first option below. $_CLICK
+# ^UnLicenseText
+Please review the license agreement before uninstalling $(^NameDA). If you accept all terms of the agreement, click I Agree.
+# ^UnLicenseTextCB
+Please review the license agreement before uninstalling $(^NameDA). If you accept all terms of the agreement, click the check box below. $_CLICK
+# ^UnLicenseTextRB
+Please review the license agreement before uninstalling $(^NameDA). If you accept all terms of the agreement, select the first option below. $_CLICK
+# ^Custom
+Custom
+# ^ComponentsText
+Check the components you want to install and uncheck the components you don't want to install. $_CLICK
+# ^ComponentsSubText1
+Select the type of install:
+# ^ComponentsSubText2_NoInstTypes
+Select components to install:
+# ^ComponentsSubText2
+Or, select the optional components you wish to install:
+# ^UnComponentsText
+Check the components you want to uninstall and uncheck the components you don't want to uninstall. $_CLICK
+# ^UnComponentsSubText1
+Select the type of uninstall:
+# ^UnComponentsSubText2_NoInstTypes
+Select components to uninstall:
+# ^UnComponentsSubText2
+Or, select the optional components you wish to uninstall:
+# ^DirText
+Setup will install $(^NameDA) in the following folder. To install in a different folder, click Browse and select another folder. $_CLICK
+# ^DirSubText
+Destination Folder
+# ^DirBrowseText
+Select the folder to install $(^NameDA) in:
+# ^UnDirText
+Setup will uninstall $(^NameDA) from the following folder. To uninstall from a different folder, click Browse and select another folder. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Select the folder to uninstall $(^NameDA) from:
+# ^SpaceAvailable
+"Space available: "
+# ^SpaceRequired
+"Space required: "
+# ^UninstallingText
+$(^NameDA) will be uninstalled from the following folder. $_CLICK
+# ^UninstallingSubText
+Uninstalling from:
+# ^FileError
+Error opening file for writing: \r\n\r\n$0\r\n\r\nClick Abort to stop the installation,\r\nRetry to try again, or\r\nIgnore to skip this file.
+# ^FileError_NoIgnore
+Error opening file for writing: \r\n\r\n$0\r\n\r\nClick Retry to try again, or\r\nCancel to stop the installation.
+# ^CantWrite
+"Can't write: "
+# ^CopyFailed
+Copy failed
+# ^CopyTo
+"Copy to "
+# ^Registering
+"Registering: "
+# ^Unregistering
+"Unregistering: "
+# ^SymbolNotFound
+"Could not find symbol: "
+# ^CouldNotLoad
+"Could not load: "
+# ^CreateFolder
+"Create folder: "
+# ^CreateShortcut
+"Create shortcut: "
+# ^CreatedUninstaller
+"Created uninstaller: "
+# ^Delete
+"Delete file: "
+# ^DeleteOnReboot
+"Delete on reboot: "
+# ^ErrorCreatingShortcut
+"Error creating shortcut: "
+# ^ErrorCreating
+"Error creating: "
+# ^ErrorDecompressing
+Error decompressing data! Corrupted installer?
+# ^ErrorRegistering
+Error registering DLL
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Execute: "
+# ^Extract
+"Extract: "
+# ^ErrorWriting
+"Extract: error writing to file "
+# ^InvalidOpcode
+Installer corrupted: invalid opcode
+# ^NoOLE
+"No OLE for: "
+# ^OutputFolder
+"Output folder: "
+# ^RemoveFolder
+"Remove folder: "
+# ^RenameOnReboot
+"Rename on reboot: "
+# ^Rename
+"Rename: "
+# ^Skipped
+"Skipped: "
+# ^CopyDetails
+Copy Details To Clipboard
+# ^LogInstall
+Log install process
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Welsh.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Welsh.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Welsh.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Welsh (1106)
+;By Rhoslyn Prys, Meddal.com
+
+!insertmacro LANGFILE "Welsh" "Welsh"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Croeso i Ddewin Gosod $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Bydd y dewin yn eich arwain drwy osodiad $(^NameDA).$\r$\n$\r$\nCaewch pob rhaglen cyn cychwyn y rhaglen osod. Bydd hyn yn ei gwneud yn bosibl i ddiweddaru'r ffeiliau system berthnasol heb fod angen ailgychwyn eich cyfrifiadur.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Croeso i Ddewin Dadosod $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Bydd y dewin yn eich arwain drwy ddadosod $(^NameDA).$\r$\n$\r$\nCyn cychwyn dadosod, gwnewch yn siwr nad yw $(^NameDA) yn rhedeg.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Cytundeb Trwyddedu"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Darllenwch amodau'r drwydded cyn gosod $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Os ydych yn derbyn amodau'r cytundeb, cliciwch Cytuno i barhau. Mae'n rhaid i chi dderbyn amodau'r cytundeb er mwyn gosod $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Os ydych yn derbyn amodau'r cytundeb, cliciwch y blwch ticio isod. Mae'n rhaid i chi dderbyn amodau'r cytundeb er mwyn gosod $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Os ydych yn derbyn amodau'r cytundeb, cliciwch y dewis cyntaf isod. Mae'n rhaid i chi dderbyn amodau'r cytundeb er mwyn gosod $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Cytundeb Trwyddedu"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Darllenwch amodau'r drwydded cyn dadosod $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Os ydych yn derbyn amodau'r cytundeb, cliciwch Cytuno i barhau. Mae'n rhaid i chi dderbyn amodau'r cytundeb er mwyn dadosod  $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Os ydych yn derbyn amodau'r cytundeb, cliciwch y blwch ticio isod. Mae'n rhaid i chi dderbyn amodau'r cytundeb er mwyn dadosod $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Os ydych yn derbyn amodau'r cytundeb, cliciwch y dewis cyntaf isod. Mae'n rhaid i chi dderbyn amodau'r cytundeb er mwyn dadosod $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Pwyswch Page Down i ddarllen gweddill y cytundeb."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Dewis Cydrannau"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Dewis pa nodweddion o $(^NameDA) rydych am eu gosod."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Dewis Cydrannau"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Dewis pa nodweddion o $(^NameDA) i'w dadoso."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Disgrifiad"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Gosod eich llygoden dros gydran i weld ei ddisgrifiad."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Gosod eich llygoden dros gydran i weld ei ddisgrifiad."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Dewis Lleoliad Gosod"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Dewis y ffolder i osod $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Dewis Lleoliad Dadosod"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Dewis y ffolder i ddadosod $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Gosod"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Arhoswch tra fo $(^NameDA) yn cael ei osod."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Cwblhawyd y Gosod"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Mae'r Gosod wedi ei gwblhau'n llwyddiannus."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Ataliwyd y Gosod"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Methwyd â chwblhau'r gosod yn llwyddiannus."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Dadosod"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Arhoswch tra bo $(^NameDA) yn cael ei ddadosod."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Cwblhawyd y Dadosod"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Mae'r Dadosod wedi ei gwblhau'n llwyddiannus."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Ataliwyd y Dadosod"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Methwyd â chwblhau'r dadosod yn llwyddiannus."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Cwblhau Dewin Gosod $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Mae $(^NameDA) wedi cael ei osod ar eich cyfrifiadur.$\r$\n$\r$\nCliciwch Gorffen i gau'r dewin."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Rhaid ailgychwyn eich cyfrifiadur i gwblhau gosod $(^NameDA). Hoffech chi ailgychwyn?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Cwblhau Dewin Dadosod $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "Mae $(^NameDA) wedi ei ddadosod oddi ar eich cyfrifiadur.$\r$\n$\r$\nCliciwch Gorffen i gau'r dewin."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Rhaid ailgychwyn eich cyfrifiadur i gwblhau gosod $(^NameDA). Hoffech chi ailgychwyn?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Ailgychwyn"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Rwyf am ailgychwyn yn hwyrach"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Rhedeg $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Dangos Darllenfi"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Gorffen"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Dewis Ffolder Dewislen Cychwyn"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Dewis ffolder Dewislen Cychwyn ar gyfer llwybrau byr $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Dewis ffolder Dewislen Cychwyn i greu llwybrau byr y rhaglen. Gallwch roi enw i greu ffolder newydd."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Peidio creu llwybrau byr"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Dadosod $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Tynnu $(^NameDA) oddiar eich cyfrifiadur."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Ydych chi'n si?r eich bod am adael Rhaglen Osod $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Ydych chi'n siwr eich bod am adael Rhaglen Dadosod $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Russian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Russian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Russian.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Russian (1049)
+;Translation updated by Dmitry Yerokhin [erodim@mail.ru] (050424)
+
+!insertmacro LANGFILE "Russian" "Russian"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Âàñ ïðèâåòñòâóåò ìàñòåð óñòàíîâêè $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Ýòà ïðîãðàììà óñòàíîâèò $(^NameDA) íà âàø êîìïüþòåð.$\r$\n$\r$\nÏåðåä íà÷àëîì óñòàíîâêè ðåêîìåíäóåòñÿ çàêðûòü âñå ðàáîòàþùèå ïðèëîæåíèÿ. Ýòî ïîçâîëèò ïðîãðàììå óñòàíîâêè îáíîâèòü ñèñòåìíûå ôàéëû áåç ïåðåçàãðóçêè êîìïüþòåðà.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Âàñ ïðèâåòñòâóåò ìàñòåð óäàëåíèÿ $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Ýòà ïðîãðàììà óäàëèò $(^NameDA) èç âàøåãî êîìïüþòåðà.$\r$\n$\r$\nÏåðåä íà÷àëîì óäàëåíèÿ óáåäèòåñü, ÷òî ïðîãðàììà $(^NameDA) íå çàïóùåíà.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Ëèöåíçèîííîå ñîãëàøåíèå"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Ïåðåä óñòàíîâêîé $(^NameDA) îçíàêîìüòåñü ñ ëèöåíçèîííûì ñîãëàøåíèåì."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Åñëè âû ïðèíèìàåòå óñëîâèÿ ñîãëàøåíèÿ, íàæìèòå êíîïêó $\"Ïðèíèìàþ$\". ×òîáû óñòàíîâèòü ïðîãðàììó, íåîáõîäèìî ïðèíÿòü ñîãëàøåíèå."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Åñëè âû ïðèíèìàåòå óñëîâèÿ ñîãëàøåíèÿ, óñòàíîâèòå ôëàæîê íèæå. ×òîáû óñòàíîâèòü ïðîãðàììó, íåîáõîäèìî ïðèíÿòü ñîãëàøåíèå. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Åñëè âû ïðèíèìàåòå óñëîâèÿ ñîãëàøåíèÿ, âûáåðèòå ïåðâûé âàðèàíò èç ïðåäëîæåííûõ íèæå. ×òîáû óñòàíîâèòü ïðîãðàììó, íåîáõîäèìî ïðèíÿòü ñîãëàøåíèå. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Ëèöåíçèîííîå ñîãëàøåíèå"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Ïåðåä óäàëåíèåì $(^NameDA) îçíàêîìüòåñü ñ ëèöåíçèîííûì ñîãëàøåíèåì."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Åñëè âû ïðèíèìàåòå óñëîâèÿ ñîãëàøåíèÿ, íàæìèòå êíîïêó $\"Ïðèíèìàþ$\". Äëÿ óäàëåíèÿ íåîáõîäèìî ïðèíÿòü ñîãëàøåíèå. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Åñëè âû ïðèíèìàåòå óñëîâèÿ ñîãëàøåíèÿ, óñòàíîâèòå ôëàæîê íèæå. Äëÿ óäàëåíèÿ íåîáõîäèìî ïðèíÿòü ñîãëàøåíèå. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Åñëè âû ïðèíèìàåòå óñëîâèÿ ñîãëàøåíèÿ, âûáåðèòå ïåðâûé âàðèàíò èç ïðåäëîæåííûõ íèæå. Äëÿ óäàëåíèÿ íåîáõîäèìî ïðèíÿòü ñîãëàøåíèå. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Äëÿ ïåðåìåùåíèÿ ïî òåêñòó èñïîëüçóéòå êëàâèøè $\"PageUp$\" è $\"PageDown$\"."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Êîìïîíåíòû óñòàíàâëèâàåìîé ïðîãðàììû"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Âûáåðèòå êîìïîíåíòû $(^NameDA), êîòîðûå âû õîòèòå óñòàíîâèòü."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Êîìïîíåíòû ïðîãðàììû"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Âûáåðèòå êîìïîíåíòû $(^NameDA), êîòîðûå âû õîòèòå óäàëèòü."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Îïèñàíèå"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Íàâåäèòå êóðñîð ìûøè íà íàçâàíèå êîìïîíåíòà, ÷òîáû ïðî÷åñòü åãî îïèñàíèå."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Íàâåäèòå êóðñîð ìûøè íà íàçâàíèå êîìïîíåíòà, ÷òîáû ïðî÷åñòü åãî îïèñàíèå."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Âûáîð ïàïêè óñòàíîâêè"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Âûáåðèòå ïàïêó äëÿ óñòàíîâêè $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Âûáîð ïàïêè äëÿ óäàëåíèÿ"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Óêàæèòå ïàïêó, èç êîòîðîé íóæíî óäàëèòü $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Êîïèðîâàíèå ôàéëîâ"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Ïîäîæäèòå, èäåò êîïèðîâàíèå ôàéëîâ $(^NameDA)..."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Óñòàíîâêà çàâåðøåíà"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Óñòàíîâêà óñïåøíî çàâåðøåíà."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Óñòàíîâêà ïðåðâàíà"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Óñòàíîâêà íå çàâåðøåíà."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Óäàëåíèå"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Ïîäîæäèòå, èäåò óäàëåíèå ôàéëîâ $(^NameDA)..."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Óäàëåíèå çàâåðøåíî"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Óäàëåíèå ïðîãðàììû óñïåøíî çàâåðøåíî."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Óäàëåíèå ïðåðâàíî"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Óäàëåíèå ïðîèçâåäåíî íå ïîëíîñòüþ."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Çàâåðøåíèå ðàáîòû ìàñòåðà óñòàíîâêè $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Óñòàíîâêà $(^NameDA) âûïîëíåíà.$\r$\n$\r$\nÍàæìèòå êíîïêó $\"Ãîòîâî$\" äëÿ âûõîäà èç ïðîãðàììû óñòàíîâêè."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Äëÿ çàâåðøåíèÿ óñòàíîâêè $(^NameDA) íåîáõîäèìî ïåðåçàãðóçèòü êîìïüþòåð. Õîòèòå ñäåëàòü ýòî ñåé÷àñ?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Çàâåðøåíèå ðàáîòû ìàñòåðà óäàëåíèÿ $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "Ïðîãðàììà $(^NameDA) óäàëåíà èç âàøåãî êîìïüþòåðà.$\r$\n$\r$\nÍàæìèòå êíîïêó $\"Ãîòîâî$\"äëÿ âûõîäà èç ïðîãðàììû óäàëåíèÿ."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Äëÿ çàâåðøåíèÿ óäàëåíèÿ $(^NameDA) íóæíî ïåðåçàãðóçèòü êîìïüþòåð. Õîòèòå ñäåëàòü ýòî ñåé÷àñ?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Äà, ïåðåçàãðóçèòü ÏÊ ñåé÷àñ"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Íåò, ÿ ïåðåçàãðóæó ÏÊ ïîçæå"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Çàïóñòèòü $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Ïîêàçàòü ôàéë ReadMe"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Ãîòîâî"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Ïàïêà â ìåíþ $\"Ïóñê$\""
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Âûáåðèòå ïàïêó â ìåíþ $\"Ïóñê$\" äëÿ ðàçìåùåíèÿ ÿðëûêîâ ïðîãðàììû."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Âûáåðèòå ïàïêó â ìåíþ $\"Ïóñê$\", êóäà áóäóò ïîìåùåíû ÿðëûêè ïðîãðàììû. Âû òàêæå ìîæåòå ââåñòè äðóãîå èìÿ ïàïêè."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Íå ñîçäàâàòü ÿðëûêè"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Óäàëåíèå $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Óäàëåíèå $(^NameDA) èç êîìïüþòåðà."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Âû äåéñòâèòåëüíî õîòèòå îòìåíèòü óñòàíîâêó $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Âû äåéñòâèòåëüíî õîòèòå îòìåíèòü óäàëåíèå $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Polish.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Polish.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Polish.nlf	(revision 728)
@@ -0,0 +1,195 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+1045
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1250
+# RTL - anything else than RTL means LTR
+-
+# Translation by Piotr Murawski & Rafa³ Lampe
+# Updated by cube and SYSTEMsoft Group
+# Corrections by Marek Stepien <marcoos@aviary.pl> - http://www.aviary.pl/
+# Updated by Pawe³ Porwisz, http://www.pepesoft.tox.pl
+# Corrected by Mateusz Gola (aka Prozac) - http://www.videopedia.pl/avirecomp
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+Instalator programu $(^Name)
+# ^UninstallCaption
+Deinstalator programu $(^Name)
+# ^LicenseSubCaption
+: Umowa licencyjna
+# ^ComponentsSubCaption
+: Opcje instalacji
+# ^DirSubCaption
+: Folder instalacyjny
+# ^InstallingSubCaption
+: Instalowanie plików
+# ^CompletedSubCaption
+: Zakoñczono
+# ^UnComponentsSubCaption
+: Opcje deinstalacji
+# ^UnDirSubCaption
+: Folder deinstalacyjny
+# ^ConfirmSubCaption
+: Potwierdzenie
+# ^UnDirSubCaption
+: Deinstalowanie plików
+# ^UnCompletedSubCaption
+: Zakoñczono
+# ^BackBtn
+< &Wstecz
+# ^NextBtn
+&Dalej >
+# ^AgreeBtn
+&Zgadzam siê
+# ^AcceptBtn
+&Akceptujê warunki umowy licencyjnej
+# ^DontAcceptBtn
+&Nie akceptujê warunków umowy licencyjnej
+# ^InstallBtn
+&Zainstaluj
+# ^UninstallBtn
+&Odinstaluj
+# ^CancelBtn
+Anuluj
+# ^CloseBtn
+&Zamknij
+# ^BrowseBtn
+&Przegl¹daj...
+# ^ShowDetailsBtn
+Poka¿ &szczegó³y
+# ^ClickNext
+Kliknij Dalej, aby kontynuowaæ.
+# ^ClickInstall
+Kliknij Zainstaluj, aby rozpocz¹æ instalacjê.
+# ^ClickUninstall
+Kliknij Odinstaluj, aby rozpocz¹æ deinstalacjê.
+# ^Name
+Nazwa
+# ^Completed
+Zakoñczono
+# ^LicenseText
+Przed zainstalowaniem $(^NameDA) przeczytaj umowê licencyjn¹. Jeœli akceptujesz wszystkie warunki umowy, kliknij Zgadzam siê.
+# ^LicenseTextCB
+Przed zainstalowaniem $(^NameDA) przeczytaj umowê licencyjn¹. Jeœli akceptujesz wszystkie warunki umowy, kliknij pole wyboru poni¿ej. $_CLICK.
+# ^LicenseTextRB
+Przed zainstalowaniem $(^NameDA) przeczytaj umowê licencyjn¹. Jeœli akceptujesz wszystkie warunki umowy, wybierz pierwsz¹ opcjê poni¿ej. $_CLICK.
+# ^UnLicenseText
+Przed odinstalowaniem $(^NameDA) przeczytaj umowê licencyjn¹. Jeœli akceptujesz wszystkie warunki umowy, kliknij Zgadzam siê.
+# ^UnLicenseTextCB
+Przed odinstalowaniem $(^NameDA) przeczytaj umowê licencyjn¹. Jeœli akceptujesz wszystkie warunki umowy, kliknij pole wyboru poni¿ej. $_CLICK.
+# ^UnLicenseTextRB
+Przed odinstalowaniem $(^NameDA) przeczytaj licencjê. Jeœli akceptujesz wszystkie warunki umowy, wybierz pierwsz¹ opcjê poni¿ej. $_CLICK.
+# ^Custom
+U¿ytkownika
+# ^ComponentsText
+Zaznacz komponenty, które chcesz zainstalowaæ i odznacz te, których nie chcesz instalowaæ. $_CLICK
+# ^ComponentsSubText1
+Wybierz typ instalacji:
+# ^ComponentsSubText2_NoInstTypes
+Wybierz komponenty do zainstalowania:
+# ^ComponentsSubText2
+Albo wybierz opcjonalne komponenty, które chcesz zainstalowaæ:
+# ^UnComponentsText
+Zaznacz komponenty, które chcesz odinstalowaæ i odznacz te, które nie zostan¹ odinstalowane. $_CLICK
+# ^UnComponentsSubText1
+Wybierz typ deinstalacji:
+# ^UnComponentsSubText2_NoInstTypes
+Wybierz komponenty do odinstalowania:
+# ^UnComponentsSubText2
+Albo wybierz opcjonalne komponenty, które chcesz odinstalowaæ:
+# ^DirText
+Instalator zainstaluje program $(^NameDA) w nastêpuj¹cym folderze. Aby zainstalowaæ w innym folderze, kliknij Przegl¹daj i wybierz folder. $_CLICK
+# ^DirSubText
+Folder docelowy
+# ^DirBrowseText
+Wybierz folder instalacyjny $(^NameDA):
+# ^UnDirText
+Deinstalator usunie $(^NameDA) z nastêpuj¹cego folderu. Aby odinstalowaæ z innego folderu, kliknij Przegl¹daj i wybierz folder. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Wybierz folder, z którego zostanie odinstalowany program $(^NameDA):
+# ^SpaceAvailable
+"Dostêpne miejsce: "
+# ^SpaceRequired
+"Wymagane miejsce: "
+# ^UninstallingText
+Ten kreator odinstaluje $(^NameDA) z Twojego komputera. $_CLICK
+# ^UninstallingSubText
+Deinstalacja z: 
+# ^FileError
+B³¹d otwarcia pliku do zapisu: \r\n\r\n$0\r\n\r\nWybierz Anuluj, aby przerwaæ instalacjê,\r\nPonów, aby ponowiæ zapis do pliku lub\r\nIgnoruj, aby pomin¹æ ten plik.
+# ^FileError_NoIgnore
+B³¹d otwarcia pliku do zapisu: \r\n\r\n$0\r\n\r\nWybierz Ponów, aby ponowiæ zapis do pliku lub\r\nAnuluj, aby przerwaæ instalacjê.
+# ^CantWrite
+"Nie mo¿na zapisaæ: "
+# ^CopyFailed
+B³¹d kopiowania
+# ^CopyTo
+"Kopiuj do "
+# ^Registering 
+"Rejestrowanie: "
+# ^Unregistering
+"Odrejestrowywanie: "
+# ^SymbolNotFound
+"Nie mo¿na odnaleŸæ symbolu: "
+# ^CouldNotLoad
+"Nie mo¿na wczytaæ: "
+#^CreateFolder
+"Utwórz folder: "
+# ^CreateShortcut
+"Utwórz skrót: "
+# ^CreatedUninstaller
+"Utworzono deinstalator: "
+# ^Delete
+"Usuñ plik: "
+# ^DeleteOnReboot
+"Usuñ przy ponownym uruchomieniu: "
+# ^ErrorCreatingShortcut
+"B³¹d tworzenia skrótu: "
+# ^ErrorCreating
+"B³¹d tworzenia: "
+# ^ErrorDecompressing
+B³¹d rozpakowywania danych! Uszkodzony instalator?
+# ^ErrorRegistering
+B³¹d rejestracji pliku DLL
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Uruchom: "
+# ^Extract
+"Rozpakuj: "
+# ^ErrorWriting
+"Rozpakuj: b³¹d zapisu do pliku "
+# ^InvalidOpcode
+Instalator uszkodzony: nieprawid³owy kod operacji
+# ^NoOLE
+"Brak OLE dla: "
+# ^OutputFolder
+"Folder wyjœciowy: "
+# ^RemoveFolder
+"Usuñ folder: "
+# ^RenameOnReboot
+"Zmieñ nazwê przy ponownym uruchomieniu: "
+# ^Rename
+"Zmieñ nazwê: "
+# ^Skipped
+"Pominiête: "
+# ^CopyDetails
+Kopiuj szczegó³y do schowka
+# ^LogInstall
+Rejestruj przebieg instalacji
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Macedonian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Macedonian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Macedonian.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+1071
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1251
+# RTL - anything else than RTL means LTR
+-
+# Translation by Sasko Zdravkin [wingman2083@yahoo.com]
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+Èíñòàëèðàœå íà $(^Name)
+# ^UninstallCaption
+Äåèíñòàëèðàœå íà $(^Name)
+# ^LicenseSubCaption
+: Ëèöåíöåí Äîãîâîð
+# ^ComponentsSubCaption
+: Èíñòàëàöèîíè Îïöèè
+# ^DirSubCaption
+: Èíñòàëàöèîíåí Äèðåêòîðèóì
+# ^InstallingSubCaption
+: Èíñòàëèðà
+# ^CompletedSubCaption
+: Çàâðøåíî
+# ^UnComponentsSubCaption
+: Äåèíñòàëàöèîíè Îïöèè
+# ^UnDirSubCaption
+: Äåèíñòàëàöèîíåí Äèðåêòîðèóì
+# ^ConfirmSubCaption
+: Ïîòâðäà
+# ^UninstallingSubCaption
+: Äåèíñòàëèðà
+# ^UnCompletedSubCaption
+: Çàâðøåíî
+# ^BackBtn
+< &Íàçàä
+# ^NextBtn
+Í&àïðåä >
+# ^AgreeBtn
+&Äà
+# ^AcceptBtn
+&Ãè ïðèôà�àì óñëîâèòå îä Ëèöåíöíèîò Äîãîâîð
+# ^DontAcceptBtn
+Í&å ãè ïðèôà�àì óñëîâèòå îä Ëèöåíöíèîò Äîãîâîð
+# ^InstallBtn
+&Èíñòàëèðà¼
+# ^UninstallBtn
+&Äåèíñòàëèðà¼
+# ^CancelBtn
+Îòêàæè
+# ^CloseBtn
+&Çàòâîðè
+# ^BrowseBtn
+&Ïðåáàðóâà¼...
+# ^ShowDetailsBtn
+Ï&îêàæè Äåòàëè
+# ^ClickNext
+Ïðèòèñíåòå 'Íàïðåä' çà äà ïðîäîëæèòå.
+# ^ClickInstall
+Ïðèòèñíåòå 'Èíñòàëèðà¼' çà äà ñå èíñòàëèðà.
+# ^ClickUninstall
+Ïðèòèñíåòå 'Äåèíñòàëèðà¼' çà äà ñå äåèíñòàëèðà.
+# ^Name
+Èìå
+# ^Completed
+Çàâðøåíî
+# ^LicenseText
+Âå ìîëèìå ïðî÷èòà¼òå ãî Ëèöåíöíèîò Äîãîâîð ïðåä äà ñå èíñòàëèðà $(^NameDA). Àêî ãè ïðèôà�àòå ñèòå óñëîâè, ïðèòèñíåòå 'Äà'.
+# ^LicenseTextCB
+Âå ìîëèìå ïðî÷èòà¼òå ãî Ëèöåíöíèîò Äîãîâîð ïðåä äà ñå èíñòàëèðà $(^NameDA). Àêî ãè ïðèôà�àòå ñèòå óñëîâè, ïðèòèñíåòå ãî Check box-îò ïîäîëå. $_CLICK
+# ^LicenseTextRB
+Âå ìîëèìå ïðî÷èòà¼òå ãî Ëèöåíöíèîò Äîãîâîð ïðåä äà ñå èíñòàëèðà $(^NameDA). Àêî ãè ïðèôà�àòå ñèòå óñëîâè, îäáåðåòå ¼à ïðâàòà îïöè¼à ïîäîëå. $_CLICK
+# ^UnLicenseText
+Âå ìîëèìå ïðî÷èòà¼òå ãî Ëèöåíöíèîò Äîãîâîð ïðåä äà ñå äåèíñòàëèðà $(^NameDA). Àêî ãè ïðèôà�àòå ñèòå óñëîâè, ïðèòèñíåòå 'Äà'.
+# ^UnLicenseTextCB
+Âå ìîëèìå ïðî÷èòà¼òå ãî Ëèöåíöíèîò Äîãîâîð ïðåä äà ñå äåèíñòàëèðà $(^NameDA). Àêî ãè ïðèôà�àòå ñèòå óñëîâè, ïðèòèñíåòå ãî Check box-îò ïîäîëå. $_CLICK
+# ^UnLicenseTextRB
+Âå ìîëèìå ïðî÷èòà¼òå ãî Ëèöåíöíèîò Äîãîâîð ïðåä äà ñå äåèíñòàëèðà $(^NameDA). Àêî ãè ïðèôà�àòå ñèòå óñëîâè, îäáåðåòå ¼à ïðâàòà îïöè¼à ïîäîëå. $_CLICK
+# ^Custom
+Ïîäåñåíî
+# ^ComponentsText
+×åêèðà¼òå ãè êîìïîíåíòèòå øòî ñàêàòå äà ñå èíñòàëèðààò èëè äå÷åêèðà¼òå ãè òèå øòî íå ñàêàòå äà ñå èíñòàëèðààò. $_CLICK 
+# ^ComponentsSubText1
+Îäáåðåòå âèä íà èíñòàëàöè¼à:
+# ^ComponentsSubText2_NoInstTypes
+Îäáåðåòå ãè êîìïîíåíòèòå øòî �å ñå èíñòàëèðààò:
+# ^ComponentsSubText2
+èëè, îäáåðåòå äðóãè êîìïîíåíòè øòî ñàêàòå äà ñå èíñòàëèðààò:
+# ^UnComponentsText
+×åêèðà¼òå ãè êîìïîíåíòèòå øòî ñàêàòå äà ñå äåèíñòàëèðààò èëè äå÷åêèðà¼òå ãè òèå øòî íå ñàêàòå äà ñå äåèíñòàëèðààò. $_CLICK
+# ^UnComponentsSubText1
+Îäáåðåòå ãî âèäîò íà äåèíñòàëàöè¼àòà:
+# ^UnComponentsSubText2_NoInstTypes
+Îäáåðåòå ãè êîìïîíåíòèòå øòî �å ñå äåèíñòàëèðààò:
+# ^UnComponentsSubText2
+èëè, îäáåðåòå äðóãè êîìïîíåíòè øòî ñàêàòå äà ñå äåèíñòàëèðààò:
+# ^DirText
+Èíñòàëàöèîíèîò ïðîãðàì �å ãî èíñòàëèðà $(^NameDA) âî ñëåäíèîâ äèðåêòîðèóì. Çà äà èíñòàëèðàòå âî äðóã, ïðèòèñíåòå 'Ïðåáàðóâà¼' è îäáåðåòå äðóã äèðåêòîðèóì. $_CLICK
+# ^DirSubText
+Äèðåêòîðèóì êàäå øòî �å ñå èíñòàëèðà
+# ^DirBrowseText
+Îäáåðåòå äèðåêòîðèóì çà èíñòàëèðàœå íà $(^NameDA):
+# ^UnDirText
+Èíñòàëàöèîíèîò ïðîãðàì �å ãî äåèíñòàëèðà $(^NameDA) îä ñëåäíèîâ äèðåêòîðèóì. Çà äà äåèíñòàëèðàòå îä äðóã, ïðèòèñíåòå 'Ïðåáàðóâà¼' è îäáåðåòå äðóã äèðåêòîðèóì. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Îäáåðåòå ãî äèðåêòîðèóìîò çà äåèíñòàëèðàœå íà $(^NameDA):
+# ^SpaceAvailable
+"Ñëîáîäåí ïðîñòîð: "
+# ^SpaceRequired
+"Ïîòðåáåí ïðîñòîð: "
+# ^UninstallingText
+$(^NameDA) �å áèäå äåèíñòàëèðàí îä ñëåäíèîâ äèðåêòîðèóì. $_CLICK
+# ^UninstallingSubText
+Äåèíñòàëèðà îä:
+# ^FileError
+Ãðåøêà ïðè îòâàðàœåòî íà äàòîòåêàòà çà çàïèøóâàœå: \r\n\t"$0"\r\nÏðèòèñíåòå 'Îòêàæè' çà äà ¼à îòêàæåòå èíñòàëàöè¼àòà,\r\n'Ïðîáà¼' çà äà ïðîáà äà ¼à çàïèøå äàòîòåêàòà, èëè\r\n'Èãíîðèðà¼' çà äà ¼à ïðåðèïà äàòîòåêàòà
+# ^FileError_NoIgnore
+Ãðåøêà ïðè îòâàðàœåòî íà äàòîòåêàòà çà çàïèøóâàœå: \r\n\t"$0"\r\nÏðèòèñíåòå 'Ïðîáà¼' çà äà ïðîáà äà ¼à çàïèøå äàòîòåêàòà, èëè\r\n'Îòêàæè' çà äà ¼à îòêàæå èíñòàëàöè¼àòà
+# ^CantWrite
+"Íå ìîæå äà çàïèøå: "
+# ^CopyFailed
+Êîïèðàœåòî íå óñïåà
+# ^CopyTo
+"Êîïèðà¼ äî "
+# ^Registering
+"Ðåãèñòðèðà: "
+# ^Unregistering
+"Äåðåãèñòðèðà: "
+# ^SymbolNotFound
+"Íå ìîæå äà ãî íà¼äå ñèìáîëîò: "
+# ^CouldNotLoad
+"Íå ìîæå äà ëîàäèðà: "
+# ^CreateFolder
+"Ñîçäàäè äèðåêòîðèóì: "
+# ^CreateShortcut
+"Ñîçäàäè êðàòåíèöà: "
+# ^CreatedUninstaller
+"Ñîçäàäåí äåèíñòàëàòîð: "
+# ^Delete
+"Èçáðèøàíà äàòîòåêà: "
+# ^DeleteOnReboot
+"Èçáðèøè ïîñëå ðåñòàðòèðàœå: "
+# ^ErrorCreatingShortcut
+"Ãðåøêà ïðè ñîçäàâàœåòî íà ñêðàòåíèöàòà: "
+# ^ErrorCreating
+"Ãðåøêà ïðè ñîçäàâàœåòî: "
+# ^ErrorDecompressing
+Ãðåøêà ïðè îòïàêóâàœåòî íà ïîäàòîöèòå! Ðàñèïàí èíñòàëàöèîíåí ïðîãðàì?
+# ^ErrorRegistering
+Ãðåøêà ïðè ðåãèñòðèðàœåòî íà DLL
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Ïîêðåíè: "
+# ^Extract
+"Îòïàêóâàíî: "
+# ^ErrorWriting
+"Îòïàêóâà¼: ãðåøêà ïðè ñíèìàœåòî âî äàòîòåêàòà "
+# ^InvalidOpcode
+Ðàñèïàí èíñòàëàöèîíåí ïðîãðàì: ïîãðåøåí êîä
+# ^NoOLE
+"Íåìà OLE çà: "
+# ^OutputFolder
+"Èíñòàëàöèîíåí äèðåêòîðèóì: "
+# ^RemoveFolder
+"Èçáðèøàí äèðåêòîðèóì: "
+# ^RenameOnReboot
+"Ïðåèìåíóâà¼ ïîñëå ðåñòàðòèðàœå: "
+# ^Rename
+"Ïðåèìåíóâà¼: "
+# ^Skipped
+"Ïðåðèïàíî: "
+# ^CopyDetails
+Êîïèðà¼ ãè Äåòàëèòå âî Clipboard-îò
+# ^LogInstall
+Ñíèìè ëîã çà èíñòàëàöèîíèòå ïðîöåñè
+# ^Byte
+á
+# ^Kilo
+Ê
+# ^Mega
+Ì
+# ^Giga
+Ã
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Slovak.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Slovak.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Slovak.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1051
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1250
+# RTL - anything else than RTL means LTR
+-
+#Translated by: Kypec (peter.dzugas@mahe.sk); edited by: Marián Hikaník (podnety@mojepreklady.net), Ivan Masár <helix84@centrum.sk>, 2008.
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+Inštalácia programu $(^Name)
+# ^UninstallCaption
+Odinštalovanie programu $(^Name)
+# ^LicenseSubCaption
+: Licenèná zmluva
+# ^ComponentsSubCaption
+: Možnosti inštalácie
+# ^DirSubCaption
+: Inštalaèný prieèinok
+# ^InstallingSubCaption
+: Prebieha inštalácia
+# ^CompletedSubCaption
+: Hotovo
+# ^UnComponentsSubCaption
+: Možnosti odinštalovania
+# ^UnDirSubCaption
+: Prieèinok s informáciami pre odinštalovanie
+# ^ConfirmSubCaption
+: Potvrdenie
+# ^UninstallingSubCaption
+: Prebieha odinštalácia
+# ^UnCompletedSubCaption
+: Hotovo
+# ^BackBtn
+< &Spä�
+# ^NextBtn
+Ï&alej >
+# ^AgreeBtn
+&Súhlasím
+# ^AcceptBtn
+&Súhlasím s podmienkami licenènej zmluvy
+# ^DontAcceptBtn
+N&esúhlasím s podmienkami licenènej zmluvy
+# ^InstallBtn
+&Nainštalova�
+# ^UninstallBtn
+&Odinštalova�
+# ^CancelBtn
+Zruši�
+# ^CloseBtn
+&Zatvori�
+# ^BrowseBtn
+&Preh¾adáva�...
+# ^ShowDetailsBtn
+&Podrobnosti
+# ^ClickNext
+V inštalácii pokraèujte kliknutím na tlaèidlo Ïalej.
+# ^ClickInstall
+Pre spustenie inštalácie kliknite na tlaèidlo Nainštalova�.
+# ^ClickUninstall
+Pre spustenie procesu odinštalovania kliknite na tlaèidlo Odinštalova�.
+# ^Name
+Názov
+# ^Completed
+Hotovo
+# ^LicenseText
+Pred inštaláciou programu si prosím dôkladne preèítajte licenènú zmluvu $(^NameDA). Ak súhlasíte so všetkými jej podmienkami, kliknite na tlaèidlo Súhlasím.
+# ^LicenseTextCB
+Pred inštaláciou programu si prosím dôkladne preèítajte licenènú zmluvu $(^NameDA). Ak súhlasíte so všetkými jej podmienkami, zaškrtnite nasledujúce políèko. $_CLICK
+# ^LicenseTextRB
+Pred inštaláciou programu si prosím dôkladne preèítajte licenènú zmluvu $(^NameDA). Ak súhlasíte so všetkými jej podmienkami, oznaète prvú z nasledujúcich možností. $_CLICK
+# ^UnLicenseText
+Pred odinštalovaním programu si prosím dôkladne preèítajte licenènú zmluvu $(^NameDA). Ak súhlasíte so všetkými jej podmienkami, kliknite na tlaèidlo Súhlasím.
+# ^UnLicenseTextCB
+Pred odinštalovaním programu si prosím dôkladne preèítajte licenènú zmluvu $(^NameDA). Ak súhlasíte so všetkými jej podmienkami, zaškrtnite nasledujúce políèko. $_CLICK
+# ^UnLicenseTextRB
+Pred odinštalovaním programu si prosím dôkladne preèítajte licenènú zmluvu $(^NameDA). Ak súhlasíte so všetkými jej podmienkami, oznaète prvú z nasledujúcich možností. $_CLICK
+# ^Custom
+Volite¾ná
+# ^ComponentsText
+Oznaète súèasti programu, ktoré chcete nainštalova� a odznaète tie, ktoré nainštalova� nechcete. $_CLICK
+# ^ComponentsSubText1
+Vyberte si typ inštalácie:
+# ^ComponentsSubText2_NoInstTypes
+Vyberte si tie súèasti programu, ktoré chcete nainštalova�:
+# ^ComponentsSubText2
+Alebo oznaète volite¾né doplnky, ktoré chcete nainštalova�:
+# ^UnComponentsText
+Oznaète súèasti programu, ktoré chcete odinštalova� a odznaète tie, ktoré chcete ponecha� nainštalované. $_CLICK
+# ^UnComponentsSubText1
+Zvo¾te typ deinštalácie:
+# ^UnComponentsSubText2_NoInstTypes
+Vyberte súèasti, ktoré chcete odinštalova�:
+# ^UnComponentsSubText2
+Alebo oznaète volite¾né súèasti, ktoré chcete odinštalova�:
+# ^DirText
+$(^NameDA) bude nainštalovaný do nasledujúceho prieèinka. Inštalova� do iného prieèinka môžete po kliknutí na tlaèidlo Preh¾adáva� a vybraní iného prieèinka. $_CLICK
+# ^DirSubText
+Cie¾ový prieèinok
+# ^DirBrowseText
+Zvo¾te prieèinok, do ktorého sa nainštaluje program $(^NameDA):
+# ^UnDirText
+Inštalátor odinštaluje program $(^NameDA) z nasledovného prieèinka. Ak ho chcete odinštalova� z iného prieèinka, kliknite na tlaèidlo Preh¾adáva� a vyberte iný prieèinok. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Zvo¾te prieèinok, z ktorého sa odinštaluje program $(^NameDA):
+# ^SpaceAvailable
+"Vo¾né miesto na disku: "
+# ^SpaceRequired
+"Potrebné miesto na disku: "
+# ^UninstallingText
+Program $(^NameDA) sa odinštaluje z nasledovného prieèinka. $_CLICK
+# ^UninstallingSubText
+Prebieha odinštalovanie z:
+# ^FileError
+Chyba pri otváraní súboru na zápis: \r\n\r\n$0\r\n\r\n. Ak chcete inštaláciu ukonèi�, kliknite na tlaèidlo Ukonèi�,\r\ ak chcete zápis súboru zopakova�, kliknite na tlaèidlo Opakova� alebo kliknite na tlaèidlo \r\nIgnorova�, ak chcete inštaláciu tohto súboru vynecha�.
+# ^FileError_NoIgnore
+Chyba pri otváraní súboru na zápis: \r\n\r\n$0\r\n\r\n. Ak chcete zopakova� zápis súboru, kliknite na tlaèidlo Opakova�, alebo kliknite na tlaèidlo \r\nZruši�, v prípade, že chcete inštaláciu ukonèi�.
+# ^CantWrite
+"Nemožno zapísa� súbor: "
+# ^CopyFailed
+Kopírovanie zlyhalo.
+# ^CopyTo
+"Kopírova� do "
+# ^Registering
+"Registruje sa: "
+# ^Unregistering
+"Vymazáva sa z registra: "
+# ^SymbolNotFound
+"Nemožno nájs� symbol: "
+# ^CouldNotLoad
+"Nemožno naèíta�: "
+# ^CreateFolder
+"Vytvorený prieèinok: "
+# ^CreateShortcut
+"Vytvorený odkaz: "
+# ^CreatedUninstaller
+"Program pre odinštalovanie: "
+# ^Delete
+"Vymazaný súbor: "
+# ^DeleteOnReboot
+"Vymaza� po reštartovaní systému: "
+# ^ErrorCreatingShortcut
+"Chyba pri vytváraní odkazu: "
+# ^ErrorCreating
+"Chyba pri vytváraní: "
+# ^ErrorDecompressing
+Chyba pri dekomprimovaní dát! Inštalátor je pravdepodobne poškodený...
+# ^ErrorRegistering
+Chyba pri registrácii súèasti
+# ^ExecShell
+"Vykona� príkaz: "
+# ^Exec
+"Spusti�: "
+# ^Extract
+"Extrahuje sa: "
+# ^ErrorWriting
+"Chyba pri zápise do súboru "
+# ^InvalidOpcode
+Inštalátor je pravdepodobne poškodený, pretože obsahuje neplatný operaèný kód.
+# ^NoOLE
+"Žiadny zápis OLE pre: "
+# ^OutputFolder
+"Výstupný prieèinok: "
+# ^RemoveFolder
+"Odstráni� prieèinok: "
+# ^RenameOnReboot
+"Premenova� po reštartovaní systému: "
+# ^Rename
+"Premenova�: "
+# ^Skipped
+"Vynechané: "
+# ^CopyDetails
+Skopírova� podrobnosti do schránky
+# ^LogInstall
+Zaznamena� priebeh inštalácie
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Indonesian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Indonesian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Indonesian.nsh	(revision 728)
@@ -0,0 +1,129 @@
+;Language: Indonesian (1057)
+;By Ariel825010106@yahoo.com modified by was.uthm@gmail.com in April 2009
+
+!insertmacro LANGFILE "Indonesian" "Indonesian"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Selamat datang di program instalasi $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Program ini akan membantu anda dalam proses instalasi $(^NameDA).$\r$\n$\r$\nAnda sangat disarankan untuk menutup program lainnya sebelum memulai proses instalasi. Hal ini diperlukan agar berkas yang terkait dapat diperbarui tanpa harus booting ulang komputer anda.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Selamat datang di program penghapusan $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Program ini akan membantu anda pada proses penghapusan $(^NameDA).$\r$\n$\r$\nSebelum memulai proses penghapusan, pastikan dulu $(^NameDA) tidak sedang digunakan.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Perihal Lisensi"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Silahkan membaca perihal lisensi sebelum memulai proses instalasi $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Jika anda setuju dan menerima semua pernyataan, tekan tombol Saya Setuju untuk melanjutkan. Anda harus setuju untuk memulai instalasi $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Jika anda setuju dan menerima semua pernyatan, beri tanda centang. Anda harus setuju untuk memulai instalasi $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Jika anda setuju dan menerima semua pernyataan, pilihlah salah satu item dibawah ini. Anda harus setuju untuk memulai instalasi $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Perihal Lisensi"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Silahkan membaca lisensi berikut sebelum melakukan penghapusan $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Jika anda setuju dan menerima semua pernyataan, tekan tombol Saya Setuju untuk melanjutkan. Anda harus setuju untuk memulai proses penghapusan $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Jika anda setuju dan menerima semua pernyataan, beri tanda centang. Anda harus setuju untuk memulai proses penghapusan $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Jika anda setuju dan menerima semua pernyataan, pilihlah salah satu item dibawah ini. Anda harus setuju untuk memulai proses penghapusan $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Tekan tombol Page Down untuk melihat pernyataan berikutnya."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Pilih Komponen"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Pilih komponen fitur tambahan dari $(^NameDA) yang ingin di instal."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Pilih Komponen"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Pilih komponen fitur tambahan dari $(^NameDA) yang ingin dihapus."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Deskripsi"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Tunjuk ke salah satu komponen untuk melihat deskripsi tentang komponen itu."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Tunjuk ke salah satu komponen untuk melihat deskripsi tentang komponen itu."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Pilih Lokasi Instalasi"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Pilih lokasi untuk instalasi program $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Pilih Lokasi berkas yang akan dihapus"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Pilih lokasi instalasi program $(^NameDA) yang akan dihapus."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Proses instalasi "
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Mohon tunggu sejenak, instalasi program $(^NameDA) sedang berlangsung."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Instalasi Selesai"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Seluruh proses instalasi sudah paripurna."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Instalasi Dibatalkan"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Proses instalasi tidak selesai dengan sempurna."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Proses penghapusan"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Mohon tunggu sejenak, penghapusan program $(^NameDA) sedang berlangsung."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Proses Penghapusan Selesai"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Seluruh proses penghapusan sudah paripurna."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Penghapusan Dibatalkan"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Proses penghapusa tidak selesai dengan sempurna."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Menutup Instalasi Program $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) sudah di instal di komputer anda.$\r$\n$\r$\nTekan tombol Selesai untuk menutup program."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Komputer anda memerlukan booting ulang untuk menyempurnakan proses instalasi $(^NameDA). Apakah anda akan melakukan booting ulang sekarang juga?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Menutup program penghapusan $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) sudah dihapus dari komputer anda.$\r$\n$\r$\nTekan tombol Selesai untuk menutup."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Komputer anda memerlukan booting untuk menyempurnakan proses penghapusan $(^NameDA). Apakah anda akan melakukan booting ulang sekarang juga?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Booting ulang sekarang"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Booting ulang nanti"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Jalankan $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Buka berkas Readme"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Selesai"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Pilih lokasi dari Menu Start"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Pilih lokasi dari Menu Start untuk meletakkan shortcut $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Pilih lokasi dari Menu Start untuk meletakkan shortcut program ini. Anda bisa juga membuat lokasi baru dengan cara menulis nama lokasi yang dikehendaki."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Tidak perlu membuat shortcut"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Penghapusan $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Menghapus $(^NameDA) dari komputer anda."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Apakah anda yakin ingin menghentikan proses instalasi $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Apakah anda yakin ingin menghentikan proses penghapusan $(^Name)?"
+!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "Pilihan Pemakai"
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "Pilihlah pemakai komputer yang akan menggunakan program $(^NameDA)."
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "Apakah anda akan melakukan instalasi $(^NameDA) untuk anda sendiri atau untuk semua pemakai komputer ini. $(^ClickNext)"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "Instalasi untuk semua pemakai komputer ini"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Instalasi hanya untuk saya sendiri"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Portuguese.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Portuguese.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Portuguese.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+2070
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation v4.0.3 by DragonSoull <dragonsoull@madalien.tk> with help from Dre` - Updated by Ramon
+# ^Branding
+Sistema de Instalação Nullsoft %s
+# ^SetupCaption
+Instalação de $(^Name)
+# ^UninstallCaption
+Desinstalação de $(^Name)
+# ^LicenseSubCaption
+: Contrato de Licença
+# ^ComponentsSubCaption
+: Opções de instalação
+# ^DirSubCaption
+: Diretório de instalação
+# ^InstallingSubCaption
+: Instalando Ficheiros
+# ^CompletedSubCaption
+: Concluído
+# ^UnComponentsSubCaption
+: Opções de Desinstalação
+# ^UnDirSubCaption
+: Pasta de Desinstalação
+# ^ConfirmSubCaption
+: Confirmação
+# ^UninstallingSubCaption
+: Desinstalando
+# ^UnCompletedSubCaption
+: Concluído
+# ^BackBtn
+< &Anterior
+# ^NextBtn
+&Seguinte >
+# ^AgreeBtn
+&Aceito
+# ^AcceptBtn
+Eu &aceito os termos do Contrato de Licença
+# ^DontAcceptBtn
+Eu &não aceito os termos do Contrato de Licença
+# ^InstallBtn
+&Instalar
+# ^UninstallBtn
+&Desinstalar
+# ^CancelBtn
+Cancelar
+# ^CloseBtn
+&Fechar
+# ^BrowseBtn
+&Procurar...
+# ^ShowDetailsBtn
+Ver &Detalhes
+# ^ClickNext
+Clique em 'Seguinte' para continuar.
+# ^ClickInstall
+Clique em 'Instalar' para iniciar a instalação.
+# ^ClickUninstall
+Clique em 'Desinstalar' para iniciar a desinstalação.
+# ^Name
+Nome
+# ^Completed
+Concluído
+# ^LicenseText
+Por favor reveja o acordo de licensa antes de instalar $(^NameDA). Se concorda com todos os termos da licensa, clique em 'Aceito'.
+# ^LicenseTextCB
+Por favor reveja o acordo de licensa antes de instalar $(^NameDA). Se concorda com todos os termos da licensa, clique na caixa de seleção abaixo. $_CLICK
+# ^LicenseTextRB
+Por favor reveja o acordo de licensa antes de instalar $(^NameDA). Se concorda com todos os termos da licensa, escolha a primeira opção abaixo. $_CLICK
+# ^UnLicenseText
+Por favor reveja o acordo de licensa antes de desinstalar $(^NameDA). Se concorda com todos os termos da licensa, clique em 'Aceito'.
+# ^UnLicenseTextCB
+Por favor reveja o acordo de licensa antes de desinstalar $(^NameDA). Se concorda com todos os termos da licensa, clique na caixa de seleção abaixo. $_CLICK
+# ^UnLicenseTextRB
+Por favor reveja o acordo de licensa antes de desinstalar $(^NameDA). Se concorda com todos os termos da licensa, escolha a primeira opção abaixo. $_CLICK
+# ^Custom
+Personalizado
+# ^ComponentsText
+Marque os componentes que deseja instalar e desmarque os componentes que não deseja instalar. $_CLICK
+# ^ComponentsSubText1
+Escolha o tipo de instalação:
+# ^ComponentsSubText2_NoInstTypes
+Escolha os componentes para instalar:
+# ^ComponentsSubText2
+Ou, escolha os componentes opcionais que deseja instalar:
+# ^UnComponentsText
+Marque os componentes que queira desinstalar e vice versa. $_CLICK
+# ^UnComponentsSubText1
+Escolha o tipo de desinstalação: 
+# ^UnComponentsSubText2_NoInstTypes
+Escolha os componentes para desinstalar:
+# ^UnComponentsSubText2
+Ou, escolha os componentes opcionais que queira desinstalar:
+# ^DirText
+O $(^NameDA) será instalado na seguinte pasta. Para instalar numa pasta diferente, clique em 'Procurar...' e escolha outra pasta. $_CLICK
+# ^DirSubText
+Pasta de Destino
+# ^DirBrowseText
+Escolha uma pasta para instalar o $(^NameDA):
+# ^UnDirText
+O $(^NameDA) será desinstalado da seguinte pasta. Para desinstalar de uma pasta diferente, clique em 'Procurar...' e escolha outra pasta. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Escolha uma pasta de onde será desinstalado o $(^NameDA):
+# ^SpaceAvailable
+"Espaço disponível: "
+# ^SpaceRequired
+"Espaço necessário: "
+# ^UninstallingText
+$(^NameDA) será desinstalado da seguinte pasta. $_CLICK
+# ^UninstallingSubText
+Desinstalando de:
+# ^FileError
+Erro ao abrir ficheiro para escrita: \r\n\t"$0"\r\nClique em Abortar para abortar a instalação,\r\nRepetir para tentar novamente a escrita do ficheiro, ou\r\nIgnorar para ignorar este ficheiro.
+# ^FileError_NoIgnore
+Erro ao abrir ficheiro para escrita: \r\n\t"$0"\r\nClique em Repetir para tentar novamente a gravação do ficheiro, ou\r\nCancelar para abortar a instalação.
+# ^CantWrite
+"Não foi possível escrever: "
+# ^CopyFailed
+Falha ao copiar
+# ^CopyTo
+"Copiar para "
+# ^Registering
+"Registando: "
+# ^Unregistering
+"Desregistando: "
+# ^SymbolNotFound
+"Símbolo não encontrado: "
+# ^CouldNotLoad
+"Não foi possível carregar: "
+# ^CreateFolder
+"Criando diretório: "
+# ^CreateShortcut
+"Criando atalho: "
+# ^CreatedUninstaller
+"Criando desinstalador: "
+# ^Delete
+"Apagando ficheiro: "
+# ^DeleteOnReboot
+"Apagar ao reiniciar: "
+# ^ErrorCreatingShortcut
+"Erro ao criar atalho: "
+# ^ErrorCreating
+"Erro ao criar: "
+# ^ErrorDecompressing
+Erro ao descomprimir dados! Instalador corrompido?
+# ^ErrorRegistering
+Erro ao registar DLL
+# ^ExecShell
+"Executando pelo Shell: "
+# ^Exec
+"Executando: "
+# ^Extract
+"Extraindo: "
+# ^ErrorWriting
+"Extraindo: erro ao escrever ficheiro "
+# ^InvalidOpcode
+Instalador corrompido: código de operação inválido
+# ^NoOLE
+"Sem OLE para: "
+# ^OutputFolder
+"Pasta de destino: "
+# ^RemoveFolder
+"Removendo pasta: "
+# ^RenameOnReboot
+"Renomear ao reiniciar: "
+# ^Rename
+"Renomeando: "
+# ^Skipped
+"Ignorado: "
+# ^CopyDetails
+Copiar detalhes para a Área de Transfêrencia
+# ^LogInstall
+Registar processo de instalação
+# ^Byte
+B
+# kilo
+K
+# mega
+M
+# giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Farsi.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Farsi.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Farsi.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+1065
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1256
+# RTL - anything else than RTL means LTR
+RTL
+# Translation By FzerorubigD - FzerorubigD@gmail.com - Thanx to all people help me in forum.persiantools.com, Elnaz Sarbar <elnaz@farsiweb.info>
+# ^Branding
+ÓíÓÊã äÕÈ äÇá�ÓÇÝÊ %s
+# ^SetupCaption
+äÕÈ $(^Name) 
+# ^UninstallCaption
+ÍÐÝ $(^Name) 
+# ^LicenseSubCaption
+: ãÌæÒ äÕÈ
+# ^ComponentsSubCaption
+: �Òíäå�åÇì äÕÈ
+# ^DirSubCaption
+: �æÔå äÕÈ
+# ^InstallingSubCaption
+: ÏÑ ÍÇá äÕÈ
+# ^CompletedSubCaption
+: �ÇíÇä íÇÝÊ
+# ^UnComponentsSubCaption
+: �Òíäå�åÇì ÍÐÝ
+# ^UnDirSubCaption
+: �æÔå ÍÐÝ
+# ^ConfirmSubCaption
+: ÊÃííÏ
+# ^UninstallingSubCaption
+: ÏÑ ÍÇá ÍÐÝ
+# ^UnCompletedSubCaption
+: �ÇíÇä íÇÝÊ
+# ^BackBtn
+&ÞÈá 
+# ^NextBtn
+&ÈÚÏ
+# ^AgreeBtn
+&ãæÇÝÞã
+# ^AcceptBtn
+ãä åãå ÈäÏåÇì ãÌæÒ ÑÇ ÞÈæá &ÏÇÑã
+# ^DontAcceptBtn
+ãä ÈäÏåÇì ãÌæÒ ÑÇ ÞÈæá &äÏÇÑã
+# ^InstallBtn
+&äÕÈ
+# ^UninstallBtn
+&ÍÐÝ
+# ^CancelBtn
+ÇäÕÑÇÝ
+# ^CloseBtn
+&ÈÓÊä
+# ^BrowseBtn
+&ãÑæÑ...
+# ^ShowDetailsBtn
+äãÇíÔ ÌÒÆíÇÊ
+# ^ClickNext
+ÈÑÇì ÇÏÇãå Ñæì Ï˜ãå  ÈÚÏ ˜áí˜ ˜äíÏ.
+# ^ClickInstall
+ÈÑÇì ÔÑæÚ äÕÈ Ñæì Ï˜ãå äÕÈ ˜áí˜ ˜äíÏ.
+# ^ClickUninstall
+ÈÑÇì ÔÑæÚ ÍÐÝ Ñæì Ï˜ãå ÍÐÝ ˜áí˜ ˜äíÏ.
+# ^Name
+äÇã
+# ^Completed
+�ÇíÇä íÇÝÊ
+# ^LicenseText
+áØÝÇð ÞÈá ÇÒ äÕÈ $(^NameDA) ãÊä ãÌæÒ ÑÇ ÈÎæÇäíÏ. Ç�Ñ åãå ÈäÏåÇì Âä ÑÇ ÞÈæá ÏÇÑíÏ Ñæì Ï˜ãå ãæÇÝÞã ˜áí˜ ˜äíÏ.
+# ^LicenseTextCB
+áØÝÇð ÞÈá ÇÒ äÕÈ $(^NameDA) ãÊä ãÌæÒ ÑÇ ÈÎæÇäíÏ. Ç�Ñ åãå ÈäÏåÇì Âä ÑÇ ÞÈæá ÏÇÑíÏ Ñæì ÌÚÈå äÔÇäå�Òäì ÒíÑ ˜áí˜ ˜äíÏ. $_CLICK
+# ^LicenseTextRB
+áØÝÇð ÞÈá ÇÒ äÕÈ $(^NameDA) ãÊä ãÌæÒ ÑÇ ÈÎæÇäíÏ. Ç�Ñ åãå ÈäÏåÇì Âä ÑÇ ÞÈæá ÏÇÑíÏ �Òíäå Çæá ÑÇ ÇäÊÎÇÈ ˜äíÏ. $_CLICK
+# ^UnLicenseText
+áØÝÇð ÞÈá ÇÒ ÍÐÝ $(^NameDA) ãÊä ãÌæÒ ÑÇ ÈÎæÇäíÏ. Ç�Ñ åãå ÈäÏåÇì Âä ÑÇ ÞÈæá ÏÇÑíÏ Ñæì Ï˜ãå ãæÇÝÞã ˜áí˜ ˜äíÏ.
+# ^UnLicenseTextCB
+áØÝÇð ÞÈá ÇÒ ÍÐÝ $(^NameDA) ãÊä ãÌæÒ ÑÇ ÈÎæÇäíÏ. Ç�Ñ åãå ÈäÏåÇì Âä ÑÇ ÞÈæá ÏÇÑíÏ Ñæì ÌÚÈå äÔÇäå�Òäì ÒíÑ ˜áí˜ ˜äíÏ. $_CLICK
+# ^UnLicenseTextRB
+áØÝÇð ÞÈá ÇÒ ÍÐÝ $(^NameDA) ãÊä ãÌæÒ ÑÇ ÈÎæÇäíÏ. Ç�Ñ åãå ÈäÏåÇì Âä ÑÇ ÞÈæá ÏÇÑíÏ �Òíäå Çæá ÑÇ ÇäÊÎÇÈ ˜äíÏ. $_CLICK
+# ^Custom
+ÓÝÇÑÔì
+# ^ComponentsText
+˜äÇÑ ÈÎÔ�åÇíì ˜å ãì�ÎæÇåíÏ äÕÈ ÔæäÏ äÔÇäå ÈÒäíÏ æ äÔÇäå ÈÎÔ�åÇíì ÑÇ ˜å äãì�ÎæÇåíÏ äÕÈ ÔæäÏ ÈÑÏÇÑíÏ. $_CLICK
+# ^ComponentsSubText1
+äæÚ äÕÈ ÑÇ ãÔÎÕ ˜äíÏ: 
+# ^ComponentsSubText2_NoInstTypes
+ÈÎÔ�åÇíì ÑÇ ˜å ãì�ÎæÇåíÏ äÕÈ ÔæäÏ ÇäÊÎÇÈ ˜äíÏ:
+# ^ComponentsSubText2
+íÇ¡ ÈÎÔ�åÇì ÇÎÊíÇÑì ÑÇ ˜å ãì�ÎæÇåíÏ äÕÈ ÔæäÏ ÇäÊÎÇÈ ˜äíÏ: 
+# ^UnComponentsText
+˜äÇÑ ÈÎÔ�åÇíì ˜å ãì�ÎæÇåíÏ ÍÐÝ ÔæäÏ äÔÇäå ÈÒäíÏ æ äÔÇäå ÈÎÔ�åÇíì ÑÇ ˜å äãì�ÎæÇåíÏ ÍÐÝ ÔæäÏ ÈÑÏÇÑíÏ. $_CLICK
+# ^UnComponentsSubText1
+äæÚ ÍÐÝ ÑÇ ÇäÊÎÇÈ ˜äíÏ: 
+# ^UnComponentsSubText2_NoInstTypes
+ÈÎÔ�åÇíì ÑÇ ˜å ãì�ÎæÇåíÏ ÍÐÝ ÔæäÏ ÇäÊÎÇÈ ˜äíÏ:
+# ^UnComponentsSubText2
+íÇ¡ ÈÎÔ�åÇì ÇÎÊíÇÑì ÑÇ ˜å ãì�ÎæÇåíÏ ÍÐÝ ÔæäÏ ÇäÊÎÇÈ ˜äíÏ: 
+# ^DirText
+ÈÑäÇãå äÕÈ¡ $(^NameDA) ÑÇ ÏÑ �æÔå ÒíÑ äÕÈ ÎæÇåÏ ˜ÑÏ. ÈÑÇì äÕÈ ÏÑ �æÔå Ïí�Ñ Ñæì Ï˜ãå ãÑæÑ ˜áí˜ ˜äíÏ æ �æÔå Ïí�Ñì ÇäÊÎÇÈ ˜äíÏ. $_CLICK
+# ^DirSubText
+�æÔå ãÞÕÏ
+# ^DirBrowseText
+ÇäÊÎÇÈ �æÔå ÈÑÇì äÕÈ $(^NameDA):
+# ^UnDirText
+ÈÑäÇãå äÕÈ¡ $(^NameDA) ÑÇ ÇÒ �æÔå ÒíÑ ÍÐÝ ÎæÇåÏ ˜ÑÏ. ÈÑÇì äÕÈ ÏÑ �æÔå Ïí�Ñ Ñæì Ï˜ãå ãÑæÑ ˜áí˜ ˜äíÏ æ �æÔå Ïí�Ñì ÇäÊÎÇÈ ˜äíÏ. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+ÇäÊÎÇÈ �æÔå ÈÑÇì ÍÐÝ $(^NameDA):
+# ^SpaceAvailable
+"ÝÖÇì ãæÌæÏ: "
+# ^SpaceRequired
+"ÝÖÇì ãæÑÏ äíÇÒ: "
+# ^UninstallingText
+þ(^NameDA) ÇÒ �æÔå ÒíÑ ÍÐÝ ÎæÇåÏ ÔÏ. $_CLICK
+# ^UninstallingSubText
+ÍÐÝ ÇÒ: 
+# ^FileError
+ÎØÇ åä�Çã ÈÇÒ ˜ÑÏä �ÑæäÏå ÈÑÇì äæÔÊä: \r\n\r\n$0\r\n\n ÈÑÇì ÊæÞÝ äÕÈ Ñæì Abort \r\n ÈÑÇì ÊáÇÔ ãÌÏÏ Ñæì Retry \r\n æ ÈÑÇì ÕÑÝ�äÙÑ ÇÒ Çíä �ÑæäÏå Ñæì Ignore ˜áí˜ ˜äíÏ.
+# ^FileError_NoIgnore
+ÎØÇ åä�Çã ÈÇÒ ˜ÑÏä �ÑæäÏå ÈÑÇì äæÔÊä: \r\n\r\n$0\r\n\nÈÑÇì ÊáÇÔ ãÌÏÏ Ñæì Retry\r\næ ÈÑÇì ÇäÕÑÇÝ Ñæì Cancel ˜áí˜ ˜äíÏ.
+# ^CantWrite
+"äæÔÊä ãã˜ä äíÓÊ: "
+# ^CopyFailed
+äÓÎå�ÈÑÏÇÑì äÇãæÝÞ ÈæÏ.
+# ^CopyTo
+"äÓÎå�ÈÑÏÇÑì ÏÑ: "
+# ^Registering
+"ÏÑ ÍÇá ËÈÊ: "
+# ^Unregistering
+"ÏÑ ÍÇá ÍÐÝ ËÈÊ: "
+# ^SymbolNotFound
+"ÚáÇãÊ �íÏÇ äÔÏ: "
+# ^CouldNotLoad
+"ÈÇÑ�ÐÇÑì ãã˜ä äíÓÊ: "
+# ^CreateFolder
+"ÇíÌÇÏ �æÔå: "
+# ^CreateShortcut
+"ÇíÌÇÏ ãíÇä�ÈõÑ: "
+# ^CreatedUninstaller
+"ÍÐÝ�˜ääÏå ÇíÌÇÏ ÔÏ: "
+# ^Delete
+"ÍÐÝ �ÑæäÏå: "
+# ^DeleteOnReboot
+"ÍÐÝ åä�Çã ÑÇå ÇäÏÇÒì ãÌÏÏ: "
+# ^ErrorCreatingShortcut
+"ÎØÇ åä�Çã ÇíÌÇÏ ãíÇä�ÈõÑ: "
+# ^ErrorCreating
+"ÎØÇ åä�Çã ÇíÌÇÏ: "
+# ^ErrorDecompressing
+ÎØÇ åä�Çã ÈÇÒ ˜ÑÏä ÇØáÇÚÇÊ! äÕÈ�˜ääÏå ÎÑÇÈ ÇÓÊ¿
+# ^ErrorRegistering
+ÎØÇ åä�Çã ËÈÊ DLL
+# ^ExecShell
+"�æÓÊå ÇÌÑÇíì: "
+# ^Exec
+"ÇÌÑÇ: "
+# ^Extract
+"ÇÓÊÎÑÇÌ: "
+# ^ErrorWriting
+"ÇÓÊÎÑÇÌ: ÎØÇ åä�Çã äæÔÊä ÏÑ �ÑæäÏå"
+# ^InvalidOpcode
+äÕÈ�˜ääÏå ÎÑÇÈ ÇÓÊ: ˜Ï ÚãáíÇÊì äÇãÚÊÈÑ.
+# ^NoOLE
+"þOLE æÌæÏ äÏÇÑÏ: "
+# ^OutputFolder
+"�æÔå ÎÑæÌì: "
+# ^RemoveFolder
+"ÍÐÝ �æÔå: "
+# ^RenameOnReboot
+"ÊÛííÑ äÇã åä�Çã ÑÇå ÇäÏÇÒì ãÌÏÏ: "
+# ^Rename
+"ÊÛííÑ äÇã: "
+# ^Skipped
+"�Ôã �æÔì ÔÏ: "
+# ^CopyDetails
+äÓÎå�ÈÑÏÇÑì ÌÒÆíÇÊ ÏÑ ˜áí��ÈÑÏ
+# ^LogInstall
+ËÈÊ ÑæäÏ äÕÈ
+# ^Byte
+ ÈÇíÊ
+# ^Kilo
+ ˜íáæ
+# ^Mega
+ ã�Ç
+# ^Giga
+ �í�Ç
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Czech.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Czech.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Czech.nsh	(revision 728)
@@ -0,0 +1,122 @@
+;Language: Czech (1029)
+;By SELiCE (ls@selice.cz - http://ls.selice.cz)
+;Corrected by Ondøej Vaniš - http://www.vanis.cz/ondra
+
+!insertmacro LANGFILE "Czech" "Cesky"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Vítejte v prùvodci instalace programu $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Tento prùvodce Vás provede instalací $(^NameDA).$\r$\n$\r$\nPøed zaèátkem instalace je doporuèeno zavøít všechny ostatní aplikace. Toto umožní aktualizovat dùležité systémové soubory bez restartování Vašeho poèítaèe.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Vítejte v $(^NameDA) odinstalaèním prùvodci"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Tento prùvodce Vás provede odinstalací $(^NameDA).$\r$\n$\r$\nPøed zaèátkem odinstalace, se pøesvìdète, že $(^NameDA) není spuštìn.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Licenèní ujednání"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Pøed instalací programu $(^NameDA) si prosím prostudujte licenèní podmínky."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Jestliže souhlasíte se všemi podmínkami ujednání, zvolte 'Souhlasím' pro pokraèování. Pro instalaci programu $(^NameDA) je nutné souhlasit s licenèním ujednáním."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Jestliže souhlasíte se všemi podmínkami ujednání, zaškrtnìte níže uvedenou volbu. Pro instalaci programu $(^NameDA) je nutné souhlasit s licenèním ujednáním. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Jestliže souhlasíte se všemi podmínkami ujednání, zvolte první z možností uvedených níže. Pro instalaci programu $(^NameDA) je nutné souhlasit s licenèním ujednáním. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Licenèní ujednání"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Pøed odinstalováním programu $(^NameDA) si prosím prostudujte licenèní podmínky."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Jestliže souhlasíte se všemi podmínkami ujednání, zvolte 'Souhlasím' pro pokraèování. Pro odinstalování programu $(^NameDA) je nutné souhlasit s licenèním ujednáním."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Jestliže souhlasíte se všemi podmínkami ujednání, zaškrtnìte níže uvedenou volbu. Pro odinstalování programu $(^NameDA) je nutné souhlasit s licenèním ujednáním. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Jestliže souhlasíte se všemi podmínkami ujednání, zvolte první z níže uvedených možností. Pro odinstalování programu $(^NameDA) je nutné souhlasit s licenèním ujednáním. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Stisknutím klávesy Page Down posunete text licenèního ujednání."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Volba souèástí"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Zvolte souèásti programu $(^NameDA), které chcete nainstalovat."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Volba souèástí"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Zvolte souèásti programu $(^NameDA), které chcete odinstalovat."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Popis"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Pøi pohybu myší nad instalátorem programu se zobrazí její popis."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Pøi pohybu myší nad instalátorem programu se zobrazí její popis."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Zvolte umístìní instalace"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Zvolte složku, do které bude program $(^NameDA) nainstalován."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Zvolte umístìní odinstalace"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Zvolte složku, ze které bude program $(^NameDA) odinstalován."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Instalace"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Vyèkejte, prosím, na dokonèení instalace programu $(^NameDA)."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Instalace dokonèena"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Instalace probìhla v poøádku."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Instalace pøerušena"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Instalace nebyla dokonèena."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Odinstalace"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Vyèkejte, prosím, na dokonèení odinstalace programu $(^NameDA)."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Odinstalace dokonèena"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Odinstalace probìhla v poøádku."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Odinstalace pøerušena"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Odinstalace nebyla dokonèena."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Dokonèení prùvodce programu $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Program $(^NameDA) byl nainstalován na Váš poèítaè.$\r$\n$\r$\nKliknìte 'Dokonèit' pro ukonèení prùvodce."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Pro dokonèení instalace programu $(^NameDA) je nutno restartovat poèítaè. Chcete restatovat nyní?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Dokonèuji odinstalaèního prùvodce $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) byl odinstalován z Vašeho poèítaèe.$\r$\n$\r$\nKliknìte na 'Dokonèit' pro ukonèení tohoto prùvodce."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Pro dokonèení odinstalace $(^NameDA) musí být Váš poèítaè restartován. Chcete restartovat nyní?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Restartovat nyní"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Restartovat ruènì pozdìji"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Spustit program $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Zobrazit Èti-mne"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Dokonèit"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Zvolte složku v Nabídce Start"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Zvolte složku v Nabídce Start pro zástupce programu $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Zvolte složku v Nabídce Start, ve které chcete vytvoøit zástupce programu. Mùžete také zadat nové jméno pro vytvoøení nové složky."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Nevytváøet zástupce"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Odinstalovat program $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Odebrat program $(^NameDA) z Vašeho poèítaèe."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Opravdu chcete ukonèit instalaci programu $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Skuteènì chcete ukonèit odinstalaci $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Spanish.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Spanish.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Spanish.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit ;Español - España (Alfabetización Tradicional)
+NLF v6
+# Language ID
+1034
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by MoNKi & Joel
+# Review and minor corrections Darwin Rodrigo Toledo Cáceres (niwrad777@gmail.com) www.winamp-es.com
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+Instalación de $(^Name)
+# ^UninstallCaption
+Desinstalación de $(^Name)
+# ^LicenseSubCaption
+: Acuerdo de Licencia
+# ^ComponentsSubCaption
+: Opciones de Instalación
+# ^DirSubCaption
+: Directorio de Instalación
+# ^InstallingSubCaption
+: Instalando
+# ^CompletedSubCaption
+: Completado
+# ^UnComponentsSubCaption
+: Opciones de Desinstalación
+# ^UnDirSubCaption
+: Directorio de Desinstalación
+# ^ConfirmSubCaption
+: Confirmación
+# ^UninstallingSubCaption
+: Desinstalando
+# ^UnCompletedSubCaption
+: Completado
+# ^BackBtn
+< &Atrás
+# ^NextBtn
+&Siguiente >
+# ^AgreeBtn
+A&cepto
+# ^AcceptBtn
+A&cepto los términos de la licencia
+# ^DontAcceptBtn
+&No acepto los términos de la licencia
+# ^InstallBtn
+&Instalar
+# ^UninstallBtn
+&Desinstalar
+# ^CancelBtn
+Cancelar
+# ^CloseBtn
+&Cerrar
+# ^BrowseBtn
+&Examinar...
+# ^ShowDetailsBtn
+Ver &detalles
+# ^ClickNext
+Presione Siguiente para continuar.
+# ^ClickInstall
+Presione Instalar para comenzar la instalación.
+# ^ClickUninstall
+Presione Desinstalar para comenzar la desinstalación.
+# ^Name
+Nombre
+# ^Completed
+Completado
+# ^LicenseText
+Por favor, revise el acuerdo de licencia antes de instalar $(^NameDA). Si acepta todos los términos del acuerdo, presione Acepto.
+# ^LicenseTextCB
+Por favor, revise el acuerdo de licencia antes de instalar $(^NameDA). Si acepta todos los términos del acuerdo, marque abajo la casilla. $_CLICK
+# ^LicenseTextRB
+Por favor, revise el acuerdo de licencia antes de instalar $(^NameDA). Si acepta todos los términos del acuerdo, seleccione abajo la primera opción. $_CLICK
+# ^UnLicenseText
+Por favor, revise el acuerdo de licencia antes de desinstalar $(^NameDA). Si acepta todos los términos del acuerdo, presione Acepto.
+# ^UnLicenseTextCB
+Por favor, revise el acuerdo de licencia antes de desinstalar $(^NameDA). Si acepta todos los términos del acuerdo, marque abajo la casilla. $_CLICK.
+# ^UnLicenseTextRB
+Por favor, revise el acuerdo de licencia antes de desinstalar $(^NameDA). Si acepta todos los términos del acuerdo, seleccione abajo la primera opción. $_CLICK
+# ^Custom
+Personalizada
+# ^ComponentsText
+Marque los componentes que desee instalar y desmarque los componentes que no desee instalar. $_CLICK
+# ^ComponentsSubText1
+Tipos de instalación:
+# ^ComponentsSubText2_NoInstTypes
+Seleccione los componentes a instalar:
+# ^ComponentsSubText2
+O seleccione los componentes opcionales que desee instalar:
+# ^UnComponentsText
+Marque los componentes que desee desinstalar y desmarque los componentes que no desee desinstalar. $_CLICK
+# ^UnComponentsSubText1
+Tipos de desinstalación:
+# ^UnComponentsSubText2_NoInstTypes
+Seleccione los componentes a desinstalar:
+# ^UnComponentsSubText2
+O seleccione los componentes opcionales que desee desinstalar:
+# ^DirText
+El programa de instalación instalará $(^NameDA) en el siguiente directorio. Para instalar en un directorio diferente, presione Examinar y seleccione otro directorio. $_CLICK
+# ^DirSubText
+Directorio de Destino
+# ^DirBrowseText
+Seleccione el directorio en el que instalará $(^NameDA):
+# ^UnDirText
+El programa de instalación desinstalará $(^NameDA) del siguiente directorio. Para desinstalar de un directorio diferente, presione Examinar y seleccione otro directorio. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Seleccione el directorio desde el cual desinstalará $(^NameDA):
+# ^SpaceAvailable
+Espacio disponible: 
+# ^SpaceRequired
+Espacio requerido: 
+# ^UninstallingText
+$(^NameDA) será desinstalado del siguiente directorio. $_CLICK
+# ^UninstallingSubText
+Desinstalando desde:
+# ^FileError
+Error abriendo archivo para escritura: \r\n\t"$0"\r\nPresione abortar para anular la instalación,\r\nreintentar para volver a intentar escribir el archivo, u\r\nomitir para ignorar este archivo
+# ^FileError_NoIgnore
+Error abriendo archivo para escritura: \r\n\t"$0"\r\nPresione reintentar para volver a intentar escribir el archivo, o\r\ncancelar para anular la instalación
+# ^CantWrite
+"No pudo escribirse: "
+# ^CopyFailed
+Falló la copia
+# ^CopyTo
+"Copiar a "
+# ^Registering
+"Registrando: "
+# ^Unregistering
+"Eliminando registro: "
+# ^SymbolNotFound
+"No pudo encontrarse símbolo: "
+# ^CouldNotLoad
+"No pudo cargarse: "
+# ^CreateFolder
+"Crear directorio: "
+# ^CreateShortcut
+"Crear acceso directo: "
+# ^CreatedUninstaller
+"Crear desinstalador: "
+# ^Delete
+"Borrar archivo: "
+# ^DeleteOnReboot
+"Borrar al reinicio: "
+# ^ErrorCreatingShortcut
+"Error creando acceso directo: "
+# ^ErrorCreating
+"Error creando: "
+# ^ErrorDecompressing
+¡Error descomprimiendo datos! ¿Instalador corrupto?
+# ^ErrorRegistering
+Error registrando DLL
+# ^ExecShell
+"Ejecutar comando: "
+# ^Exec
+"Ejecutar: "
+# ^Extract
+"Extraer: "
+# ^ErrorWriting
+"Extraer: error escribiendo al archivo "
+# ^InvalidOpcode
+Instalador corrupto: código de operación no válido
+# ^NoOLE
+"Sin OLE para: "
+# ^OutputFolder
+"Directorio de salida: "
+# ^RemoveFolder
+"Eliminar directorio: "
+# ^RenameOnReboot
+"Renombrar al reinicio: "
+# ^Rename
+"Renombrar: "
+# ^Skipped
+"Omitido: "
+# ^CopyDetails
+Copiar Detalles al Portapapeles
+# ^LogInstall
+Registrar proceso de instalación 
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Albanian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Albanian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Albanian.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+1052
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1250
+# RTL - anything else than RTL means LTR
+-
+# Përkthimi nga Besnik Bleta, besnik@programeshqip.org
+# ^Branding
+Sistemi Nullsoft për Instalime %s
+# ^SetupCaption
+Rregullimi i $(^Name)
+# ^UninstallCaption
+Çinstalimi i $(^Name)
+# ^LicenseSubCaption
+: Marrëveshje Licence
+# ^ComponentsSubCaption
+: Mundësi Instalimi
+# ^DirSubCaption
+: Dosje Instalimi
+# ^InstallingSubCaption
+: Po instalohet
+# ^CompletedSubCaption
+: U plotësua
+# ^UnComponentsSubCaption
+: Mundësi Çinstalimi
+# ^UnDirSubCaption
+: Dosje Çinstalimi
+# ^ConfirmSubCaption
+: Ripohim
+# ^UninstallingSubCaption
+: Po çinstalohet
+# ^UnCompletedSubCaption
+: U plotësua
+# ^BackBtn
+< &Mbrapsht
+# ^NextBtn
+&Tjetri >
+# ^AgreeBtn
+&Pajtohem
+# ^AcceptBtn
+&I pranoj kushtet e Marrëveshjes së Licensës
+# ^DontAcceptBtn
+&Nuk i pranoj kushtet e Marrëveshjes së Licensës
+# ^InstallBtn
+&Instaloje
+# ^UninstallBtn
+&Çinstaloje
+# ^CancelBtn
+Anuloje
+# ^CloseBtn
+&Mbylle
+# ^BrowseBtn
+Sh&fletoni...
+# ^ShowDetailsBtn
+Shfaq &hollësi
+# ^ClickNext
+Klikoni Tjetri për të vazhduar.
+# ^ClickInstall
+Për të filluar instalimin klikoni Instaloje.
+# ^ClickUninstall
+Për të filluar çinstalimin klikoni Çinstaloje.
+# ^Name
+Emër
+# ^Completed
+U plotësua
+# ^LicenseText
+Ju lutem, para instalimit të $(^NameDA), shqyrtoni marrëveshjen e licencës. Nëse i pranoni tërë kushtet e marrëveshjes, klikoni Pajtohem.
+# ^LicenseTextCB
+Ju lutem, para instalimit të $(^NameDA), shqyrtoni marrëveshjen e licensës. Nëse i pranoni tërë kushtet e marrëveshjes, klikoni kutizën më poshtë. $_CLICK
+# ^LicenseTextRB
+Ju lutem, para instalimit të $(^NameDA), shqyrtoni marrëveshjen e licensës. Nëse i pranoni tërë kushtet e marrëveshjes, përzgjidhni mundësinë e parë më poshtë. $_CLICK
+# ^UnLicenseText
+Ju lutem, para çinstalimit të $(^NameDA), shqyrtoni marrëveshjen e licensës. Nëse i pranoni tërë kushtet e marrëveshjes, klikoni Pajtohem.
+# ^UnLicenseTextCB
+Ju lutem, para çinstalimit të $(^NameDA), shqyrtoni marrëveshjen e licensës. Nëse i pranoni tërë kushtet e marrëveshjes, klikoni kutizën më poshtë. $_CLICK
+# ^UnLicenseTextRB
+Ju lutem, para çinstalimit të $(^NameDA), shqyrtoni marrëveshjen e licensës. Nëse i pranoni tërë kushtet e marrëveshjes, përzgjidhni mundësinë e parë më poshtë. $_CLICK
+# ^Custom
+Vetjake
+# ^ComponentsText
+U vini shenjë përbërësve që doni të instalohen dhe hiquani shenjën  përbërësvet që nuk doni të instalohen. $_CLICK
+# ^ComponentsSubText1
+Përzgjidhni llojin e instalimit:
+# ^ComponentsSubText2_NoInstTypes
+Përzgjidhni përbërësit për instalim:
+# ^ComponentsSubText2
+Ose, përzgjidhni përbërësit e mundshëm që doni të instalohen:
+# ^UnComponentsText
+U vini shenjë përbërësve që doni të çinstalohen dhe hiquni shenjën përbërësve që nuk doni të çinstalohen. $_CLICK
+# ^UnComponentsSubText1
+Përzgjidhni llojin e çinstalimit:
+# ^UnComponentsSubText2_NoInstTypes
+Përzgjidhni përbërësit për çinstalim:
+# ^UnComponentsSubText2
+Ose, përzgjidhni përbërësit e mundshëm që doni të çinstalohen:
+# ^DirText
+Rregullimi do ta instalojë $(^NameDA) në dosjen vijuese. Për instalim në një dosje tjetër, klikoni Shfletoni dhe përzgjidhni një tjetër dosje. $_CLICK
+# ^DirSubText
+Dosje Vendmbërritje
+# ^DirBrowseText
+Përzgjidhni dosjen ku të instalohet $(^NameDA):
+# ^UnDirText
+Rregullimi do të çinstalojë $(^NameDA) prej dosjes vijuese. Për çinstalim prej një dosjeje tjetër, klikoni Shfletoni dhe përzgjidhni një tjetër dosje. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Përzgjidhni dosjen prej nga ku të çinstalohet $(^NameDA):
+# ^SpaceAvailable
+"Hapësirë e mundshme: "
+# ^SpaceRequired
+"Hapësirë e nevojshme: "
+# ^UninstallingText
+$(^NameDA) do të çinstalohet prej dosjes vijuese. $_CLICK
+# ^UninstallingSubText
+Po çinstalohet prej:
+# ^FileError
+Gabim në hapje kartele për shkrim: \r\n\r\n$0\r\n\r\nKlikoni Ndërprite për të ndalur instalimin,\r\nRiprovo për të provuar sërish, ose\r\nShpërfille për të sanashkaluar këtë kartelë.
+# ^FileError_NoIgnore
+Gabim në hapje kartele për shkrim: \r\n\r\n$0\r\n\r\nKlikoni Riprovo për të provuar sërish, ose\r\nAnulo për të ndalur instalimin.
+# ^CantWrite
+"S'shkruaj dot: "
+# ^CopyFailed
+Kopjimi dështoi
+# ^CopyTo
+"Kopjo tek "
+# ^Registering
+"Regjistrim: "
+# ^Unregistering
+"Çregjistrim: "
+# ^SymbolNotFound
+"S'u gjet dot simbol: "
+# ^CouldNotLoad
+"S'u ngarkua dot: "
+# ^CreateFolder
+"Krijo dosje: "
+# ^CreateShortcut
+"Krijo shkurtore: "
+# ^CreatedUninstaller
+"Krijo çinstalues: "
+# ^Delete
+"Fshi kartelë: "
+# ^DeleteOnReboot
+"Fshi gjatë rinisjes: "
+# ^ErrorCreatingShortcut
+"Gabim në krijim shkurtoresh: "
+# ^ErrorCreating
+"Gabim në krijimin e: "
+# ^ErrorDecompressing
+Gabim në çngjeshje të dhënash! Instalues i dëmtuar?
+# ^ErrorRegistering
+Gabim në regjistrim DLL-je
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Ekzekuto: "
+# ^Extract
+"Përfto: "
+# ^ErrorWriting
+"Përftim: gabim në shkrim te kartela "
+# ^InvalidOpcode
+Instalues i dëmtuar: opcode i pavlefshëm
+# ^NoOLE
+"Pa OLE për: "
+# ^OutputFolder
+"Dosje përfundimesh: "
+# ^RemoveFolder
+"Hiq dosjen: "
+# ^RenameOnReboot
+"Riemërtoje gjatë rinisjes: "
+# ^Rename
+"Riemërtoje: "
+# ^Skipped
+"U anashkalua: "
+# ^CopyDetails
+Kopjo Hollësira Te Clipboard
+# ^LogInstall
+Regjistro procesin e instalimit
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Luxembourgish.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Luxembourgish.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Luxembourgish.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Luxembourgish (1031)
+;By Snowloard, changes by Philo
+
+!insertmacro LANGFILE "Luxembourgish" "Lëtzebuergesch"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Wëllkomm beim Installatiouns-$\r$\nAssistent vun $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Dësen Assistent wärt dech duech d'Installatioun vun $(^NameDA) begleeden.$\r$\n$\r$\nEt gëtt ugeroden alleguer d'Programmer di am Moment lafen zouzemaan, datt bestëmmt Systemdateien ouni Neistart ersat kënne ginn.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Wëllkomm am Desinstallatiouns-$\r$\n\Assistent fir $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Desen Assistent begleet dech duech d'Desinstallatioun vun $(^NameDA).$\r$\n$\r$\nW.e.g. maach $(^NameDA) zu, ierts de mat der Desinstallatioun ufänks.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Lizenzofkommes"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "W.e.g. d'Lizenzoofkommes liesen, ierts de mat der Installatioun weiderfiers."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Wanns de alleguer d'Bedengungen vum Ofkommes akzeptéiers, klick op Unhuelen. Du muss alleguer d'Fuerderungen unerkennen, fir $(^NameDA) installéieren ze kënnen."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Wanns de alleguer d'Bedengungen vum Ofkommes akzeptéiers, aktivéier d'Këschtchen. Du muss alleguer d'Fuerderungen unerkennen, fir $(^NameDA) installéieren ze kënnen. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Wanns de alleguer d'Bedengungen vum Ofkommes akzeptéiers, wiel ënnen di entspriechend Äntwert aus. Du muss alleguer d'Fuerderungen unerkennen, fir $(^NameDA) installéieren ze kënnen. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Lizenzofkommes"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "W.e.g. lies d'Lizenzofkommes duech ierts de mat der Desinstallatioun vun $(^NameDA) weiderfiers."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Wanns de d'Fuerderungen vum Ofkommes akzeptéiers, klick op unhuelen. Du muss d'Ofkommes akzeptéieren, fir $(^NameDA) kënnen ze desinstalléieren."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Wanns de d'Fuerderungen vum Ofkommes akzeptéiers, aktivéier d'Këschtchen. Du muss d'Ofkommes akzeptéieren, fir $(^NameDA) kënnen ze desinstalléieren. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Wanns de d'Fuerderungen vum Ofkommes akzeptéiers, wiel ënnen di entspriechend Optioun. Du muss d'Oofkommes akzeptéieren, fir $(^NameDA) kennen ze desinstalléieren. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Dréck d'PageDown-Tast fir den Rescht vum Ofkommes ze liesen."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Komponenten auswielen"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Wiel d'Komponenten aus, déis de wëlls installéieren."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Komponenten auswielen"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Wiel eng Komponent aus, déis de desinstalléieren wëlls."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Beschreiwung"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Hal den Mausfeil iwwer eng Komponent, fir d'Beschreiwung dervun ze gesinn."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Hal den Mausfeil iwwer eng Komponent, fir d'Beschreiwung dervun ze gesinn."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Zielverzeechnes auswielen"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Wiel den Dossier aus, an deen $(^NameDA) installéiert soll ginn."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Dossier fir d'Desinstallatioun wielen"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Wiel den Dossier aus, aus dem $(^NameDA) desinstalléiert soll ginn."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Installéieren..."
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Waard w.e.g während deem $(^NameDA) installéiert gëtt."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Installatioun färdeg"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "D'Installatioun ass feelerfräi oofgeschloss ginn."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Installatioun ofgebrach"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "D'Installatioun ass net komplett ofgeschloss ginn."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Desinstalléieren..."
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "W.e.g. waard, während deems $(^NameDA) desinstalléiert gëtt."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Desinstallatioun ofgeschloss"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "D'Desinstallatioun ass erfollegräich ofgeschloss ginn."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Desinstallatioun oofbriechen"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Desinstallatioun ass net erfollegräich ofgeschloss ginn."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "D'Installatioun vun $(^NameDA) gëtt ofgeschloss."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) ass um Computer installéiert ginn.$\r$\n$\r$\nKlick op färdeg maan, fir den Installatiouns-Assistent zou ze maan.."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Den Windows muss nei gestart ginn, fir d'Installatioun vun $(^NameDA) ofzeschléissen. Wëlls de Windows lo néi starten?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Desinstallatioun vun $(^NameDA) gëtt ofgeschloss"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) ass vum Computer desinstalléiert ginn.$\r$\n$\r$\nKlick op Ofschléissen fir den Assistent zou ze maan."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Windows muss néi gestart gin, fir d'Desinstallatioun vun $(^NameDA) ze vervollstännegen. Wëlls de Windows lo néi starten?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Lo néi starten"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Spéider manuell néi starten"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "$(^NameDA) op maan"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Liesmech op maan"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Färdeg man"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Startmenü-Dossier bestëmmen"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Bestëmm een Startmanü-Dossier an deen d'Programmofkierzungen kommen."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Bestëmm een Startmanü-Dossier an deen d'Programmofkierzungen kommen. Wanns de een néien Dossier man wells, gëff deem säin zukünftegen Numm an."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Keng Ofkierzungen man"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Desinstallatioun vun $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "$(^NameDA) gett vum Computer desinstalléiert."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Bass de sécher, dass de d'Installatioun vun $(^Name) ofbriechen wëlls?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Bass de sécher, dass de d'Desinstallatioun vun $(^Name) ofbriechen wëlls?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Dutch.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Dutch.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Dutch.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+1043
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by Joost Verburg & Hendri Adireans, fixes by Milan Bast
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name)-installatie
+# ^UninstallCaption
+$(^Name)-deïnstallatie
+# ^LicenseSubCaption
+: Licentieovereenkomst
+# ^ComponentsSubCaption
+: Installatieopties
+# ^DirSubCaption
+: Installatiemap
+# ^InstallingSubCaption
+: Bezig met installeren
+# ^CompletedSubCaption
+: Voltooid
+# ^UnComponentsSubCaption
+: Verwijderingsopties
+# ^UnDirSubCaption
+: Te verwijderen map
+# ^ConfirmSubCaption
+: Bevestiging
+# ^UninstallingSubCaption
+: Bezig met verwijderen
+# ^UnCompletedSubCaption
+: Voltooid
+# ^BackBtn
+< V&orige
+# ^NextBtn
+&Volgende >
+# ^AgreeBtn
+&Akkoord
+# ^AcceptBtn
+Ik &accepteer de overeenkomst
+# ^DontAcceptBtn
+Ik accepteer de overeenkomst &niet
+# ^InstallBtn
+&Installeren
+# ^UninstallBtn
+&Verwijderen
+# ^CancelBtn
+Annuleren
+# ^CloseBtn
+&Afsluiten
+# ^BrowseBtn
+&Bladeren...
+# ^ShowDetailsBtn
+&Details tonen
+# ^ClickNext
+Klik op Volgende om verder te gaan.
+# ^ClickInstall
+Klik op Installeren om de installatie te beginnen.
+# ^ClickUninstall
+Klik op Verwijderen om de deïnstallatie te beginnen.
+# ^Name
+Naam
+# ^Completed
+Voltooid
+# ^LicenseText
+Lees de licentieovereenkomst voordat u $(^NameDA) installeert. Klik op Akkoord als u de overeenkomst accepteert.
+# ^LicenseTextCB
+Lees de licentieovereenkomst voordat u $(^NameDA) installeert. Schakel het selectievakje hieronder in als u de overeenkomst accepteert. $_CLICK
+# ^LicenseTextRB
+Lees de licentieovereenkomst voordat u $(^NameDA) installeert. Selecteer de eerste optie hieronder als u de overeenkomst accepteert. $_CLICK
+# ^UnLicenseText
+Lees de licentieovereenkomst voordat u $(^NameDA) verwijdert. Klik op Akkoord als u de overeenkomst accepteert.
+# ^UnLicenseTextCB
+Lees de licentieovereenkomst voordat u $(^NameDA) verwijdert. Schakel het selectievakje hieronder in als u de overeenkomst accepteert. $_CLICK
+# ^UnLicenseTextRB
+Lees de licentieovereenkomst voordat u $(^NameDA) verwijdert. Selecteer de eerste optie hieronder als u de overeenkomst accepteert. $_CLICK
+# ^Custom
+Aangepast
+# ^ComponentsText
+Selecteer de onderdelen die u wilt installeren en deselecteer welke u niet wilt installeren. $_CLICK
+# ^ComponentsSubText1
+Selecteer het installatietype:
+# ^ComponentsSubText2_NoInstTypes
+Selecteer de onderdelen die moeten worden geïnstalleerd:
+# ^ComponentsSubText2
+Of selecteer de optionele onderdelen die moeten worden geïnstalleerd:
+# ^UnComponentsText
+Selecteer de onderdelen die u wilt verwijderen en deselecteer welke u niet wilt verwijderen. $_CLICK
+# ^UnComponentsSubText1
+Selecteer het type verwijdering:
+# ^UnComponentsSubText2_NoInstTypes
+Selecteer de onderdelen die moeten worden verwijderd:
+# ^UnComponentsSubText2
+Of selecteer de optionele onderdelen die moeten worden verwijderd:
+# ^DirText
+Setup zal $(^NameDA) in de volgende map installeren. Klik op Bladeren als u $(^NameDA) in een andere map wilt installeren en selecteer deze. $_CLICK
+# ^DirSubText
+Installatiemap
+# ^DirBrowseText
+Selecteer de map om $(^NameDA) in te installeren:
+# ^UnDirText
+Setup zal $(^NameDA) uit de volgende map verwijderen. Klik op Bladeren als u $(^NameDA) uit een andere map wilt verwijderen en selecteer deze. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Selecteer de map om $(^NameDA) uit te verwijderen:
+# ^SpaceAvailable
+"Beschikbare ruimte: "
+# ^SpaceRequired
+"Vereiste ruimte: "
+# ^UninstallingText
+$(^NameDA) zal uit de volgende map worden verwijderd. $_CLICK
+# ^UninstallingSubText
+Verwijderen uit:
+# ^FileError
+Fout bij het schrijven naar bestand: \r\n\r\n$0\r\n\r\nKlik op Afbreken om de installatie te stoppen,\r\nOpnieuw om het opnieuw te proberen of\r\nNegeren om dit bestand over te slaan.
+# ^FileError_NoIgnore
+Fout bij het schrijven naar bestand: \r\n\r\n$0\r\n\r\nKlik op Opnieuw om het opnieuw te proberen of \r\nAnnuleren om de installatie te stoppen.
+# ^CantWrite
+"Kon niet schrijven: "
+# ^CopyFailed
+Kopiëren mislukt
+# ^CopyTo
+"Kopiëren naar "
+# ^Registering
+"Registreren: "
+# ^Unregistering
+"Deregistreren: "
+# ^SymbolNotFound
+"Kon symbool niet vinden: "
+# ^CouldNotLoad
+"Kon niet laden: "
+# ^CreateFolder
+"Map maken: "
+# ^CreateShortcut
+"Snelkoppeling maken: "
+# ^CreatedUninstaller
+"Deïnstallatieprogramma gemaakt: "
+# ^Delete
+"Bestand verwijderen: "
+# ^DeleteOnReboot
+"Verwijderen na opnieuw opstarten: "
+# ^ErrorCreatingShortcut
+"Fout bij maken snelkoppeling: "
+# ^ErrorCreating
+"Fout bij maken: "
+# ^ErrorDecompressing
+Fout bij uitpakken van gegevens! Gegevens beschadigd?
+# ^ErrorRegistering
+Fout bij registreren DLL
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Uitvoeren: "
+# ^Extract
+"Uitpakken: "
+# ^ErrorWriting
+"Uitpakken: fout bij schrijven naar bestand "
+# ^InvalidOpcode
+Installatieprogramma beschadigd: ongeldige opcode
+# ^NoOLE
+"Geen OLE voor: "
+# ^OutputFolder
+"Uitvoermap: "
+# ^RemoveFolder
+"Map verwijderen: "
+# ^RenameOnReboot
+"Hernoemen na opnieuw opstarten: "
+# ^Rename
+"Hernoemen: "
+# ^Skipped
+"Overgeslagen: "
+# ^CopyDetails
+Details kopiëren naar klembord
+# ^LogInstall
+Gegevens over installatie bewaren
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Slovenian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Slovenian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Slovenian.nsh	(revision 728)
@@ -0,0 +1,129 @@
+;Language: Slovenian (1060)
+;By Janez Dolinar, edited by Martin Srebotnjak - Lugos.si
+
+!insertmacro LANGFILE "Slovenian" "Slovenski jezik"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Dobrodošli v èarovniku namestitve $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Ta èarovnik vas vodi skozi namestitev programa $(^NameDA).$\r$\n$\r$\nPred namestitvijo je priporoèeno zapreti vsa ostala okna in programe. S tem omogoèite nemoteno namestitev programa in potrebnih sistemskih datotek brez ponovnega zagona raèunalnika.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Dobrodošli v èarovniku za odstranitev $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Ta èarovnik vas bo vodil skozi odstranitev $(^NameDA).$\r$\n$\r$\nPreden priènete z odstranitvijo, se preprièajte, da program $(^NameDA) ni zagnan.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Licenèna pogodba"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Prosimo, da si ogledate pogoje licenène pogodbe pred namestitvijo $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Èe se strinjate s pogoji, pritisnite Se strinjam. Da bi lahko namestili $(^NameDA), se morate s pogodbo strinjati."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Èe se strinjate z licenènimi pogoji pogodbe, spodaj izberite ustrezno okence. Za namestitev $(^NameDA) se morate strinjati s pogoji pogodbe. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Èe se strinjate z licenènimi pogoji pogodbe, spodaj izberite prvo možnost. Za namestitev $(^NameDA) se morate strinjati s pogoji pogodbe. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Licenèna pogodba"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Prosimo, da pred odstranitvijo $(^NameDA) pregledate pogoje licenène pogodbe."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Èe se strinjate s pogoji licenène pogodbe, izberite Se strinjam. Za odstranitev $(^NameDA) se morate strinjati s pogoji."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Èe se strinjate s pogoji licenène pogodbe, kliknite na okence spodaj. Za odstranitev $(^NameDA) se morate strinjati s pogoji. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Èe se strinjate s pogoji licenène pogodbe, spodaj izberite prvo podano možnost. Za odstranitev $(^NameDA) se morate strinjati s pogoji. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Za preostali del pogodbe pritisnite tipko 'Page Down'."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Izbor komponent"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Izberite, katere komponente izdelka $(^NameDA) želite namestiti."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Izbor komponent"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Izberite komponente $(^NameDA), ki jih želite odstraniti."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Opis"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Povlecite miško nad komponento, da vidite njen opis."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Povlecite miško nad komponento, da vidite njen opis."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Izberite pot namestive"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Izberite mapo, v katero želite namestiti $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Izbor mape"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Izberite mapo, iz katere želite odstraniti $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Namešèanje poteka"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Prosimo, poèakajte, $(^NameDA) se namešèa."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Dokonèana namestitev"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Namestitev je uspešno zakljuèena."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Prekinjena namestitev"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Namestitev ni bila uspešno zakljuèena."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Odstranjevanje poteka"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Prosimo, poèakajte, dokler se program $(^NameDA) odstranjuje."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Odstranitev konèana"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Odstranitev je uspešno konèana."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Odstranitev prekinjena"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Odstranitev ni bila konèana uspešno."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Zakljuèevanje namestitve $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Program $(^NameDA) je bil namešèen na vaš raèunalnik.$\r$\n$\r$\nPritisnite Dokonèaj za zaprtje èarovnika."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Za dokonèanje namestitve $(^NameDA) morate ponovno zagnati raèunalnik. Želite zdaj ponovno zagnati raèunalnik?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Èarovnik za odstranitev $(^NameDA) se zakljuèuje"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "Program $(^NameDA) je odstranjen z vašega raèunalnika.$\r$\n$\r$\nKliknite Dokonèaj, da zaprete èarovnika."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Da bi se namestitev $(^NameDA) dokonèala, morate ponovno zagnati raèunalnik. Želite zdaj znova zagnati raèunalnik?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Ponovni zagon"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Raèunalnik želim znova zagnati kasneje"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Zaženi $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Pokaži BeriMe"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "Do&konèaj"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Izberite mapo menija Start"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Izberite mapo menija Start za bližnjice do $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Izberite mapo menija Start, kjer želite ustvariti bližnjico do programa. Èe vpišete novo ime, boste ustvarili istoimensko mapo."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Ne ustvari bližnjic"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Odstranitev $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Odstrani $(^NameDA) z vašega raèunalnika."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Ste preprièani, da želite prekiniti namestitev $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Ste preprièani, da želite zapustiti odstranitev $(^Name)?"
+!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "Izberite uporabnike"
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "Izberite uporabnike, za katere želite namestiti $(^NameDA)."
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "Izberite, ali želite namestiti $(^NameDA) le zase ali za vse uporabnike tega raèunalnika. $(^ClickNext)"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "Namesti za vse uporabnike tega raèunalnika"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Namesti le zame"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Latvian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Latvian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Latvian.nsh	(revision 728)
@@ -0,0 +1,122 @@
+;Language: Latvieðu [Latvian] - (1062)
+;By Valdis Griíis
+;Corrections by Kristaps Meòìelis / x-f (x-f 'AT' inbox.lv)
+
+!insertmacro LANGFILE "Latvian" "Latvieðu"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Esiet sveicinâti '$(^NameDA)' uzstâdîðanas vednî"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Ðis uzstâdîðanas vednis jums palîdzçs veikt '$(^NameDA)' uzstâdîðanu.$\r$\n$\r$\nÏoti ieteicams aizvçrt citas programmas pirms ðîs programmas uzstâdîðanas veikðanas. Tas ïaus atjaunot svarîgus sistçmas failus bez datora pârstartçðanas.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Esiet sveicinâti '$(^NameDA)' atinstalçðanas vednî"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Ðis vednis jums palîdzçs veikt '$(^NameDA)' atinstalçðanu.$\r$\n$\r$\nPirms sâkt atinstalçðanas procesu, pârliecinieties, vai '$(^NameDA)' paðlaik nedarbojas.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Licences lîgums"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Lûdzu izlasiet licences lîgumu pirms '$(^NameDA)' uzstâdîðanas."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Ja piekrîtat licences lîguma noteikumiem, spiediet 'Piekrîtu', lai turpinâtu uzstâdîðanu. Jums ir jâpiekrît licences noteikumiem, lai uzstâdîtu '$(^NameDA)'."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Ja piekrîtat licences lîguma noteikumiem, tad atzîmçjiet izvçles rûtiòu. Jums ir jâpiekrît licences noteikumiem, lai uzstâdîtu '$(^NameDA)'. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Ja piekrîtat licences lîguma noteikumiem, tad izvçlieties pirmo zemâkesoðo opciju. Jums ir jâpiekrît licences noteikumiem, lai uzstâdîtu '$(^NameDA)'. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Licences lîgums"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Lûdzu izlasiet licences lîgumu pirms '$(^NameDA)' atinstalçðanas."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Ja piekrîtat licences noteikumiem, spiediet 'Piekrîtu', lai turpinâtu. Jums ir jâpiekrît licences noteikumiem, lai atinstalçtu '$(^NameDA)'."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Ja piekrîtat licences lîguma noteikumiem, tad iezîmçjiet izvçles rûtiòu. Jums ir jâpiekrît licences noteikumiem, lai atinstalçtu '$(^NameDA)'. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Ja piekrîtat licences lîguma noteikumiem, tad izvçlieties pirmo zemâkesoðo opciju. Jums ir jâpiekrît licences noteikumiem, lai atinstalçtu '$(^NameDA)'. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Spiediet 'Page Down', lai aplûkotu visu lîgumu."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Izvçlieties komponentus"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Izvçlieties nepiecieðamâs '$(^NameDA)' sastâvdaïas, kuras uzstâdît."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Izvçlieties komponentus"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Izvçlieties nepiecieðamâs '$(^NameDA)' sastâvdaïas, kuras atinstalçt."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Apraksts"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Novietojiet peles kursoru uz komponenta, lai tiktu parâdîts tâ apraksts."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Novietojiet peles kursoru uz komponenta, lai tiktu parâdîts tâ apraksts."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Izvçlieties uzstâdîðanas mapi"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Izvçlieties mapi, kurâ uzstâdît '$(^NameDA)'."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Izvçlieties atinstalçðanas mapi"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Izvçlieties mapi, no kuras notiks '$(^NameDA)' atinstalçðana."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Notiek uzstâdîðana"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Lûdzu uzgaidiet, kamçr notiek '$(^NameDA)' uzstâdîðana."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Uzstâdîðana pabeigta"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Uzstâdîðana noritçja veiksmîgi."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Uzstâdîðana atcelta"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Uzstâdîðana nenoritçja veiksmîgi."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Notiek atinstalçðana"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Lûdzu uzgaidiet, kamçr '$(^NameDA)' tiek atinstalçta."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Atinstalçðana pabeigta"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Atinstalçðana noritçja veiksmîgi."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Atinstalçðana atcelta"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Atinstalçðana nenoritçja veiksmîgi."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Tiek pabeigta '$(^NameDA)' uzstâdîðana"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "'$(^NameDA)' tika veiksmîgi uzstâdîta jûsu datorâ.$\r$\n$\r$\nNospiediet 'Pabeigt', lai aizvçrtu vedni."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Jûsu datoru ir nepiecieðams pârstartçt, lai pabeigtu '$(^NameDA)' uzstâdîðanu. Vai vçlaties pârstartçt datoru tûlît?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Tiek pabeigta '$(^NameDA)' atinstalâcija"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "'$(^NameDA)' tika veiksmîgi izdzçsta no jûsu datora.$\r$\n$\r$\nNospiediet 'Pabeigt', lai aizvçrtu vedni."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Jûsu datoru nepiecieðams pârstartçt, lai pabeigtu '$(^NameDA)' atinstalçðanu. Vai vçlaties pârstartçt datoru tûlît?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Pârstartçt tûlît"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Es vçlos pârstartçt pats vçlâk"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "P&alaist '$(^NameDA)'"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Pa&râdît LasiMani failu"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Pabeigt"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Izvçlieties 'Start Menu' folderi"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Izvçlieties 'Start Menu' mapi '$(^NameDA)' saîsnçm."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Izvçlieties 'Start Menu' mapi, kurâ tiks izveidotas programmas saîsnes. Varat arî pats izveidot jaunu mapi."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Neveidot saîsnes"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "'$(^NameDA)' atinstalçðana"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Dzçst '$(^NameDA)' no jûsu datora."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Vai tieðâm vçlaties pârtraukt '$(^Name)' uzstâdîðanu?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Vai tieðâm vçlaties pârtraukt '$(^Name)' atinstalçðanu?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Afrikaans.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Afrikaans.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Afrikaans.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Afrikaans (1078)
+;By Friedel Wolff
+
+!insertmacro LANGFILE "Afrikaans" "Afrikaans"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Welkom by die $(^NameDA) Installasieslimmerd"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Hierdie slimmerd lei mens deur die installasie van $(^NameDA).$\r$\n$\r$\nDit word aanbeveel dat u alle ander programme afsluit voor die begin van die installasie. Dit maak dit moontlik om die relevante stelsellêers op te dateer sonder om die rekenaar te herlaai.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Welkom by die $(^NameDA) Verwyderingslimmerd"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Hierdie slimmerd lei mens deur die verwydering van $(^NameDA).$\r$\n$\r$\nVoor die verwydering begin word, maak seker dat $(^NameDA) nie loop nie.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Lisensie-ooreenkoms"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Lees die lisensie-ooreenkoms voordat u $(^NameDA) installeer."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Klik op Regso om verder te gaan as u die ooreenkoms aanvaar. U moet die ooreenkoms aanvaar om $(^NameDA) te installeer."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Merk die blokkie hier onder as u die ooreenkoms aanvaar. U moet die ooreenkoms aanvaar om $(^NameDA) te installeer. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Kies die eerste keuse hieronder as u die ooreenkoms aanvaar. U moet die ooreenkoms aanvaar om $(^NameDA) te installeer. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Lisensie-ooreenkoms"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Lees die lisensie-ooreenkoms voordat u $(^NameDA) verwyder."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Klik op Regso om verder te gaan as u die ooreenkoms aanvaar. U moet die ooreenkoms aanvaar om $(^NameDA) te verwyder."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Merk die kiesblokkie hieronder as u die ooreenkoms aanvaar. U moet die ooreenkoms aanvaar om $(^NameDA) te verwyder."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Kies die eerste keuse hieronder as u die ooreenkoms aanvaar. U moet die ooreenkoms aanvaar om $(^NameDA) te verwyder."
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Druk op Page Down om die res van die ooreenkoms te sien."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Kies komponente"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Kies watter komponente van $(^NameDA) geïnstalleer moet word."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Kies komponente"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Kies watter komponente van $(^NameDA) verwyder moet word."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Beskrywing"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Beweeg die muis oor 'n komponent om sy beskrywing te sien."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Beweeg die muis oor 'n komponent om sy beskrywing te sien."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Kies installasieplek"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Kies die gids waarin u $(^NameDA) wil installeer."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Kies verwyderinggids"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Kies die gids waaruit u $(^NameDA) wil verwyder."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Installeer tans"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Wag asb. terwyl $(^NameDA) geïnstalleer word."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Installasie voltooid"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Die installasie is suksesvol voltooi."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Installasie gestaak"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Die installasie is nie suksesvol voltooi nie."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Verwyder tans"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Wag asb. terwyl $(^NameDA) van u rekenaar verwyder word."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Verwydering voltooi"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Verwydering is suksesvol voltooi."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Verwydering gestaak"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Verwydering is nie suksesvol voltooi nie."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Voltooi van die $(^NameDA) Installasieslimmerd"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) is geïnstalleer op uw rekenaar.$\r$\n$\r$\nKlik op Voltooi om hierdie slimmerd af te sluit."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Die rekenaar moet oorbegin word om die installasie van $(^NameDA) te voltooi. Wil u nou oorbegin?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Voltooi van die $(^NameDA) Verwyderingslimmerd"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) is van u rekenaar verwyder.$\r$\n$\r$\nKlik op Voltooi om hierdie slimmerd af te sluit."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Die rekenaar moet oorbegin word om die verwydering van $(^NameDA) te voltooi. Wil u nou oorbegin?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Begin nou oor"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Ek wil later self oorbegin"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Laat loop $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Wys Leesmy-lêer"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Voltooi"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Kies gids in Begin-kieslys"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Kies 'n gids in die Begin-kieslys vir $(^NameDA) se kortpaaie."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Kies die gids in die Begin-kieslys waarin die program se kortpaaie geskep moet word. U kan ook 'n nuwe naam gee om 'n nuwe gids te skep."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Moenie kortpaaie maak nie"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Verwyder $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Verwyder $(^NameDA) van u rekenaar."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Wil u definitief die installasie van $(^Name) afsluit?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Wil u definitief die verwydering van $(^Name) afsluit?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Esperanto.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Esperanto.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Esperanto.nsh	(revision 728)
@@ -0,0 +1,129 @@
+;Language: Esperanto (0)
+;By Felipe Castro <fefcas@gmail.com>
+
+!insertmacro LANGFILE "Esperanto" "Esperanto"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Bonvenon al la Gvidilo por Instalado de $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Tiu cxi gvidilo helpos vin dum la instalado de $(^NameDA).$\r$\n$\r$\nOni rekomendas fermi cxiujn aliajn aplikajxojn antaux ol ekigi la Instaladon. Tio cxi ebligos al la Instalilo gxisdatigi la koncernajn dosierojn de la sistemo sen bezono restartigi la komputilon.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Bonvenon al la Gvidilo por Malinstalado de $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Tiu cxi gvidilo helpos vin dum la malinstalado de $(^NameDA).$\r$\n$\r$\nAntaux ol ekigi la malinstalado, certigxu ke $(^NameDA) ne estas plenumata nun.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Permes-Kontrakto"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Bonvole, kontrolu la kondicxojn de la permesilo antaux ol instali la programon $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Se vi akceptas la kondicxojn, musklaku en 'Akceptite' por dauxrigi. Vi devos akcepti la kontrakton por instali la programon $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Se vi akceptas la permes-kondicxojn, musklaku la suban elekt-skatolon. Vi devos akcepti la kontrakton por instali la programon $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Se vi akceptas la permes-kondicxojn, elektu la unuan opcion sube. Vi devas akcepti la kontrakton por instali la programon $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Permes-Kontrakto"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Bonvole, kontrolu la kondicxojn de la permesilo antaux ol malinstali la programon $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Se vi akceptas la kondicxojn, musklaku en 'Akceptite' por dauxrigi. Vi devos akcepti la kontrakton por malinstali la programon $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Se vi akceptas la permes-kondicxojn, musklaku la suban elekt-skatolon. Vi devos akcepti la kontrakton por malinstali la programon $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Se vi akceptas la permes-kondicxojn, elektu la unuan opcion sube. Vi devas akcepti la kontrakton por malinstali la programon $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Premu 'Page Down' por rigardi la reston de la permeso."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Elekto de Konsisteroj"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Elektu kiujn funkciojn de $(^NameDA) vi deziras instali."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Elekto de Konsisteroj"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Elektu kiujn funkciojn de $(^NameDA) vi deziras malinstali."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Priskribo"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Poziciu la muson sur konsistero por rigardi ties priskribon."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Poziciu la muson sur konsistero por rigardi ties priskribon."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Elekto de la Instalada Loko"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Elektu la dosierujon en kiun vi deziras instali la programon $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Elekto de la Malinstalada Loko"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Elektu la dosierujon el kiu vi deziras malinstali la programon $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Oni instalas"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Bonvole, atendu dum $(^NameDA) estas instalata."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Instalado Plenumite"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "La instalado sukcese plenumigxis."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Instalado Cxesigite"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "La instalado ne plenumigxis sukcese."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Oni malinstalas"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Bonvole, atendu dum $(^NameDA) estas malinstalata."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Malinstalado Plenumite"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "La malinstalado sukcese plenumigxis."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Malinstalado Cxesigxite"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "La malinstalado ne plenumigxis sukcese."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Oni finigas la Gvidilon por Instalado de $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) estas instalita en via komputilo.$\r$\n$\r$\nMusklaku en Finigi por fermi tiun cxi gvidilon."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Via komputilo devas esti restartigita por kompletigi la instaladon de $(^NameDA). Cxu restartigi nun?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Oni finigas la Gvidilon por Malinstalado de $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) estis forigita el via komputilo.$\r$\n$\r$\nMusklaku en Finigi por fermi tiun cxi gvidilon."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Via komputilo devas esti restartigita por kompletigi la malinstaladon de $(^NameDA). Cxu restartigi nun?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Restartigi Nun"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Mi volas restartigi permane poste"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Lancxi $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Montri Legumin"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Finigi"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Elektu Dosierujon de la Ek-Menuo"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Elektu dosierujon de la Ek-Menuo por la lancxiloj de la programo."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Elektu dosierujon de la Ek-Menuo en kiu vi deziras krei la lancxilojn de la programo. Vi povas ankaux tajpi nomon por krei novan ujon."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Ne krei lancxilojn"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Malinstali $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Forigi $(^NameDA) el via komputilo."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Cxu vi certe deziras nuligi la instaladon de $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Cxu vi certe deziras nuligi la malinstaladon de $(^Name)?"
+!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "Elekti Uzantojn"
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "Elekti por kiuj uzantoj vi deziras instali $(^NameDA)."
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "Elektu cxu vi volas instali $(^NameDA) por vi mem aux por cxiuj uzantoj de tiu cxi komputilo. $(^ClickNext)"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "Instali por iu ajn uzanto de tiu cxi komputilo"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Instali nur por mi"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Icelandic.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Icelandic.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Icelandic.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+15
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by Gretar Orri Kristinsson
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) Uppsetning
+# ^UninstallCaption
+$(^Name) Fjarlæging
+# ^LicenseSubCaption
+: Notandaleyfissamningur
+# ^ComponentsSubCaption
+: Uppsetningarvalmöguleikar
+# ^DirSubCaption
+: Uppsetningarskráarsafn
+# ^InstallingSubCaption
+: Set upp
+# ^CompletedSubCaption
+: Lokið
+# ^UnComponentsSubCaption
+: Fjarlægingarvalmöguleikar
+# ^UnDirSubCaption
+: Fjarlægingarskráarsafn
+# ^ConfirmSubCaption
+: Staðfesting
+# ^UninstallingSubCaption
+: Fjarlægi
+# ^UnCompletedSubCaption
+: Lokið
+# ^BackBtn
+< &Til baka
+# ^NextBtn
+&Áfram >
+# ^AgreeBtn
+Ég &Samþykki
+# ^AcceptBtn
+Ég &samþykki skilmála leyfissamningsins
+# ^DontAcceptBtn
+Ég samþykki &ekki skilmála leyfissamningsins
+# ^InstallBtn
+&Setja upp
+# ^UninstallBtn
+&Fjarlægja
+# ^CancelBtn
+Hætta við
+# ^CloseBtn
+&Loka
+# ^BrowseBtn
+&Vafra...
+# ^ShowDetailsBtn
+Sýna &upplýsingar
+# ^ClickNext
+Smelltu á 'Áfram' til að halda áfram.
+# ^ClickInstall
+Smelltu á 'Setja upp' til þess að hefja uppsetninguna.
+# ^ClickUninstall
+Smelltu á 'Fjarlægja' til að hefja fjarlægingar ferlið.
+# ^Name
+Nafn
+# ^Completed
+Lokið
+# ^LicenseText
+Vinsamlegast skoðaðu notandaleyfissamninginn vel áður en uppsetning á $(^NameDA) hefst. Ef þú samþykkir skilmála samningsins, smelltu þá á 'Ég samþykki'.
+# ^LicenseTextCB
+Vinsamlegast skoðaðu notandaleyfissamninginn vel áður en uppsetning á $(^NameDA) hefst. Ef þú samþykkir skilmála samningsins, hakaðu þá í kassann hér að neðan. $_CLICK
+# ^LicenseTextRB
+Vinsamlegast skoðaðu notandaleyfissamninginn vel áður en uppsetning á $(^NameDA) hefst. Ef þú samþykkir skilmála samningsins, veldu þá fyrsta valmöguleikann hér að neðan. $_CLICK
+# ^UnLicenseText
+Vinsamlegast skoðaðu notandaleyfissamninginn vel áður en uppsetning á $(^NameDA) hefst. Ef þú samþykkir skilmála samningsins, smelltu þá á 'Ég samþykki'.
+# ^UnLicenseTextCB
+Vinsamlegast skoðaðu notandaleyfissamninginn vel áður en uppsetning á $(^NameDA) hefst. Ef þú samþykkir skilmála samningsins, hakaðu þá í kassann hér að neðan. $_CLICK
+# ^UnLicenseTextRB
+Vinsamlegast skoðaðu notandaleyfissamninginn vel áður en uppsetning á $(^NameDA) hefst. Ef þú samþykkir skilmála samningsins, veldu þá fyrsta valmöguleikann hér að neðan. $_CLICK
+# ^Custom
+Sjálfval
+# ^ComponentsText
+Hakaðu við þá íhluti sem þú vilt setja upp og taktu hakið af þeim íhlutum sem þú vilt ekki setja upp. $_CLICK
+# ^ComponentsSubText1
+Veldu tegund uppsetningar:
+# ^ComponentsSubText2_NoInstTypes
+Veldu þá íhluti sem á að setja upp:
+# ^ComponentsSubText2
+Eða, veldu valfrjálsa íhluti á að setja upp:
+# ^UnComponentsText
+Hakaðu við þá íhluti sem þú vilt fjarlægja og taktu hakið af þeim íhlutum sem þú vilt ekki fjarlægja. $_CLICK
+# ^UnComponentsSubText1
+Veldu tegund fjarlægingar:
+# ^UnComponentsSubText2_NoInstTypes
+Veldu íhluti sem á að fjarlægja:
+# ^UnComponentsSubText2
+Eða, veldu valfrjálsa íhluti sem á að fjarlægja:
+# ^DirText
+Uppsetningin mun setja $(^NameDA) upp í eftirfarandi skráarsafn. Til að setja forritið upp í annað skráarsafn, smelltu á 'Vafra...' og veldu annað skráarsafn. $_CLICK
+# ^DirSubText
+Uppsetningarskráarsafn
+# ^DirBrowseText
+Veldu það skráarsafn sem þú vilt setja $(^NameDA) upp í:
+# ^UnDirText
+Uppsetningin mun fjarlægja $(^NameDA) úr eftirfarandi skráarsafni. Til að fjarlægja forritið úr öðru skráarsafni, smelltu á 'Vafra...' og veldu annað skráarsafn. $_CLICK
+# ^UnDirSubText
+"Fjarlægingarskráarsafn"
+# ^UnDirBrowseText
+Veldu það skráarsafn sem þú vilt fjarlægja $(^NameDA) úr:
+# ^SpaceAvailable
+"Tiltækt rými: "
+# ^SpaceRequired
+"Nauðsynlegt rými: "
+# ^UninstallingText
+$(^NameDA) verður fjarlægt úr eftirfarandi skráarsafni. $_CLICK
+# ^UninstallingSubText
+Fjarlægi úr:
+# ^FileError
+Villa við að skrifa í skrá: \r\n\r\n$0\r\n\r\nSmelltu á 'Hætta við' til að stoppa uppsetninguna,\r\n'Reyna aftur' til að gera aðra tilraun, eða\r\n'Hunsa' til sleppa þessari skrá.
+# ^FileError_NoIgnore
+Villa við að skrifa í skrá: \r\n\r\n$0\r\n\r\nSmelltu á 'Reyna aftur' til að gera aðra tilraun, eða\r\n'Hætta við' til að stoppa uppsetninguna.
+# ^CantWrite
+"Get ei skrifað: "
+# ^CopyFailed
+Afritun mistókst
+# ^CopyTo
+"Afrita til "
+# ^Registering
+"Skrásetja: "
+# ^Unregistering
+"Afskrá: "
+# ^SymbolNotFound
+"Fann ekki tákn: "
+# ^CouldNotLoad
+"Gat ekki hlaðið inn: "
+# ^CreateFolder
+"Búa til skráarsafn: "
+# ^CreateShortcut
+"Búa til flýtileið: "
+# ^CreatedUninstaller
+"Bjó til fjarlægingarhjálp: "
+# ^Delete
+"Eyða skrá: "
+# ^DeleteOnReboot
+"Eyða við endurræsingu: "
+# ^ErrorCreatingShortcut
+"Villa við gerð flýtileiðar: "
+# ^ErrorCreating
+"Villa við gerð: "
+# ^ErrorDecompressing
+Villa við afþjöppun gagna! Biluð uppsetningarhjálp?
+# ^ErrorRegistering
+Villa við skrásetningu DLL
+# ^ExecShell
+"Keyrslugluggi: "
+# ^Exec
+"Keyra: "
+# ^Extract
+"Færa út: "
+# ^ErrorWriting
+"Færa út: villa við að skrifa í skrá "
+# ^InvalidOpcode
+Uppsetningarhjálp biluð: rangur stýrikóði
+# ^NoOLE
+"Engin OLE fyrir: "
+# ^OutputFolder
+"Útskráarsafn: "
+# ^RemoveFolder
+"Fjarlægja skráarsafn: "
+# ^RenameOnReboot
+"Endurskíra við endurræsingu: "
+# ^Rename
+"Endurskíra: "
+# ^Skipped
+"Sleppt: "
+# ^CopyDetails
+Afrita upplýsingar til skrifbrettis
+# ^LogInstall
+Skrá uppsetningarferli
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Catalan.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Catalan.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Catalan.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Catalan (1027)
+;By falanko, corrections by Toni Hermoso Pulido
+
+!insertmacro LANGFILE "Catalan" "Català"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Benvinguts a l'auxiliar d'instal·lació de l'aplicació $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Aquest auxiliar us guiarà durant el procés d'instal·lació de l'aplicació $(^NameDA).$\r$\n$\r$\nEs recomana tancar la resta d'aplicacions abans de començar la instal·lació. Això permetrà al programa d'instal·ació actualitzar fitxers del sistema rellevants sense haver de reiniciar l'ordinador.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Benvinguts a l'auxiliar de desinstal·lació de l'aplicació $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Aquest auxiliar us guiarà a través de la desinstal·lació de l'aplicació $(^NameDA).$\r$\n\rAbans de començar la desinstal·lació, assegureu-vos que l'aplicació $(^NameDA) no s'està executant.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Acord de Llicència"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Reviseu els termes de la llicència abans d'instal·lar l'aplicació $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Si accepteu tots els termes de l'acord, premeu Hi estic d'acord per a continuar. Heu d'acceptar l'acord per a poder instal·lar l'aplicació $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Si accepteu tots els termes de l'acord, activeu la casella de sota. Heu d'acceptar l'acord per poder instal·lar l'aplicació $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Si accepteu tots els termes de l'acord, seleccioneu la primera opció de sota. Heu d'acceptar l'acord per a poder instal·lar $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Acord de llicència"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Reviseu els termes de la llicència abans de desinstal·lar l'aplicació $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Si accepteu tots els termes de l'acord, premeu Hi estic d'Acord per a continuar. Heu d'acceptar l'acord per a poder desinstal·lar l'aplicació $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Si accepteu tots els termes de l'acord, activeu la casella de sota. Heu d'acceptar l'acord per a poder desinstal·lar l'aplicació $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Si accepteu tots els termes de l'acord, seleccioneu la primera opció de sota. Heu d'acceptar l'acord per a poder desinstal·lar l'aplicació $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Premeu AvPàg per a veure la resta de l'acord."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Selecció de components"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Seleccioneu quines característiques de l'aplicació $(^NameDA) desitgeu instal·lar."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Selecció de components"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Seleccioneu quines característiques de l'aplicació $(^NameDA) desitgeu desinstal·lar."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Descripció"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Situeu el ratolí damunt d'un component per a veure'n la descripció."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Situeu el ratolí damunt d'un component per a veure'n la descripció."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Trieu una ubicació d'instal·lació"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Trieu la carpeta on instal·lar-hi l'aplicació $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Trieu la ubicació de desinstal·lació"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Trieu la carpeta d'on desinstal·lar l'aplicació $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "S'està instal·lant"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Si us plau, espereu mentre l'aplicació $(^NameDA) s'instal·la."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "S'ha acabat la instal·lació"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "La instal·lació ha acabat correctament."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "S'ha abandonat la instal·lació"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "La instal·lació no ha acabat correctament."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "S'està desinstal·lant"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Si us plau, espereu mentre l'aplicació $(^NameDA) es desinstal·la."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "S'ha acabat la desinstal·lació"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "La desinstal·lació s'ha realitzat correctament."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "S'ha abandonat la desinstal·lació"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "La desinstal·lació no ha acabat correctament."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "S'està acabant l'auxiliar d'instal·lació de l'aplicació $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "L'aplicació $(^NameDA) s'ha instal·lat a l'ordinador.$\r$\n$\r$\nFeu clic a Finalitza per a tancar aquest auxiliar."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Cal reiniciar l'ordinador perquè pugui acabar-se la instal·lació de l'aplicació $(^NameDA). Voleu reiniciar-lo ara?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "S'està acabant l'auxiliar de desinstal·lació de l'aplicació $(^NameDA)."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "L'aplicació $(^NameDA) s'ha desinstal·lat de l'ordinador.$\r$\n$\r$\nFeu clic a Finalitza per a tancar aquest auxiliar."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Cal reiniciar l'ordinador perquè pugui acabar-se la desinstal·lació de l'aplicació $(^NameDA). Voleu reiniciar-lo ara?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Reinicia ara"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Reinicia més tard manualment"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "Executa l'aplicació $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Mostra el Llegeix-me"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Finalitza"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Tria la carpeta del menú Inicia"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Tria una carpeta del menú Inicia per a les dreceres de l'aplicació $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Seleccioneu la carpeta del Menú Inicia en la que hi vulgueu crear les dreceres del programa. Podeu introduir-hi un altre nom si voleu crear una carpeta nova."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "No creïs les dreceres"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Desinstal·la l'aplicació $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Suprimeix l'aplicació $(^NameDA) de l'ordinador."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Esteu segur que voleu sortir del programa d'instal·lació de l'aplicació $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Esteu segur que voleu sortir del programa de desinstal·lació de l'aplicació $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Romanian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Romanian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Romanian.nsh	(revision 728)
@@ -0,0 +1,130 @@
+;Language: Romanian (1048)
+;Translated by Cristian Pirvu (pcristip@yahoo.com)
+;Updates by Sorin Sbarnea - INTERSOL SRL (sbarneasorin@intersol.ro) - ROBO Design (www.robodesign.ro)
+;New revision by George Radu (georadu@hotmail.com) http://mediatae.3x.ro
+;New revision by Vlad Rusu (vlad@bitattack.ro)
+;	- Use Romanian letters ãâîºþ
+;	- ".. produsului" removed as unnecessary
+;	- "Eliminã" related terms replaced with more appropiate "Dezinstaleazã"
+;	- Misc language tweaks
+!insertmacro LANGFILE "Romanian" "Romana"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Bine aþi venit la instalarea $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Aceastã aplicaþie va instala $(^NameDA).$\r$\n$\r$\nEste recomandat sã închideþi toate aplicaþiile înainte de începerea procesului de instalare. Acest lucru vã poate asigura un proces de instalare fãrã erori sau situaþii neprevãzute.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Bine aþi venit la dezinstalarea $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Aceastã aplicaþie va dezinstala $(^NameDA).$\r$\n$\r$\nEste recomandat sã închideþi toate aplicaþiile înainte de începerea procesului de dezinstalare. Acest lucru vã poate asigura un proces de dezinstalare fãrã erori sau situaþii neprevãzute.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_WELCOMEPAGE | MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Terminare"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Contract de licenþã"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Citiþi cu atenþie termenii contractului de licenþã înainte de a instala $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Dacã acceptaþi termenii contractului de licenþã, apãsati De Acord. Pentru a instala $(^NameDA) trebuie sã acceptaþi termenii din contractul de licenþã."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Dacã acceptaþi termenii contractului de licenþã, bifaþi cãsuþa de mai jos. Pentru a instala $(^NameDA) trebuie sã acceptaþi termenii din contractul de licenþã. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Dacã acceptaþi termenii contractului de licenþã, selectaþi prima opþiune de mai jos. Pentru a instala $(^NameDA) trebuie sã acceptaþi termenii din contractul de licenþã. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Contract de licenþã"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Citiþi cu atenþie termenii contractului de licenþã înainte de a dezinstala $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Dacã acceptaþi termenii contractului de licenþã, apãsati De Acord. Pentru a dezinstala $(^NameDA) trebuie sã acceptaþi termenii din contractul de licenþã."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Dacã acceptaþi termenii contractului de licenþã, bifaþi cãsuþa de mai jos. Pentru a dezinstala $(^NameDA) trebuie sã acceptaþi termenii din contractul de licenþã. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Dacã acceptaþi termenii contractului de licenþã, selectaþi prima opþiune de mai jos. Pentru a dezinstala $(^NameDA) trebuie sã acceptaþi termenii din contractul de licenþã. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Apãsaþi Page Down pentru a vizualiza restul contractului de licenþã."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Selectare componente"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Selectaþi componentele $(^NameDA) pe care doriþi sã le instalaþi."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Selectare componente"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Selectaþi componentele $(^NameDA) pe care doriþi sã le dezinstalaþi."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Descriere"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Aºezaþi mouse-ul deasupra fiecãrei componente pentru a vizualiza descrierea acesteia."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Aºezaþi mouse-ul deasupra fiecãrei componente pentru a vizualiza descrierea acesteia."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Selectare director destinaþie"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Selectaþi directorul în care doriþi sã instalaþi $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Selectare director de dezinstalat"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Selectaþi directorul din care doriþi sã dezinstalaþi $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "În curs de instalare"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Vã rugãm sã aºteptaþi, $(^NameDA) se instaleazã."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Instalare terminatã"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Instalarea s-a terminat cu succes."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Instalare anulatã"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Instalarea a fost anulatã de utilizator."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "În curs de dezinstalare"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Vã rugãm sã aºteptaþi, $(^NameDA) se dezinstaleazã."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Dezinstalare terminatã"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Dezinstalarea s-a terminat cu succes."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Dezinstalare anulatã"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Dezinstalarea fost anulatã de utilizator."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Terminare instalare $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) a fost instalat.$\r$\n$\r$\nApãsaþi Terminare pentru a încheia instalarea."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Trebuie sã reporniþi calculatorul pentru a termina instalarea. Doriþi sã-l reporniþi acum?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Terminare dezinstalare $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) a fost dezinstalat.$\r$\n$\r$\nApãsaþi Terminare pentru a încheia dezinstalarea."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Trebuie sã reporniþi calculatorul pentru a termina dezinstalarea. Doriþi sã-l reporniþi acum?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Reporneºte acum"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Repornesc eu mai târziu"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "Executare $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Afiºare fiºier readme (citeºte-mã)."
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Selectare grup Meniul Start"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Selectaþi un grup in Meniul Start pentru a crea comenzi rapide pentru produs."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Selectaþi grupul din Meniul Start în care vor fi create comenzi rapide pentru produs. Puteþi de asemenea sã creaþi un grup nou."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Nu doresc comenzi rapide"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Dezinstalare $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Dezinstalare $(^NameDA) din calculatorul dumneavoastrã."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Sunteþi sigur(ã) cã doriþi sã anulaþi instalarea $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Sunteþi sigur(ã) cã doriþi sã anulaþi dezinstalarea $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Danish.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Danish.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Danish.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Danish (1030)
+;By Claus Futtrup
+
+!insertmacro LANGFILE "Danish" "Dansk"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Velkommen til installationsguiden for $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Denne guide vil installere $(^NameDA) på din computer.$\r$\n$\r$\nDet anbefales, at du lukker alle kørende programmer inden start af installationsguiden. Dette vil tillade guiden at opdatere de nødvendige systemfiler uden at skulle genstarte computeren.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Velkommen til $(^NameDA) afinstallationsguiden"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Denne afinstallationsguide vil hjælpe dig gennem afinstallationen af $(^NameDA).$\r$\n$\r$\nFør start af afinstallationen skal du være sikker på at $(^NameDA) ikke kører.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Licensaftale"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Læs venligst licensaftalen før du installerer $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Tryk 'Jeg accepterer' hvis du ønsker at accepterer alle vilkårene i aftalen og forsætte. Du skal acceptere vilkårene for at installere $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Hvis du accepterer alle vilkårene i aftalen, skal du markere afkrydsningsfeltet nedenfor. Du skal acceptere vilkårene for at installere $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Hvis du accepterer alle vilkårene i aftalen, skal du vælge den første mulighed nedenfor. Du skal acceptere vilkårene for at installere $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Licensaftale"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Læs venligst licensvilkårene før afinstalleringen af $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Hvis du accepterer vilkårene for aftalen, skal du trykke 'Jeg accepterer' for at fortsætte. Du skal acceptere aftalen for at afinstallere $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Hvis du accepterer vilkårene for aftalen, skal du markere afkrydsningsfeltet nedenfor. Du skal acceptere aftalen for at afinstallere $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Hvis du accepterer vilkårene for aftalen, skal du vælge den første mulighed nedenfor. Du skal acceptere aftalen for at afinstallere $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Tryk Page Down for at se resten af aftalen."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Vælg komponenter"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Vælg hvilke features af $(^NameDA) du vil installere."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Vælg komponenter"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Vælg hvilke features af $(^NameDA) du vil afinstallere."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Beskrivelse"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Placer musemarkøren over en komponent for at se beskrivelsen af komponenten."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Placer musemarkøren over en komponent for at se beskrivelsen af komponenten."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Vælg installationsmappe"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Vælg hvilken mappe du vil installere $(^NameDA) i."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Vælg afinstallationsmappe"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Vælg den mappe hvorfra du vil afinstallere $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Installerer"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Vent venligst mens $(^NameDA) bliver installeret."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Installation gennemført"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Installationsguiden blev gennemført med succes."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Installation afbrudt"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Installationsguiden blev ikke gennemført."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Afinstallerer"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Vent venligst mens $(^NameDA) bliver afinstalleret."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Afinstallationen er færdig"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Afinstallationen blev afsluttet med succes."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Afinstallationen er blevet afbrudt"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Afinstallationen blev ikke genmmenført."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Afslutter $(^NameDA) installationsguiden"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) er blevet installeret på din computer.$\r$\n$\r$\nTryk 'Afslut' for at lukke installationsguiden."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Din computer skal genstartes før installationen af $(^NameDA) er afsluttet. Vil du genstarte nu?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Afslutter $(^NameDA) afinstallationsguiden"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) er blevet afinstalleret fra din computer.$\r$\n$\r$\nTryk 'Afslut' for at lukke denne guide."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Din computer skal genstartes for at gennemføre afinstallationen af $(^NameDA). Vil du genstarte nu?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Genstart nu"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Jeg genstarter selv på et andet tidspunkt"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Start $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Vis vigtig information"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Afslut"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Vælg Start Menu mappe"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Vælg en Start Menu mappe til programmets genveje."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Vælg Start Menu mappen hvor du vil lave programmets genveje. Du kan også skrive et navn for at oprette en ny mappe."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Opret ikke genveje"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Afinstaller $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Slet $(^NameDA) fra din computer."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Er du sikker på, at du vil afslutte $(^Name) installationen?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Er du sikker på at du vil afbryde $(^Name) afinstallationen?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Swedish.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Swedish.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Swedish.nsh	(revision 728)
@@ -0,0 +1,122 @@
+;Compatible with Modern UI 1.72
+;Language: Swedish (1053)
+;By Magnus Bonnevier (magnus.bonnevier@telia.com), updated by Rickard Angbratt (r.angbratt@home.se), updated by Ulf Axelsson (ulf.axelsson@gmail.com)
+
+!insertmacro LANGFILE "Swedish" "Svenska"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Välkommen till installationsguiden för $(^NameDA)."
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Denna guide tar dig igenom installationen av $(^NameDA).$\r$\n$\r$\nDet rekommenderas att du avslutar alla andra program innan du fortsätter installationen. Detta tillåter att installationen uppdaterar nödvändiga systemfiler utan att behöva starta om din dator.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Välkommen till avinstallationsguiden för $(^NameDA)."
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Denna guide tar dig igenom avinstallationen av $(^NameDA).$\r$\n$\r$\nInnan du startar avinstallationen, försäkra dig om att $(^NameDA) inte körs.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Licensavtal"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Var vänlig läs igenom licensvillkoren innan du installerar $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Om du accepterar villkoren i avtalet, klicka Jag Godkänner för att fortsätta. Du måste acceptera avtalet för att installera $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Om du accepterar villkoren i avtalet, klicka i checkrutan nedan. Du måste acceptera avtalet för att installera $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Om du accepterar villkoren i avtalet, välj det första alternativet nedan. Du måste acceptera avtalet för att installera $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Licensavtal"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Var vänlig läs igenom licensvillkoren innan du avinstallerar $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Om du accepterar villkoren i avtalet, klicka Jag Godkänner för att fortsätta. Du måste acceptera avtalet för att avinstallera $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Om du accepterar villkoren i avtalet, klicka i checkrutan nedan. Du måste acceptera avtalet för att avinstallera $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Om du accepterar villkoren i avtalet, välj det första alternativet nedan. Du måste acceptera avtalet för att avinstallera $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Tryck Page Down för att se resten av licensavtalet."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Välj komponenter"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Välj vilka alternativ av $(^NameDA) som du vill installera."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Välj komponenter"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Välj vilka alternativ av $(^NameDA) som du vill avinstallera."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Beskrivning"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Håll muspekaren över ett alternativ för att se dess beskrivning."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Håll muspekaren över ett alternativ för att se dess beskrivning."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Välj installationsväg"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Välj katalog att installera $(^NameDA) i."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Välj avinstallationsväg"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Välj katalog att avinstallera $(^NameDA) från."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Installerar"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Var vänlig vänta medan $(^NameDA) installeras."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Installationen är klar"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Guiden avslutades korrekt."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Installationen avbröts"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Guiden genomfördes inte korrekt."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Avinstallerar"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Var vänlig vänta medan $(^NameDA) avinstalleras."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Avinstallationen genomförd"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Avinstallationen genomfördes korrekt."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Avinstallationen avbruten"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Avinstallationen genomfördes inte korrekt."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Avslutar installationsguiden för $(^NameDA)."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) har installerats på din dator.$\r$\n$\r$\nKlicka på Slutför för att avsluta guiden."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Din dator måste startas om för att fullborda installationen av $(^NameDA). Vill du starta om nu?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Avslutar avinstallationsguiden för $(^NameDA)."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) komponenter har avinstallerats från din dator.$\r$\n$\r$\nKlicka på Slutför för att avsluta guiden."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Din dator måste startas om för att fullborda avinstallationen av $(^NameDA). Vill du starta om nu?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Starta om nu"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Jag vill starta om själv senare"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Kör $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Visa Readme-filen"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Slutför"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Välj Startmenykatalog"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Välj en Startmenykatalog för programmets genvägar."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Välj startmenykatalog i vilken du vill skapa programmets genvägar. Du kan ange ett eget namn för att skapa en ny katalog."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Skapa ej genvägar"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Avinstallera $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Ta bort $(^NameDA) från din dator."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Är du säker på att du vill avbryta installationen av $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Är du säker på att du vill avbryta avinstallationen av $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Galician.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Galician.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Galician.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Galician (1110)
+;Ramon Flores <fa2ramon@usc.es>
+
+!insertmacro LANGFILE "Galician" "Galego"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Benvindo ao Asistente de Instalación do $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Este asistente vai axudá-lo durante a instalación do $(^NameDA).$\r$\n$\r$\nRecomenda-se fechar todas as outras aplicacións antes de iniciar a instalación. Isto posibilita actualizar os ficheiros do sistema relevantes sen ter que reiniciar o computador.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Benvindo ao Asistente de desinstalación do $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Este asistente vai axudá-lo durante a desinstalación do $(^NameDA).$\r$\n$\r$\nAntes de iniciar a desinstalación, certifique-se de que o $(^NameDA) non está a executar-se.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Contrato de licenza"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Por favor, verifique os termos da licenza antes de instalar o $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Se aceitar os termos da licenza, clique en 'Aceito' para continuar. Cumpre aceitar o contrato para instalar o $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Se aceitar os termos da licenza, clique na caixa de selección abaixo. Cumpre aceitar o contrato para instalar o $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Se aceitar os termos da licenza, seleccione a primeira opción abaixo. Cumpre aceitar o contrato para instalar o $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Contrato de licenza"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Por favor, verifique os termos da licenza antes de desinstalar o $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Se aceitar os termos da licenza, clique en 'Aceito' para continuar. Cumpre aceitar o contrato para desinstalar o $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Se aceitar os termos da licenza, clique na caixa de selección abaixo. Cumpre aceitar o contrato para desinstalar o $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Se aceitar os termos da licenza, seleccione a primeira opción abaixo. Cumpre aceitar o contrato para desinstalar o $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Prema Page Down para ver o restante da licenza."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Escolla de componentes"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Escolla que características do $(^NameDA) que desexa instalar."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Escoller componentes"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Escolla que características do $(^NameDA) desexa desinstalar."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Descrición"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Posicione o rato sobre un componente para ver a sua descrición."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Posicione o rato sobre un componente para ver a sua descrición."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Escolla do local da instalación"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Escolla a directória na cal desexa instalar o $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Escolla o Local de desinstalación"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Escolla a directória de onde pretende desinstalar o $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Instalando"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Por favor, agarde entanto o $(^NameDA) está sendo instalado."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Instalación completa"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "A instalación concluiu con suceso."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Instalación Abortada"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "A instalación concluiu sen suceso."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Desinstalando"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Por favor, agarde entanto se desinstala o $(^NameDA)."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Desinstalación completa"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "A desinstalación concluiu con suceso."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Desinstalación abortada"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "A desinstalación non concluiu con suceso"
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Concluindo o Asistente de instalación do $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Instalou-se o $(^NameDA) no seu computador.$\r$\n$\r$\nClique en Rematar para fechar este asistente."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Cumpre reiniciar o seu computador para concluír a instalación do $(^NameDA). Desexa reiniciar agora?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Concluíndo o asistente de desinstalación do $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "Eliminou-se $(^NameDA) do seu computador.$\r$\n$\r$\nClique em Rematar para fechar este asistente."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Cumpre reiniciar o seu computador para concluír a desinstalación do $(^NameDA). Desexa reiniciá-lo agora?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Reiniciar agora"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Prefiro reinicia-lo manualmente despois"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Executar $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Mostrar Leame"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Rematar"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Escolla un cartafol do Menu Iniciar"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Escolla un cartafol do Menu Iniciar para os atallos do programa."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Seleccione o cartafol do Menu Iniciar no que desexa criar os atallos do programa. Tamén é posíbel dixitar un nome para criar un novo cartafol. "
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Non criar atallos"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Desinstalar $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Eliminar o $(^NameDA) do seu computador."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Realmente desexa cancelar a instalación do $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Realmente desexa cancelar a desinstalación do $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Basque.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Basque.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Basque.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1069
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by Iñaki San Vicente
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) -ren Instalazioa
+# ^UninstallCaption
+$(^Name) -ren Ezabaketa
+# ^LicenseSubCaption
+: Lizentzia hitzarmen agiria
+# ^ComponentsSubCaption
+: Instalazio aukerak
+# ^DirSubCaption
+: Instalazio karpeta
+# ^InstallingSubCaption
+: Instalatzen
+# ^CompletedSubCaption
+: Instalazioa burututa
+# ^UnComponentsSubCaption
+: Ezabaketa aukerak
+# ^UnDirSubCaption
+: Ezabaketa direktorioa
+# ^ConfirmSubCaption
+: Berretsi ezabaketa
+# ^UninstallingSubCaption
+: Ezabatzen
+# ^UnCompletedSubCaption
+: Ezabaketa burututa
+# ^BackBtn
+< &Atzera
+# ^NextBtn
+&Aurrera >
+# ^AgreeBtn
+Onartu
+# ^AcceptBtn
+Lizentzia hitzarmenaren baldintzak onartzen ditut.
+# ^DontAcceptBtn
+Ez ditut lizentzia hitzarmenaren baldintzak onartzen.
+# ^InstallBtn
+&Instalatu
+# ^UninstallBtn
+&Ezabatu
+# ^CancelBtn
+Ezeztatu
+# ^CloseBtn
+&Itxi
+# ^BrowseBtn
+&Arakatu...
+# ^ShowDetailsBtn
+Ikusi &zehaztasunak
+# ^ClickNext
+Sakatu Aurrera jarraitzeko.
+# ^ClickInstall
+Sakatu Instalatu instalazioarekin hasteko.
+# ^ClickUninstall
+Sakatu Ezabatu ezabaketarekin hasteko.
+# ^Name
+Izena
+# ^Completed
+Osatuta
+# ^LicenseText
+Mesedez, aztertu lizentzia hitzarmena $(^NameDA) instalatu aurretik. Baldintza guztiak onartzen badituzu, sakatu Onartu.
+# ^LicenseTextCB
+Mesedez, aztertu lizentzia hitzarmena $(^NameDA) instalatu aurretik. Baldintza guztiak onartzen badituzu, nabarmendu azpiko laukitxoa. $_CLICK
+# ^LicenseTextRB
+Mesedez, aztertu lizentzia hitzarmena $(^NameDA) instalatu aurretik. Baldintza guztiak onartzen badituzu, hautatu azpian lehen aukera. $_CLICK
+# ^UnLicenseText
+Mesedez, aztertu lizentzia hitzarmena $(^NameDA) ezabatu aurretik. Baldintza guztiak onartzen badituzu, sakatu Onartu.
+# ^UnLicenseTextCB
+Mesedez, aztertu lizentzia hitzarmena $(^NameDA) ezabatu aurretik. Baldintza guztiak onartzen badituzu, nabarmendu azpiko laukitxoa. $_CLICK.
+# ^UnLicenseTextRB
+Mesedez, aztertu lizentzia hitzarmena $(^NameDA) ezabatu aurretik. Baldintza guztiak onartzen badituzu, hautatu azpian lehen aukera. $_CLICK
+# ^Custom
+Norberaren nahien arabera
+# ^ComponentsText
+Nabarmendu instalatu nahi diren osagaiak, eta utzi zuri instalatu nahi ez direnak. $_CLICK
+# ^ComponentsSubText1
+Hautatu instalazio mota:
+# ^ComponentsSubText2_NoInstTypes
+Hautatu instalatu beharreko osagaiak:
+# ^ComponentsSubText2
+Edo hautatu instalatu beharreko aukerazko osagaiak:
+# ^UnComponentsText
+Nabarmendu ezabatu nahi diren osagaiak, eta utzi zuri ezabatu nahi ez direnak. $_CLICK
+# ^UnComponentsSubText1
+Hautatu ezabaketa mota:
+# ^UnComponentsSubText2_NoInstTypes
+Hautatu ezabatu beharreko osagaiak:
+# ^UnComponentsSubText2
+Edo hautatu ezabatu beharreko aukerazko osagaiak:
+# ^DirText
+Instalazio programak $(^NameDA) honako karpetan instalatuko du. Beste karpeta batean instalatzeko, sakatu Arakatu eta aukeratu beste bat. $_CLICK
+# ^DirSubText
+Helburu karpeta
+# ^DirBrowseText
+Aukeratu $(^NameDA) instalatuko den karpeta:
+# ^UnDirText
+Instalazio programak $(^NameDA) honako karpetatik ezabatuko du. Beste karpeta batetik ezabatzeko, sakatu Arakatu eta aukeratu beste bat. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Aukeratu $(^NameDA) zein karpetatik ezabatuko den:
+# ^SpaceAvailable
+Leku erabilgarria:
+# ^SpaceRequired
+Behar den lekua:
+# ^UninstallingText
+$(^NameDA) ondorengo karpetan instalatuko da. $_CLICK
+# ^UninstallingSubTex
+Ezabatzen honako karpetatik:
+# ^FileError
+Hutsegitea idazteko fitxategia irekitzean: \r\n\t"$0"\r\nSakatu Irten instalazioa ,\r\nsaiatu berriz fitxategi hau berriz idazten saiatzeko, u\r\njarraitu fitxategi hau alde batera utzita aurrera egiteko
+# ^FileError_NoIgnore
+Hutsegitea idazteko fitxategia irekitzean: \r\n\t"$0"\r\nsaiatu berriz fitxategi hau berriz idazten saiatzeko ,\r\nSakatu Irten instalazioa
+# ^CantWrite
+"Ezin izan da idatzi: "
+# ^CopyFailed
+Kopiatzeak hutsegin du
+# ^CopyTo
+"Kopiatu hona "
+# ^Registering
+"Erregistratzen: "
+# ^Unregistering
+"Erregistroa ezabatzen: "
+# ^SymbolNotFound
+"Ikurra ezin izan da aurkitu: "
+# ^CouldNotLoad
+"Ezin izan da kargatu: "
+# ^CreateFolder
+"Sortu karpeta: "
+# ^CreateShortcut
+"Sortu lasterbidea: "
+# ^CreatedUninstaller
+"Sortu ezabatzailea: "
+# ^Delete
+"Ezabatu fitxategia: "
+# ^DeleteOnReboot
+"Ezabatu berrabiarazitakoan: "
+# ^ErrorCreatingShortcut
+"Hutsegitea lasterbidea sortzerakoan: "
+# ^ErrorCreating
+"Hutsegitea sortzerakoan: "
+# ^ErrorDecompressing
+¡Hutsegitea datuak deskomprimatzean! Instalatzailea okerra?
+# ^ErrorRegistering
+Hutsegitea DLL erregistratzerakoan
+# ^ExecShell
+"Exekutatu agindua: "
+# ^Exec
+"Exekutatu: "
+# ^Extract
+"Kanporatu: "
+# ^ErrorWriting
+"Kanporaketa: hutsegitea fitxategira idazterakoan "
+# ^InvalidOpcode
+Instalatzailea okerra: ekintza kodea ez da baliozkoa
+# ^NoOLE
+"OLE-rik ez honentzako: "
+# ^OutputFolder
+"Irteera karpeta: "
+# ^RemoveFolder
+"Ezabatu karpeta: "
+# ^RenameOnReboot
+"Berrizendatu berrabiarazitakoan: "
+# ^Rename
+"Berrizendatu: "
+# ^Skipped
+"Alde batera utzitakoa: "
+# ^CopyDetails
+Kopiatu xehetasunak arbelera
+# ^LogInstall
+Instalazio prozesuaren erregistroa gorde
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Welsh.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Welsh.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Welsh.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+1160
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+-
+# RTL - anything else than RTL means LTR
+-
+# Translation by Rhoslyn Prys, Meddal.com
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+Rhaglen Osod $(^Name)
+# ^UninstallCaption
+Rhaglen Dadosod $(^Name)
+# ^LicenseSubCaption
+: Cytundeb Trwyddedu
+# ^ComponentsSubCaption
+: Dewisiadau Gosod
+# ^DirSubCaption
+: Ffolder Gosod
+# ^InstallingSubCaption
+: Gosod
+# ^CompletedSubCaption
+: Cwblhawyd
+# ^UnComponentsSubCaption
+: Dewisiadau Dadosod
+# ^UnDirSubCaption
+: Ffolder Dadosod
+# ^ConfirmSubCaption
+: Cadarnhad
+# ^UninstallingSubCaption
+: Dadosod
+# ^UnCompletedSubCaption
+: Cwblhawyd
+# ^BackBtn
+< &Nôl
+# ^NextBtn
+&Nesaf >
+# ^AgreeBtn
+&Cytuno
+# ^AcceptBtn
+Rwy'n &derbyn Amodau'r Drwydded
+# ^DontAcceptBtn
+Rwy'n &gwrthod Amodau'r Drwydded
+# ^InstallBtn
+&Gosod
+# ^UninstallBtn
+&Dadosod
+# ^CancelBtn
+Diddymu
+# ^CloseBtn
+C&au
+# ^BrowseBtn
+&Pori...
+# ^ShowDetailsBtn
+&Dangos manylion
+# ^ClickNext
+Cliciwch Nesaf i barhau.
+# ^ClickInstall
+Cliciwch Gosod i gychwyn gosod.
+# ^ClickUninstall
+Cliciwch Dadosod i gychwyn dadosod.
+# ^Name
+Enw
+# ^Completed
+Cwblhawyd
+# ^LicenseText
+Darllenwch y cytundeb trwyddedu cyn gosod $(^NameDA). Os ydych yn derbyn holl amodau'r cytundeb, cliciwch Cytuno.
+# ^LicenseTextCB
+Darllenwch y cytundeb trwyddedu cyn gosod $(^NameDA). Os ydych yn derbyn holl amodau'r cytundeb, cliciwch y blwch ticio isod. $_CLICK
+# ^LicenseTextRB
+Darllenwch y cytundeb trwyddedu cyn gosod $(^NameDA). Os ydych yn derbyn holl amodau'r cytundeb, ticiwch y dewis cyntaf isod. $_CLICK
+# ^UnLicenseText
+Darllenwch y cytundeb trwyddedu cyn dadosod $(^NameDA). Os ydych yn derbyn holl amodau'r cytundeb, cliciwch Cytuno.
+# ^UnLicenseTextCB
+Darllenwch y cytundeb trwyddedu cyn dadosod $(^NameDA). Os ydych yn derbyn holl amodau'r cytundeb, cliciwch y blwch ticio isod. $_CLICK
+# ^UnLicenseTextRB
+Darllenwch y cytundeb trwyddedu cyn dadosod $(^NameDA). Os ydych yn derbyn holl amodau'r cytundeb, ticiwch y dewis cyntaf isod. $_CLICK
+# ^Custom
+Addasu
+# ^ComponentsText
+Ticiwch y cydrannau rydych am eu gosod a dad-dicio'r cydrannau nad ydych am eu gosod. $_CLICK
+# ^ComponentsSubText1
+Dewis y math o osod:
+# ^ComponentsSubText2_NoInstTypes
+Dewis cydrannau i'w gosod:
+# ^ComponentsSubText2
+Neu, ddewis y cydrannau ychwanegol i'w gosod:
+# ^UnComponentsText
+Ticiwch y cydrannau rydych am eu dadosod a dad-dicio'r cydrannau nad ydych am eu dadosod. $_CLICK
+# ^UnComponentsSubText1
+Dewis y math o ddadosod:
+# ^UnComponentsSubText2_NoInstTypes
+Dewis cydrannau i'w dadosod:
+# ^UnComponentsSubText2
+Neu, ddewis y cydrannau ychwanegol i'w dadosod:
+# ^DirText
+Bydd y Rhaglen Osod yn gosod $(^NameDA) yn y ffolder canlynol. I'w osod mewn ffolder gwahanol, cliciwch Pori a dewis ffolder arall. $_CLICK
+# ^DirSubText
+Ffolder Cyrchfan
+# ^DirBrowseText
+Dewis y ffolder i osod $(^NameDA) ynddo:
+# ^UnDirText
+Bydd y Rhegen Osod yn dadosod $(^NameDA) o'r ffolder canlynol. I ddadosod o ffolder gwahanol, cliciwch Pori a dewis ffolder arall. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Dewis ffolder i ddadosod $(^NameDA) ohono:
+# ^SpaceAvailable
+"Lle ar gael: "
+# ^SpaceRequired
+"Lle angenrheidiol: "
+# ^UninstallingText
+Bydd $(^NameDA) yn cael ei ddadosod o'r ffolder canlynol. $_CLICK
+# ^UninstallingSubText
+Dadosod o:
+# ^FileError
+Gwall agor ffeil i'w hysgrifennu: \r\n\r\n$0\r\n\r\nCliciwch Atal i atal y gosod,\r\nEto i geisio eto, neu\r\nAnwybyddu i hepgor y ffeil.
+# ^FileError_NoIgnore
+Gwall agor ffeil i'w hysgrifennu: \r\n\r\n$0\r\n\r\nCliciwch Eto i geisio eto, neu\r\nDiddymu i atal y gosod.
+# ^CantWrite
+"Methu ysgrifennu: "
+# ^CopyFailed
+Methu Copïo
+# ^CopyTo
+"Copïo i "
+# ^Registering
+"Cofrestru: "
+# ^Unregistering
+"Dadgofrestru: "
+# ^SymbolNotFound
+"Methu canfod symbol: "
+# ^CouldNotLoad
+"Methu llwytho: "
+# ^CreateFolder
+"Creu ffolder: "
+# ^CreateShortcut
+"Creu llwybr byr: "
+# ^CreatedUninstaller
+"Creu dadosodwr: "
+# ^Delete
+"Dileu ffeil: "
+# ^DeleteOnReboot
+"Dileu wrth ailgychwyn: "
+# ^ErrorCreatingShortcut
+"Gwall wrth greu llwybr byr: "
+# ^ErrorCreating
+"Gwall wrth greu: "
+# ^ErrorDecompressing
+Gwall wrth ddatgywasgu data! Gosodwr llwgr?
+# ^ErrorRegistering
+Gwall cofrestru DLL
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Gweithredu: "
+# ^Extract
+"Echdynnu: "
+# ^ErrorWriting
+"Echdynnu: gwall ysgrifennu i ffeil "
+# ^InvalidOpcode
+Gosodwr llwgr: opcode annilys
+# ^NoOLE
+"Dim OLE ar gyfer: "
+# ^OutputFolder
+"Ffolder allbwn: "
+# ^RemoveFolder
+"Tynnu ffolder: "
+# ^RenameOnReboot
+"Ailenwi wrth ailgychwyn: "
+# ^Rename
+"Ailenwi: "
+# ^Skipped
+"Hepgor: "
+# ^CopyDetails
+Copïo Manylion i'r Clipfwrdd
+# ^LogInstall
+Cofnodi'r brosed gosod
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Russian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Russian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Russian.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1049
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1251
+# RTL - anything else than RTL means LTR
+-
+# Translation by Timon [ timon@front.ru ] + 20030919
+# Translation updated by Dmitry Yerokhin [erodim@mail.ru] (050424)
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+Óñòàíîâêà $(^Name)
+# ^UninstallCaption
+Óäàëåíèå $(^Name)
+# ^LicenseSubCaption
+: Ëèöåíçèîííîå ñîãëàøåíèå
+# ^ComponentsSubCaption
+: Ïàðàìåòðû óñòàíîâêè
+# ^DirSubCaption
+: Ïàïêà óñòàíîâêè
+# ^InstallingSubCaption
+: Êîïèðîâàíèå ôàéëîâ
+# ^CompletedSubCaption
+: Îïåðàöèÿ çàâåðøåíà
+# ^UnComponentsSubCaption
+: Ïàðàìåòðû óäàëåíèÿ
+# ^UnDirSubCaption
+: Ïàïêà óäàëåíèÿ
+# ^ConfirmSubCaption
+: Ïîäòâåðæäåíèå
+# ^UninstallingSubCaption
+: Óäàëåíèå ôàéëîâ
+# ^UnCompletedSubCaption
+: Îïåðàöèÿ çàâåðøåíà
+# ^BackBtn
+< &Íàçàä
+# ^NextBtn
+&Äàëåå >
+# ^AgreeBtn
+Ïðèíèìà&þ
+# ^AcceptBtn
+ß &ïðèíèìàþ óñëîâèÿ ñîãëàøåíèÿ
+# ^DontAcceptBtn
+ß &íå ïðèíèìàþ óñëîâèÿ ñîãëàøåíèÿ
+# ^InstallBtn
+&Óñòàíîâèòü
+# ^UninstallBtn
+Óä&àëèòü
+# ^CancelBtn
+Îòìåíà
+# ^CloseBtn
+&Çàêðûòü
+# ^BrowseBtn
+Î&áçîð ...
+# ^ShowDetailsBtn
+&Äåòàëè...
+# ^ClickNext
+Íàæìèòå êíîïêó 'Äàëåå' äëÿ ïðîäîëæåíèÿ.
+# ^ClickInstall
+Íàæìèòå êíîïêó 'Óñòàíîâèòü', ÷òîáû óñòàíîâèòü ïðîãðàììó.
+# ^ClickUninstall
+Íàæìèòå êíîïêó 'Óäàëèòü', ÷òîáû óäàëèòü ïðîãðàììó.
+# ^Name
+Èìÿ
+# ^Completed
+Ãîòîâî
+# ^LicenseText
+Ïåðåä óñòàíîâêîé $(^NameDA) îçíàêîìüòåñü ñ ëèöåíçèîííûì ñîãëàøåíèåì. Åñëè âû ïðèíèìàåòå óñëîâèÿ ñîãëàøåíèÿ, íàæìèòå êíîïêó 'Ïðèíèìàþ'.
+# ^LicenseTextCB
+Ïåðåä óñòàíîâêîé $(^NameDA) îçíàêîìüòåñü ñ ëèöåíçèîííûì ñîãëàøåíèåì. Åñëè âû ïðèíèìàåòå óñëîâèÿ ñîãëàøåíèÿ, óñòàíîâèòå ôëàæîê íèæå. $_CLICK
+# ^LicenseTextRB
+Ïåðåä óñòàíîâêîé $(^NameDA) îçíàêîìüòåñü ñ ëèöåíçèîííûì ñîãëàøåíèåì. Åñëè âû ïðèíèìàåòå óñëîâèÿ ñîãëàøåíèÿ, âûáåðèòå ïåðâûé âàðèàíò èç ïðåäëîæåííûõ íèæå. $_CLICK
+# ^UnLicenseText
+Ïåðåä óñòàíîâêîé $(^NameDA) îçíàêîìüòåñü ñ ëèöåíçèîííûì ñîãëàøåíèåì. Åñëè âû ïðèíèìàåòå óñëîâèÿ ñîãëàøåíèÿ, íàæìèòå êíîïêó 'Ïðèíèìàþ'.
+# ^UnLicenseTextCB
+Ïåðåä óñòàíîâêîé $(^NameDA) îçíàêîìüòåñü ñ ëèöåíçèîííûì ñîãëàøåíèåì. Åñëè âû ïðèíèìàåòå óñëîâèÿ ñîãëàøåíèÿ, óñòàíîâèòå ôëàæîê íèæå. $_CLICK
+# ^UnLicenseTextRB
+Ïåðåä óñòàíîâêîé $(^NameDA) îçíàêîìüòåñü ñ ëèöåíçèîííûì ñîãëàøåíèåì. Åñëè âû ïðèíèìàåòå óñëîâèÿ ñîãëàøåíèÿ, âûáåðèòå ïåðâûé âàðèàíò èç ïðåäëîæåííûõ íèæå. $_CLICK
+# ^Custom
+Ïî âûáîðó
+# ^ComponentsText
+Âûáåðèòå êîìïîíåíòû ïðîãðàììû, êîòîðûå âû õîòèòå óñòàíîâèòü. $_CLICK
+# ^ComponentsSubText1
+Âûáåðèòå òèï óñòàíîâêè:
+# ^ComponentsSubText2_NoInstTypes
+Âûáåðèòå êîìïîíåíòû ïðîãðàììû äëÿ óñòàíîâêè:
+# ^ComponentsSubText2
+èëè âûáåðèòå äîïîëíèòåëüíûå êîìïîíåíòû äëÿ óñòàíîâêè:
+# ^UnComponentsText
+Âûáåðèòå êîìïîíåíòû, êîòîðûå âû õîòèòå óäàëèòü. $_CLICK
+# ^UnComponentsSubText1
+Âûáåðèòå òèï óäàëåíèÿ:
+# ^UnComponentsSubText2_NoInstTypes
+Âûáåðèòå êîìïîíåíòû äëÿ óäàëåíèÿ:
+# ^UnComponentsSubText2
+èëè âûáåðèòå äîïîëíèòåëüíûå êîìïîíåíòû äëÿ óäàëåíèÿ:
+# ^DirText
+Ïðîãðàììà óñòàíîâèò $(^NameDA) â óêàçàííóþ ïàïêó. ×òîáû óñòàíîâèòü ïðèëîæåíèå â äðóãóþ ïàïêó, íàæìèòå êíîïêó 'Îáçîð' è óêàæèòå åå. $_CLICK
+# ^DirSubText
+Ïàïêà óñòàíîâêè
+# ^DirBrowseText
+Óêàæèòå ïàïêó äëÿ óñòàíîâêè $(^NameDA):
+# ^UnDirText
+Ïðîãðàììà óäàëèò $(^NameDA) èç óêàçàííîé ïàïêè. ×òîáû âûïîëíèòü óäàëåíèå èç äðóãîé ïàïêè, íàæìèòå êíîïêó 'Îáçîð' è óêàæèòå åå. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Óêàæèòå ïàïêó, èç êîòîðîé íóæíî óäàëèòü $(^NameDA):
+# ^SpaceAvailable
+"Äîñòóïíî íà äèñêå: "
+# ^SpaceRequired
+"Òðåáóåòñÿ íà äèñêå: "
+# ^UninstallingText
+Ïðîãðàììà $(^NameDA) áóäåò óäàëåíà èç âàøåãî ÏÊ. $_CLICK
+# ^UninstallingSubText
+Óäàëåíèå èç:
+# ^FileError
+Íåâîçìîæíî îòêðûòü ôàéë äëÿ çàïèñè: \r\n\t"$0"\r\n'Ïðåðâàòü': îñòàíîâèòü óñòàíîâêó;\r\n"Ïîâòîð": ïîâòîðèòü ïîïûòêó;\r\n"Ïðîïóñê": ïðîïóñòèòü ýòî äåéñòâèå.
+# ^FileError_NoIgnore
+Íåâîçìîæíî îòêðûòü ôàéë äëÿ çàïèñè: \r\n\t"$0"\r\n'Ïîâòîð': ïîâòîðèòü ïîïûòêó;\r\n'Îòìåíà': ïðåðâàòü ïðîöåññ óñòàíîâêè.
+# ^CantWrite
+"Íåâîçìîæíî çàïèñàòü: "
+# ^CopyFailed
+Îøèáêà ïðè êîïèðîâàíèè
+# ^CopyTo
+"Êîïèðîâàíèå â "
+# ^Registering
+"Ðåãèñòðàöèÿ: "
+# ^Unregistering
+"Äå-ðåãèñòðàöèÿ: "
+# ^SymbolNotFound
+"Íåâîçìîæíî íàéòè ñèìâîë: "
+# ^CouldNotLoad
+"Íåâîçìîæíî çàãðóçèòü: "
+# ^CreateFolder
+"Ñîçäàíèå ïàïêè: "
+# ^CreateShortcut
+"Ñîçäàíèå ÿðëûêà: "
+# ^CreatedUninstaller
+"Ñîçäàíèå ïðîãðàììû óäàëåíèÿ: "
+# ^Delete
+"Óäàëåíèå ôàéëà: "
+# ^DeleteOnReboot
+"Óäàëåíèå ïðè ïåðåçàãðóçêå ÏÊ: "
+# ^ErrorCreatingShortcut
+"Îøèáêà ñîçäàíèÿ ÿðëûêà: " 
+# ^ErrorCreating
+"Îøèáêà ñîçäàíèÿ: "
+# ^ErrorDecompressing
+Îøèáêà ðàñïàêîâêè äàííûõ! Âîçìîæíî, ïîâðåæä¸í äèñòðèáóòèâ.
+# ^ErrorRegistering
+Íåâîçìîæíî çàðåãèñòðèðîâàòü áèáëèîòåêó (DLL)
+# ^ExecShell
+"Âûïîëíåíèå êîìàíäû îáîëî÷êè: " 
+# ^Exec
+"Âûïîëíåíèå: "
+# ^Extract
+"Èçâëå÷åíèå: "
+# ^ErrorWriting
+"Èçâëå÷åíèå: îøèáêà çàïèñè ôàéëà "
+# ^InvalidOpcode
+Äèñòðèáóòèâ ïîâðåæäåí: íåäîïóñòèìûé êîä
+# ^NoOLE
+"Íåò OLE äëÿ: " 
+# ^OutputFolder
+"Ïàïêà óñòàíîâêè: "
+# ^RemoveFolder
+"Óäàëåíèå ïàïêè: "
+# ^RenameOnReboot
+"Ïåðåèìåíîâàíèå ïðè ïåðåçàãðóçêå ÏÊ: "
+# ^Rename
+"Ïåðåèìåíîâàíèå: "
+# ^Skipped
+"Ïðîïóñê: "
+# ^CopyDetails
+Êîïèðîâàòü ñâåäåíèÿ â áóôåð îáìåíà 
+# ^LogInstall
+Âåñòè îò÷åò óñòàíîâêè
+# byte
+áàéò
+# kilo
+ Ê
+# mega
+ Ì
+# giga
+ Ã
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Hebrew.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Hebrew.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Hebrew.nsh	(revision 728)
@@ -0,0 +1,129 @@
+;Language: Hebrew (1037)
+;By Yaron Shahrabani
+
+!insertmacro LANGFILE "Hebrew" "Hebrew"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "áøåëéí äáàéí ìàùó ääú÷ðä ùì $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "àùó æä éðçä àúëí áîäìê ääú÷ðä ùì $(^NameDA).$\r$\n$\r$\nîåîìõ ìñâåø ëì úåëðéú àçøú ìôðé äúçìú ääú÷ðä. ôòåìä æå úàôùø ìàùó ìòãëï ÷áöé îòøëú ììà àéúçåì äîçùá.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "áøåëéí äáàéí ìàùó ääñøä ùì $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "àùó æä éðçä àúëí áîäìê ääñøä ùì $(^NameDA).$\r$\n$\r$\nîåîìõ ìñâåø ëì úåëðéú àçøú ìôðé äúçìú ääñøä. ôòåìä æå úàôùø ìàùó ìòãëï ÷áöé îòøëú ììà àéúçåì äîçùá.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "äñëí øéùåé"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "ðà òééï áúðàé äñëí äøéùåé ìôðé äú÷ðú $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "àí àúä î÷áì àú úðàé ääñëí, ìçõ òì 'àðé îñëéí' ëãé ìäîùéê. àí ìà úñëéí ìúðàé ääñëí ìà úåëì ìäú÷éï àú $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "àí àúä î÷áì àú úðàé ääñëí, ñîï àú úéáú äáçéøä ùìäìï. òìééê ì÷áì àú úðàé ääñëí áëãé ìäú÷éï àú $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "àí àúä î÷áì àú úðàé ääñëí, áçø áàôùøåú äøàùåðä ùìäìï. òìééê ì÷áì àú ääñëí ëãé ìäú÷éï àú $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "äñëí øéùåé"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "ðà òééï áúðàé äñëí äøéùåé ìôðé äñøú $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "àí àúä î÷áì àú úðàé ääñëí, ìçõ òì 'àðé îñëéí' ëãé ìäîùéê. àí ìà ú÷áì àú úðàé ääñëí ìà úåëì ìäñéø àú $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "àí àúä î÷áì àú úðàé ääñëí, ñîï àú úéáú äáçéøä ùìäìï. òìééê ì÷áì àú úðàé ääñëí ëãé ìäñéø àú $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "àí àúä î÷áì àú úðàé ääñëí, áçø áàôùøåú äøàùåðä ùìäìï. òìééê ì÷áì àú ääñëí ëãé ìäñéø àú $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "ëãé ìöôåú áùàø äñëí äøéùåé ìçõ òì Page Down."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "áçø øëéáéí"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "áçø àéìå øëéáéí ùì $(^NameDA) áøöåðê ìäú÷éï."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "áçø øëéáéí"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "áçø àéìå úëåðåú ùì $(^NameDA) áøöåðê ìäñéø."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "úéàåø"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "äòáø àú äòëáø îòì øëéá ëìùäå áëãé ìöôåú áúéàåøå."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "äòáø àú äòëáø îòì øëéá ëìùäå áëãé ìöôåú áúéàåøå."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "áçø îé÷åí ìäú÷ðä"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "áçø àú äúé÷ééä áä àúä îòåðééï ìäú÷éï àú $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "áçø îé÷åí ìäñøä"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "áçø àú äúé÷ééä îîðä àúä îòåðééï ìäñéø àú $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "îú÷éï"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "àðà äîúï áæîï ù-$(^NameDA) îåú÷ï."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "ääú÷ðä äåùìîä"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "ääú÷ðä äåùìîä áîìåàä."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "ääú÷ðä áåèìä"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "ääú÷ðä ìà äåùìîä äîìåàä."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "îñéø"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "àðà äîúï áæîï ù-$(^NameDA) îåñø îäîçùá."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "ääñøä äåùìîä"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "ääñøä äåùìîä áîìåàä."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "ääñøä áåèìä"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "ääñøä ìà äåùìîä áîìåàä."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "îùìéí àú àùó ääú÷ðä ùì $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) äåú÷ï áäöìçä.$\r$\n$\r$\nìçõ òì ñéåí ëãé ìñâåø àú äàùó."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "òìééê ìàúçì àú äîçùá ëãé ìñééí àú äú÷ðú $(^NameDA). äàí áøöåðê ìàúçì ëòú?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "îùìéí àú àùó ääñøä ùì $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) äåñø áäöìçä.$\r$\n$\r$\nìçõ òì ñéåí ëãé ìñâåø àú äàùó."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "òìééê ìàúçì àú äîçùá ëãé ìñééí àú äñøú $(^NameDA). äàí áøöåðê ìàúçì ëòú?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "àúçì ëòú"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "áøöåðé ìàúçì éãðéú îàåçø éåúø"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&äøõ àú $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&äöâ îñîê '÷øà àåúé'"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&ñééí"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "áçø úé÷ééä áúôøéè ääúçìä"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "áçø áúé÷ééú úôøéè ääúçìä áä éååöøå ÷éöåøé äãøê ùì äúåëðéú."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "áçø áúé÷ééä îúôøéè ääúçìä áä áøöåðê ìéöåø àú ÷éöåøé äãøê òáåø äúåëðéú. áàôùøåúê âí ìä÷ìéã àú ùí äúé÷ééä ëãé ìéöåø úé÷ééä çãùä."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "àì úéöåø ÷éöåøé ãøê"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "äñø àú $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "äñø àú $(^NameDA) îäîçùá."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "äàí àúä áèåç ùáøöåðê ìöàú îäú÷ðú $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "äàí àúä áèåç ùáøöåðê ìöàú îäñøú $(^Name)?"
+!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "áçø îùúîùéí"
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "áçø ìàéìå îùúîùéí ìäú÷éï àú $(^NameDA)."
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "áçø äàí ìäú÷éï àú $(^NameDA) ìòöîê àå ìëì äîùúîùéí ùì äîçùá. $(^ClickNext)"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "äú÷ï ìëì îùúîùé äîçùá"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "äú÷ï ø÷ ìîùúîù ùìé"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/NorwegianNynorsk.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/NorwegianNynorsk.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/NorwegianNynorsk.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Norwegian nynorsk (2068)
+;By Vebjoern Sture and Håvard Mork (www.firefox.no)
+
+!insertmacro LANGFILE "NorwegianNynorsk" "Norwegian nynorsk"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Velkommen til $(^NameDA) innstallasjonsvegvisar"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Denne vegvisaren vil leie deg gjennom installeringa av $(^NameDA).$\n$\nDet er tilrådd at du avsluttar alle andre program før du held fram. Dette vil la installeringsprogrammet oppdatera systemfiler utan at du må starta datamaskinen på nytt.$\n$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Velkommen til avinstallering av $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Denne vegvisaren vil leie deg gjennom avinstalleringen av $(^NameDA).$\n$\nFør du fortsetter må du forsikre deg om at $(^NameDA) ikkje er opent.$\n$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Lisensavtale"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Les gjennom lisensavtalen før du startar installeringa av $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Trykk på «Godta» dersom du godtar betingelsane i avtala. Du må godta avtala for å installere $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Trykk på avkryssingsboksen nedanfor nedanfor dersom du godtar betingelsane i avtala. Du må godta avtala for å installere $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Vel det første alternativet nedanfor dersom du godtek vilkåra i avtala. Du må godta avtala for å installera $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Lisensavtale"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Les gjennom lisensavtalen før du startar avinstalleringa av $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Trykk på «Godta» dersom du godtar betingelsane i avtala. Du må godta avtala for å avinstallera $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Trykk på avkryssingsboksen nedanfor nedanfor dersom du godtar betingelsane i avtala. Du må godta avtala for å avinstallera $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Vel det første alternativet nedanfor dersom du godtar betingelsane i avtala. Du må godta avtala for å avinstallera $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Trykk Page Down-knappen for å sjå resten av lisensavtala."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Vel komponentar"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Vel kva delar av $(^NameDA) du ynskjer å installera."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Vel funksjonar"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Vel kva for funksjonar du vil avinstallera i $(^NameDA)."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Beskriving"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Beveg musa over komponentene for å sjå beskrivinga."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Beveg musa over komponentene for å sjå beskrivinga."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Vel installasjonsmappe"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Vel kva mappe du vil installera $(^NameDA) i."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Vel avinstalleringplassering"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Vel mappa du vil avinstallere $(^NameDA) frå."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Installerer"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Vent mens $(^NameDA) blir installert."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Installeringa er fullført"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Installeringa vart fullført."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Installeringa vart avbroten"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Installeringa vart ikkje fullført."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Avinstallerer"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Vent medan $(^NameDA) vert avinstallert."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Avinstallering ferdig"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Avinstallering ble utført uten feil."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Avinstallering broten"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Avinstallering ble ikkje utført riktig."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Installering fullført"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) er installert og klar til bruk.$\n$\nTrykk på «Fullfør» for å avslutte installeringa."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Du må starta datamaskinen på nytt for å fullføra installeringa av $(^NameDA). Vil du starta på nytt no?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Fullfører avinstalleringa av $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) er no avinstallert frå datamaskina di.$\n$\nTrykk på «Fullfør» for å avslutta denne vegvisaren."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Datamaskinen må starta på nytt for å fullføra avinstalleringa av $(^NameDA). Vil du starta datamaskina på nytt no?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Start på nytt no"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Eg vil starta på nytt seinare"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Køyr $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Syn lesmeg"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Fullfør"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Vel mappe på startmenyen"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Vel kva mappe snarvegane til $(^NameDA) skal liggja i."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Vel mappa du vil oppretta snarvegane til programmet i. Du kan òg skriva inn eit nytt namn for å laga ei ny mappe."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Ikkje opprett snarvegar"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Avinstaller $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Slett $(^NameDA) frå datamaskinen."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Er du viss på at du vil avslutta installeringa av $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Er du viss på at du vil avbryta avinstalleringa av $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Irish.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Irish.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Irish.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Irish (2108)
+;By Kevin P. Scannell < scannell at slu dot edu >
+
+!insertmacro LANGFILE "Irish" "Irish"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Fáilte go dtí Draoi Suiteála $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Déanfaidh an draoi seo treorú duit tríd an suiteáil de $(^NameDA).$\r$\n$\r$\nMoltar duit gach feidhmchlár eile a dhúnadh sula dtosaíonn tú an Suiteálaí. Cinnteoidh sé seo gur féidir na comhaid oiriúnacha a nuashonrú gan do ríomhaire a atosú.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Fáilte go dtí Draoi Díshuiteála $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Déanfaidh an draoi seo treorú duit tríd an díshuiteáil de $(^NameDA).$\r$\n$\r$\nBí cinnte nach bhfuil $(^NameDA) ag rith sula dtosaíonn tú an díshuiteáil.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Comhaontú um Cheadúnas"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Déan iniúchadh ar choinníollacha an cheadúnais sula suiteálann tú $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Má ghlacann tú le coinníollacha an chomhaontaithe, cliceáil $\"Glacaim Leis$\" chun leanúint ar aghaidh. Caithfidh tú glacadh leis an gcomhaontú chun $(^NameDA) a shuiteáil."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Má ghlacann tú le coinníollacha an chomhaontaithe, cliceáil an ticbhosca thíos. Caithfidh tú glacadh leis an gcomhaontú chun $(^NameDA) a shuiteáil. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Má ghlacann tú le coinníollacha an chomhaontaithe, roghnaigh an chéad rogha thíos. Caithfidh tú glacadh leis an gcomhaontú chun $(^NameDA) a dhíshuiteáil. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Comhaontú um Cheadúnas"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Déan iniúchadh ar choinníollacha an cheadúnais sula ndíshuiteálann tú $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Má ghlacann tú le coinníollacha an chomhaontaithe, cliceáil $\"Glacaim Leis$\" chun leanúint ar aghaidh. Caithfidh tú glacadh leis an gcomhaontú chun $(^NameDA) a dhíshuiteáil."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Má ghlacann tú le coinníollacha an chomhaontaithe, cliceáil an ticbhosca thíos. Caithfidh tú glacadh leis an gcomhaontú chun $(^NameDA) a dhíshuiteáil. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Má ghlacann tú le coinníollacha an chomhaontaithe, roghnaigh an chéad rogha thíos. Caithfidh tú glacadh leis an gcomhaontú chun $(^NameDA) a dhíshuiteáil. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Brúigh $\"Page Down$\" chun an chuid eile den cheadúnas a léamh."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Roghnaigh Comhpháirteanna"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Roghnaigh na gnéithe $(^NameDA) ba mhaith leat suiteáil."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Roghnaigh Comhpháirteanna"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Roghnaigh na gnéithe $(^NameDA) ba mhaith leat díshuiteáil."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Cur Síos"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Cuir do luch os cionn comhpháirte chun cur síos a fheiceáil."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Cuir do luch os cionn comhpháirte chun cur síos a fheiceáil."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Roghnaigh Suíomh na Suiteála"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Roghnaigh an fillteán inar mian leat $(^NameDA) a shuiteáil."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Roghnaigh Suíomh na Díshuiteála"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Roghnaigh an fillteán ar mian leat $(^NameDA) a dhíshuiteáil as."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Á Shuiteáil"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Fan go fóill; $(^NameDA) á shuiteáil."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Suiteáil Críochnaithe"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "D'éirigh leis an tsuiteáil."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Suiteáil Tobscortha"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Níor éirigh leis an tsuiteáil."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Á Dhíshuiteáil"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Fan go fóill; $(^NameDA) á dhíshuiteáil."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Díshuiteáil Críochnaithe"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "D'éirigh leis an díshuiteáil."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Díshuiteáil Tobscortha"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Níor éirigh leis an díshuiteáil."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Draoi Suiteála $(^NameDA) á Chríochnú"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Suiteáladh $(^NameDA) ar do ríomhaire.$\r$\n$\r$\nCliceáil $\"Críochnaigh$\" chun an draoi seo a dhúnadh."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Ní mór duit do ríomhaire a atosú chun suiteáil $(^NameDA) a chur i gcrích. Ar mhaith leat atosú anois?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Draoi Díshuiteála $(^NameDA) á Chríochnú"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "Díshuiteáladh $(^NameDA) ó do ríomhaire.$\r$\n$\r$\nCliceáil $\"Críochnaigh$\" chun an draoi seo a dhúnadh."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Ní mór duit do ríomhaire a atosú chun díshuiteáil $(^NameDA) a chur i gcrích. Ar mhaith leat atosú anois?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Atosaigh anois"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Atosóidh mé de láimh níos déanaí"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Rith $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Tai&speáin comhad README"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Críochnaigh"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Roghnaigh Fillteán sa Roghchlár Tosaigh"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Roghnaigh fillteán sa Roghchlár Tosaigh a gcuirfear aicearraí $(^NameDA) ann."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Roghnaigh an fillteán sa Roghchlár Tosaigh inar mian leat aicearraí an chláir a chruthú. Is féidir freisin fillteán nua a chruthú trí ainm nua a iontráil."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Ná cruthaigh aicearraí"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Díshuiteáil $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Bain $(^NameDA) ó do ríomhaire."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "An bhfuil tú cinnte gur mian leat Suiteálaí $(^Name) a scor?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "An bhfuil tú cinnte gur mian leat Díshuiteálaí $(^Name) a scor?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Indonesian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Indonesian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Indonesian.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1057
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+-
+# RTL - anything else than RTL means LTR
+-
+# Translation ariel825010106@yahoo.com modified and completed by was.uthm@gmail.com in April 2009
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+Instalasi Program $(^Name)
+# ^UninstallCaption
+Penghapusan Program $(^Name)
+# ^LicenseSubCaption
+: Perihal Lisensi
+# ^ComponentsSubCaption
+: Pilihan Instalasi
+# ^DirSubCaption
+: Lokasi Instalasi
+# ^InstallingSubCaption
+: Proses Instalasi
+# ^CompletedSubCaption
+: Selesai
+# ^UnComponentsSubCaption
+: Pilihan Penghapusan
+# ^UnDirSubCaption
+: Berkas Lokasi yang dihapus
+# ^ConfirmSubCaption
+: Konfirmasi
+# ^UninstallingSubCaption
+: Proses Penghapusan
+# ^UnCompletedSubCaption
+: Selesai
+# ^BackBtn
+< &Mundur
+# ^NextBtn
+&Lanjut >
+# ^AgreeBtn
+Saya &Setuju
+# ^AcceptBtn
+Saya s&etuju dengan Perihal Lisensi
+# ^DontAcceptBtn
+Saya &tidak setuju dengan Perihal Lisensi
+# ^InstallBtn
+&Instal
+# ^UninstallBtn
+&Hapus
+# ^CancelBtn
+Batalkan
+# ^CloseBtn
+&Tutup
+# ^BrowseBtn
+Ca&ri...
+# ^ShowDetailsBtn
+Lihat &perincian
+# ^ClickNext
+Tekan tombol Lanjut untuk melanjutkan.
+# ^ClickInstall
+Tekan tombol Instal untuk memulai instalasi.
+# ^ClickUninstall
+Tekan tombol Hapus untuk memulai penghapusan.
+# ^Name
+Nama
+# ^Completed
+Selesai
+# ^LicenseText
+Silahkan membaca lisensi berikut sebelum memulai instalasi $(^NameDA). Jika anda menyetujui dan menerima semua pernyataan, tekan tombol Saya Setuju.
+# ^LicenseTextCB
+Silahkan membaca lisensi berikut sebelum memulai instalasi $(^NameDA). Jika anda menyetujui dan menerima semua pernyataan, beri tanda centang. $_CLICK
+# ^LicenseTextRB
+Silahkan membaca lisensi berikut sebelum memulai instalasi $(^NameDA). Jika anda menyetujui dan menerima semua pernyataan, pilihlah salah satu item dibawah ini. $_CLICK
+# ^UnLicenseText
+Silahkan membaca lisensi berikut sebelum mulai menghapus $(^NameDA). Jika anda menyetujui dan menerima semua pernyataan, tekan tombol Saya Setuju.
+# ^UnLicenseTextCB
+Silahkan membaca lisensi berikut sebelum mulai menghapus $(^NameDA). Jika anda menyetujui dan menerima semua pernyataan, beri tanda centang. $_CLICK
+# ^UnLicenseTextRB
+Silahkan membaca lisensi berikut sebelum mulai menghapus $(^NameDA). Jika anda menyetujui dan menerima semua pernyataan, pilihlah salah satu item dibawah ini. $_CLICK
+# ^Custom
+Tentukan Sendiri
+# ^ComponentsText
+Beri tanda centang pada komponen yang akan di instal and hilangkan tanda centang pada komponen yang tidak perlu di instal. $_CLICK
+# ^ComponentsSubText1
+Pilih tipe instalasi:
+# ^ComponentsSubText2_NoInstTypes
+Pilih komponen-komponen yang akan di instal:
+# ^ComponentsSubText2
+Atau, pilih komponen tambahan yang akan di instal:
+# ^UnComponentsText
+Beri tanda centang pada komponen yang akan dihapus and hilangkan tanda centang pada komponen yang tidak ingin dihapus. $_CLICK
+# ^UnComponentsSubText1
+Pilih tipe penghapusan:
+# ^UnComponentsSubText2_NoInstTypes
+Pilih komponen-komponen yang ingin dihapus:
+# ^UnComponentsSubText2
+Atau, pilih komponen tambahan yang ingin dihapus:
+# ^DirText
+Program $(^NameDA) akan di instal pada lokasi berikut. Untuk memilih lokasi, tekan tombol Cari kemudian pilih lokasi yang anda kehendaki. $_CLICK
+# ^DirSubText
+Lokasi instalasi
+# ^DirBrowseText
+Pilih lokasi instalasi program $(^NameDA):
+# ^UnDirText
+Proses penghapusan program $(^NameDA) dari lokasi instalasi berikut. Untuk memilih lokasi lainnya, tekan tombol Cari kemudian pilih lokasi yang anda kehendaki. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Pilih lokasi instalasi program $(^NameDA) yang akan dihapus:
+# ^SpaceAvailable
+"Ruang yang tersedia:   "
+# ^SpaceRequired
+"Ruang yang dibutuhkan: "
+# ^UninstallingText
+$(^NameDA) akan dihapus dari lokasi berikut. $_CLICK
+# ^UninstallingSubText
+Proses penghapusan dari:
+# ^FileError
+Tidak dapat membuka berkas untuk menulis: \r\n\t"$0"\r\nTekan tombol Abort untuk membatalkan instalasi,\r\nRetry untuk mencoba lagi, atau\r\nIgnore untuk melewati file ini.
+# ^FileError_NoIgnore
+Tidak dapat membuka berkas untuk menulis: \r\n\t"$0"\r\nTekan tombol Retry untuk mencoba lagi, atau\r\nCancel untuk membatalkan instalasi.
+# ^CantWrite
+"Tidak bisa menulis pada berkas: "
+# ^CopyFailed
+Gagal menyalin berkas
+# ^CopyTo
+"Menyalin ke "
+# ^Registering
+"Memasukkan dalam daftar: "
+# ^Unregistering
+"Menghapus dari daftar: "
+# ^SymbolNotFound
+"Tidak dapat menemukan simbol: "
+# ^CouldNotLoad
+"Tidak dapat memuat: "
+# ^CreateFolder
+"Membuat tempat menyimpan berkas: "
+# ^CreateShortcut
+"Membuat shortcut: "
+# ^CreatedUninstaller
+"Program penghapusan yang dibuat: "
+# ^Delete
+"Menghapus berkas: "
+# ^DeleteOnReboot
+"Akan dihapus saat reboot: "
+# ^ErrorCreatingShortcut
+"Tidak dapat membuat shortcut: "
+# ^ErrorCreating
+"Ada kesalahan saat membuat: "
+# ^ErrorDecompressing
+Ada kesalahan saat membuka data! Program Instalasi tidak lengkap?
+# ^ErrorRegistering
+Ada kesalahan ketika mendaftarkan modul DLL
+# ^ExecShell
+"Perintah: "
+# ^Exec
+"Menjalankan: "
+# ^Extract
+"Proses ekstraksi berkas: "
+# ^ErrorWriting
+"Ekstraksi: ada kesalahan saat menulis ke berkas "
+# ^InvalidOpcode
+Program instalasi rusak: kode program tidak lengkap
+# ^NoOLE
+"OLE tidak ditemukan: "
+# ^OutputFolder
+"Lokasi tujuan: "
+# ^RemoveFolder
+"Menghapus lokasi penyimpanan: "
+# ^RenameOnReboot
+"Memberi nama baru saat reboot: "
+# ^Rename
+"Memberi nama baru: "
+# ^Skipped
+"Dilewati: "
+# ^CopyDetails
+Salin perincian ke Clipboard
+# ^LogInstall
+Catat proses instalasi
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Uzbek.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Uzbek.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Uzbek.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Uzbek (1091)
+;Translation updated by Emil Garipov [emil.garipov@gmail.com] 
+
+!insertmacro LANGFILE "Uzbek" "Uzbek"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Sizni o'rnatish dastur tabriklaydi $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Bu dastur sizning komputeringizga $(^NameDA) dasturni o'rnatadi.$\r$\n$\r$\nO'rnatishdan oldin ishlayotgan barcha ilovalarni yopish tavsiya etiladi. Bu o'rnatuvchi dasturga kompyuterni qayta yuklamasdan sistemali fayllarni yangilash imkonini beradi.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Sizni $(^NameDA)ni o'chirish dasturi tabriklaydi"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Bu dastur $(^NameDA)ni sizning kompyuteringizdan o'chiradi.$\r$\n$\r$\nO'chirishdan oldin $(^NameDA) dasturni ishlamayotganligini aniqlang.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Lisenzion kelishuv"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "$(^NameDA) dasturini o'rnatishdan oldin lisenzion kelishuv bilan tanishib chiking."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Agar kelishuv shartlariga rozi bo'lsangiz $\"Qabul kilaman$\" tugmasini bosing.Dasturni o'rnatish uchun,kelishuv shartlarini qabul qilish kerak."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Agar siz kelishuv shartlarini qabul kilsangiz,bayroqchani joylashtiring. Dasturni o'rnatish uchun kelisuv shartlarini qabul qilish kerak. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Kelishuv shartlarini qabul qilsangiz quida taklif etilganlardan birinchi variantni tanlang. Dasturni o'rnatish uchun kelisuv shartlarini qabul qilish kerak. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Lisenzion kelishuv"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "$(^NameDA)ni o'chirishdan oldin lesinzion kelishuv bilan tanishing."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Agar siz kelishuv shartlariniqabul qilsangiz $\"Qabul qilaman$\" tugmasini bosing. O'chirish uchun kelishuv shartlarini qabul qilishingiz kerak. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Agar shartlarni qabul qilsangiz, bayroqchani o'rnating.O'chirish uchun kelishuv shartlarini qabul qilishingiz kerak. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Kelishuv shartlarini qabul qilsangiz, taklif etilganlardan birinchi variantni tanlang.O'chirish uchun kelishuv shartlarini qabul qilishingiz kerak. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Matn bo'icha silgish uchun $\"PageUp$\" va $\"PageDown$\" tugmasidan foydalaning."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "O'rnatilayotgan dastur komponentlari"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "$(^NameDA) dasturning o'zingizga kerak bo'lgan komponentasini tanlang."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Dastur komponentlari"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "$(^NameDA)ning o'chirish kerak bo'lgan komponentlarini tanlang."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Tasvir"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Sichqonchaning kursorini komponent tasvirini o'qish uchun ustiga quying."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Sichqonchaning kursorini komponent tasvirini o'qish uchun ustiga quying."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "O'rnatish papkasini tanlash"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "$(^NameDA)ni o'rnatish uchun papka tanlang."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "O'chiriladigan papkani tanlash"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "$(^NameDA) o'chiriladigan papkasini ko'rsating."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Fayllarni ko'chirish"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Biror kuting, $(^NameDA) fayllari ko'chirilmoqda..."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "O'rnatish jarayoni tugadi"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "O'rnatish jarayoni muvaffaqiyat bilan tugadi."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "O'rnatish jarayoni uzildi"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "O'rnatish jarayoni tugamadi."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "O'chirish"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Biror kutib turing, $(^NameDA) fayllarini o'chirish bajarilmoqda..."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "O'chirish tuganlandi"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Dasturni o'chirish muvaffaqiyatli yakunlandi."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "O'chirish jarayoni uzildi"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "O'chirish to'la bajarilmadi."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "$(^NameDA)ni o'rnatuvci dasturi o'z ishini tugatmoqda"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA)ni o'rnatish bajarildi.$\r$\n$\r$\nO'rnatuvchi dasturdan chiqish uchun $\"Tayor$\" tugmasini bosing."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "$(^NameDA) dasturini o'rnatish jarayonini tugatish uchun Kompyuterni qayta yuklash kerak.Shu ishni bajarishni xoziroq istaysizmi?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "$(^NameDA)ni o'chirish dasturi o'z ishini tugatdi."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) dasturi kompyuteringizdan o'chirildi.$\r$\n$\r$\nO'chirish dasturidan chiqish uchun $\"Tayor$\"tugmasini bosing."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "$(^NameDA) dasturini o'chirishni tugatish uchun kompyuterni qayta yuklash kerak.shu ishni xozir bajarasizmi?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Ha, kompyuter hozir qayta yuklansin"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Yo'q, bu ishni keyinroq bajaraman"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "$(^NameDA) &Ishga tushirilsin"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Readme fayli ko'rsatilsin"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Tayor"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Papka $\"Ïóñê$\" menyusida"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Dastur belgilarini joylashtirish uchun $\"Ïóñê$\" menyusidan papka tanlang."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "$\"Ïóñê$\" menyusidan dastur belgilari joylashadigan papka tanlang. Siz papkaning boshqa ismini kiritishingiz mumkin"
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Belgilar yaratilmasin"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "$(^NameDA)ni o'chirish"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "$(^NameDA)ni kompyuterdan o'chirish."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Haqiqatdan ham siz $(^Name)ni o'rnatishni bekor qilmoqchimisiz?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "$(^Name)ni o'chirish jarayonini bekor qilmoqchisizmi?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Estonian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Estonian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Estonian.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Estonian (1061)
+;Translated by johnny izzo (izzo@hot.ee)
+
+!insertmacro LANGFILE "Estonian" "Eesti keel"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "$(^NameDA) paigaldamine!"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "See abiline aitab paigaldada $(^NameDA).$\r$\n$\r$\nEnne paigaldamise alustamist on soovitatav kõik teised programmid sulgeda, see võimaldab teatud süsteemifaile uuendada ilma arvutit taaskäivitamata.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "$(^NameDA) eemaldamine!"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "See abiline aitab eemaldada $(^NameDA).$\r$\n$\r$\nEnne eemaldamist vaata, et $(^NameDA) oleks suletud.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Litsentsileping"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Enne $(^NameDA) paigaldamist vaata palun litsentsileping üle."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Kui sa oled lepingu tingimustega nõus, vali jätkamiseks Nõustun. $(^NameDA) paigaldamiseks pead sa lepinguga nõustuma."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Kui nõustud lepingu tingimustega, vali allolev märkeruut. $(^NameDA) paigaldamiseks pead lepinguga nõustuma. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Kui nõustud lepingu tingimustega, märgi allpool esimene valik. $(^NameDA) paigaldamiseks pead lepinguga nõustuma. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Litsentsileping"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Enne $(^NameDA) eemaldamist vaata palun litsentsileping üle."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Kui sa oled lepingu tingimustega nõus, vali jätkamiseks Nõustun. $(^NameDA) eemaldamiseks pead sa lepinguga nõustuma."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Kui nõustud lepingu tingimustega, vali allolev märkeruut. $(^NameDA) eemaldamiseks pead lepinguga nõustuma. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Kui nõustud lepingu tingimustega, märgi allpool esimene valik. $(^NameDA) eemaldamiseks pead lepinguga nõustuma. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Vajuta Page Down, et näha ülejäänud teksti."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Vali komponendid"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Vali millised $(^NameDA) osad sa soovid paigaldada."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Vali komponendid"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Vali millised $(^NameDA) osad sa soovid eemaldada."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Kirjeldus"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Nihuta hiir komponendile, et näha selle kirjeldust."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Nihuta hiir komponendile, et näha selle kirjeldust."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Vali asukoht"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Vali kaust kuhu paigaldada $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Vali asukoht"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Vali kaust kust $(^NameDA) eemaldada."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Paigaldan..."
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Palun oota kuni $(^NameDA) on paigaldatud."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Programm paigaldatud"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Paigaldus edukalt sooritatud."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Paigaldus katkestatud"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Paigaldamine ebaõnnestus."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Eemaldan..."
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Palun oota kuni $(^NameDA) on eemaldatud."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Eemaldamine lõpetatud"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Eemaldamine edukalt lõpule viidud."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Eemaldamine katkestatud"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Eemaldamine ebaõnestus."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "$(^NameDA) paigalduse lõpule viimine."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) on sinu arvutisse paigaldatud.$\r$\n$\r$\nAbilise sulgemiseks vajuta Lõpeta."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "$(^NameDA) täielikuks paigaldamiseks tuleb arvuti taaskäivitada. Kas soovid arvuti kohe taaskäivitada ?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "$(^NameDA) eemaldamise lõpule viimine."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) on sinu arvutist eemaldatud.$\r$\n$\r$\nAbilise sulgemiseks vajuta Lõpeta."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "$(^NameDA) täielikuks eemaldamiseks tuleb arvuti taaskäivitada. Kas soovid arvuti kohe taaskäivitada ?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Taaskäivita kohe"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Taaskäivitan hiljem käsitsi"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "Käivita $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Kuva Loemind"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "Lõpeta"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Vali Start-menüü kaust"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Vali $(^NameDA) otseteede jaoks Start-menüü kaust."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Vali Start-menüü kaust, kuhu soovid paigutada programmi otseteed. Võid ka sisestada nime, et luua uus kaust."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Ära loo otseteid"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Eemalda $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Eemalda $(^NameDA) oma arvutist."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Oled sa kindel et soovid $(^Name) paigaldamise katkestada?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Oled sa kindel et soovid $(^Name) eemaldamise katkestada?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Czech.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Czech.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Czech.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1029
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1250
+# RTL - anything else than RTL means LTR
+-
+# Translation by SELiCE (ls@selice.cz - http://ls.selice.cz)
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+Instalovat $(^Name)
+# ^UninstallCaption
+Odinstalovat $(^Name)
+# ^LicenseSubCaption
+: Licenèní ujednání
+# ^ComponentsSubCaption
+: Možnosti instalace
+# ^DirSubCaption
+: Umístìní instalace
+# ^InstallingSubCaption
+: Instaluje se
+# ^CompletedSubCaption
+: Dokonèeno
+# ^UnComponentsSubCaption
+: Možnosti odinstalace
+# ^UnDirSubCaption
+: Odinstalovat adresáø
+# ^ConfirmSubCaption
+: Potvrzení
+# ^UninstallingSubCaption
+: Odinstalování
+# ^UnCompletedSubCaption
+: Dokonèeno
+# ^BackBtn
+< &Zpìt
+# ^NextBtn
+&Další >
+# ^AgreeBtn
+Souhl&asím
+# ^AcceptBtn
+Souhl&asím s podmínkami Licenèního ujednání
+# ^DontAcceptBtn
+&Nesouhlasím s podmínkami Licenèního ujednání
+# ^InstallBtn
+&Instalovat
+# ^UninstallBtn
+&Odinstalovat
+# ^CancelBtn
+Storno
+# ^CloseBtn
+&Zavøít
+# ^BrowseBtn
+P&rocházet...
+# ^ShowDetailsBtn
+Zobrazit &detaily
+# ^ClickNext
+Pro pokraèování kliknìte na 'Další'.
+# ^ClickInstall
+Kliknìte na 'Instalovat' pro zahájení instalace.
+# ^ClickUninstall
+Kliknìte na 'Odinstalovat' pro zahájení odinstalace.
+# ^Name
+Název
+# ^Completed
+Dokonèeno
+# ^LicenseText
+Pøed instalací $(^NameDA) si prosím pøeètìte licenèní ujednání. Jestliže souhlasíte se všema podmínkama ujednání, kliknìte 'Souhlasím'.
+# ^LicenseTextCB
+Pøed instalací $(^NameDA) si prosím pøeètìte licenèní ujednání. Jestliže souhlasíte se všema podmínkama ujednání, zaškrtnìte políèko dole. $_CLICK
+# ^LicenseTextRB
+Pøed instalací $(^NameDA) si prosím pøeètìte licenèní ujednání. Jestliže souhlasíte se všema podmínkama ujednání, zaškrtnìte níže první možnost. $_CLICK
+# ^UnLicenseText
+Pøed odinstalování $(^NameDA) si prosím pøeètìte licenèní ujednání. Jestliže souhlasíte se všema podmínkama ujednání, kliknìte 'Souhlasím'.
+# ^UnLicenseTextCB
+Pøed odinstalování $(^NameDA) si prosím pøeètìte licenèní ujednání. Jestliže souhlasíte se všema podmínkama ujednání, zaškrtnìte políèko dole. $_CLICK
+# ^UnLicenseTextRB
+Pøed odinstalování $(^NameDA) si prosím pøeètìte licenèní ujednání. Jestliže souhlasíte se všema podmínkama ujednání, zaškrtnìte níže první možnost. $_CLICK
+# ^Custom
+Vlastní
+# ^ComponentsText
+Zvolte souèásti, které chcete nainstalovat a nezatrhnìte souèásti, které instalovat nechcete. $_CLICK
+# ^ComponentsSubText1
+Zvolte zpùsob instalace:
+# ^ComponentsSubText2_NoInstTypes
+Zvolte souèásti k instalaci:
+# ^ComponentsSubText2
+Nebo zvolte volitelné souèásti, které chcete nainstalovat:
+# ^UnComponentsText
+Zatrhnìte souèásti, které chcete odinstalovat a nezatrhnìte souèásti, které odinstalovat nechcete. $_CLICK
+# ^UnComponentsSubText1
+Zvolte zpùsob odinstalace:
+# ^UnComponentsSubText2_NoInstTypes
+Zvolte souèásti pro odinstalaci:
+# ^UnComponentsSubText2
+Nebo zvolte jednotlivé souèásti, které chcete odinstalovat:
+# ^DirText
+Setup nyní nainstaluje program $(^NameDA) do následující složky. Pro instalaci do jiné složky zvolte 'Procházet' a vyberte jinou složku. $_CLICK
+# ^DirSubText
+Cílová složka
+# ^DirBrowseText
+Zvolte složku kam instalovat program $(^NameDA):
+# ^UnDirText
+Setup nyní odinstaluje program $(^NameDA) z následující složky. Pro odinstalaci z jiné složky zvolte 'Procházet' a vyberte jinou složku. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Zvolte adresáø pro odinstalaci $(^NameDA) z:
+# ^SpaceAvailable
+"Volné místo: "
+# ^SpaceRequired
+"Potøebné místo: "
+# ^UninstallingText
+Tento prùvodce z Vašeho poèítaèe odinstaluje $(^NameDA). $_CLICK
+# ^UninstallingSubText
+Odinstalovat z:
+# ^FileError
+Nelze otevøít soubor pro zápis: \r\n\t"$0"\r\nStisknìte 'Pøerušit' pro ukonèení instalace\r\nnebo 'Znovu' pro další pokus nebo\r\n'Ignorovat' pro pøeskoèení souboru
+# ^FileError_NoIgnore
+Nelze otevøít soubor pro zápis: \r\n\t"$0"\r\nStisknìte 'Znovu' pro další pokus nebo\r\n*Storno* pro ukonèení instalace
+# ^CantWrite
+"Nelze zapsat: "
+# ^CopyFailed
+Kopírování selhalo
+# ^CopyTo
+"Zkopírovat do "
+# ^Registering
+"Registrování: "
+# ^Unregistering
+"Odregistrování: "
+# ^SymbolNotFound
+"Nelze najít znak: "
+# ^CouldNotLoad
+"Nelze naèíst: "
+# ^CreateFolder
+"Vytvoøen adresáø: "
+# ^CreateShortcut
+"Vytvoøen zástupce: "
+# ^CreatedUninstaller
+"Vytvoøen odinstalátor: "
+# ^Delete
+"Smazat soubor: "
+# ^DeleteOnReboot
+"Smazat po restartu: "
+# ^ErrorCreatingShortcut
+"Chyba pøi vytváøení zástupce: "
+# ^ErrorCreating
+"Chyba pøi vytváøení: "
+# ^ErrorDecompressing
+Chyba pøi rozbalování dat! Poškozený instalátor?
+# ^ErrorRegistering
+Chyba pøi registrování DLL
+# ^ExecShell
+"Spustit shell: "
+# ^Exec
+"Spustit: "
+# ^Extract
+"Rozbalit: "
+# ^ErrorWriting
+"Rozbalit: chyba pøi zápisu do souboru "
+# ^InvalidOpcode
+Instalátor je poškozen: nesprávný kontrolní kód
+# ^NoOLE
+"Nedostupné OLE pro: "
+# ^OutputFolder
+"Výstupní složka: "
+# ^RemoveFolder
+"Odstranit složku: "
+# ^RenameOnReboot
+"Pøejmenovat pøi restartu: "
+# ^Rename
+"Pøejmenováno: "
+# ^Skipped
+"Pøeskoèeno: "
+# ^CopyDetails
+Zkopírovat podrobnosti do schránky
+# ^LogInstall
+Zaznamenat prùbìh instalace
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Luxembourgish.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Luxembourgish.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Luxembourgish.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+4103
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by Jo Hoeser
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) Installatioun
+# ^UninstallCaption
+$(^Name) Desinstallatioun
+# ^LicenseSubCaption
+: Lizenzofkommes
+# ^ComponentsSubCaption
+: Installatiouns-Optiounen
+# ^DirSubCaption
+: Zielverzeechnis
+# ^InstallingSubCaption
+: Installéieren
+# ^CompletedSubCaption
+: Färdeg
+# ^UnComponentsSubCaption
+: Desinstallatiuons-Optiounen
+# ^UnDirSubCaption
+: Quellverzeechnes
+# ^ConfirmSubCaption
+: Bestätegung
+# ^UninstallingSubCaption
+: Läschen
+# ^UnCompletedSubCaption
+: Färdeg
+# ^BackBtn
+< &Zréck
+# ^NextBtn
+&Weider >
+# ^AgreeBtn
+&Unhuelen
+# ^AcceptBtn
+Ech &huelen d'Lizenzofkommes un.
+# ^DontAcceptBtn
+Ech &lehnen d'Lizenzofkommes of.
+# ^InstallBtn
+&Installéieren
+# ^UninstallBtn
+&Desinstalléieren
+# ^CancelBtn
+Ofbriechen
+# ^CloseBtn
+&Zou maan
+# ^BrowseBtn
+&Duerchsichen...
+# ^ShowDetailsBtn
+&Details uweisen
+# ^ClickNext
+Klick op weider fir weiderzefueren
+# ^ClickInstall
+Klick op Installéieren, fir d'Installatioun unzefänken.
+# ^ClickUninstall
+Klick op Desinstalléieren, fir d'Desinstallatioun unzefänken.
+# ^Name
+Numm
+# ^Completed
+Färdeg
+# ^LicenseText
+W.e.g. d'Lizenzofkommes liesen, ierts de $(^NameDA) installéiers. Wanns de all Bedengungen vum Ofkommes akzeptéiers, klick op Unhuelen.
+# ^LicenseTextCB
+W.e.g. d'Lizenzofkommes liesen, ierts de $(^NameDA) installéiers. Wanns de all Bedengungen vum Ofkommes akzeptéiers, aktivéier d'Kontrollkeschtchen. $_CLICK
+# ^LicenseTextRB
+W.e.g. d'Lizenzofkommes liesen, ierts de $(^NameDA) installéiers. Wanns de all Bedengungen vum Ofkommes akzeptéiers, wiel d'entsprichend Optioun. $_CLICK
+# ^UnLicenseText
+W.e.g. d'Lizenzofkommes liesen, ierts de $(^NameDA) desinstalléiers. Wanns de all Bedengungen vum Ofkommes akzeptéiers, klick op Unhuelen.
+# ^UnLicenseTextCB
+W.e.g. d'Lizenzofkommes liesen, ierts de $(^NameDA) desinstalléiers. Wanns de all Bedengungen vum Ofkommes akzeptéiers, aktivéier d'Kontrollkeschtchen. $_CLICK
+# ^UnLicenseTextRB
+W.e.g. d'Lizenzoofkommes liesen, ierts de $(^NameDA) desinstalléiers. Wanns de all Bedengungen vum Oofkommes akzeptéiers, wiel d'entspriechend Optioun. $_CLICK
+# ^Custom
+Benutzerdefiniert
+# ^ComponentsText
+Wiel d'Komponenten aus, déis de wëlls installéieren an wiel déijéineg of, déis de net installéieren wëlls. $_CLICK
+# ^ComponentsSubText1
+Installatiouns-Typ bestëmmen:
+# ^ComponentsSubText2_NoInstTypes
+Wiel d'Komponenten aus, déis de installéieren wëlls:
+# ^ComponentsSubText2
+oder wiel zousätzlech Komponenten aus déis de installéieren wëlls:
+# ^UnComponentsText
+Wiel d'Komponenten aus déis de desinstalléieren wëlls an wiel déijéineg of, déis de net desinstalléieren wëlls. $_CLICK
+# ^UnComponentsSubText1
+Deinstallatiouns-Typ bestëmmen:
+# ^UnComponentsSubText2_NoInstTypes
+Wiel d'Komponenten aus, déis de desinstalléieren wëlls:
+# ^UnComponentsSubText2
+oder wiel zusätzlech Komponenten aus, déis de desinstalléieren wëlls:
+# ^DirText
+$(^NameDA) gëtt an den Dossier installéiert deen fierginn gouf. Wanns de et an een aneren Dossier installéieren wëlls, klick op Duechsichen an wiel een aneren Dossier aus. $_CLICK
+# ^DirSubText
+Zielverzeechnes
+# ^DirBrowseText
+Wiel en Dossier aus wuers de $(^NameDA) installéieren wëlls:
+# ^UnDirText
+$(^NameDA) gëtt an deem Dossier desinstalléiert, deen uginn gouf. Wann $(^NameDA) an engem aneren Dossier ass, klick op Duechsichen an wiel een aneren Dossier aus. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Wiel den Dossier aus wou $(^NameDA) dran installéiert ass:
+# ^SpaceAvailable
+"Verfügbaren Späicher: "
+# ^SpaceRequired
+"Gebrauchten Späicher: "
+# ^UninstallingText
+$(^NameDA) gëtt aus dem ausgewielten Dossier desinstalléiert. $_CLICK
+# ^UninstallingSubText
+Desinstalléieren aus:
+# ^FileError
+Fehler beim Iwwerschreiwen vun der Datei: \r\n\t"$0"\r\nKlick op ofbriechen fir den Setup ze verloossen,\r\nop Widderhuelen fir den Setup nach eng Kéier duechzeféieren\r\n oder op Ignoréieren fir des Datei ze iwwersprengen an weiderzefueren.
+# ^FileError_NoIgnore
+Fehler beim Iwwerschreiwen vun der Datei: \r\n\t"$0"\r\nKlick op Widderhuelen fir den Setup nach eng Kéier duechzeféieren,\r\noder op ofbriechen fir den Setup ze verloossen.
+# ^CantWrite
+"Fehler beim Schreiwen: "
+# ^CopyFailed
+Kopéieren fehlgeschloen
+# ^CopyTo
+"Kopéiere an "
+# ^Registering
+"Registréieren: "
+# ^Unregistering
+"Deregistréieren: "
+# ^SymbolNotFound
+"Symbol ass net do: "
+# ^CouldNotLoad
+"Fehler beim Lueden vun: "
+# ^CreateFolder
+"Maan Dossier: "
+# ^CreateShortcut
+"Maan Oofkierzung: "
+# ^CreatedUninstaller
+"Man Desinstallatiouns-Programm: "
+# ^Delete
+"Läschen Datei: "
+# ^DeleteOnReboot
+"Läschen Datei no engem Neistart: "
+# ^ErrorCreatingShortcut
+"Fehler beim man vun enger Oofkierzung: "
+# ^ErrorCreating
+"Fehler beim maan: "
+# ^ErrorDecompressing
+Fehler beim Dekompriméieren. Installations-Programm beschiedegt?
+# ^ErrorRegistering
+Fehler beim Registréieren vun der DLL
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Starten: "
+# ^Extract
+"Dekompriméieren: "
+# ^ErrorWriting
+"Dekompriméierung: Fehler beim Schreiwen vun der Datei "
+# ^InvalidOpcode
+Installations-Programm Beschiedegt: net zoulässegen Befehlscode
+# ^NoOLE
+"Keen OLE fier: "
+# ^OutputFolder
+"Zieldossier: "
+# ^RemoveFolder
+"Läschen Dossier: "
+# ^RenameOnReboot
+"Gett no Neistart embenannt: "
+# ^Rename
+"Embenennen: "
+# ^Skipped
+"Iwwersprongen: "
+# ^CopyDetails
+Detailler an d'Zwëschenooflag kopéieren
+# ^LogInstall
+Installatioun protokolléieren
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Slovenian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Slovenian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Slovenian.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1060
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1250
+# RTL - anything else than RTL means LTR
+-
+# Translation by Janez Dolinar, edited by Martin Srebotnjak - Lugos.si
+# ^Branding
+Namestitveni sistem Nullsoft %s
+# ^SetupCaption
+Namestitev $(^Name)
+# ^UninstallCaption
+Odstranitev $(^Name)
+# ^LicenseSubCaption
+: Licenèna pogodba
+# ^ComponentsSubCaption
+: Možnosti namestitve
+# ^DirSubCaption
+: Mapa namestitve
+# ^InstallingSubCaption
+: Namešèanje poteka
+# ^CompletedSubCaption
+: Dokonèano
+# ^UnComponentsSubCaption
+: Možnosti odstranitve
+# ^UnDirSubCaption
+: Mapa odstranitve
+# ^ConfirmSubCaption
+: Potrditev
+# ^UninstallingSubCaption
+: Odstranjevanje poteka
+# ^UnCompletedSubCaption
+: Dokonèano
+# ^BackBtn
+< &Nazaj
+# ^NextBtn
+N&aprej >
+# ^AgreeBtn
+Se &strinjam
+# ^AcceptBtn
+&Sprejmem pogoje licenène pogodbe
+# ^DontAcceptBtn
+&Ne sprejmem pogojev licenène pogodbe
+# ^InstallBtn
+&Namesti
+# ^UninstallBtn
+&Odstrani
+# ^CancelBtn
+Preklièi
+# ^CloseBtn
+&Zapri
+# ^BrowseBtn
+Prebrsk&aj ...
+# ^ShowDetailsBtn
+&Podrobnosti
+# ^ClickNext
+Kliknite Naprej za nadaljevanje.
+# ^ClickInstall	
+Kliknite Namesti za zaèetek namestitve.
+# ^ClickUninstall	
+Kliknite Odstrani za odstranitev.
+# ^NameIme
+Ime
+# ^Completed
+Dokonèano
+# ^LicenseText
+Prosimo, da pred namestitvijo $(^NameDA) pregledate licenèno pogodbo. Èe se z njo strinjate, pritisnite Se strinjam.
+# ^LicenseTextCB
+Prosimo, da pred namestitvijo $(^NameDA) pregledate licenèno pogodbo. Èe sprejmete vse naštete pogoje, potrdite spodnje polje. $_CLICK
+# ^LicenseTextRB
+Prosimo, da pred namestitvijo $(^NameDA) pregledate licenèno pogodbo. Èe sprejmete vse naštete pogoje, izberite prvo spodaj podano možnost. $_CLICK
+# ^UnLicenseText
+Prosimo, da pred odstranitvijo $(^NameDA) pregledate licenèno pogodbo. Èe se z njo strinjate, pritisnite Se strinjam.
+# ^UnLicenseTextCB
+Prosimo, da pred odstranitvijo $(^NameDA) pregledate licenèno pogodbo. Èe sprejmete vse naštete pogoje, potrdite spodnje polje. $_CLICK
+# ^UnLicenseTextRB
+Prosimo, da pred odstranitvijo $(^NameDA) pregledate licenèno pogodbo. Èe sprejmete vse naštete pogoje, izberite prvo spodaj podano možnost. $_CLICK
+# ^Custom
+Po meri ...
+# ^ComponentsText
+Oznaèite komponente, ki jih želite namestiti, in pustite neoznaèene tiste, katerih ne želite namestiti. $_CLICK
+# ^ComponentsSubText1
+Izberite vrsto namestitve:
+# ^ComponentsSubText2_NoInstTypes
+Izberite komponente namestitve:
+# ^ComponentsSubText2
+Ali pa izberite komponente, ki jih želite namestiti:
+# ^UnComponentsText
+Oznaèite komponente, ki jih želite odstraniti, in pustite neoznaèene tiste, ki jih ne želite odstraniti. $_CLICK
+# ^UnComponentsSubText1
+Izberite vrsto odstranitve:
+# ^UnComponentsSubText2_NoInstTypes
+Izberite komponente za odstranitev:
+# ^UnComponentsSubText2
+Ali pa izberite komponente namestitve, ki jih želite odstraniti:
+# ^DirText
+$(^NameDA) boste namestili v sledeèo mapo. Za izbiro druge mape kliknite tipko Prebrskaj in izberite drugo mapo. $_CLICK
+# ^DirSubText
+Ciljna mapa
+# ^DirBrowseText
+Izberite mapo, kamor želite namestiti $(^NameDA):
+# ^UnDirText
+Odstranili boste $(^NameDA) iz sledeèe mape. Za izbiro druge mape kliknite tipko Prebrskaj in izberite drugo mapo. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Izberite mapo, od koder želite odstraniti $(^NameDA):
+# ^SpaceAvailable
+"Prostor na disku: "
+# ^SpaceRequired
+"Potreben prostor: "
+# ^UninstallingText
+$(^NameDA) bo odstranjen iz naslednje mape. $_CLICK
+# ^UninstallingSubText
+Odstranjevanje iz:
+# ^FileError
+Napaka pri odpiranju datoteke za pisanje: \r\n\r\n$0\r\n\r\nPritisnite Prekini za prekinitev namestitve,\r\nPonovi za ponoven poskus ali\r\nPrezri za izpust te datoteke.
+# ^FileError_NoIgnore
+Napaka pri odpiranju datoteke za pisanje: \r\n\r\n$0\r\n\r\nPritisnite Ponovi za ponoven poskus pisanja ali\r\Preklièi za prekinitev namestitve.
+# ^CantWrite
+"Ni mogoèe pisati: "
+# ^CopyFailed
+Kopiranje neuspešno
+# ^CopyTo
+"Kopiranje v "
+# ^Registering
+"Registracija: "
+# ^Unregistering
+"Preklic registracije: "
+# ^SymbolNotFound
+"Ni mogoèe najti simbola: "
+# ^CouldNotLoad
+"Ni mogoèe naložiti: "
+# ^CreateFolder
+"Ustvarjanje mape: "
+# ^CreateShortcut
+"Ustvarjanje bližnjice: "
+# ^CreatedUninstaller
+"Ustvarjena odstranitev: "
+# ^Delete
+"Brisanje datoteke: "
+# ^DeleteOnReboot
+"Brisanje ob ponovnem zagonu: "
+# ^ErrorCreatingShortcut
+"Napaka ustvarjanja bližnjice: "
+# ^ErrorCreating
+"Napaka ustvarjanja: "
+# ^ErrorDecompressing
+Napaka pri razširjanju podatkov! Je namestitvena datoteka okvarjena?
+# ^ErrorRegistering
+Napaka registracije DLL
+# ^ExecShell
+"Izvajanje v lupini: "
+# ^Exec
+"Izvajanje: "
+# ^Extract
+"Razširjanje: "
+# ^ErrorWriting
+"Razširjanje: napaka pri pisanju v datoteko "
+# ^InvalidOpcode
+Namestitev neveljavna: napaèen ukaz
+# ^NoOLE
+"Neobstojeèi OLE za: "
+# ^OutputFolder
+"Ciljna mapa: "
+# ^RemoveFolder
+"Odstranjevanje mape: "
+# ^RenameOnReboot
+"Preimenovanje ob zagonu: "
+# ^Rename
+"Preimenovanje: "
+# ^Skipped
+"Izpušèeno: "
+# ^CopyDetails
+Kopiraj podrobnosti v odložišèe
+# ^LogInstall
+Shrani potek namestitve
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Belarusian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Belarusian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Belarusian.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Belarusian (1059)
+;Translated by Sitnikov Vjacheslav [ glory_man@tut.by ]
+
+!insertmacro LANGFILE "Belarusian" "Byelorussian"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Âàñ âiòàå ìàéñòàð ¢ñòàíî¢ê³ $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Ãýòàÿ ïðàãðàìà ¢ñòàëþå $(^NameDA) íà Âàø êàìïóòàð.$\r$\n$\r$\nÏåðàä ïà÷àòêàì óñòàíî¢êi ïðàïàíóåì çà÷ûí³öü óñå ïðàãðàìû, ÿê³ÿ âûêîíâàþööà ¢ ñàïðà¢äíû ìîìàíò. Ãýòà äàïàìîæà ïðàãðàìå ¢ñòàíî¢ê³ àáíàâ³öü ñ³ñòýìíûÿ ôàéëû áåç ïåðàçàãðóçê³ êàìïóòàðà.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Âàñ âiòàå ìàéñòàð âûäàëåííÿ $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Ãýòàÿ ïðàãðàìà âûäàë³öü $(^NameDA) ç Âàøàãà êàìïóòàðà.$\r$\n$\r$\nÏåðàä ïà÷àòêàì âûäàëåííÿ ïåðàêàíàéöåñÿ ¢ òûì, øòî ïðàãðàìà $(^NameDA) íå âûêîíâàåööà.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Ëiöåíçiéíàå ïàãàäíåííå"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Êàë³ ëàñêà, ïðà÷ûòàéöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ ïåðàä ïà÷àòêàì óñòàíî¢êi $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Êàëi Âû ïðûìàåöå ¢ìîâû Ëiöåíçiéíàãà ïàãàäíåííÿ, íàö³ñí³öå êíîïêó $\"Çãîäçåí$\". Ãýòà íåàáõîäíà äëÿ ¢ñòàíî¢ê³ ïðàãðàìû."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Êàëi Âû ïðûìàåöå ¢ìîâû Ëiöåíçiéíàãà ïàãàäíåííÿ, óñòàëþéöå ñöÿæîê í³æýé. Ãýòà íåàáõîäíà äëÿ ¢ñòàíî¢ê³ ïðàãðàìû. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Êàëi Âû ïðûìàåöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ, âûëó÷ûöå ïåðøû âàðûÿíò ç ïðàïàíîâàíûõ í³æýé. Ãýòà íåàáõîäíà äëÿ ¢ñòàíî¢ê³ ïðàãðàìû. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Ë³öýíç³éíàå ïàãàäíåííå"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Êàë³ ëàñêà, ïðà÷ûòàéöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ ïåðàä ïà÷àòêàì âûäàëåííÿ $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Êàë³ Âû ïðûìàåöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ, íàö³ñí³öå êíîïêó $\"Çãîäçåí$\". Ãýòà íåàáõîäíà äëÿ âûäàëåííÿ ïðàãðàìû. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Êàë³ Âû ïðûìàåöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ, óñòàëþéöå ñöÿæîê í³æýé. Ãýòà íåàáõîäíà äëÿ âûäàëåííÿ ïðàãðàìû. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Êàë³ Âû ïðûìàåöå ¢ìîâû Ë³öýíç³éíàãà ïàãàäíåííÿ, âûëó÷ûöå ïåðøû âàðûÿíò ç ïðàïàíàâàíûõ í³æýé. Ãýòà íåàáõîäíà äëÿ âûäàëåííÿ ïðàãðàìû. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Âûêàðûñòî¢âàéöå êíîïêi $\"PageUp$\" i $\"PageDown$\" äëÿ ïåðàìÿø÷ýííÿ ïà òýêñöå."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Êàìïàíåíòû ïðàãðàìû, ÿêàÿ ¢ñòàë¸¢âàåööà"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Âûçíà÷öå êàìïàíåíòû $(^NameDA), ÿê³ÿ Âû æàäàåöå ¢ñòàëÿâàöü."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Êàìïàíåíòû ïðàãðàìû"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Âûçíà÷öå êàìïàíåíòû $(^NameDA), ÿê³ÿ Âû æàäàåöå âûäàë³öü."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Àï³ñàííå"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Óñòàëþéöå êóðñîð ìûøû íà íàçâó êàìïàíåíòà, êàá ïðà÷ûòàöü ÿãî àï³ñàííå."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Óñòàëþéöå êóðñîð ìûøû íà íàçâó êàìïàíåíòà, êàá ïðà÷ûòàöü ÿãî àï³ñàííå."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Âûáàð ïàïê³ ¢ñòàíî¢ê³"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Âûçíà÷öå ïàïêó äëÿ ¢ñòàíî¢ê³ $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Âûáàð ïàïê³ äëÿ âûäàëåííÿ"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Âûçíà÷öå ïàïêó, ç ÿêîé ïàòðýáíà âûäàë³öü $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Êàï³ðàâàííå ôàéëà¢"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Ïà÷àêàéöå, êàë³ ëàñêà, âûêîíâàåööà êàï³ðàâàííå ôàéëà¢ $(^NameDA) íà Âàø êàìïóòàð..."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Óñòàíî¢êà çàâåðøàíà"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Óñòàíî¢êà ïàñïÿõîâà çàâåðøàíà."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Óñòàíî¢êà ïåðàðâàíà"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Óñòàíî¢êà íå çàâåðøàíà."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Âûäàëåííå"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Ïà÷àêàéöå, êàë³ ëàñêà, âûêîíâàåööà âûäàëåííå ôàéëà¢ $(^NameDA) ç Âàøàãà êàìïóòàðà..."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Âûäàëåííå çàâåðøàíà"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Âûäàëåííå ïðàãðàìû ïàñïÿõîâà çàâåðøàíà."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Âûäàëåííå ïåðàðâàíà"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Âûäàëåííå âûêàíàíà íå ïî¢íàñöþ."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Çàêàí÷ýííå ìàéñòðà ¢ñòàíî¢ê³ $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Óñòàíî¢êà $(^NameDA) âûêàíàíà.$\r$\n$\r$\nÍàö³ñí³öå êíîïêó $\"Ãàòîâà$\" äëÿ âûéñöÿ ç ïðàãðàìû ¢ñòàíî¢ê³."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Êàá çàêîí÷ûöü óñòàíî¢êó $(^NameDA), íåàáõîäíà ïåðàçàãðóç³öü êàìïóòàð. Ö³ æàäàåöå Âû çðàá³öü ãýòà çàðàç?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Çàêàí÷ýííå ðàáîòû ìàéñòàðà âûäàëåííÿ $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "Ïðàãðàìà $(^NameDA) âûäàëåíà ç Âàøàãà êàìïóòàðà.$\r$\n$\r$\nÍàö³ñí³öå êíîïêó $\"Ãàòîâà$\"êàá âûéñö³ ç ïðàãðàìû âûäàëåííÿ."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Êàá ñêîí÷ûöü âûäàëåííå  $(^NameDA), íåàáõîäíà ïåðàçàãðóç³öü êàìïóòàð. Ö³ æàäàåöå Âû çðàá³öü ãýòà çàðàç?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Òàê, ïåðàçàãðóç³öü êàìïóòàð çàðàç"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Íå, ïåðàçàãðóç³öü êàìïóòàð ïàçíåé"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Çàïóñö³öü $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Ïàêàçàöü ³íôàðìàöûþ àá ïðàãðàìå"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Ãàòîâà"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Ïàïêà ¢ ìåíþ $\"Ïóñê$\""
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Âûëó÷ûöå ïàïêó ¢ ìåíþ $\"Ïóñê$\" äëÿ ðàçìÿø÷ýííÿ ÿðëûêî¢ ïðàãðàìû."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Âûëó÷ûöå ïàïêó ¢ ìåíþ $\"Ïóñê$\", êóäû áóäóöü çìåø÷àíû ÿðëûê³ ïðàãðàìû. Âû òàêñàìà ìîæàöå àçíà÷ûöü ³íøàå ³ìÿ ïàïê³."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Íå ñòâàðàöü ÿðëûê³"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Âûäàëåííå $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Âûäàëåííå $(^NameDA) ç Âàøàãà êàìïóòàðà."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Âû ñàïðà¢äû æàäàåöå ñêàñàâàöü óñòàíî¢êó $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Âû ñàïðà¢äû æàäàåöå ñêàñàâàöü âûäàëåííå $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Latvian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Latvian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Latvian.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1062
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1257
+# RTL - anything else than RTL means LTR
+-
+# Translation by Valdis Griíis (valmiera-9@inbox.lv)
+# Corrections by Kristaps Meòìelis / x-f (x-f 'AT' inbox.lv)
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+'$(^Name)' Uzstâdîðana
+# ^UninstallCaption
+'$(^Name)' Atinstalçðana
+# ^LicenseSubCaption
+: Licences lîgums
+# ^ComponentsSubCaption
+: Uzstâdîðanas opcijas
+# ^DirSubCaption
+: Uzstâdîðanas mape
+# ^InstallingSubCaption
+: Notiek uzstâdîðana
+# ^CompletedSubCaption
+: Uzstâdîðana pabeigta.
+# ^UnComponentsSubCaption
+: Atinstalçðanas opcijas
+# ^UnDirSubCaption
+: Atinstalçðanas mape
+# ^ConfirmSubCaption
+: Apstiprinâðana
+# ^UninstallingSubCaption
+: Notiek atinstalçðana
+# ^UnCompletedSubCaption
+: Atinstalçðana pabeigta
+# ^BackBtn
+< &Atpakaï
+# ^NextBtn
+&Tâlâk >
+# ^AgreeBtn
+Es &piekrîtu
+# ^AcceptBtn
+Es &piekrîtu licences lîguma noteikumiem
+# ^DontAcceptBtn
+Es &nepiekrîtu licences lîguma noteikumiem
+# ^InstallBtn
+&Uzstâdît
+# ^UninstallBtn
+&Atinstalçt
+# ^CancelBtn
+Atcelt
+# ^CloseBtn
+Ai&zvçrt
+# ^BrowseBtn
+Pâ&rlûkot...
+# ^ShowDetailsBtn
+Parâdît &detaïas
+# ^ClickNext
+Spiediet 'Tâlâk', lai turpinâtu.
+# ^ClickInstall
+Spiediet 'Uzstâdît', lai sâktu uzstâdîðanas procesu.
+# ^ClickUninstall
+Spiediet 'Atinstalçt', lai sâktu atinstalçðanas procesu.
+# ^Name
+Vârds
+# ^Completed
+Uzstâdîðana pabeigta
+# ^LicenseText
+Lûdzu izlasiet licences lîgumu pirms '$(^NameDA)' uzstâdîðanas. Ja piekrîtat licences lîguma noteikumiem, tad spiediet 'Es piekrîtu'.
+# ^LicenseTextCB
+Lûdzu izlasiet licences lîgumu pirms '$(^NameDA)' uzstâdîðanas. Ja piekrîtat licences lîguma noteikumiem, tad atzîmçjiet izvçles rûtiòu. $_CLICK
+# ^LicenseTextRB
+Lûdzu izlasiet licences lîgumu pirms '$(^NameDA)' uzstâdîðanas. Ja piekrîtat licences lîguma noteikumiem, tad izvçlieties pirmo zemâkesoðo opciju. $_CLICK
+# ^UnLicenseText
+Lûdzu izlasiet licences lîgumu pirms '$(^NameDA)' atinstalçðanas. Ja piekrîtat licences lîguma noteikumiem, tad spiediet 'Es piekrîtu'.
+# ^UnLicenseTextCB
+Lûdzu izlasiet licences lîgumu pirms '$(^NameDA)' atinstalçðanas. Ja piekrîtat licences lîguma noteikumiem, tad atzîmçjiet izvçles rûtiòu. $_CLICK
+# ^UnLicenseTextRB
+Lûdzu izlasiet licences lîgumu pirms '$(^NameDA)' atinstalçðanas. Ja piekrîtat licences lîguma noteikumiem, tad izvçlieties zemâkesoðo opciju. $_CLICK
+# ^Custom
+Pielâgots
+# ^ComponentsText
+Izvçlieties, kurus komponentus vçlaties uzstâdît un neiezîmçjiet tos, kurus nevçlaties uzstâdît. $_CLICK
+# ^ComponentsSubText1
+Izvçlieties uzstâdîðanas veidu:
+# ^ComponentsSubText2_NoInstTypes
+Izvçlieties uzstâdâmos komponentus:
+# ^ComponentsSubText2
+Vai arî – izvçlieties tikai nepiecieðamos komponentus, kurus vçlaties uzstâdît:
+# ^UnComponentsText
+Izvçlieties, kurus komponentus atinstalçt un neiezîmçjiet tos, kurus nevçlaties atinstalçt. $_CLICK
+# ^UnComponentsSubText1
+Izvçlieties atinstalçðanas veidu:
+# ^UnComponentsSubText2_NoInstTypes
+Izvçlieties atinstalçjamos komponentus:
+# ^UnComponentsSubText2
+Vai arî – izvçlieties tikai nepiecieðamos komponentus, kurus vçlaties atinstalçt:
+# ^DirText
+'$(^NameDA)' tiks uzstâdîta ðajâ mapç. Lai to uzstâdîtu citâ mapç, nospiediet 'Pârlûkot' un izvçlieties citu mapi. $_CLICK
+# ^DirSubText
+Uzstâdîðanas mape
+# ^DirBrowseText
+Izvçlieties mapi, kurâ uzstâdît '$(^NameDA)':
+# ^UnDirText
+'$(^NameDA)' tiks atinstalçta no ðîs mapes. Lai to atinstalçtu no citas mapes, nospiediet 'Pârlûkot' un izvçlieties citu mapi. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Izvçlieties mapi, no kuras atinstalçt '$(^NameDA)':
+# ^SpaceAvailable
+"Pieejamais diska apjoms: "
+# ^SpaceRequired
+"Nepiecieðamais diska apjoms: "
+# ^UninstallingText
+'$(^NameDA)' tiks atinstalçta no ðîs mapes. $_CLICK
+# ^UninstallingSubText
+Atinstalçðana no:
+# ^FileError
+Kïûda atverot failu rakstîðanai: \r\n\t"$0"\r\nNospiediet 'Atcelt', lai atceltu uzstâdîðanas procesu,\r\n'Mçìinât vçlreiz', lai atkârtoti mçìinâtu rakstît failâ vai\r\n'Ignorçt', lai izlaistu ðî faila uzstâdîðanu
+# ^FileError_NoIgnore
+Kïûda atverot failu rakstîðanai: \r\n\t"$0"\r\nNospiediet 'Atcelt', lai pârtrauktu uzstâdîðanas procesu
+# ^CantWrite
+"Nevar ierakstît: "
+# ^CopyFailed
+Kopçðana neizdevâs
+# ^CopyTo
+"Kopç uz "
+# ^Registering
+"Reìistrç: "
+# ^Unregistering
+"Atreìistrç: "
+# ^SymbolNotFound
+"Simbols nav atrasts: "
+# ^CouldNotLoad
+"Nav iespçjams ielâdçt: "
+# ^CreateFolder
+"Izveido mapi: "
+# ^CreateShortcut
+"Izveido saîsni: "
+# ^CreatedUninstaller
+"Izveidots atinstalçtâjs: "
+# ^Delete
+"Dzçð failu: "
+# ^DeleteOnReboot
+"Dzçst pçc pârstartçðanas: "
+# ^ErrorCreatingShortcut
+"Kïûda veidojot saîsni: "
+# ^ErrorCreating
+"Kïûda veidojot: "
+# ^ErrorDecompressing
+Kïûda atkompresçjot datus! Bojâta instalâcija?
+# ^ErrorRegistering
+Kïûda reìistrçjot DLL failu
+# ^ExecShell
+"Izpilda èaulâ: "
+# ^Exec
+"Izpilda: "
+# ^Extract
+"Atspieþ: "
+# ^ErrorWriting
+"Atspieðana: kïûda rakstot failâ "
+# ^InvalidOpcode
+Instalâcija bojâta: nederîgs CRC kods
+# ^NoOLE
+"Nav OLE priekð: "
+# ^OutputFolder
+"Izvades mape: "
+# ^RemoveFolder
+"Dzçð mapi: "
+# ^RenameOnReboot
+"Pârsaukt pçc pârstartçðanas: "
+# ^Rename
+"Pârsaukt: "
+# ^Skipped
+"Izlaists: "
+# ^CopyDetails
+Iekopçt detaïas starpliktuvç
+# ^LogInstall
+Ierakstît þurnâla failâ uzstâdîðanas procesu
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Afrikaans.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Afrikaans.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Afrikaans.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1078
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by Friedel Wolff
+# ^Branding
+Nullsoft Installeerstelsel %s
+# ^SetupCaption
+$(^Name) Installasie
+# ^UninstallCaption
+$(^Name) Verwydering
+# ^LicenseSubCaption
+: Lisensie-ooreenkoms
+# ^ComponentsSubCaption
+: Installasiekeuses
+# ^DirSubCaption
+: Installasiegids
+# ^InstallingSubCaption
+: Installeer tans
+# ^CompletedSubCaption
+: Voltooid
+# ^UnComponentsSubCaption
+: Verwyderingkeuses
+# ^UnDirSubCaption
+: Verwyderinggids
+# ^ConfirmSubCaption
+: Bevestiging
+# ^UninstallingSubCaption
+: Verwyder tans
+# ^UnCompletedSubCaption
+: Voltooid
+# ^BackBtn
+< V&orige
+# ^NextBtn
+&Volgende >
+# ^AgreeBtn
+&Regso
+# ^AcceptBtn
+Ek &aanvaar die ooreenkoms
+# ^DontAcceptBtn
+Ek aan vaar &nie die ooreenkoms nie
+# ^InstallBtn
+&Installeer
+# ^UninstallBtn
+&Verwyder
+# ^CancelBtn
+Kanselleer
+# ^CloseBtn
+&Sluit af
+# ^BrowseBtn
+&Blaai...
+# ^ShowDetailsBtn
+&Wys detail
+# ^ClickNext
+Klik op Volgende om verder te gaan.
+# ^ClickInstall
+Klik op Installeer om die installasie te begin.
+# ^ClickUninstall
+Klik op Verwyder om die verwydering te begin.
+# ^Name
+Naam
+# ^Completed
+Voltooid
+# ^LicenseText
+Lees die lisensieooreenkoms voordat u $(^NameDA) installeer. Klik op Regso as u die ooreenkoms aanvaar.
+# ^LicenseTextCB
+Lees die lisensieooreenkoms voordat u $(^NameDA) installeer. Merk die blokkie hieronder as u die ooreenkoms aanvaar. $_CLICK
+# ^LicenseTextRB
+Lees die lisensieooreenkoms voordat u $(^NameDA) installeer. Kies die eerste keuse hieronder as u die ooreenkoms aanvaar. $_CLICK
+# ^UnLicenseText
+Lees die lisensieooreenkoms voordat u $(^NameDA) verwyder. Klik op Regso als u die ooreenkoms aanvaar.
+# ^UnLicenseTextCB
+Lees die lisensieooreenkoms voordat u $(^NameDA) verwyder. Merk die blokkie hieronder as u die ooreenkoms aanvaar. $_CLICK
+# ^UnLicenseTextRB
+Lees die lisensieooreenkoms voordat u $(^NameDA) verwyder. KIes die eerste keuse hieronder as u die ooreenkoms aanvaar. $_CLICK
+# ^Custom
+Aangepast
+# ^ComponentsText
+Kies die komponente wat u wil installeer en deselekteer dié wat u nie wil installeer nie. $_CLICK
+# ^ComponentsSubText1
+Kies die installasietipe:
+# ^ComponentsSubText2_NoInstTypes
+Kies die komponente wat geïnstalleer moet word:
+# ^ComponentsSubText2
+Of kies die komponente wat geïnstalleer moet word:
+# ^UnComponentsText
+Kies die komponente wat u wil verwyder en deselekteer dié wat u nie wil verwyder nie. $_CLICK
+# ^UnComponentsSubText1
+Kies die verwyderingstipe:
+# ^UnComponentsSubText2_NoInstTypes
+Kies die komponente wat verwyder moet word:
+# ^UnComponentsSubText2
+Of kies die komponente wat verwyder moet word:
+# ^DirText
+$(^NameDA) sal in die volgende gids geïnstalleer word. Om elders te installeer, klik op Blaai en kies 'n ander een. $_CLICK
+# ^DirSubText
+Installasiegids
+# ^DirBrowseText
+Kies die gids om $(^NameDA) in te installeer:
+# ^UnDirText
+$(^NameDA) gaan uit die volgende gids verwyder word. Om van elders af te verwyder, klik op Blaai en kies 'n ander gids. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Kies die gids om $(^NameDA) uit te verwyder:
+# ^SpaceAvailable
+"Beskikbare spasie: "
+# ^SpaceRequired
+"Vereiste spasie: "
+# ^UninstallingText
+$(^NameDA) sal uit die volgende gids verwyder word. $_CLICK
+# ^UninstallingSubText
+Verwydering uit:
+# ^FileError
+Fout met skryf na lêer: \r\n\r\n$0\r\n\r\nKlik Staak om de installasie te stop,\r\nProbeer weer om weer te probeer of\r\nIgnoreer om dié lêer oor te slaan.
+# ^FileError_NoIgnore
+Fout met skryf na lêer: \r\n\r\n$0\r\n\r\nKlik Probeer weer om op nuut te probeer, of \r\nKanselleer om die installasie te stop.
+# ^CantWrite
+"Kon nie skyf nie: "
+# ^CopyFailed
+Kopiëring het misluk
+# ^CopyTo
+"Kopieer na "
+# ^Registering
+"Registreer tans: "
+# ^Unregistering
+"Deregistreer tans: "
+# ^SymbolNotFound
+"Kon nie simbool vind nie: "
+# ^CouldNotLoad
+"Kon nie laai nie: "
+# ^CreateFolder
+"Skep gids: "
+# ^CreateShortcut
+"Maak kortpad: "
+# ^CreatedUninstaller
+"Verwyderingsprogram gemaak: "
+# ^Delete
+"Verwyder lêer: "
+# ^DeleteOnReboot
+"Verwyder na herbegin van rekenaar: "
+# ^ErrorCreatingShortcut
+"Fout met maak van kortpad: "
+# ^ErrorCreating
+"Fout met skep: "
+# ^ErrorDecompressing
+Fout met uitpak van data! Korrupte installasielêer?
+# ^ErrorRegistering
+Fout met registrasie van DLL
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Voer uit: "
+# ^Extract
+"Pak uit: "
+# ^ErrorWriting
+"Uitpak: fout met skryf na lêer "
+# ^InvalidOpcode
+Installasieprogram korrup: ongeldige opcode
+# ^NoOLE
+"Geen OLE vir: "
+# ^OutputFolder
+"Afvoergids: "
+# ^RemoveFolder
+"Verwyder gids: "
+# ^RenameOnReboot
+"Hernoem na herbegin van rekenaar: "
+# ^Rename
+"Hernoem: "
+# ^Skipped
+"Oorgeslaan: "
+# ^CopyDetails
+Kopieer detail na knipbord
+# ^LogInstall
+Boekstaaf die installasieproses
+# ^Byte
+G
+# ^Kilo
+K
+# ^Mega
+M
+#  ^Giga
+G
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Japanese.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Japanese.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Japanese.nsh	(revision 728)
@@ -0,0 +1,130 @@
+;Language: Japanese (1041)
+;By Dnanako
+;Translation updated by Takahiro Yoshimura <takahiro_y@monolithworks.co.jp>
+
+!insertmacro LANGFILE "Japanese" "Japanese"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "$(^NameDA) ƒZƒbƒgƒAƒbƒv ƒEƒBƒU�[ƒh‚Ö‚æ‚¤‚±‚»"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "‚±‚ÌƒEƒBƒU�[ƒh‚Í�A$(^NameDA)‚ÌƒCƒ“ƒXƒg�[ƒ‹‚ðƒKƒCƒh‚µ‚Ä‚¢‚«‚Ü‚·�B$\r$\n$\r$\nƒZƒbƒgƒAƒbƒv‚ðŠJŽn‚·‚é‘O‚É�A‘¼‚Ì‚·‚×‚Ä‚ÌƒAƒvƒŠƒP�[ƒVƒ‡ƒ“‚ð�I—¹‚·‚é‚±‚Æ‚ð�„�§‚µ‚Ü‚·�B‚±‚ê‚É‚æ‚Á‚ÄƒZƒbƒgƒAƒbƒv‚ªƒRƒ“ƒsƒ…�[ƒ^‚ð�Ä‹N“®‚¹‚¸‚É�AƒVƒXƒeƒ€ ƒtƒ@ƒCƒ‹‚ð�X�V‚·‚é‚±‚Æ‚ª�o—ˆ‚é‚æ‚¤‚É‚È‚è‚Ü‚·�B$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "$(^NameDA) ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹ ƒEƒBƒU�[ƒh‚Ö‚æ‚¤‚±‚»"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "‚±‚ÌƒEƒBƒU�[ƒh‚Í�A$(^NameDA)‚ÌƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚ðƒKƒCƒh‚µ‚Ä‚¢‚«‚Ü‚·�B$\r$\n$\r$\nƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚ðŠJŽn‚·‚é‘O‚É�A$(^NameDA)‚ª‹N“®‚µ‚Ä‚¢‚È‚¢‚±‚Æ‚ðŠm”F‚µ‚Ä‰º‚³‚¢�B$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "ƒ‰ƒCƒZƒ“ƒXŒ_–ñ�‘"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "$(^NameDA)‚ðƒCƒ“ƒXƒg�[ƒ‹‚·‚é‘O‚É�Aƒ‰ƒCƒZƒ“ƒX�ðŒ�‚ðŠm”F‚µ‚Ä‚­‚¾‚³‚¢�B"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Œ_–ñ�‘‚Ì‚·‚×‚Ä‚Ì�ðŒ�‚É“¯ˆÓ‚·‚é‚È‚ç‚Î�A[“¯ˆÓ‚·‚é] ‚ð‘I‚ñ‚ÅƒCƒ“ƒXƒg�[ƒ‹‚ð‘±‚¯‚Ä‚­‚¾‚³‚¢�B$(^NameDA) ‚ðƒCƒ“ƒXƒg�[ƒ‹‚·‚é‚É‚Í�AŒ_–ñ�‘‚É“¯ˆÓ‚·‚é•K—v‚ª‚ ‚è‚Ü‚·�B"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Œ_–ñ�‘‚Ì‚·‚×‚Ä‚Ì�ðŒ�‚É“¯ˆÓ‚·‚é‚È‚ç‚Î�A‰º‚Ìƒ`ƒFƒbƒNƒ{ƒbƒNƒX‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢�B$(^NameDA) ‚ðƒCƒ“ƒXƒg�[ƒ‹‚·‚é‚É‚Í�AŒ_–ñ�‘‚É“¯ˆÓ‚·‚é•K—v‚ª‚ ‚è‚Ü‚·�B $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Œ_–ñ�‘‚Ì‚·‚×‚Ä‚Ì�ðŒ�‚É“¯ˆÓ‚·‚é‚È‚ç‚Î�A‰º‚É•\Ž¦‚³‚ê‚Ä‚¢‚éƒIƒvƒVƒ‡ƒ“‚Ì‚¤‚¿�A�Å�‰‚Ì‚à‚Ì‚ð‘I‚ñ‚Å‰º‚³‚¢�B$(^NameDA) ‚ðƒCƒ“ƒXƒg�[ƒ‹‚·‚é‚É‚Í�AŒ_–ñ�‘‚É“¯ˆÓ‚·‚é•K—v‚ª‚ ‚è‚Ü‚·�B $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "ƒ‰ƒCƒZƒ“ƒXŒ_–ñ�‘"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "$(^NameDA)‚ðƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚·‚é‘O‚É�Aƒ‰ƒCƒZƒ“ƒX�ðŒ�‚ðŠm”F‚µ‚Ä‚­‚¾‚³‚¢�B"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Œ_–ñ�‘‚Ì‚·‚×‚Ä‚Ì�ðŒ�‚É“¯ˆÓ‚·‚é‚È‚ç‚Î�A[“¯ˆÓ‚·‚é] ‚ð‘I‚ñ‚ÅƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚ð‘±‚¯‚Ä‚­‚¾‚³‚¢�B$(^NameDA) ‚ðƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚·‚é‚É‚Í�AŒ_–ñ�‘‚É“¯ˆÓ‚·‚é•K—v‚ª‚ ‚è‚Ü‚·�B"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Œ_–ñ�‘‚Ì‚·‚×‚Ä‚Ì�ðŒ�‚É“¯ˆÓ‚·‚é‚È‚ç‚Î�A‰º‚Ìƒ`ƒFƒbƒNƒ{ƒbƒNƒX‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢�B$(^NameDA) ‚ðƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚·‚é‚É‚Í�AŒ_–ñ�‘‚É“¯ˆÓ‚·‚é•K—v‚ª‚ ‚è‚Ü‚·�B $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Œ_–ñ�‘‚Ì‚·‚×‚Ä‚Ì�ðŒ�‚É“¯ˆÓ‚·‚é‚È‚ç‚Î�A‰º‚É•\Ž¦‚³‚ê‚Ä‚¢‚éƒIƒvƒVƒ‡ƒ“‚Ì‚¤‚¿�A�Å�‰‚Ì‚à‚Ì‚ð‘I‚ñ‚Å‰º‚³‚¢�B$(^NameDA) ‚ðƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚·‚é‚É‚Í�AŒ_–ñ�‘‚É“¯ˆÓ‚·‚é•K—v‚ª‚ ‚è‚Ü‚·�B $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "[Page Down]‚ð‰Ÿ‚µ‚ÄŒ_–ñ�‘‚ð‚·‚×‚Ä‚¨“Ç‚Ý‚­‚¾‚³‚¢�B"
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "ƒRƒ“ƒ|�[ƒlƒ“ƒg‚ð‘I‚ñ‚Å‚­‚¾‚³‚¢�B"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "$(^NameDA)‚ÌƒCƒ“ƒXƒg�[ƒ‹ ƒIƒvƒVƒ‡ƒ“‚ð‘I‚ñ‚Å‚­‚¾‚³‚¢�B"
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "ƒRƒ“ƒ|�[ƒlƒ“ƒg‚ð‘I‚ñ‚Å‚­‚¾‚³‚¢�B"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "$(^NameDA)‚ÌƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹ ƒIƒvƒVƒ‡ƒ“‚ð‘I‚ñ‚Å‚­‚¾‚³‚¢�B"
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "�à–¾"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "ƒRƒ“ƒ|�[ƒlƒ“ƒg‚Ì�ã‚Éƒ}ƒEƒX ƒJ�[ƒ\ƒ‹‚ðˆÚ“®‚·‚é‚Æ�A‚±‚±‚É�à–¾‚ª•\Ž¦‚³‚ê‚Ü‚·�B"
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "ƒRƒ“ƒ|�[ƒlƒ“ƒg‚Ì�ã‚Éƒ}ƒEƒX ƒJ�[ƒ\ƒ‹‚ðˆÚ“®‚·‚é‚Æ�A‚±‚±‚É�à–¾‚ª•\Ž¦‚³‚ê‚Ü‚·�B"
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "ƒCƒ“ƒXƒg�[ƒ‹�æ‚ð‘I‚ñ‚Å‚­‚¾‚³‚¢�B"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "$(^NameDA)‚ðƒCƒ“ƒXƒg�[ƒ‹‚·‚éƒtƒHƒ‹ƒ_‚ð‘I‚ñ‚Å‚­‚¾‚³‚¢�B"
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹Œ³‚ð‘I‚ñ‚Å‚­‚¾‚³‚¢�B"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "$(^NameDA)‚ðƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚·‚éƒtƒHƒ‹ƒ_‚ð‘I‚ñ‚Å‚­‚¾‚³‚¢�B"
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "ƒCƒ“ƒXƒg�[ƒ‹"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "$(^NameDA)‚ðƒCƒ“ƒXƒg�[ƒ‹‚µ‚Ä‚¢‚Ü‚·�B‚µ‚Î‚ç‚­‚¨‘Ò‚¿‚­‚¾‚³‚¢�B"
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "ƒCƒ“ƒXƒg�[ƒ‹‚ÌŠ®—¹"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "ƒCƒ“ƒXƒg�[ƒ‹‚É�¬Œ÷‚µ‚Ü‚µ‚½�B"
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "ƒCƒ“ƒXƒg�[ƒ‹‚Ì’†Ž~"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "ƒZƒbƒgƒAƒbƒv‚Í�³�í‚ÉŠ®—¹‚³‚ê‚Ü‚¹‚ñ‚Å‚µ‚½�B"
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "$(^NameDA)‚ðƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚µ‚Ä‚¢‚Ü‚·�B‚µ‚Î‚ç‚­‚¨‘Ò‚¿‚­‚¾‚³‚¢�B"
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚ÌŠ®—¹"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚É�¬Œ÷‚µ‚Ü‚µ‚½�B"
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚Ì’†Ž~"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚Í�³�í‚ÉŠ®—¹‚³‚ê‚Ü‚¹‚ñ‚Å‚µ‚½�B"
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "$(^NameDA) ƒZƒbƒgƒAƒbƒv ƒEƒBƒU�[ƒh‚ÍŠ®—¹‚µ‚Ü‚µ‚½�B"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA)‚Í�A‚±‚ÌƒRƒ“ƒsƒ…�[ƒ^‚ÉƒCƒ“ƒXƒg�[ƒ‹‚³‚ê‚Ü‚µ‚½�B$\r$\n$\r$\nƒEƒBƒU�[ƒh‚ð•Â‚¶‚é‚É‚Í [Š®—¹] ‚ð‰Ÿ‚µ‚Ä‚­‚¾‚³‚¢�B"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "$(^NameDA) ‚ÌƒCƒ“ƒXƒg�[ƒ‹‚ðŠ®—¹‚·‚é‚É‚Í�A‚±‚ÌƒRƒ“ƒsƒ…�[ƒ^‚ð�Ä‹N“®‚·‚é•K—v‚ª‚ ‚è‚Ü‚·�B�¡‚·‚®�Ä‹N“®‚µ‚Ü‚·‚©�H"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "$(^NameDA) ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹ ƒEƒBƒU�[ƒh‚ÍŠ®—¹‚µ‚Ü‚µ‚½�B"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA)‚Í�A‚±‚ÌƒRƒ“ƒsƒ…�[ƒ^‚©‚çƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚³‚ê‚Ü‚µ‚½�B$\r$\n$\r$\nƒEƒBƒU�[ƒh‚ð•Â‚¶‚é‚É‚Í [Š®—¹] ‚ð‰Ÿ‚µ‚Ä‚­‚¾‚³‚¢�B"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "$(^NameDA) ‚ÌƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚ðŠ®—¹‚·‚é‚É‚Í�A‚±‚ÌƒRƒ“ƒsƒ…�[ƒ^‚ð�Ä‹N“®‚·‚é•K—v‚ª‚ ‚è‚Ü‚·�B�¡‚·‚®�Ä‹N“®‚µ‚Ü‚·‚©�H"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "�¡‚·‚®�Ä‹N“®‚·‚é"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Œã‚ÅŽè“®‚Å�Ä‹N“®‚·‚é"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "$(^NameDA)‚ðŽÀ�s(&R)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Readme ‚ð•\Ž¦‚·‚é(&S)"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "Š®—¹(&F)"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "ƒXƒ^�[ƒgƒ�ƒjƒ…�[ ƒtƒHƒ‹ƒ_‚ð‘I‚ñ‚Å‚­‚¾‚³‚¢�B"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "$(^NameDA)‚ÌƒVƒ‡�[ƒgƒJƒbƒg‚ð�ì�¬‚·‚éƒXƒ^�[ƒgƒ�ƒjƒ…�[ ƒtƒHƒ‹ƒ_‚ð‘I‚ñ‚Å‰º‚³‚¢�B"
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "‚±‚Ìƒvƒ�ƒOƒ‰ƒ€‚ÌƒVƒ‡�[ƒgƒJƒbƒg‚ð�ì�¬‚µ‚½‚¢ƒXƒ^�[ƒgƒ�ƒjƒ…�[ ƒtƒHƒ‹ƒ_‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢�B‚Ü‚½�A�ì�¬‚·‚é�V‚µ‚¢ƒtƒHƒ‹ƒ_‚É–¼‘O‚ð‚Â‚¯‚é‚±‚Æ‚à‚Å‚«‚Ü‚·�B"
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "ƒVƒ‡�[ƒgƒJƒbƒg‚ð�ì�¬‚µ‚È‚¢"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "$(^NameDA)‚ÌƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "$(^NameDA)‚ð‚±‚ÌƒRƒ“ƒsƒ…�[ƒ^‚©‚ç�í�œ‚µ‚Ü‚·�B"
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "$(^Name) ƒZƒbƒgƒAƒbƒv‚ð’†Ž~‚µ‚Ü‚·‚©�H"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "$(^Name) ƒAƒ“ƒCƒ“ƒXƒg�[ƒ‹‚ð’†Ž~‚µ‚Ü‚·‚©�H"
+!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "ƒ†�[ƒU�[‚ð‘I‘ð"
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "‚Ç‚Ìƒ†�[ƒU�[‚Ì‚½‚ß‚É$(^NameDA)‚ðƒCƒ“ƒXƒg�[ƒ‹‚·‚é‚©‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢�B"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "$(^NameDA)‚ðŽ©•ªŽ©�g‚Ì‚½‚ß‚¾‚¯‚ÉƒCƒ“ƒXƒg�[ƒ‹‚µ‚½‚¢‚Ì‚©�A‚±‚ÌƒRƒ“ƒsƒ…�[ƒ^�[‚Ì‘Sƒ†�[ƒU�[‚Ì‚½‚ß‚ÉƒCƒ“ƒXƒg�[ƒ‹‚µ‚½‚¢‚Ì‚©‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢�B$(^ClickNext)"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "‚±‚ÌƒRƒ“ƒsƒ…�[ƒ^�[‚ðŽg—p‚µ‚Ä‚¢‚é‘S‚Ä‚Ì�l—p‚ÉƒCƒ“ƒXƒg�[ƒ‹‚·‚é"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Ž©•ª�ê—p‚ÉƒCƒ“ƒXƒg�[ƒ‹‚·‚é"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Esperanto.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Esperanto.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Esperanto.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID (none exists for Kurdish at the moment)
+9998
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+-
+# RTL - anything else than RTL means LTR
+-
+# Translation v4.0.3 by Felipe Castro <fefcas@gmail.com>
+# ^Branding
+Instalada Sistemo de Nullsoft %s
+# ^SetupCaption
+Instalado de $(^Name)
+# ^UninstallCaption
+Malinstalado de $(^Name)
+# ^LicenseSubCaption
+: Permes-Kontrakto
+# ^ComponentsSubCaption
+: Instaladaj Opcioj
+# ^DirSubCaption
+: Instalada Dosierujo
+# ^InstallingSubCaption
+: Oni Instalas Dosierojn
+# ^CompletedSubCaption
+: Kompletite
+# ^UnComponentsSubCaption
+: Malinstaladaj Opcioj
+# ^UnDirSubCaption
+: Malinstalada Dosierujo
+# ^ConfirmSubCaption
+: Konfirmo
+# ^UninstallingSubCaption
+: Oni malinstalas
+# ^UnCompletedSubCaption
+: Kompletite
+# ^BackBtn
+< &Antauxe
+# ^NextBtn
+&Sekve >
+# ^AgreeBtn
+&Akceptite
+# ^AcceptBtn
+Mi &akceptas la kondicxojn de la Permes-Kontrakto
+# ^DontAcceptBtn
+Mi &ne akceptas la kondicxojn de la Permes-Kontrakto
+# ^InstallBtn
+&Instali
+# ^UninstallBtn
+&Malinstali
+# ^CancelBtn
+Nuligi
+# ^CloseBtn
+&Fermi
+# ^BrowseBtn
+&Sercxi...
+# ^ShowDetailsBtn
+Vidi &Detalojn
+# ^ClickNext
+Musklaku en 'Sekve' por dauxrigi.
+# ^ClickInstall
+Musklaku en 'Instali' por ekigi la instaladon.
+# ^ClickUninstall
+Musklaku en 'Malinstali' por ekigi la malinstaladon.
+# ^Name
+Nomo
+# ^Completed
+Kompletite
+# ^LicenseText
+Bonvole revidu la permes-akordon antaux ol instali $(^NameDA). Se vi konsentas kun cxiuj kondicxoj de la permeso, musklaku en 'Akceptite'.
+# ^LicenseTextCB
+Bonvole revidu la permes-akordon antaux ol instali $(^NameDA). Se vi konsentas kun cxiuj kondicxoj de la permeso, musklaku en la suba elekt-skatolo. $_CLICK
+# ^LicenseTextRB
+Bonvole revidu la permes-akordon antaux ol instali $(^NameDA). Se vi konsentas kun cxiuj kondicxoj de la permeso, elektu la unuan opcion sube. $_CLICK
+# ^UnLicenseText
+Bonvole revidu la permes-akordon antaux ol malinstali $(^NameDA). Se vi konsentas kun cxiuj kondicxoj de la permeso, musklaku en 'Akceptite'.
+# ^UnLicenseTextCB
+Bonvole revidu la permes-akordon antaux ol malinstali $(^NameDA). Se vi konsentas kun cxiuj kondicxoj de la permeso, musklaku en la suba elekt-skatolo. $_CLICK
+# ^UnLicenseTextRB
+Bonvole revidu la permes-akordon antaux ol malinstali $(^NameDA). Se vi konsentas kun cxiuj kondicxoj de la permeso, elektu la unuan opcion sube. $_CLICK
+# ^Custom
+Personigite
+# ^ComponentsText
+Marku la konsisterojn, kiujn vi deziras instali kaj malmarku tiujn, kiujn vi ne deziras instali. $_CLICK
+# ^ComponentsSubText1
+Elektu la tipon de instalado:
+# ^ComponentsSubText2_NoInstTypes
+Elektu la konsisterojn por instali:
+# ^ComponentsSubText2
+Aux, elektu la nedevigajn konsisterojn, kiujn vi deziras instali:
+# ^UnComponentsText
+Marku la konsisterojn, kiujn vi volas malinstali aux male. $_CLICK 
+# ^UnComponentsSubText1
+Elektu la tipon de malinstalado:
+# ^UnComponentsSubText2_NoInstTypes
+Elektu la konsisterojn por malinstali:
+# ^UnComponentsSubText2
+Aux, elektu la nedevigajn konsisterojn, kiujn vi deziras malinstali:
+# ^DirText
+$(^NameDA) estos instalita en la jena dosierujo. Por instali en alia dosierujo, musklaku en 'Sercxi...' kaj elektu gxin. $_CLICK
+# ^DirSubText
+Celota Dosierujo
+# ^DirBrowseText
+Elektu dosierujon por instali $(^NameDA):
+# ^UnDirText
+$(^NameDA) estos malinstalita el la jena dosierujo. Por malinstali en alia dosierujo, musklaku en 'Sercxi...' kaj elektu gxin. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Elektu dosierujon el kie $(^NameDA) estos malinstalita:
+# ^SpaceAvailable
+"Disponebla spaco: "
+# ^SpaceRequired
+"Postulata spaco: "
+# ^UninstallingText
+$(^NameDA) estos malinstalita el la jena dosierujo. $_CLICK
+# ^UninstallingSubText
+Malinstalado el:
+# ^FileError
+Eraro dum malfermo de dosiero por skribi: \r\n\t"$0"\r\nMusklaku en Cxesigi por finigi la instaladon,\r\Ripeti por provi refoje skribi sur la dosiero, aux\r\nPreteratenti por preteratenti tiun cxi dosieron.
+# ^FileError_NoIgnore
+Eraro dum malfermo de dosierujo por skribi: \r\n\t"$0"\r\nMusklaku en Ripeti por provi refoje skribi sur la dosiero, aux\r\nNuligi por cxesigi la instaladon.
+# ^CantWrite
+"Ne eblis skribi: "
+# ^CopyFailed
+Malsukceso dum kopio
+# ^CopyTo
+"Kopii al "
+# ^Registering
+"Oni registras: "
+# ^Unregistering
+"Oni malregistras: "
+# ^SymbolNotFound
+"Ne trovita simbolo: "
+# ^CouldNotLoad
+"Ne eblis sxargi: "
+# ^CreateFolder
+"Oni kreas subdosierujon: "
+# ^CreateShortcut
+"Oni kreas lancxilon: "
+# ^CreatedUninstaller
+"Oni kreas malinstalilon: "
+# ^Delete
+"Oni forigas dosieron: "
+# ^DeleteOnReboot
+"Forigi je restarto: "
+# ^ErrorCreatingShortcut
+"Eraro dum kreo de lancxilo: "
+# ^ErrorCreating
+"Eraro dum kreo: "
+# ^ErrorDecompressing
+Eraro dum malkompaktigo de datumaro! Cxu misrompita instalilo?
+# ^ErrorRegistering
+Eraru dum registro de DLL
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Lancxi: "
+# ^Extract
+"Eltiri: "
+# ^ErrorWriting
+"Eltirado: eraro dum skribo de dosiero "
+# ^InvalidOpcode
+Misrompita instalilo: malvalida operaci-kodo
+# ^NoOLE
+"Sen OLE por: "
+# ^OutputFolder
+"Celota dosierujo: "
+# ^RemoveFolder
+"Oni forigas la dosierujon: "
+# ^RenameOnReboot
+"Renomigi je restarto: "
+# ^Rename
+"Oni renomigas: "
+# ^Skipped
+"Preterpasita: "
+# ^CopyDetails
+Kopii detalojn al la tondejo
+# ^LogInstall
+Registri instalad-procezo
+# ^Byte
+B
+# ^Kilo
+k
+# ^Mega
+M
+# ^Giga
+G
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/TradChinese.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/TradChinese.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/TradChinese.nsh	(revision 728)
@@ -0,0 +1,122 @@
+;Language: 'Chinese (Traditional)' (1028)
+;Translator: Kii Ali <kiiali@cpatch.org>
+;Revision date: 2004-12-15
+
+!insertmacro LANGFILE "TradChinese" "Chinese (Traditional)"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Åwªï¨Ï¥Î $(^NameDA) ¦w¸ËºëÆF"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "³o­ÓºëÆF±N«ü¤Þ§A§¹¦¨ $(^NameDA) ªº¦w¸Ë¶iµ{¡C$\r$\n$\r$\n¦b¶}©l¦w¸Ë¤§«e¡A«ØÄ³¥ýÃö³¬¨ä¥L©Ò¦³À³¥Îµ{¦¡¡C³o±N¤¹³\\¡u¦w¸Ëµ{¦¡¡v§ó·s«ü©wªº¨t²ÎÀÉ®×¡A¦Ó¤£»Ý­n­«·s±Ò°Ê§Aªº¹q¸£¡C$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Åwªï¨Ï¥Î $(^NameDA) ¸Ñ°£¦w¸ËºëÆF"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "³o­ÓºëÆF±N¥þµ{«ü¤Þ§A $(^NameDA) ªº¸Ñ°£¦w¸Ë¶iµ{¡C$\r$\n$\r$\n¦b¶}©l¸Ñ°£¦w¸Ë¤§«e¡A½T»{ $(^NameDA) ¨Ã¥¼°õ¦æ·í¤¤¡C$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "±ÂÅv¨óÄ³"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "¦b¦w¸Ë $(^NameDA) ¤§«e¡A½ÐÀË¾\±ÂÅv±ø´Ú¡C"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "¦pªG§A±µ¨ü¨óÄ³¤¤ªº±ø´Ú¡A«ö¤@¤U [§Ú¦P·N(I)] Ä~Äò¦w¸Ë¡C¦pªG§A¿ï¨ú [¨ú®ø(C)] ¡A¦w¸Ëµ{¦¡±N·|Ãö³¬¡C¥²¶·­n±µ¨ü¨óÄ³¤~¯à¦w¸Ë $(^NameDA) ¡C"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "¦pªG§A±µ¨ü¨óÄ³¤¤ªº±ø´Ú¡A«ö¤@¤U¤U¤èªº¤Ä¿ï®Ø¡C¥²¶·­n±µ¨ü¨óÄ³¤~¯à¦w¸Ë $(^NameDA)¡C$_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "¦pªG§A±µ¨ü¨óÄ³¤¤ªº±ø´Ú¡A¿ï¾Ü¤U¤è²Ä¤@­Ó¿ï¶µ¡C¥²¶·­n±µ¨ü¨óÄ³¤~¯à¦w¸Ë $(^NameDA)¡C$_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "±ÂÅv¨óÄ³"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "¦b¸Ñ°£¦w¸Ë $(^NameDA) ¤§«e¡A½ÐÀË¾\±ÂÅv±ø´Ú¡C"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "¦pªG§A±µ¨ü¨óÄ³¤¤ªº±ø´Ú¡A«ö¤@¤U [§Ú¦P·N(I)] Ä~Äò¸Ñ°£¦w¸Ë¡C¦pªG§A¿ï¨ú [¨ú®ø(C)] ¡A¦w¸Ëµ{¦¡±N·|Ãö³¬¡C¥²¶·­n±µ¨ü¨óÄ³¤~¯à¸Ñ°£¦w¸Ë $(^NameDA) ¡C"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "¦pªG§A±µ¨ü¨óÄ³¤¤ªº±ø´Ú¡A«ö¤@¤U¤U¤èªº¤Ä¿ï®Ø¡C¥²¶·­n±µ¨ü¨óÄ³¤~¯à¸Ñ°£¦w¸Ë $(^NameDA)¡C$_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "¦pªG§A±µ¨ü¨óÄ³¤¤ªº±ø´Ú¡A¿ï¾Ü¤U¤è²Ä¤@­Ó¿ï¶µ¡C¥²¶·­n±µ¨ü¨óÄ³¤~¯à¸Ñ°£¦w¸Ë $(^NameDA)¡C$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "ÀË¾\¨óÄ³ªº¨ä¾l³¡¤À¡A½Ð«ö [PgDn] ©¹¤U±²°Ê­¶­±¡C"
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "¿ï¾Ü¤¸¥ó"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "¿ï¾Ü§A·Q­n¦w¸Ë $(^NameDA) ªº¨º¨Ç¥\¯à¡C"
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "¿ï¨ú¤¸¥ó"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "¿ï¨ú $(^NameDA) ·í¤¤§A·Q­n¸Ñ°£¦w¸Ëªº¥\¯à¡C"
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "´y­z"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "²¾°Ê§Aªº·Æ¹««ü¼Ð¨ì¤¸¥ó¤§¤W¡A«K¥i¨£¨ì¥¦ªº´y­z¡C"
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "²¾°Ê§Aªº·Æ¹««ü¼Ð¨ì¤¸¥ó¤§¤W¡A«K¥i¨£¨ì¥¦ªº´y­z¡C"
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "¿ï¨ú¦w¸Ë¦ì¸m"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "¿ï¨ú $(^NameDA) ­n¦w¸Ëªº¸ê®Æ§¨¡C"
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "¿ï¨ú¸Ñ°£¦w¸Ë¦ì¸m"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "¿ï¨ú $(^NameDA) ­n¸Ñ°£¦w¸Ëªº¸ê®Æ§¨¡C"
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "¥¿¦b¦w¸Ë"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "$(^NameDA) ¥¿¦b¦w¸Ë¡A½Ðµ¥­Ô¡C"
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "¦w¸Ë§¹¦¨"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "¦w¸Ëµ{¦¡¤w¦¨¥\¦a°õ¦æ§¹¦¨¡C"
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "¦w¸Ë¤v¤¤¤î"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "¦w¸Ëµ{¦¡¨Ã¥¼¦¨¥\¦a°õ¦æ§¹¦¨¡C"
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "¥¿¦b¸Ñ°£¦w¸Ë"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "$(^NameDA) ¥¿¦b¸Ñ°£¦w¸Ë¡A½Ðµ¥­Ô¡C"
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "¸Ñ°£¦w¸Ë¤w§¹¦¨"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "¸Ñ°£¦w¸Ëµ{¦¡¤w¦¨¥\¦a°õ¦æ§¹¦¨¡C"
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "¸Ñ°£¦w¸Ë¤w¤¤¤î"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "¸Ñ°£¦w¸Ëµ{¦¡¨Ã¥¼¦¨¥\¦a°õ¦æ§¹¦¨¡C"
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "¥¿¦b§¹¦¨ $(^NameDA) ¦w¸ËºëÆF"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) ¤w¦w¸Ë¦b§Aªº¨t²Î¡C$\r$\n«ö¤@¤U [§¹¦¨(F)] Ãö³¬¦¹ºëÆF¡C"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "§Aªº¨t²Î»Ý­n­«·s±Ò°Ê¡A¥H«K§¹¦¨ $(^NameDA) ªº¦w¸Ë¡C²{¦b­n­«·s±Ò°Ê¶Ü¡H"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "¥¿¦b§¹¦¨ $(^NameDA) ¸Ñ°£¦w¸ËºëÆF"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) ¤w±q§Aªº¹q¸£¸Ñ°£¦w¸Ë¡C$\r$\n$\r$\n«ö¤@¤U [§¹¦¨] Ãö³¬³o­ÓºëÆF¡C"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "¹q¸£»Ý­n­«·s±Ò°Ê¡A¥H«K§¹¦¨ $(^NameDA) ªº¸Ñ°£¦w¸Ë¡C²{¦b·Q­n­«·s±Ò°Ê¶Ü¡H"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "¬O¡A²{¦b­«·s±Ò°Ê(&Y)"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "§_¡A§Úµy«á¦A¦Û¦æ­«·s±Ò°Ê(&N)"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "°õ¦æ $(^NameDA)(&R)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Åã¥Ü¡uÅª§ÚÀÉ®×¡v(&M)"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "§¹¦¨(&F)"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "¿ï¾Ü¡u¶}©l¥\¯àªí¡v¸ê®Æ§¨"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "¿ï¾Ü¡u¶}©l¥\¯àªí¡v¸ê®Æ§¨¡A¥Î©óµ{¦¡ªº±¶®|¡C"
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "¿ï¾Ü¡u¶}©l¥\¯àªí¡v¸ê®Æ§¨¡A¥H«K«Ø¥ßµ{¦¡ªº±¶®|¡C§A¤]¥i¥H¿é¤J¦WºÙ¡A«Ø¥ß·s¸ê®Æ§¨¡C"
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "¤£­n«Ø¥ß±¶®|(&N)"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "¸Ñ°£¦w¸Ë $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "±q§Aªº¹q¸£¸Ñ°£¦w¸Ë $(^NameDA) ¡C"
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "§A½T©w­nÂ÷¶} $(^Name) ¦w¸Ëµ{¦¡¡H"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "§A½T©w­nÂ÷¶} $(^Name) ¸Ñ°£¦w¸Ë¶Ü¡H"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Catalan.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Catalan.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Catalan.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1027
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by falanko
+# Corrections by Toni Hermoso Pulido
+# ^Branding
+Sistema d'instal·lació de Nullsoft %s
+# ^SetupCaption
+Instal·lació de l'aplicació $(^Name)
+# ^UninstallCaption
+Desinstal·lació de l'aplicació $(^Name)
+# ^LicenseSubCaption
+: Acord de llicència
+# ^ComponentsSubCaption
+: Opcions d'instal·lació
+# ^DirSubCaption
+: Carpeta d'instal·lació
+# ^InstallingSubCaption
+: S'està instal·lant
+# ^CompletedSubCaption
+: S'ha acabat
+# ^UnComponentsSubCaption
+: Opcions de desinstal·lació
+# ^UnDirSubCaption
+: Carpeta de desinstal·lació
+# ^ConfirmSubCaption
+: Confirmació
+# ^UninstallingSubCaption
+: S'està desinstal·lant
+# ^UnCompletedSubCaption
+: No s'ha acabat
+# ^BackBtn
+< En&rere
+# ^NextBtn
+En&davant >
+# ^AgreeBtn
+Hi estic d'a&cord
+# ^AcceptBtn
+&Accepto els termes de l'acord de llicència
+# ^DontAcceptBtn
+&No accepto els termes de l'acord de llicència
+# ^InstallBtn
+&Instal·la
+# ^UninstallBtn
+&Desinstal·la
+# ^CancelBtn
+&Cancel·la
+# ^CloseBtn
+&Tanca
+# ^BrowseBtn
+&Navega...
+# ^ShowDetailsBtn
+&Mostra els detalls
+# ^ClickNext
+Feu clic a Endavant per a continuar.
+# ^ClickInstall
+Feu clic a Instal·la per a iniciar la instal·lació.
+# ^ClickUninstall
+Feu clic a Desinstal·la per a iniciar la desinstal·lació.
+# ^Name
+Nom
+# ^Completed
+S'ha acabat
+# ^LicenseText
+Reviseu l'acord de llicència abans d'instal·lar l'aplicació $(^NameDA). Si accepteu tots els termes de l'acord, feu clic a Hi estic d'acord.
+# ^LicenseTextCB
+Reviseu l'acord de llicència abans d'instal·lar l'aplicació $(^NameDA). Si accepteu tots els termes de l'acord, activeu la casella de sota. $_CLICK
+# ^LicesnseTextRB
+Reviseu l'acord de llicència abans d'instal·lar l'aplicació $(^NameDA). Si accepteu tots els termes de l'acord, seleccioneu la primera opció de sota. $_CLICK
+# ^UnLicenseText
+Reviseu l'acord de llicència abans de desinstal·lar l'aplicació $(^NameDA). Si accepteu tots els termes de l'acord, feu clic a Hi estic d'acord.
+# ^UnLicenseTextCB
+Reviseu l'acord de llicència abans de desinstal·lar l'aplicació $(^NameDA). Si accepteu tots els termes de l'acord, activeu la la casella de sota. $_CLICK
+# ^UnLicesnseTextRB
+Reviseu l'acord de llicència abans de desinstal·lar l'aplicació $(^NameDA). Si accepteu tots els termes de l'acord, seleccioneu la primera opció de sota. $_CLICK
+# ^Custom
+Personalitzada
+# ^ComponentsText
+Activeu els components que voleu instal·lar i desactiveu els que no. $_CLICK
+# ^ComponentsSubText1
+Seleccioneu el tipus d'instal·lació:
+# ^ComponentsSubText2_NoInstTypes
+Seleccioneu els components per instal·lar:
+# ^ComponentsSubText2
+O bé, seleccioneu els components opcionals que desitgéssiu instal·lar:
+# ^UnComponentsText
+Activeu els components que voleu desinstal·lar i desactiveu els que no. $_CLICK
+# ^UnComponentsSubText1
+Seleccioneu el tipus de desinstal·lació:
+# ^UnComponentsSubText2_NoInstTypes
+Seleccioneu els components per desinstal·lar:
+# ^UnComponentsSubText2
+O bé, seleccioneu els components opcionals per desinstal·lar:
+# ^DirText
+El programa d'instal·lació instal·larà l'aplicació $(^NameDA) en la següent carpeta. Per a instal·lar-lo en una carpeta diferent, feu clic a Navega i seleccioneu-ne una altra. $_CLICK
+# ^DirSubText
+Carpeta de destinació
+# ^DirBrowseText
+Seleccioneu la carpeta on s'instal·larà l'aplicació $(^NameDA):
+# ^UnDirText
+El programa d'instal·lació desinstal·larà l'aplicació $(^NameDA) de la següent carpeta. Per a desinstal·lar-lo d'una carpeta diferent, feu clic a Navega i seleccioneu-ne una altra. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Seleccioneu la carpeta des d'on es desinstal·larà l'aplicació $(^NameDA):
+# ^SpaceAvailable
+"Espai lliure: "
+# ^SpaceRequired
+"Espai necessari: "
+# ^UninstallingText
+Es desinstal·larà l'aplicació $(^NameDA) de la següent carpeta. $_CLICK
+# ^UninstallingSubTex
+S'està desinstal·lant de:
+# ^FileError
+S'ha produït un error en obrir el fitxer en mode d'escriptura: \r\n\t"$0"\r\nFeu clic a Abandona per a aturar la instal·lació,\r\nReintenta per a tornar-ho a provar, o\r\Ignora per a ometre aquest fitxer.
+# ^FileError_NoIgnore
+S'ha produït un error en obrir el fitxer en mode d'escriptura: \r\n\t"$0"\r\nFeu clic a Reintenta per a tornar-ho a provar, o\r\Cancel·la per a aturar la instal·lació.
+# ^CantWrite
+"No s'ha pogut escriure: "
+# ^CopyFailed
+Ha fallat la còpia
+# ^CopyTo
+"Copia a "
+# ^Registering
+"S'esta registrant:"
+# ^Unregistering
+"S'està suprimint el registre: "
+# ^SymbolNotFound
+"No s'ha trobat el símbol: "
+# ^CouldNotLoad
+"No s'ha pogut carregar: "
+# ^CreateFolder
+"Crea la carpeta: "
+# ^CreateShortcut
+"Crea la drecera: "
+# ^CreatedUninstaller
+"S'ha creat el desinstal·lador: "
+# ^Delete
+"S'ha suprimit el fitxer: "
+# ^DeleteOnReboot
+"Suprimeix en reiniciar: "
+# ^ErrorCreatingShortcut
+"S'ha produït un error en crear la drecera: "
+# ^ErrorCreating
+S'ha produït un error en crear:
+# ^ErrorDecompressing
+S'ha produït un error en descomprimir les dades! L'instal·lador està corrupte?
+# ^ErrorRegistering
+S'ha produït un error en registrar una DLL
+# ^ExecShell
+"Executa l'ordre: "
+# ^Exec
+"Executa:"
+# ^Extract
+"Extreu: "
+# ^ErrorWriting
+"Extreu: s'ha produït un error en escriure el fitxer "
+# ^InvalidOpcode
+L'instal·lador està corrupte: el codi d'operació no és vàlid
+# ^NoOLE
+"No hi ha OLE per a: "
+# ^OutputFolder
+"Carpeta de sortida: "
+# ^RemoveFolder
+"Suprimeix la carpeta: "
+# ^RenameOnReboot
+"Reanomena en reiniciar: "
+# ^Rename
+"Reanomena: "
+# ^Skipped
+"S'ha omès: "
+# ^CopyDetails
+Copia els detalls al porta-retalls
+# ^LogInstall
+Registra el procés d'instal·lació
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Romanian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Romanian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Romanian.nlf	(revision 728)
@@ -0,0 +1,202 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1048
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1250
+# RTL - anything else than RTL means LTR
+-
+# Translation by Cristian Pirvu (pcristip@yahoo.com) v6
+# Revision by Sorin Sbarnea (sorin@intersol.ro)      v5.1
+# and Sorin Sbarnea INTERSOL SRL (sorin@intersol.ro) v4
+# New revision by George Radu (georadu@hotmail.com)
+# New revision by Iulian Dogariu (iulian@jayomega.net)
+#   - Use Romanian letters ãâîºþ
+#   - Use imperative forms on buttons
+#   - Replace some neologisms
+# New revision by Vlad Rusu (vlad@bitattack.ro)
+#	- "Rasfoieºte" replaced with "Alege" - more appropiate
+#	- "Eliminã" related terms replaced with more appropiate "Dezinstaleazã"
+#	- Fixed: Wrong translation in ^FileError and ^FileError_NoIgnore -> no translation
+#	  needed Abort/Retry/Ignore, as these are not translated into local language, OS related
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+Instalare $(^Name)
+# ^UninstallCaption
+Dezinstalare $(^Name)
+# ^LicenseSubCaption
+: Contract de licenþã
+# ^ComponentsSubCaption
+: Opþiuni instalare
+# ^DirSubCaption
+: Directorul destinaþie
+# ^InstallingSubCaption
+: În curs de instalare
+# ^CompletedSubCaption
+: Instalare terminatã
+# ^UnComponentsSubCaption
+: Opþiuni dezinstalare
+# ^UnDirSubCaption
+: Directorul de dezinstalare
+# ^ConfirmSubCaption
+: Confirmã
+# ^UninstallingSubCaption
+: În curs de dezinstalare
+# ^UnCompletedSubCaption
+: Terminã
+# ^BackBtn
+< Îna&poi
+# ^NextBtn
+Îna&inte >
+# ^AgreeBtn
+&De acord
+# ^AcceptBtn
+&Accept termenii contractului de licenþã
+# ^DontAcceptBtn
+Nu accept termenii contractului de licenþã
+# ^InstallBtn
+&Instaleazã
+# ^UninstallBtn
+&Dezinstaleazã
+# ^CancelBtn
+&Renunþã
+# ^CloseBtn
+În&chide
+# ^BrowseBtn
+&Alege...
+# ^ShowDetailsBtn
+Aratã &detalii
+# ^ClickNext
+Apãsaþi Înainte pentru a continua.
+# ^ClickInstall
+Apãsaþi Instaleazã pentru a începe instalarea.
+# ^ClickUninstall
+Apãsaþi Dezinstaleazã pentru a începe dezinstalarea.
+# ^Name
+Nume
+# ^Completed
+Terminat
+# ^LicenseText
+Citiþi cu atenþie contractul de licenþã înainte de a instala $(^NameDA). Dacã acceptaþi termenii contractului de licenþã, apãsaþi butonul De acord.
+# ^LicenseTextCB
+Citiþi cu atenþie contractul de licenþã înainte de a instala $(^NameDA). Dacã acceptaþi termenii contractului de licenþã, bifaþi cãsuþa de mai jos. $_CLICK
+# ^LicenseTextRB
+Citiþi cu atenþie contractul de licenþã înainte de a instala $(^NameDA). Dacã acceptaþi termenii contractului de licenþã, selectaþi prima opþiune de mai jos. $_CLICK
+# ^UnLicenseText
+Citiþi cu atenþie contractul de licenþã înainte de a dezinstala $(^NameDA). Dacã acceptaþi termenii contractului de licenþã, apãsaþi butonul De acord.
+# ^UnLicenseTextCB
+Citiþi cu atenþie contractul de licenþã înainte de a dezinstala $(^NameDA). Dacã acceptaþi termenii contractului de licenþã, bifaþi cãsuþa de mai jos. $_CLICK
+# ^UnLicenseTextRB
+Citiþi cu atenþie contractul de licenþã înainte de a dezinstala $(^NameDA). Dacã acceptaþi termenii contractului de licenþã, selectaþi prima opþiune de mai jos. $_CLICK
+# ^Custom
+Personalizatã
+# ^ComponentsText
+Alegeþi componentele pe care doriþi sã le instalaþi. $_CLICK
+# ^ComponentsSubText1
+Alegeþi tipul instalãrii:
+# ^ComponentsSubText2_NoInstTypes
+Alegeþi componentele ce urmeazã a fi instalate:
+# ^ComponentsSubText2
+Sau, alegeþi componentele opþionale pe care doriþi sã le instalaþi:
+# ^UnComponentsText
+Alegeþi componentele pe care doriþi sã le dezinstalaþi. $_CLICK
+# ^UnComponentsSubText1
+Alegeþi tipul de dezinstalare:
+# ^UnComponentsSubText2_NoInstTypes
+Alegeþi componentele ce urmeazã a fi dezinstalate:
+# ^UnComponentsSubText2
+Sau, alegeþi componentele opþionale pe care doriþi sã le dezinstalaþi:
+# ^DirText
+$(^NameDA) se va instala în urmãtorul director. Pentru a alege altã destinaþie, apãsaþi Alege ºi alegeþi alt director. $_CLICK
+# ^DirSubText
+Director destinaþie
+# ^DirBrowseText
+Alegeþi directorul în care doriþi sã instalaþi $(^NameDA):
+# ^UnDirText
+$(^NameDA) se va dezinstala din urmãtorul director. Pentru a dezinstala din alt director, apãsaþi Alege ºi alegeþi alt director. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Alegeþi directorul de dezinstalare al $(^NameDA):
+# ^SpaceAvailable
+"Spaþiu disponibil: "
+# ^SpaceRequired
+"Spaþiu necesar: "
+# ^UninstallingText
+Aceastã aplicaþie va dezinstala $(^NameDA) din computerul Dv. $_CLICK
+# ^UninstallingSubText
+Dezinstalare din:
+# ^FileError
+Eroare la scrierea fiºierului: \r\n\t"$0"\r\nApãsaþi Abort pentru oprirea instalãrii,\r\nRetry pentru a mai încerca o datã scrierea fiºierului, \r\nIgnore pentru a trece peste acest fiºier.
+# ^FileError_NoIgnore
+Eroare la scrierea fiºierului: \r\n\t"$0"\r\nApãsaþi Retry pentru a mai încerca o datã, sau\r\nAbort pentru oprirea instalãrii.
+# ^CantWrite
+"Nu am putut scrie: "
+# ^CopyFailed
+Copierea a eºuat
+# ^CopyTo
+"Copiere în "
+# ^Registering
+"Se înregistreazã: "
+# ^Unregistering
+"Se dezînregistreazã din registru: "
+# ^SymbolNotFound
+"Simbolul nu a fost gãsit: "
+# ^CouldNotLoad
+"Nu am putut încãrca: "
+# ^CreateFolder
+"Creare director: "
+# ^CreateShortcut
+"Creare comandã rapidã: "
+# ^CreatedUninstaller
+"S-a creat aplicaþia de dezinstalare: "
+# ^Delete
+"ªtergere fiºier: "
+# ^DeleteOnReboot
+"ªtergere la repornire: "
+# ^ErrorCreatingShortcut
+"Eroare la crearea comenzii rapide: "
+# ^ErrorCreating
+"Eroare la creare: "
+# ^ErrorDecompressing
+Eroare la dezarhivarea datelor! Aplicatia de instalare este defectã?
+# ^ErrorRegistering
+Eroare la Înregistrarea DLL-ului
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Executare: "
+# ^Extract
+"Extragere: "
+# ^ErrorWriting
+"Extragere: eroare la scriere în fiºier "
+# ^InvalidOpcode
+Aplicaþie de instalare defectã: opcode incorect
+# ^NoOLE
+"Nu existã OLE pentru: "
+# ^OutputFolder
+"Directorul destinaþie: "
+# ^RemoveFolder
+"ªtergere destinaþie: "
+# ^RenameOnReboot
+"Redenumire la repornirea computerului: "
+# ^Rename
+"Redenumire: "
+# ^Skipped
+"Sãrite: "
+# ^CopyDetails
+Copiere detalii în clipboard
+# ^LogInstall
+Jurnal proces instalare
+# ^Byte
+O
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Lithuanian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Lithuanian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Lithuanian.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Lithuanian (1063)
+;By Vytautas Krivickas (Vytautas). Updated by Danielius Scepanskis (Daan daniel@takas.lt) 2004.01.09
+
+!insertmacro LANGFILE "Lithuanian" "Lietuviu"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Sveiki atvykæ á $(^NameDA) ádiegimo programà."
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Ði programa jums padës lengvai ádiegti $(^NameDA).$\r$\n$\r$\nRekomenduojama iðjungti visas programas, prieð pradedant ádiegimà. Tai leis atnaujinti sistemos failus neperkraunat kompiuterio.$\r$\n$\r$\n"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Sveiki atvykæ á $(^NameDA) paðalinimo programà."
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Ði programa jums padës lengvai iðtrinti $(^NameDA).$\r$\n$\r$\nPrieð pradedant pasitikrinkite kad $(^NameDA) yra iðjungta.$\r$\n$\r$\n"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Naudojimo sutartis"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Praðome perskaityti sutartá prieð ádiegdami $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Jei jûs sutinkate su nurodytomis sàlygomis, spauskite Sutinku. Jûs privalote sutikti, jei norite ádiegti $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Jei jûs sutinkate su nurodytomis sàlygomis, padëkite varnelæ tam skirtame laukelyje. Jûs privalote sutikti, jei norite ádiegti $(^NameDA). "
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Jei jûs sutinkate su nurodytomis sàlygomis, pasirinkite pirmà pasirinkimà esantá þemiau. Jûs privalote sutikti, jei norite ádiegti $(^NameDA). "
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Naudojimo sutartis"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Praðome perskaityti sutartá prieð $(^NameDA) paðalinimà."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Jei jûs sutinkate su nurodytomis sàlygomis, spauskite Sutinku. Jûs privalote sutikti, jei norite iðtrinti $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "s, padëkite varnelæ tam skirtame laukelyje. Jûs privalote sutikti, jei norite iðtrinti $(^NameDA). "
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Jei jûs sutinkate su nurodytomis sàlygomis, pasirinkite pirmà pasirinkimà esantá þemiau. Jûs privalote sutikti, jei norite iðtrinti $(^NameDA)."
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Paspauskite Page Down ir perskaitykite visà sutartá."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Pasirinkite"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Pasirinkite kokias $(^NameDA) galimybes jûs norite ádiegti."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Pasirinkite"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Pasirinkite kokias $(^NameDA) galimybes jûs norite paðalinti."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Paaiðkinimas"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Uþveskite pelës þymeklá ant komponento ir pamatysite jo apraðymà."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Uþveskite pelës þymeklá ant komponento ir pamatysite jo apraðymà."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Pasirinkite ádiegimo vietà"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Pasirinkite katalogà á kûri ádiegsite $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Pasirinkite iðtrinimo vietà"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Pasirinkite katalogà ið kurio iðtrinsite $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Diegiama"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Praðome palaukti, kol $(^NameDA) bus ádiegtas."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Ádiegimas baigtas"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Ádiegimas baigtas sekmingai."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Ádiegimas nutrauktas"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Ádiegimas nebuvo baigtas sekmingai."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Ðalinama"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Praðome palaukti, kol $(^NameDA) bus paðalinta."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Programos paðalinimas baigtas"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Iðtrynimas baigtas sekmingai."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Iðtrynimas nutrauktas"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Iðtrynimas nebuvo baigtas sekmingai."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Baigiu $(^NameDA) ádiegimo procesà"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) buvo ádiegtas á jûsø kompiuterá.$\r$\n$\r$\nPaspauskite Baigti."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Jûsø kompiuteris turi bûti perkrautas, kad bûtø baigtas $(^NameDA) ádiegimas. Ar jûs norite perkrauti dabar?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Baigiu $(^NameDA) paðalinimo programà."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) buvo iðtrinta ið jûsø kompiuterio.$\r$\n$\r$\nPaspauskite Baigti."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Jûsø kompiuteris turi bûti perkrautas, kad bûtø baigtas $(^NameDA) paðalinimas. Ar jûs norite perkrauti dabar?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Perkrauti dabar"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Að noriu perkrauti veliau pats"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Leisti $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Parodyti dokumentacijà"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Baigti"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Pasirinkite Start Menu katalogà"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Pasirinkite Start Menu katalogà, kuriame bus sukurtos programos nuorodos."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Pasirinkite Start Menu katalogà, kuriame bus sukurtos programos nuorodos. Jûs taip pat galite sukurti naujà katalogà."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Nekurti nuorodø"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Panaikinti $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Iðtrinti $(^NameDA) ið jûsø kompiuterio."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Ar jûs tikrai norite iðjungti $(^Name) ádiegimo programà?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Ar jûs tikrai norite iðjungti $(^Name) paðalinimo programà?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Danish.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Danish.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Danish.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1030
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by Claus Futtrup
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) Installation
+# ^UninstallCaption
+$(^Name) Afinstallation
+# ^LicenseSubCaption
+: Licensaftale
+# ^ComponentsSubCaption
+: Installationsmuligheder
+# ^DirSubCaption
+: Installationsmappe
+# ^InstallingSubCaption
+: Installerer
+# ^CompletedSubCaption
+: Gennemført
+# ^UnComponentsSubCaption
+: Afinstallationsmuligheder
+# ^UnDirSubCaption
+: Afinstallationsmappe
+# ^ConfirmSubCaption
+: Bekræft
+# ^UninstallingSubCaption
+: Afinstallerer
+# ^UnCompletedSubCaption
+: Gennemført
+# ^BackBtn
+< &Tilbage
+# ^NextBtn
+&Næste >
+# ^AgreeBtn
+Jeg &accepterer
+# ^AcceptBtn
+Jeg &accepterer vilkårene i licensaftalen
+# ^DontAcceptBtn
+Jeg &accepterer ikke vilkårene i licensaftalen
+# ^InstallBtn
+&Installer
+# ^UninstallBtn
+&Afinstaller
+# ^CancelBtn
+Afbryd
+# ^CloseBtn
+&Luk
+# ^BrowseBtn
+G&ennemse...
+# ^ShowDetailsBtn
+Vis &detaljer
+# ^ClickNext
+Tryk Næste for at fortsætte.
+# ^ClickInstall
+Tryk Installer for at starte installationen.
+# ^ClickUninstall
+Tryk Afinstaller for at starte afinstallationen.
+# ^Name
+Navn
+# ^Completed
+Gennemført
+# ^LicenseText
+Læs venligst licensaftalen før installationen af $(^NameDA). Hvis du accepterer alle betingelser i aftalen, skal du trykke 'Jeg accepterer'.
+# ^LicenseTextCB
+Læs venligst licensaftalen før installationen af $(^NameDA). Hvis du accepterer alle betingelser i aftalen, skal du markere afkrydsningsfeltet nedenfor. $_CLICK
+# ^LicenseTextRB
+Læs venligst licensaftalen før installationen af $(^NameDA). Hvis du accepterer alle betingelser i aftalen, skal du vælge den første mulighed nedenfor. $_CLICK
+# ^UnLicenseText
+Læs venligst licensaftalen før afinstallationen af $(^NameDA). Hvis du accepterer alle betingelser i aftalen, skal du trykke 'Jeg accepterer'
+# ^UnLicenseTextCB
+Læs venligst licensaftalen før afinstallationen af $(^NameDA). Hvis du accepterer alle betingelser i aftalen, skal du markere afkrydsningsfeltet nedenfor. $_CLICK
+# ^UnLicenseTextRB
+Læs venligst licensaftalen før afinstallationen af $(^NameDA). Hvis du accepterer alle betingelser i aftalen, skal du vælge den første mulighed nedenfor $_CLICK
+# ^Custom
+Brugerdefineret
+# ^ComponentsText
+Marker de komponenter du vil installere, og fjern markeringen af de komponenter du ikke vil installere. $_CLICK
+# ^ComponentsSubText1
+Vælg installationstype:
+# ^ComponentsSubText2_NoInstTypes
+Vælg de komponenter der skal installeres:
+# ^ComponentsSubText2
+Eller vælg de tillægskomponenter komponenter du ønsker at installere:
+# ^UnComponentsText
+Marker de komponenter du vil afinstallere, og fjern markeringen af de komponenter du ikke vil afinstallere. $_CLICK
+# ^UnComponentsSubText1
+Vælg afinstallationstype:
+# ^UnComponentsSubText2_NoInstTypes
+Vælg de komponenter der skal afinstalleres:
+# ^UnComponentsSubText2
+Eller vælg de tillægskomponenter du ønsker at afinstallere:
+# ^DirText
+Installationsguiden vil installere $(^NameDA) i følgende mappe. For at installere i en anden mappe, tryk Gennemse og vælg en anden mappe. $_CLICK
+# ^DirSubText
+Destinationsmappe
+# ^DirBrowseText
+Vælg den mappe $(^NameDA) skal installeres i:
+# ^UnDirText
+Installationsguiden vil afinstallere $(^NameDA) fra følgende mappe. For at afinstallere fra en anden mappe, tryk Gennemse og vælg en anden mappe. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Vælg den mappe hvorfra $(^NameDA) skal afinstalleres:
+# ^SpaceAvailable
+"Ledig plads: "
+# ^SpaceRequired
+"Nødvendig plads: "
+# ^UninstallingText
+$(^NameDA) vil blive afinstalleret fra følgende mappe. $_CLICK
+# ^UninstallingSubText
+Afinstallerer fra:
+# ^FileError
+Fejl ved skrivning af fil: \r\n\t"$0"\r\nTryk Afbryd for at afbryde installationen,\r\nPrøv Igen for at prøve at skrive til filen, eller\r\nIgnorer for at springe over denne fil
+# ^FileError_NoIgnore
+Fejl ved åbning af fil: \r\n\t"$0"\r\nTryk Prøv Igen for at prøve at skrive til filen, eller\r\nAfbryd for at afbryde installationen
+# ^CantWrite
+"Kan ikke skrive: "
+# ^CopyFailed
+Kopiering mislykkedes
+# ^CopyTo
+"Kopier til "
+# ^Registering
+"Registrerer: "
+# ^Unregistering
+"Afregisterer: "
+# ^SymbolNotFound
+"Kunne ikke finde symbol: "
+# ^CouldNotLoad
+"Kunne ikke hente: "
+# ^CreateFolder
+"Opret mappe: "
+# ^CreateShortcut
+"Opret genvej: "
+# ^CreatedUninstaller
+"Afinstallationsguide oprettet: "
+# ^Delete
+"Slet fil: "
+# ^DeleteOnReboot
+"Slet ved genstart: "
+# ^ErrorCreatingShortcut
+"Fejl ved oprettelse af genvej: "
+# ^ErrorCreating
+"Fejl ved oprettelse: "
+# ^ErrorDecompressing
+Fejl ved udpakning af data! Installationsguiden skadet?
+# ^ErrorRegistering
+Fejl ved registrering af DLL
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Kør: "
+# ^Extract
+"Udpak: "
+# ^ErrorWriting
+"Udpak: Fejl ved skrivning til fil "
+# ^InvalidOpcode
+Installationsguide i stykker: Ugyldig opcode
+# ^NoOLE
+"Ingen OLE for: "
+# ^OutputFolder
+"Outputmappe: "
+# ^RemoveFolder
+"Slet mappe: "
+# ^RenameOnReboot
+"Omdøb ved genstart: "
+# ^Rename
+"Omdøb: "
+# ^Skipped
+"Sprunget over: "
+# ^CopyDetails
+Kopier detaljer til udklipsholderen
+# ^LogInstall
+Log installationsproces
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Swedish.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Swedish.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Swedish.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1053
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by Magnus Bonnevier (magnus.bonnevier@telia.com)
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) Installation
+# ^UninstallCaption
+$(^Name) Avinstallation
+# ^LicenseSubCaption
+: Licensavtal
+# ^ComponentsSubCaption
+: Installationsval
+# ^DirSubCaption
+: Installationskatalog
+# ^InstallingSubCaption
+: Installerar
+# ^CompletedSubCaption
+: Slutförd
+# ^UnComponentsSubCaption
+: Avinstallationsval
+# ^UnDirSubCaption
+: Avinstallationskatalog
+# ^ConfirmSubCaption
+: Bekräftelse
+# ^UninstallingSubCaption
+: Avinstallerar
+# ^UnCompletedSubCaption
+: Slutförd
+# ^BackBtn
+< &Tillbaka
+# ^NextBtn
+&Nästa >
+# ^AgreeBtn
+Jag &Godkänner
+# ^AcceptBtn
+Jag &Godkänner villkoren i licensavtalet
+# ^DontAcceptBtn
+Jag &Godkänner inte villkoren i licensavtalet
+# ^InstallBtn
+&Installera
+# ^UninstallBtn
+&Avinstallera
+# ^CancelBtn
+Avbryt
+# ^CloseBtn
+&Stäng
+# ^BrowseBtn
+B&läddra...
+# ^ShowDetailsBtn
+Visa &detaljer
+# ^ClickNext
+Klicka på Nästa för att fortsätta.
+# ^ClickInstall
+Klicka på Installera för att starta installationen.
+# ^ClickUninstall
+Klicka på Avinstallera för att starta avinstallationen.
+# ^Name
+Namn
+# ^Completed
+Slutförd
+# ^LicenseText
+Var vänlig läs igenom licensvillkoren innan du installerar $(^NameDA). Om du accepterar villkoren i avtalet, klicka Jag Godkänner.
+# ^LicenseTextCB
+Var vänlig läs igenom licensvillkoren innan du installerar $(^NameDA). Om du accepterar villkoren i avtalet, klicka i checkrutan nedan. $_CLICK
+# ^LicenseTextRB
+Var vänlig läs igenom licensvillkoren innan du installerar $(^NameDA). Om du accepterar villkoren i avtalet, välj det första alternativet nedan. $_CLICK
+# ^UnLicenseText
+Var vänlig läs igenom licensvillkoren innan du avinstallerar $(^NameDA). Om du accepterar villkoren i avtalet, klicka Jag Godkänner.
+# ^UnLicenseTextCB
+Var vänlig läs igenom licensvillkoren innan du avinstallerar $(^NameDA). Om du accepterar villkoren i avtalet, klicka i checkrutan nedan. $_CLICK
+# ^UnLicenseTextRB
+Var vänlig läs igenom licensvillkoren innan du avinstallerar $(^NameDA). Om du accepterar villkoren i avtalet, välj det första alternativet nedan. $_CLICK
+# ^Custom
+Valfri
+# ^ComponentsText
+Markera de komponenter du vill installera och avmarkera de komponenter du inte vill installera. $_CLICK
+# ^ComponentsSubText1
+Välj typ av installation:
+# ^ComponentsSubText2_NoInstTypes
+Välj komponenter att installera:
+# ^ComponentsSubText2
+Eller, välj de alternativa komponenter du önskar installera:
+# ^UnComponentsText
+Markera de komponenter du vill avinstallera och avmarkera de komponenter du inte vill avinstallera. $_CLICK
+# ^UnComponentsSubText1
+Välj typ av avinstallation:
+# ^UnComponentsSubText2_NoInstTypes
+Välj komponenter att avinstallera:
+# ^UnComponentsSubText2
+Eller, välj de alternativa komponenter du önskar avinstallera:
+# ^DirText
+Guiden kommer att installera $(^NameDA) i följande katalog. För att installera i en annan katalog, klicka Bläddra och välj en alternativ katalog. $_CLICK
+# ^DirSubText
+Målkatalog
+# ^DirBrowseText
+Välj katalog att installera $(^NameDA) i:
+# ^UnDirText
+Installationsguiden kommer att avinstallera $(^NameDA) från följande katalog. För att avinstallera från en annan katalog, klicka Bläddra och välj en annan katalog. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Välj katalog att avinstallera $(^NameDA) från:
+# ^SpaceAvailable
+"Utrymme tillgängligt: "
+# ^SpaceRequired
+"Utrymme som behövs: "
+# ^UninstallingText
+$(^NameDA) kommer att avinstalleras från följande katalog. $_CLICK
+# ^UninstallingSubText
+Avinstallerar från:
+# ^FileError
+Fel vid Öppning av fil för skrivning: \r\n\t"$0"\r\nKlicka på avbryt för att avbryta installationen,\r\nförsök igen för att försöka skriva till filen igen, eller\r\nIgnorera för att skippa denna fil
+# ^FileError_NoIgnore
+Fel vid Öppning av fil för skrivning: \r\n\t"$0"\r\nKlicka på försök igen för att skriva till filen igen, eller\r\navbryt för att avbryta installationen
+# ^CantWrite
+"Kan inte skriva: "
+# ^CopyFailed
+Kopiering misslyckades
+# ^CopyTo
+"Kopiera till "
+# ^Registering
+"Registrerar: "
+# ^Unregistering
+"Avregistrerar: "
+# ^SymbolNotFound
+"Kunde inte hitta symbol: "
+# ^CouldNotLoad
+"Kunde inte ladda: "
+# ^CreateFolder
+"Skapa katalog: "
+# ^CreateShortcut
+"Skapa genväg: "
+# ^CreatedUninstaller
+"Skapade avinstallationsprogram: "
+# ^Delete
+"Radera fil: "
+# ^DeleteOnReboot
+"Radera vid omstart: "
+# ^ErrorCreatingShortcut
+"Fel vid skapande av genväg: "
+# ^ErrorCreating
+"Fel vid skapande: "
+# ^ErrorDecompressing
+Fel vid uppackning av data! Skadat installationspaket?
+# ^ErrorRegistering
+Fel vid registrering av DLL
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Kör: "
+# ^Extract
+"Extrahera: "
+# ^ErrorWriting
+"Extrahera: fel vid skrivning till fil "
+# ^InvalidOpcode
+Installationspaket skadat: ogiltig opcode
+# ^NoOLE
+"Ingen OLE för: "
+# ^OutputFolder
+"Målkatalog: "
+# ^RemoveFolder
+"Ta bort katalog: "
+# ^RenameOnReboot
+"Döp om vid omstart: "
+# ^Rename
+"Döp om: "
+# ^Skipped
+"Ignorerad: "
+# ^CopyDetails
+Kopiera detaljinformation till klippbordet
+# ^LogInstall
+Logga installationsförfarandet
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Galician.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Galician.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Galician.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+1110
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation v 1.0.0 by Ramon Flores <fa2ramon@usc.es>
+# ^Branding
+Sistema de Instalación Nullsoft %s
+# ^SetupCaption
+Instalación de $(^Name)
+# ^UninstallCaption
+Desinstalación de $(^Name)
+# ^LicenseSubCaption
+: Contrato de licenza
+# ^ComponentsSubCaption
+: Opcións de instalación
+# ^DirSubCaption
+: Diretória de instalación
+# ^InstallingSubCaption
+: Instalando ficheiros
+# ^CompletedSubCaption
+: Concluído
+# ^UnComponentsSubCaption
+: Opcións de desinstalación
+# ^UnDirSubCaption
+: Cartafol de desinstalación
+# ^ConfirmSubCaption
+: Confirmación
+# ^UninstallingSubCaption
+: Desinstalando
+# ^UnCompletedSubCaption
+: Concluído
+# ^BackBtn
+< &Anterior
+# ^NextBtn
+&Seguinte >
+# ^AgreeBtn
+&Aceito
+# ^AcceptBtn
+Eu &aceito os termos do Contrato de licenza
+# ^DontAcceptBtn
+Eu &non aceito os termos do Contrato de licenza
+# ^InstallBtn
+&Instalar
+# ^UninstallBtn
+&Desinstalar
+# ^CancelBtn
+Cancelar
+# ^CloseBtn
+&Fechar
+# ^BrowseBtn
+&Procurar...
+# ^ShowDetailsBtn
+Ver &Detalles
+# ^ClickNext
+Clique en 'Seguinte' para continuar.
+# ^ClickInstall
+Clique en 'Instalar' para iniciar a instalación.
+# ^ClickUninstall
+Clique en 'Desinstalar' para iniciar a desinstalación.
+# ^Name
+Nome
+# ^Completed
+Concluído
+# ^LicenseText
+Por favor revexa o acordo de licenza antes de instalar $(^NameDA). Se concordar con todos os termos da licenza, clique em 'Aceito'.
+# ^LicenseTextCB
+Por favor reveja o acordo de licenza antes de instalar $(^NameDA). Se concordar con todos os termos da licenza, clique na caixa de selección abaixo. $_CLICK
+# ^LicenseTextRB
+Por favor revexa o acordo de licenza antes de instalar $(^NameDA). Se concordar con todos os termos da licenza, escolla a primeira opción abaixo. $_CLICK
+# ^UnLicenseText
+Por favor revexa o acordo de licenza antes de desinstalar $(^NameDA). Se concordar con todos os termos da licenza, clique em 'Aceito'.
+# ^UnLicenseTextCB
+Por favor reveja o acordo de licenza antes de desinstalar $(^NameDA). Se concordar con todos os termos da licenza, clique na caixa de selección abaixo. $_CLICK
+# ^UnLicenseTextRB
+Por favor revexa o acordo de licenza antes de desinstalar $(^NameDA). Se concordar con todos os termos da licenza, escolla a primeira opción abaixo. $_CLICK
+# ^Custom
+Personalizado
+# ^ComponentsText
+Marque os componentes que desexa instalar e desmarque os componentes que non desexa instalar. $_CLICK
+# ^ComponentsSubText1
+Escolla o tipo de instalación:
+# ^ComponentsSubText2_NoInstTypes
+Escolla os componentes para instalar:
+# ^ComponentsSubText2
+Ou, escolla os componentes opcionais que desexa instalar:
+# ^UnComponentsText
+Marque os componentes que queira desinstalar e vice versa. $_CLICK
+# ^UnComponentsSubText1
+Escolla o tipo de desinstalación:
+# ^UnComponentsSubText2_NoInstTypes
+Escolla os componentes para desinstalar:
+# ^UnComponentsSubText2
+Ou, escolla os componentes opcionais que queira desinstalar:
+# ^DirText
+O $(^NameDA) será instalado na seguinte directória. Para instalar nunha directória diferente, clique en 'Procurar...' e escolla outra directória. $_CLICK
+# ^DirSubText
+Directória de destino
+# ^DirBrowseText
+Escolla unha directória para instalar o $(^NameDA):
+# ^UnDirText
+O $(^NameDA) será desinstalado da seguinte directória. Para desinstalar dunha pasta diferente, clique en 'Procurar...' e escolla outra directória. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Escolla a directória de onde vai ser desinstalado o $(^NameDA):
+# ^SpaceAvailable
+"Espazo disponíbel: "
+# ^SpaceRequired
+"Espazo necesário: "
+# ^UninstallingText
+$(^NameDA) vai ser desinstalado da seguinte directória. $_CLICK
+# ^UninstallingSubText
+Desinstalando de:
+# ^FileError
+Erro ao abrir ficheiro para escrita: \r\n\t"$0"\r\nClique en Abortar para abortar a instalación,\r\nRepetir para tentar novamente a escrita do ficheiro, ou\r\nIgnorar para ignorar este ficheiro.
+# ^FileError_NoIgnore
+Erro ao abrir ficheiro para escrita: \r\n\t"$0"\r\nClique en Repetir para tentar novamente a gravación do ficheiro, ou\r\nCancelar para abortar a instalación.
+# ^CantWrite
+"Non foi posíbel escreber: "
+# ^CopyFailed
+Falla ao copiar
+# ^CopyTo
+"Copiar para "
+# ^Registering
+"Rexistando: "
+# ^Unregistering
+"Desrexistando: "
+# ^SymbolNotFound
+"Símbolo non achado: "
+# ^CouldNotLoad
+"Non foi posíbel carregar: "
+# ^CreateFolder
+"Criando diretória: "
+# ^CreateShortcut
+"Criando atallo: "
+# ^CreatedUninstaller
+"Criando desinstalador: "
+# ^Delete
+"Eliminando ficheiro: "
+# ^DeleteOnReboot
+"Eliminar ao reiniciar: "
+# ^ErrorCreatingShortcut
+"Erro ao criar atallo: "
+# ^ErrorCreating
+"Erro ao criar: "
+# ^ErrorDecompressing
+Erro ao descomprimir dados! Instalador corrompido?
+# ^ErrorRegistering
+Erro ao rexistar DLL
+# ^ExecShell
+"Executando polo Shell: "
+# ^Exec
+"Executando: "
+# ^Extract
+"Extraindo: "
+# ^ErrorWriting
+"Extraindo: erro ao escreber ficheiro "
+# ^InvalidOpcode
+Instalador corrompido: código de operación inválido
+# ^NoOLE
+"Sen OLE para: "
+# ^OutputFolder
+"Cartafol de destino: "
+# ^RemoveFolder
+"Removendo cartafol: "
+# ^RenameOnReboot
+"Renomear ao reiniciar: "
+# ^Rename
+"Renomeando: "
+# ^Skipped
+"Ignorado: "
+# ^CopyDetails
+Copiar detalles para a Área de transférencia
+# ^LogInstall
+Rexistar proceso de instalación
+# ^Byte
+B
+# kilo
+K
+# mega
+M
+# giga
+G
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Croatian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Croatian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Croatian.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Croatian (1050)
+;By Igor Ostriz
+
+!insertmacro LANGFILE "Croatian" "Hrvatski"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Dobrodošli u instalaciju programa $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Instalacija programa $(^NameDA) na Vaše raèunalo sastoji se od nekoliko jednostavnih koraka kroz koje æe Vas provesti ovaj èarobnjak.$\r$\n$\r$\nPreporuèamo zatvaranje svih ostalih aplikacija prije samog poèetka instalacije. To æe omoguæiti nadogradnju nekih sistemskih datoteka bez potrebe za ponovnim pokretanjem Vašeg raèunala. U svakom trenutku instalaciju možete prekinuti pritiskom na 'Odustani'.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Dobrodošli u postupak uklanjanja programa $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Ovaj æe Vas èarobnjak provesti kroz postupak uklanjanja programa $(^NameDA).$\r$\n$\r$\nPrije samog poèetka, molim zatvorite program $(^NameDA) ukoliko je sluèajno otvoren.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Licenèni ugovor"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Molim proèitajte licencu prije instalacije programa $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Ukoliko prihvaæate uvjete licence, odaberite 'Prihvaæam' za nastavak. Morate prihvatiti licencu za instalaciju programa $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Ukoliko prihvaæate uvjete licence, oznaèite donji kvadratiæ. Morate prihvatiti licencu za instalaciju programa $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Ukoliko prihvaæate uvjete licence, odaberite prvu donju opciju. Morate prihvatiti licencu za instalaciju programa $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Licenèni ugovor"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Molim proèitajte licencu prije uklanjanja programa $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Ukoliko prihvaæate uvjete licence, odaberite 'Prihvaæam' za nastavak. Morate prihvatiti licencu za uklanjanje programa $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Ukoliko prihvaæate uvjete licence, oznaèite donji kvadratiæ. Morate prihvatiti licencu za uklanjanje programa $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Ukoliko prihvaæate uvjete licence, odaberite prvu donju opciju. Morate prihvatiti licencu za uklanjanje programa $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "'Page Down' za ostatak licence."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Izbor komponenti"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Odaberite komponente programa $(^NameDA) koje želite instalirati."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Izbor komponenti"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Odaberite koje komponente programa $(^NameDA) želite ukloniti."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Opis"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Postavite pokazivaè iznad komponente za njezin opis."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Postavite pokazivaè iznad komponente za njezin opis."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Odaberite odredište za instalaciju"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Odaberite mapu u koju želite instalirati program $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Odaberite polazište za uklanjanje"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Odaberite mapu iz koje želite ukloniti program $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Instaliranje"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Molim prièekajte na završetak instalacije programa $(^NameDA)."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Kraj instalacije"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Instalacija je u potpunosti završila uspješno."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Instalacija je prekinuta"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Instalacija nije završila uspješno."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Uklanjanje"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Molim prièekajte na završetak uklanjanja programa $(^NameDA)."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Uklanjanje završeno"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Uklanjanje je u potpunosti završilo uspješno."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Uklanjanje je prekinuto"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Uklanjanje nije završilo uspješno."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Dovršenje instalacije programa $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Program $(^NameDA) je instaliran na Vaše raèunalo.$\r$\n$\r$\nOdaberite 'Kraj' za završetak."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Vaše raèunalo treba ponovno pokrenuti za dovršenje instalacije programa $(^NameDA). Želite li to uèiniti sada?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Završetak uklanjanja programa $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "Program $(^NameDA) je uklonjen s Vašeg raèunala.$\r$\n$\r$\nOdaberite 'Kraj' za zatvaranje ovog èarobnjaka."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Vaše raèunalo treba ponovno pokrenuti za dovršenje postupka uklanjanja programa $(^NameDA). Želite li to uèiniti sada?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Ponovno pokreni raèunalo sada"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Ponovno æu pokrenuti raèunalo kasnije"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Pokreni program $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Prikaži &Readme"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Kraj"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Izbor mape u Start meniju"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Odaberite ime za programsku mapu unutar Start menija."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Program æe pripadati odabranoj programskoj mapi u Start meniju. Možete odrediti novo ime za mapu ili odabrati veæ postojeæu."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Nemoj napraviti preèace"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Uklanjanje programa $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Program $(^NameDA) æe biti uklonjen s Vašeg raèunala."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Jeste li sigurni da želite prekinuti instalaciju programa $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Jeste li sigurni da želite prekinuti uklanjanje programa $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Malay.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Malay.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Malay.nsh	(revision 728)
@@ -0,0 +1,121 @@
+;Language: Malay (1086)
+;By muhammadazwa@yahoo.com
+
+!insertmacro LANGFILE "Malay" "Malay"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Assalamualaikum, Selamat datang ke $(^NameDA) Setup Wizard"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Setup Wizard akan membantu anda untuk memasukkan $(^NameDA).$\r$\n$\r$\nSila tutup program aplikasi yang lain sebelum Setup ini dimulakan. Ini supaya tiada proses reboot komputer diperlukan.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Selamat datang ke $(^NameDA) Uninstall Wizard"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Uninstall Wizard akan membantu anda pada proses membuang $(^NameDA).$\r$\n$\r$\nSebelum membuang, pastikan dulu $(^NameDA) dimatikan.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Perlesenan"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Sila baca teks lesen berikut sebelum memasukkan $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Jika anda bersetuju, klik Saya setuju untuk teruskan. Anda mesti setuju untuk sebelum aplikasi dapat dimasukkan $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Jika anda bersetuju dengan syarat-syarat lesen, sila tanda dicheckbox. Anda mesti setuju sebelum memasukkan $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Jika anda terima semua yang ada di lesen, pilihlah salah satu item dibawah ini. Anda mesti setuju sebelum memasukkan $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Tentang Lesen"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Sila baca teks lesen sebelum membuang $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Jika anda menerima lesen, klik Saya setuju untuk teruskan. Anda mesti setuju untuk dapat membuang $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Jika anda menerima semua yang ada di lesen, beri tanda dicheckbox. Anda mesti setuju untuk dapat membuang $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Jika anda menerima semua yang ada di lesen, pilihlah salah satu item dibawah ini. Anda mesti setuju untuk dapat membuang $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Tekan Page Down untuk melihat teks selebihnya."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Pilih Komponen"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Pilih fungsi-fungsi dari $(^NameDA) yang ingin dimasukkan."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Pilih Komponen"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Pilih fungsi-fungsi $(^NameDA) yang ingin dibuang."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Penerangan"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Alihkan tetikus ke komponen untuk mengetahui penerangannya."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Alihkan tetikus ke komponen untuk mengetahui penerangannya."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Pilih Lokasi Kemasukan"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Pilih folder untuk memasukkan $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Pilih Lokasi Uninstall"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Pilih folder untuk meng-uninstall $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Pemasangan"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Sila tunggu ketika $(^NameDA) sedang dimasukkan."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Proses Selesai"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Setup sudah selesai."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Proses Dibatalkan"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Setup terbatal."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Uninstall"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Sila tunggu ketika $(^NameDA) sedang di-buang."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Proses Uninstall Selesai"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Uninstall sudah selesai."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Proses Uninstall Dibatalkan"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Uninstall belum selesai secara sempurna."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Menyelesaikan $(^NameDA) Setup Wizard"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) sudah dimasukkan di komputer anda.$\r$\n$\r$\nKlik Selesai untuk menutup Setup Wizard."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Komputer anda harus direboot untuk menyelesaikan proses memasukkan $(^NameDA). Apakah anda hendak reboot sekarang juga?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Menyelesaikan $(^NameDA) Uninstall Wizard"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) sudah dibuang dari komputer anda.$\r$\n$\r$\nKlik Selesai untuk menutup Setup Wizard."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Komputer anda harus di reboot untuk menyelesaikan proses membuang $(^NameDA). Reboot sekarang?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Reboot sekarang"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Reboot nanti"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "&Jalankan $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&Buka fail Readme"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Selesai"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Pilih Folder Start Menu"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Pilih folder Start Menu untuk meletakkan pintasan $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Pilih folder Start Menu untuk perletakkan pintasan aplikasi ini. Boleh cipta nama folder anda sendiri."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Tidak perlu pintasan"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Buang $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Padam $(^NameDA) dari komputer anda."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Adakan anda yakin ingin membatalkan Setup $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Adakan anda yakin ingin membatalkan proses buang $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Hebrew.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Hebrew.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Hebrew.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Hebrew NSIS language file
+NLF v6
+# Language ID
+1037
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1255
+# RTL - anything else than RTL means LTR
+RTL
+# Translation by Amir Szekely (aka KiCHiK), fixed by Yaron Shahrabani
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+äú÷ðú $(^Name)
+# ^UninstallCaption
+äñøú $(^Name)
+# ^LicenseSubCaption
+: äñëí øéùåé
+# ^ComponentsSubCaption
+: àôùøåéåú äú÷ðä
+# ^DirSubCaption
+: úé÷ééú äú÷ðä
+# ^InstallingSubCaption
+: îú÷éï
+# ^CompletedSubCaption
+: ääú÷ðä äåùìîä
+# ^UnComponentsSubCaption
+: àôùøåéåú äñøä
+# ^UnDirSubCaption
+: úé÷ééä ìäñøä
+# ^ConfirmSubCaption
+: àéùåø äñøä
+# ^UninstallingSubCaption
+: îñéø
+# ^UnCompletedSubCaption
+: ääñøä äåùìîä
+# ^BackBtn
+< ä&÷åãí
+# ^NextBtn
+ä&áà >
+# ^AgreeBtn
+àðé &îñëéí
+# ^AcceptBtn
+àðé &îñëéí ìúðàé äñëí äøéùåé
+# ^DontAcceptBtn
+àðé &ìà îñëéí ìúðàé äñëí äøéùåé
+# ^InstallBtn
+&äú÷ï
+# ^UninstallBtn
+&äñø
+# ^CancelBtn
+áéèåì
+# ^CloseBtn
+ñâåø&
+# ^BrowseBtn
+&òééï...
+# ^ShowDetailsBtn
+ä&öâ ôøèéí
+# ^ClickNext
+ìçõ òì äáà ëãé ìäîùéê.
+# ^ClickInstall
+ìçõ òì äú÷ï ëãé ìäúçéì àú ääú÷ðä.
+# ^ClickUninstall
+ìçõ òì äñø ëãé ìäúçéì àú ääñøä.
+# ^Name
+ùí
+# ^Completed
+äôòåìä äåùìîä
+# ^LicenseText
+àðà ñ÷åø àú äñëí äøéùåé ìôðé äú÷ðú $(^NameDA). àí äéðê î÷áì àú ëì úðàé ääñëí, ìçõ 'àðé îñëéí'.
+# ^LicenseTextCB
+àðà ñ÷åø àú äñëí äøéùåé ìôðé äú÷ðú $(^NameDA). àí äéðê î÷áì àú ëì úðàé ääñëí, ñîï àú úéáú äñéîåï ùìäìï. $_CLICK
+# ^LicenseTextRB
+àðà ñ÷åø àú äñëí äøéùåé ìôðé äú÷ðú $(^NameDA). àí äéðê î÷áì àú ëì úðàé ääñëí, áçø áàôùøåú äøàùåðä ùìäìï. $_CLICK
+# ^UnLicenseText
+àðà ñ÷åø àú äñëí äøéùåé ìôðé äñøú $(^NameDA). àí äéðê îñëéí ìëì úðàé ääñëí, ìçõ 'àðé îñëéí'.
+# ^UnLicenseTextCB
+àðà ñ÷åø àú äñëí äøéùåé ìôðé äñøú $(^NameDA). àí äéðê îñëéí ìëì úðàé ääñëí, ñîï àú úéáú äñéîåï ùìäìï. $_CLICK
+# ^UnLicenseTextRB
+àðà ñ÷åø àú äñëí äøéùåé ìôðé äñøú $(^NameDA). àí äéðê îñëéí ìëì úðàé ääñëí, áçø áàôùøåú äøàùåðä ùìäìï. $_CLICK
+# ^Custom
+îåúàí àéùéú
+# ^ComponentsText
+ñîï àú äøëéáéí ùáøöåðê ìäú÷éï åáèì àú äñéîåï ùì øëéáéí ùàéï áøöåðê ìäú÷éï. $_CLICK
+# ^ComponentsSubText1
+áçø ñåâ äú÷ðä:
+# ^ComponentsSubText2_NoInstTypes
+áçø øëéáéí ìäú÷ðä:
+# ^ComponentsSubText2
+àå, áçø øëéáé øùåú ìäú÷ðä:
+# ^UnComponentsText
+ñîï àú äøëéáéí ùáøöåðê ìäñéø åáèì àú äñéîåï ùì øëéáéí ùàéï áøöåðê ìäñéø. $_CLICK
+# ^UnComponentsSubText1
+áçø ñåâ äñøä:
+# ^UnComponentsSubText2_NoInstTypes
+áçø øëéáéí ìäñøä:
+# ^UnComponentsSubText2
+àå, áçø øëéáé øùåú ìäñøä:
+# ^DirText
+úåëðéú æå úú÷éï àú $(^NameDA) ìúé÷ééä ùìäìï. ëãé ìäú÷éï ìúé÷ééä àçøú, ìçõ òì 'òééï' åáçø úé÷ééä àçøú. $_CLICK
+# ^DirSubText
+úé÷ééú éòã
+# ^DirBrowseText
+áçø úé÷ééä ìäú÷ðú $(^NameDA):
+# ^UnDirText
+úåëðéú æå úñéø àú $(^NameDA) îäúé÷ééä ùìäìï. ëãé ìäñéø îúé÷ééä àçøú, ìçõ òì 'òééï' åáçø úé÷ééä àçøú. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+áçø úé÷ééä îîðä úåñø $(^NameDA):
+# ^SpaceAvailable
+"î÷åí ôðåé: "
+# ^SpaceRequired
+"î÷åí ãøåù: "
+# ^UninstallingText
+äñøú $(^NameDA) úúáöò îäúé÷ééä ùìäìï. $_CLICK
+# ^UninstallingSubText
+îñéø î:
+# ^FileError
+àøòä ùâéàä áòú ôúéçú ÷åáõ ìëúéáä:\r\n\t"$0"\r\nìçõ òì áéèåì ëãé ìáèì àú ääú÷ðä,\r\nðñä ùðéú ëãé ìðñåú ìôúåç àú ä÷åáõ ùåá, àå\r\näúòìí ëãé ìãìâ òì ä÷åáõ
+# ^FileError_NoIgnore
+àøòä ùâéàä áòú ôúéçú ÷åáõ ìëúéáä:\r\n\t"$0"\r\nìçõ òì ðñä ùðéú ëãé ìðñåú ìôúåç àú ä÷åáõ  ùåá, àå\r\náéèåì ëãé ìáèì àú äúú÷ðä
+# ^CantWrite
+"ìà ðéúï ìëúåá: "
+# ^CopyFailed
+ääòú÷ä ðëùìä
+# ^CopyTo
+äòú÷ ì-
+# ^Registering
+"øåùí: "
+# ^Unregistering
+"áéèåì øéùåí: "
+# ^SymbolNotFound
+"ñîì ìà ðîöà: "
+# ^CouldNotLoad
+"ìà ðéúï ìèòåï: "
+# ^CreateFolder
+"öåø úé÷ééä: "
+# ^CreateShortcut
+"öåø ÷éöåø ãøê: "
+# ^CreatedUninstaller
+"îñéø äú÷ðä ðåöø: "
+# ^Delete
+"îç÷ ÷åáõ: "
+# ^DeleteOnReboot
+"îç÷ àçøé àúçåì: "
+# ^ErrorCreatingShortcut
+"ùâéàä áòú éöéøú ÷éöåø ãøê: "
+# ^ErrorCreating
+"ùâéàä áòú éöéøú: "
+# ^ErrorDecompressing
+ùâéàä áòú ôøéùú îéãò! äú÷ðä ôâåîä?
+# ^ErrorRegistering
+ùâéàä áòú øéùåí DLL
+# ^ExecShell
+"áöò ôòåìú-÷åáõ: "
+# ^Exec
+"áöò: "
+# ^Extract
+"ôøåù: "
+# ^ErrorWriting
+"ôøåù: ùâéàä áòú ëúéáä ì÷åáõ "
+# ^InvalidOpcode
+äú÷ðä ôâåîä! ô÷åãú áéöåò ùâåéä
+# ^NoOLE
+"àéï OLE ì: "
+# ^OutputFolder
+"úé÷ééú ôìè: "
+# ^RemoveFolder
+"äñø úé÷ééä: "
+# ^RenameOnReboot
+"ùðä ùí ìàçø àúçåì: "
+# ^Rename
+"ùðä ùí: "
+# ^Skipped
+"ãìâ: "
+# ^CopyDetails
+äòú÷ ôøèéí ììåç
+# ^LogInstall
+ùîåø øéùåí ôòéìåéåú ääú÷ðä
+# ^Byte
+"á
+# ^Kilo
+" ÷"
+# ^Mega
+" î"
+# ^Giga
+" â"
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Bulgarian.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Bulgarian.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Bulgarian.nsh	(revision 728)
@@ -0,0 +1,124 @@
+;Language: Bulgarian (1026)
+;Translated by Asparouh Kalyandjiev [acnapyx@sbline.net]
+;Review and update from v1.63 to v1.68 by Plamen Penkov [plamen71@hotmail.com]
+;Updated by Êèðèë Êèðèëîâ (DumpeR) [dumper@data.bg]
+;
+
+!insertmacro LANGFILE "Bulgarian" "Bulgarian"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Äîáðå äîøëè â Ñúâåòíèêà çà èíñòàëèðàíå íà $(^NameDA)!"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Òîé ùå èíñòàëèðà $(^NameDA) íà âàøèÿ êîìïþòúð.$\r$\n$\r$\nÏðåïîðú÷âà ñå äà çàòâîðèòå âñè÷êè äðóãè ïðèëîæåíèÿ, ïðåäè äà ïðîäúëæèòå. Òîâà ùå ïîçâîëè íà ïðîãðàìàòà äà îáíîâè íÿêîè ñèñòåìíè ôàéëîâå, áåç äà ñå ðåñòàðòèðà êîìïþòúðà.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Äîáðå äîøëè â Ñúâåòíèêà çà èçòðèâàíå íà $(^NameDA)!"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Òîé ùå âè ïîìîãíå äà èçòðèåòå $(^NameDA) îò âàøèÿ êîìïþòúð.$\r$\n$\r$\nÏðåäè äà ïðîäúëæèòå, óâåðåòå ñå ÷å $(^NameDA) íå å ñòàðòèðàíà â ìîìåíòà.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Ëèöåíçèîííî ñïîðàçóìåíèå"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Ìîëÿ çàïîçíàéòå ñå Ëèöåíçèîííîòî ñïîðàçóìåíèå ïðåäè äà ïðîäúëæèòå."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Àêî ïðèåìàòå óñëîâèÿòà íà ñïîðàçóìåíèåòî, íàòèñíåòå $\"Ñúãëàñåí$\", çà äà ïðîäúëæèòå. Òðÿáâà äà ïðèåìåòå ñïîðàçóìåíèåòî, çà äà èíñòàëèðàòå $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Àêî ïðèåìàòå óñëîâèÿòà íà ñïîðàçóìåíèåòî, ñëîæåòå îòìåòêà â ïîëåòî ïî-äîëó. Òðÿáâà äà ïðèåìåòå ñïîðàçóìåíèåòî, çà äà èíñòàëèðàòå $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Àêî ïðèåìàòå óñëîâèÿòà íà ñïîðàçóìåíèåòî, èçáåðåòå ïúðâàòà îïöèÿ ïî-äîëó. Òðÿáâà äà ïðèåìåòå ñïîðàçóìåíèåòî, çà äà èíñòàëèðàòå $(^NameDA) $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Ëèöåíçèîííî ñïîðàçóìåíèå"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Ìîëÿ çàïîçíàéòå ñå ëèöåíçèîííèòå óñëîâèÿ ïðåäè äà èçòðèåòå $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Àêî ïðèåìàòå óñëîâèÿòà íà ñïîðàçóìåíèòî, íàòèñíåòå $\"Ñúãëàñåí$\" çà äà ïðîäúëæèòå. Òðÿáâà äà ïðèåìåòå ñïîðàçóìåíèåòî, çà äà èçòðèåòå $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Àêî ïðèåìàòå óñëîâèÿòà íà ñïîðàçóìåíèåòî, ñëîæåòå îòìåòêà â ïîëåòî ïî-äîëó. Òðÿáâà äà ïðèåìåòå ñïîðàçóìåíèåòî, çà äà èçòðèåòå $(^NameDA). $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Àêî ïðèåìàòå óñëîâèÿòà íà ñïîðàçóìåíèòî, èçáåðåòå ïúðâàòà îïöèÿ ïî-äîëó. Òðÿáâà äà ïðèåìåòå ñïîðàçóìåíèåòî, çà äà èçòðèåòå $(^NameDA). $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Íàòèñíåòå êëàâèøà $\"Page Down$\", çà äà âèäèòå îñòàíàëàòà ÷àñò îò ñïîðàçóìåíèåòî."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Èçáîð íà êîìïîíåíòè"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Èçáåðåòå êîè êîìïîíåíòè íà $(^NameDA) èñêàòå äà èíñòàëèðàòå."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Èçáîð íà êîìïîíåíòè"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Èçáåðåòå êîè êîìïîíåíòè íà $(^NameDA) èñêàòå äà èçòðèåòå."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Îïèñàíèå"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Ïðåìèíåòå ñ ìèøêàòà íàä îïðåäåëåí êîìïîíåíò, çà äà âèäèòå îïèñàíèåòî ìó."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Ïðåìèíåòå ñ ìèøêàòà íàä îïðåäåëåí êîìïîíåíò, çà äà âèäèòå îïèñàíèåòî ìó."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Èçáîð íà ïàïêà çà èíñòàëèðàíå"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Èçáåðåòå ïàïêàòà, â êîÿòî äà ñå èíñòàëèðà $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Èçáîð íà ïàïêà çà èçòðèâàíå"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Èçáåðåòå ïàïêàòà, îò êîÿòî äà ñå èçòðèå $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Èíñòàëèðàíå"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Èç÷àêàéòå, èíñòàëèðàò ñå ôàéëîâåòå íà $(^NameDA)..."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Èíñòàëèðàíåòî çàâúðøè."
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Èíñòàëèðàíåòî çàâúðøè óñïåøíî."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Èíñòàëèðàíåòî ïðåêðàòåíî."
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Èíñòàëèðàíåòî íå çàâúðøè óñïåøíî."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Èçòðèâàíå"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Èç÷àêàéòå, èçòðèâàò ñå ôàéëîâåòå íà $(^NameDA)..."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Êðàé"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Èçòðèâàíåòî çàâúðøè óñïåøíî."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Èçòðèâàíåòî ïðåêðàòåíî."
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Èçòðèâàíåòî íå çàâúðøè íàïúëíî."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Ïðèêëþ÷âàíå íà Ñúâåòíèêà çà èíñòàëèðàíå íà $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Èíñòàëèðàíåòî íà $(^NameDA) å çàâúðøåíî.$\r$\n$\r$\nÍàòèñíåòå áóòîíà $\"Êðàé$\", çà äà çàòâîðèòå Ñúâåòíèêà."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Êîìïþòúðúò òðÿáâà äà áúäå ðåñòàðòèðàí, çà äà çàâúðøè èíñòàëèðàíåòî íà $(^NameDA). Èñêàòå ëè äà ðåñòàðòèðàòå ñåãà?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Ïðèêëþ÷âàíå íà Ñúâåòíèêà çà èçòðèâàíå íà $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "Ïðîãðàìàòà $(^NameDA) áåøå èçòðèòà îò âàøèÿ êîìïþòúð.$\r$\n$\r$\nÍàòèñíåòå $\"Êðàé$\" çà äà çàòâîðèòå òîçè Ñúâåòíèê."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Êîìïþòúðúò âè òðÿáâà äà ñå ðåñòàðòèðà, çà äà ïðèêëþ÷è óñïåøíî èçòðèâàíåòî íà $(^NameDA). Èñêàòå ëè äà ðåñòàðòèðàòå ñåãà?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Äà, ðåñòàðòèðàé ñåãà"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Íå, ùå ðåñòàðòèðàì ïî-êúñíî"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "Ñòàðòèðàé $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Ïîêàæè ôàéëà $\"ReadMe$\""
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Êðàé"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Èçáîð íà ïàïêà â ìåíþòî $\"Ñòàðò$\""
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Èçáåðåòå ïàïêà â ìåíþòî $\"Ñòàðò$\" çà ïðåêè ïúòèùà êúì ïðîãðàìàòà."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Èçáåðåòå ïàïêà â ìåíþòî $\"Ñòàðò$\", â êîÿòî èñêàòå äà ñúçäàäåòå ïðåêè ïúòèùà êúì ïðîãðàìàòà. Ìîæåòå ñúùî òàêà äà âúâåäåòå èìå, çà äà ñúçäàäåòå íîâà ïàïêà."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Íå ñúçäàâàé ïðåêè ïúòèùà"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Èçòðèâàíå íà $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Èçòðèâàíå íà $(^NameDA) îò âàøèÿ êîìïþòúð."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Ñèãóðíè ëè ñòå, ÷å èñêàòå äà ïðåêðàòèòå èíñòàëèðàíåòî íà $(^Name)?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Ñèãóðíè ëè ñòå, ÷å èñêàòå äà ïðåêðàòèòå èçòðèâàíåòî íà $(^Name)?"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/NorwegianNynorsk.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/NorwegianNynorsk.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/NorwegianNynorsk.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Language ID
+2068
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by Vebjørn Sture, vsture gmail com
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) installasjon
+# ^UninstallCaption
+$(^Name) avinstallasjon
+# ^LicenseSubCaption
+: Lisensavtale
+# ^ComponentsSubCaption
+: Installasjonsval
+# ^DirSubCaption
+: Installasjonsmappe
+# ^InstallingSubCaption
+: Installerer
+# ^CompletedSubCaption
+: Ferdig
+# ^UnComponentsSubCaption
+: Avinstallasjonsval
+# ^UnDirSubCaption
+: Avinstallasjonsmappe
+# ^ConfirmSubCaption
+: Stadfest
+# ^UninstallingSubCaption
+: Avinstallerer
+# ^UnCompletedSubCaption
+: Ferdig
+# ^BackBtn
+< &Attende
+# ^NextBtn
+&Neste >
+# ^AgreeBtn
+&Godta
+# ^AcceptBtn
+Eg &godtek vilkåra i lisensavtalen
+# ^DontAcceptBtn
+Eg godtek &ikkje vilkåra i lisensavtalen
+# ^InstallBtn
+&Installer
+# ^UninstallBtn
+&Avinstaller
+# ^CancelBtn
+Avbryt
+# ^CloseBtn
+&Lat att
+# ^BrowseBtn
+Bla &gjennom ...
+# ^ShowDetailsBtn
+Syn &detaljar
+# ^ClickNext
+Trykk Neste for å halda fram.
+# ^ClickInstall
+Trykk Installer for å starta installasjonen.
+# ^ClickUninstall
+Trykk Avinstaller for å starta avinstallasjonen.
+# ^Name
+Namn
+# ^Completed
+Ferdig
+# ^LicenseText
+Ver grei og les gjennom lisensavtalen før du installerer $(^NameDA). Dersom du godtek vilkåra i avtalen, trykk på Godta.
+# ^LicenseTextCB
+Ver grei og les gjennom lisensavtalen før du installerer $(^NameDA). Dersom du godtek vilkåra i avtalen, merk av under. $_CLICK
+# ^LicenseTextRB
+Ver grei og les gjennom lisensavtalen før du installerer $(^NameDA). Dersom du godtek vilkåra i avtalen, vel det fyrste alternativet. $_CLICK
+# ^UnLicenseText
+Ver grei og les gjennom lisensavtalen før du avinstallerer $(^NameDA). Dersom du godtek vilkåra i avtalen, trykk på Godta.
+# ^UnLicenseTextCB
+Ver grei og les gjennom lisensavtalen før du avinstallerer $(^NameDA). Dersom du godtek vilkåra i avtalen, merk av under. $_CLICK
+# ^UnLicenseTextRB
+Ver grei og les gjennom lisensavtalen før du avinstallerer $(^NameDA). Dersom du godtek vilkåra i avtalen, vel det fyrste alternativet. $_CLICK
+# ^Custom
+Eigendefinert
+# ^ComponentsText
+Merk komponentane du vil installera og fjern merkinga for dei du ikkje vil installera. $_CLICK
+# ^ComponentsSubText1
+Vel kva måte du vil installera på:
+# ^ComponentsSubText2_NoInstTypes
+Merk komponentar du vil installera:
+# ^ComponentsSubText2
+Eller merk dei valfrie komponentane du ynskjer å installera:
+# ^UnComponentsText
+Merk komponentane du vil avinstallera og fjern merkinga for dei du vil ta vare på. $_CLICK
+# ^UnComponentsSubText1
+Vel kva måte du vil avinstallera på:
+# ^UnComponentsSubText2_NoInstTypes
+Merk komponentar du vil avinstallera:
+# ^UnComponentsSubText2
+Eller merk dei valfrie komponentane du ynskjer å avinstallera:
+# ^DirText
+$(^NameDA) vil verta installert i fylgjande mappe. For å velja ei anna mappe, trykk Bla gjennom. $_CLICK
+# ^DirSubText
+Målmappe
+# ^DirBrowseText
+Vel mappe du vil installera $(^NameDA) i:
+# ^UnDirText
+$(^NameDA) i fylgjande mappe vil verta avinstallert. For å velja ei anna mappe, trykk Bla gjennom. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Vel mappe du vil avinstallera $(^NameDA) frå:
+# ^SpaceAvailable
+"Ledig plass: "
+# ^SpaceRequired
+"Naudsynt plass: "
+# ^UninstallingText
+Denne vegvisaren vil avinstallera $(^NameDA) frå din datamaskin. $_CLICK
+# ^UninstallingSubText
+Avinstallerer frå:
+# ^FileError
+Feil under opning av fil for skriving: \r\n\t\"$0\"\r\nTrykk Avbryt for å avbryta installasjonen,\r\nPrøv igjen for å prøva igjen, eller\r\nIgnorer for å hoppa over denne fila
+# ^FileError_NoIgnore
+Feil under opning av fil for skriving: \r\n\t\"$0\"\r\nTrykk Prøv igjen for å prøva igjen, or\r\neller Avbryt for å avbryta installasjonen
+# ^CantWrite
+"Kan ikkje skriva: "
+# ^CopyFailed
+Kopiering mislukka
+# ^CopyTo
+"Kopier til "
+# ^Registering
+"Registrerer: "
+# ^Unregistering
+""Avregistrerer: "
+# ^SymbolNotFound
+"Kunne ikkje finna symbol: "
+# ^CouldNotLoad
+"Kunne ikkje lasta: "
+# ^CreateFolder
+"Lag mappe: "
+# ^CreateShortcut
+"Lag snarveg: "
+# ^CreatedUninstaller
+"Avinstallasjon laga: "
+# ^Delete
+"Slett fil: "
+# ^DeleteOnReboot
+"Slett ved omstart: "
+# ^ErrorCreatingShortcut
+"Feil under oppretting av snarveg: "
+# ^ErrorCreating
+"Feil under oppretting av: "
+# ^ErrorDecompressing
+Feil under utpakking av data! Installasjonsprogrammet kan vera skadd.
+# ^ErrorRegistering
+Feil under registrering av DLL
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Køyra: "
+# ^Extract
+"Pakk ut: "
+# ^ErrorWriting
+"Pakk ut: Feil under skriving til fil "
+# ^InvalidOpcode
+Installasjonsprogrammet er skadd: ukjend kode
+# ^NoOLE
+"Ingen OLE for: "
+# ^OutputFolder
+"Ut-mappe: "
+# ^RemoveFolder
+"Fjern mappe: "
+# ^RenameOnReboot
+"Gje nytt namn ved omstart: "
+# ^Rename
+"Gje nytt namn: "
+# ^Skipped
+"Hoppa over: "
+# ^CopyDetails
+Kopier detaljar til utklyppstavla
+# ^LogInstall
+Loggfør installasjonsprosessen
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
+
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Irish.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Irish.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Irish.nlf	(revision 728)
@@ -0,0 +1,191 @@
+# Header, don't edit
+NLF v6
+# Start editing here
+# Language ID
+2108
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by Kevin P. Scannell < scannell at slu dot edu >
+# ^Branding
+Córas Suiteála Nullsoft %s
+# ^SetupCaption
+Socrú $(^Name)
+# ^UninstallCaption
+Díshuiteáil $(^Name)
+# ^LicenseSubCaption
+: Comhaontú um Cheadúnas
+# ^ComponentsSubCaption
+: Roghanna Suiteála
+# ^DirSubCaption
+: Fillteán Suiteála
+# ^InstallingSubCaption
+: Suiteáil
+# ^CompletedSubCaption
+: Críochnaithe
+# ^UnComponentsSubCaption
+: Roghanna Díshuiteála
+# ^UnDirSubCaption
+: Fillteán Díshuiteála
+# ^ConfirmSubCaption
+: Deimhniú
+# ^UninstallingSubCaption
+: Díshuiteáil
+# ^UnCompletedSubCaption
+: Críochnaithe
+# ^BackBtn
+< Ar Ai&s
+# ^NextBtn
+Ar &Aghaidh >
+# ^AgreeBtn
+Gl&acaim Leis
+# ^AcceptBtn
+Táim toilteanach &glacadh le coinníollacha an Chomhaontú um Cheadúnas
+# ^DontAcceptBtn
+Nílim &toilteanach glacadh le coinníollacha an Chomhaontú um Cheadúnas
+# ^InstallBtn
+&Suiteáil
+# ^UninstallBtn
+&Díshuiteáil
+# ^CancelBtn
+Cealaigh
+# ^CloseBtn
+&Dún
+# ^BrowseBtn
+B&rabhsáil...
+# ^ShowDetailsBtn
+Taispeáin &sonraí
+# ^ClickNext
+Cliceáil "Ar Aghaidh" chun leanúint ar aghaidh.
+# ^ClickInstall
+Cliceáil "Suiteáil" chun tosú.
+# ^ClickUninstall
+Cliceáil "Díshuiteáil" chun tosú.
+# ^Name
+Ainm
+# ^Completed
+Críochnaithe
+# ^LicenseText
+Déan iniúchadh ar an gComhaontú um Cheadúnas sula suiteálann tú $(^NameDA). Má ghlacann tú le gach coinníoll den chomhaontú, cliceáil "Glacaim Leis".
+# ^LicenseTextCB
+Déan iniúchadh ar an gComhaontú um Cheadúnas sula suiteálann tú $(^NameDA). Má ghlacann tú le gach coinníoll den chomhaontú, cliceáil an ticbhosca thíos. $_CLICK
+# ^LicenseTextRB
+Déan iniúchadh ar an gComhaontú um Cheadúnas sula suiteálann tú $(^NameDA). Má ghlacann tú le gach coinníoll den chomhaontú, roghnaigh an chéad rogha thíos. $_CLICK
+# ^UnLicenseText
+Déan iniúchadh ar an gComhaontú um Cheadúnas sula ndíshuiteálann tú $(^NameDA). Má ghlacann tú le gach coinníoll den chomhaontú, cliceáil "Glacaim Leis".
+# ^UnLicenseTextCB
+Déan iniúchadh ar an gComhaontú um Cheadúnas sula ndíshuiteálann tú $(^NameDA). Má ghlacann tú le gach coinníoll den chomhaontú, cliceáil an ticbhosca thíos. $_CLICK
+# ^UnLicenseTextRB
+Déan iniúchadh ar an gComhaontú um Cheadúnas sula ndíshuiteálann tú $(^NameDA). Má ghlacann tú le gach coinníoll den chomhaontú, roghnaigh an chéad rogha thíos. $_CLICK
+# ^Custom
+Saincheaptha
+# ^ComponentsText
+Roghnaigh na comhpháirteanna is mian leat a shuiteáil, agus díroghnaigh na comhpháirteanna nach mian leat a shuiteáil. $_CLICK
+# ^ComponentsSubText1
+Roghnaigh cineál na suiteála:
+# ^ComponentsSubText2_NoInstTypes
+Roghnaigh na comhpháirteanna is mian leat a shuiteáil:
+# ^ComponentsSubText2
+Nó, roghnaigh na comhpháirteanna roghnacha is mian leat a shuiteáil:
+# ^UnComponentsText
+Roghnaigh na comhpháirteanna is mian leat a dhíshuiteáil, agus díroghnaigh na comhpháirteanna nach mian leat a dhíshuiteáil. $_CLICK
+# ^UnComponentsSubText1
+Roghnaigh cineál na díshuiteála:
+# ^UnComponentsSubText2_NoInstTypes
+Roghnaigh comhpháirteanna le díshuiteáil:
+# ^UnComponentsSubText2
+Nó, roghnaigh na comhpháirteanna roghnacha is mian leat a dhíshuiteáil:
+# ^DirText
+Cuirfidh an Suiteálaí $(^NameDA) san fhillteán seo a leanas. Más mian leat suiteáil i bhfillteán difriúil, cliceáil "Brabhsáil" agus roghnaigh fillteán eile. $_CLICK
+# ^DirSubText
+Sprioc-Fhillteán
+# ^DirBrowseText
+Roghnaigh an fillteán inar mian leat $(^NameDA) a shuiteáil:
+# ^UnDirText
+Bainfidh an Suiteálaí $(^NameDA) amach as an bhfillteán seo a leanas. Más mian leat é a dhíshuiteáil ó fhillteán difriúil, cliceáil "Brabhsáil" agus roghnaigh fillteán eile. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Roghnaigh an fillteán ar mian leat $(^NameDA) a dhíshuiteáil as:
+# ^SpaceAvailable
+"Spás le fáil: "
+# ^SpaceRequired
+"Spás de dhíth: "
+# ^UninstallingText
+Díshuiteálfar $(^NameDA) ón fhillteán seo a leanas. $_CLICK
+# ^UninstallingSubText
+Á dhíshuiteáil ó:
+# ^FileError
+Earráid agus comhad á scríobh: \r\n\r\n$0\r\n\r\nCliceáil "Abort" chun an tsuiteáil a stopadh,\r\n"Retry" chun iarracht eile a dhéanamh, nó\r\n"Ignore" chun neamhaird a dhéanamh den chomhad seo.
+# ^FileError_NoIgnore
+Earráid agus comhad á scríobh: \r\n\r\n$0\r\n\r\nCliceáil "Retry" chun iarracht eile a dhéanamh, nó\r\n"Cancel" chun an tsuiteáil a stopadh.
+# ^CantWrite
+"Ní féidir scríobh: "
+# ^CopyFailed
+Theip ar an gcóipeáil
+# ^CopyTo
+"Cóipeáil go "
+# ^Registering
+"Clárú: "
+# ^Unregistering
+"Díchlárú: "
+# ^SymbolNotFound
+"Níorbh fhéidir siombail a aimsiú: "
+# ^CouldNotLoad
+"Níorbh fhéidir luchtú: "
+# ^CreateFolder
+"Cruthaigh fillteán: "
+# ^CreateShortcut
+"Cruthaigh aicearra: "
+# ^CreatedUninstaller
+"Cruthaíodh díshuiteálaí: "
+# ^Delete
+"Scrios comhad: "
+# ^DeleteOnReboot
+"Scrios ag am atosaithe: "
+# ^ErrorCreatingShortcut
+"Earráid agus aicearra á chruthú: "
+# ^ErrorCreating
+"Earráid le linn cruthaithe: "
+# ^ErrorDecompressing
+Earráid agus sonraí á ndíchomhbhrú! Suiteálaí truaillithe?
+# ^ErrorRegistering
+Earráid agus DLL á chlárú
+# ^ExecShell
+"Blaosc: "
+# ^Exec
+"Rith: "
+# ^Extract
+"Bain Amach: "
+# ^ErrorWriting
+"Extract: earráid le linn scríofa "
+# ^InvalidOpcode
+Díshuiteálaí truaillithe: cód neamhbhailí oibríochta
+# ^NoOLE
+"Gan OLE le haghaidh: "
+# ^OutputFolder
+"Fillteán aschurtha: "
+# ^RemoveFolder
+"Bain fillteán: "
+# ^RenameOnReboot
+"Athainmnigh ag am atosaithe: "
+# ^Rename
+"Athainmnigh: "
+# ^Skipped
+"Neamhaird déanta de: "
+# ^CopyDetails
+Cóipeáil Sonraí go dtí an Ghearrthaisce
+# ^LogInstall
+Logáil an próiseas suiteála
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/French.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/French.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/French.nsh	(revision 728)
@@ -0,0 +1,129 @@
+;Language: French (1036)
+;By Sébastien Delahaye <seb@delahaye.net>
+
+!insertmacro LANGFILE "French" "French"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Bienvenue dans le programme d'installation de $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Vous êtes sur le point d'installer $(^NameDA) sur votre ordinateur.$\r$\n$\r$\nAvant de démarrer l'installation, il est recommandé de fermer toutes les autres applications. Cela permettra la mise à jour de certains fichiers système sans redémarrer votre ordinateur.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Bienvenue dans le programme de désinstallation de $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Vous êtes sur le point de désinstaller $(^NameDA) de votre ordinateur.$\r$\n$\r$\nAvant d'amorcer la désinstallation, assurez-vous que $(^NameDA) ne soit pas en cours d'exécution.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Licence utilisateur"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Veuillez examiner les termes de la licence avant d'installer $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Si vous acceptez les conditions de la licence utilisateur, cliquez sur J'accepte pour continuer. Vous devez accepter la licence utilisateur afin d'installer $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Si vous acceptez les conditions de la licence utilisateur, cochez la case ci-dessous. Vous devez accepter la licence utilisateur afin d'installer $(^NameDA)."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Si vous acceptez les conditions de la licence utilisateur, sélectionnez le premier choix ci-dessous. Vous devez accepter la licence utilisateur afin d'installer $(^NameDA)."
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Licence utilisateur"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Veuillez examiner les conditions de la licence avant de désinstaller $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Si vous acceptez les conditions de la licence utilisateur, cliquez sur J'accepte pour continuer. Vous devez accepter la licence utilisateur afin de désinstaller $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Si vous acceptez les conditions de la licence utilisateur, cochez la case ci-dessous. Vous devez accepter la licence utilisateur afin de désintaller $(^NameDA)."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Si vous acceptez les conditions de la licence utilisateur, sélectionnez le premier choix ci-dessous. Vous devez accepter la licence utilisateur afin de désinstaller $(^NameDA)."
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Appuyez sur Page Suivante pour lire le reste de la licence utilisateur."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Choisissez les composants"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Choisissez les composants de $(^NameDA) que vous souhaitez installer."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Choisissez les composants"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Cochez les composants de $(^NameDA) que vous souhaitez désinstaller."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Description"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Passez le curseur de votre souris sur un composant pour en voir la description."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Passez le curseur de votre souris sur un composant pour en voir la description."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Choisissez le dossier d'installation"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Choisissez le dossier dans lequel installer $(^NameDA)."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Choisissez le dossier de désinstallation"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Choisissez le dossier à partir duquel vous voulez désinstaller $(^NameDA)."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Installation en cours"
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Veuillez patienter pendant l'installation des fichiers de $(^NameDA) sur votre machine."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Installation terminée"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "L'installation s'est terminée avec succès."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Installation interrompue"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "L'installation n'a pas été terminée."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Désinstallation en cours"
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Veuillez patienter pendant que $(^NameDA) est en train d'être supprimé de votre ordinateur."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Désinstallation terminée"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "La désinstallation s'est terminée avec succès."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Désinstallation interrompue"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "La désinstallation n'a pas été terminée."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Fin de l'installation de $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) a été installé sur votre ordinateur.$\r$\n$\r$\nCliquez sur Fermer pour quitter le programme d'installation."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Votre ordinateur doit être redémarré afin de compléter l'installation de $(^NameDA). Souhaitez-vous redémarrer maintenant ?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Fin de la désinstallation de $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) a été supprimé de votre ordinateur.$\r$\n$\r$\nCliquez sur Fermer pour quitter le programme d'installation."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Votre ordinateur doit être redémarré pour terminer la désinstallation de $(^NameDA). Souhaitez-vous redémarrer maintenant ?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Redémarrer maintenant"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Je souhaite redémarrer moi-même plus tard"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "Lancer $(^NameDA)"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Afficher le fichier Readme"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Fermer"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Choisissez un dossier dans le menu Démarrer"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Choisissez un dossier dans le menu Démarrer pour les raccourcis de l'application."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Choisissez le dossier du menu Démarrer dans lequel vous voulez placer les raccourcis du programme. Vous pouvez également entrer un nouveau nom pour créer un nouveau dossier."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Ne pas créer de raccourcis"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Désinstaller $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "Supprimer $(^NameDA) de votre ordinateur."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Êtes-vous sûr de vouloir quitter l'installation de $(^Name) ?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Êtes-vous sûr de vouloir quitter la désinstallation de $(^Name) ?"
+!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "Choix des utilisateurs"
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "Sélection des utilisateurs désirant utiliser $(^NameDA)."
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "Choix entre installer $(^NameDA) seulement pour vous-même  ou bien pour tous les utilisateurs du système. $(^ClickNext)"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "Installer pour tous les utilisateurs"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Installer seulement pour moi"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Estonian.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Estonian.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Estonian.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1061
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1257
+# RTL - anything else than RTL means LTR
+-
+# Translation by izzo (izzo@hot.ee)
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+$(^Name) Paigaldamine
+# ^UninstallCaption
+$(^Name) Eemaldamine
+# ^LicenseSubCaption
+: Litsentsileping
+# ^ComponentsSubCaption
+: Paigaldusvalikud
+# ^DirSubCaption
+: Paigalduskaust
+# ^InstallingSubCaption
+: Paigaldan			
+# ^CompletedSubCaption
+: Valmis
+# ^UnComponentsSubCaption
+: Eemaldusvalikud
+# ^UnDirSubCaption
+: Eemalduskaust
+# ^ConfirmSubCaption
+: Kinnitus
+# ^UninstallingSubCaption
+: Eemaldan
+# ^UnCompletedSubCaption
+: Valmis
+# ^BackBtn
+< Tagasi
+# ^NextBtn
+Edasi >
+# ^AgreeBtn
+Nõustun
+# ^AcceptBtn
+Nõustun litsentsilepingu tingimustega
+# ^DontAcceptBtn
+Ei nõustu litsentsilepingu tingimustega
+# ^InstallBtn
+Paigalda
+# ^UninstallBtn
+Eemalda
+# ^CancelBtn
+Loobu
+# ^CloseBtn
+Sule
+# ^BrowseBtn
+Sirvi...
+# ^ShowDetailsBtn
+Detailid
+# ^ClickNext
+Jätkamiseks vajuta Edasi.
+# ^ClickInstall
+Paigaldamise alustamiseks vajuta Paigalda.
+# ^ClickUninstall
+Eemaldamise alustamiseks vajuta Eemalda.
+# ^Name
+Nimi
+# ^Completed
+Valmis
+# ^LicenseText
+Enne $(^NameDA) paigaldamist vaata palun litsentsileping üle. Kui sa nõustud kõigi lepingu tingimustega, vajuta Nõustun.
+# ^LicenseTextCB
+Enne $(^NameDA) paigaldamist vaata palun litsentsileping üle. Kui sa nõustud kõigi lepingu tingimustega, vali allolev märkeruut. $_CLICK
+# ^LicenseTextRB
+Enne $(^NameDA) paigaldamist vaata palun litsentsileping üle. Kui sa nõustud kõigi lepingu tingimustega, märgi allpool esimene valik. $_CLICK
+# ^UnLicenseText
+Enne $(^NameDA) eemaldamist vaata palun litsentsileping üle. Kui sa nõustud kõigi lepingu tingimustega, vajuta Nõustun.
+# ^UnLicenseTextCB
+Enne $(^NameDA) eemaldamist vaata palun litsentsileping üle. Kui sa nõustud kõigi lepingu tingimustega, vali allolev märkeruut. $_CLICK
+# ^UnLicenseTextRB
+Enne $(^NameDA) eemaldamist vaata palun litsentsileping üle. Kui sa nõustud kõigi lepingu tingimustega, märgi allpool esimene valik. $_CLICK
+# ^Custom
+Kohandatud
+# ^ComponentsText
+Märgista komponendid mida soovid paigaldada ja eemalda märgistus neilt, mida ei soovi paigaldada. $_CLICK
+# ^ComponentsSubText1
+Vali paigalduse tüüp:
+# ^ComponentsSubText2_NoInstTypes
+Vali paigaldatavad komponendid:
+# ^ComponentsSubText2
+või vali lisakomponendid mida soovid paigaldada:
+# ^UnComponentsText
+Märgista komponendid mida soovid eemaldada ja eemalda märgistus neilt, mida ei soovi eemaldada. $_CLICK
+# ^UnComponentsSubText1
+Vali eemalduse tüüp:
+# ^UnComponentsSubText2_NoInstTypes
+Vali eemaldatavad komponendid:
+# ^UnComponentsSubText2
+või vali lisakomponendid mida soovid eemaldada:
+# ^DirText
+$(^NameDA) paigaldatakse järgmisse kausta. Et mujale paigaldada, vajuta sirvi ja vali teine kaust. $_CLICK
+# ^DirSubText
+Sihtkaust
+# ^DirBrowseText
+Vali kaust kuhu $(^NameDA) paigaldada:
+# ^UnDirText
+$(^NameDA) eemaldatakse järgmisest kaustast. Et mujalt eemaldada, vajuta sirvi ja vali teine kaust. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+Vali kaust kust $(^NameDA) eemaldada:
+# ^SpaceAvailable
+"Vaba ruum: "
+# ^SpaceRequired
+"Vajalik ruum: "
+# ^UninstallingText
+$(^NameDA) eemaldatakse järgmisest kaustast. $_CLICK
+# ^UninstallingSubText
+Eemaldan sealt:
+# ^FileError
+Tõrge faili avamisel kirjutamiseks: \r\n\t"$0"\r\nPaigalduse katkestamiseks vajuta Katkesta,\r\nvajuta Ürita uuesti, et faili kirjutamist uuesti proovida, või\r\nIgnoreeri, et see fail vahele jätta.
+# ^FileError_NoIgnore
+Tõrge faili avamisel kirjutamiseks: \r\n\t"$0"\r\nVajuta Ürita uuesti, et faili kirjutamist uuesti proovida, või\r\nLoobu, et paigaldamine katkestada
+# ^CantWrite
+"Ei saa kirjutada: "
+# ^CopyFailed
+Kopeerimine ebaõnnestus
+# ^CopyTo
+"Kopeeri sinna "
+# ^Registering
+"Registreerin: "
+# ^Unregistering
+"Deregistreerin: "
+# ^SymbolNotFound
+"Ei leidnud sümbolit: "
+# ^CouldNotLoad
+"Ei saanud laadida: "
+# ^CreateFolder
+"Loo kaust: "
+# ^CreateShortcut
+"Loo otsetee: "
+# ^CreatedUninstaller
+"Loodud eemaldaja: "
+# ^Delete
+"Kustuta fail: "
+# ^DeleteOnReboot
+"Kustuta taaskäivitamisel: "
+# ^ErrorCreatingShortcut
+"Tõrge otsetee loomisel: "
+# ^ErrorCreating
+"Tõrge loomisel: "
+# ^ErrorDecompressing
+Tõrge andmete lahtipakkimisel! Vigane paigaldaja?
+# ^ErrorRegistering
+Tõrge DLL-i registreerimisel
+# ^ExecShell
+"ExecShell: "
+# ^Exec
+"Käivita: "
+# ^Extract
+"Paki lahti: "
+# ^ErrorWriting
+"Paki lahti: viga faili kirjutamisel "
+# ^InvalidOpcode
+Paigaldaja kõlbmatu: vigane opkood
+# ^NoOLE
+"No OLE for: "
+# ^OutputFolder
+"Väljastatav kaust: "
+# ^RemoveFolder
+"Eemalda kaust: "
+# ^RenameOnReboot
+"Taaskäivitusel nimeta ümber: "
+# ^Rename
+"Nimeta ümber: "
+# ^Skipped
+"Vahele jäetud: "
+# ^CopyDetails
+Kopeeri detailid lõikelauale
+# ^LogInstall
+Logi paigaldusprotsess
+# ^Byte
+B
+# ^Kilo
+K
+# ^Mega
+M
+# ^Giga
+G
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Uzbek.nlf
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Uzbek.nlf	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/Uzbek.nlf	(revision 728)
@@ -0,0 +1,190 @@
+# Header, don't edit
+NLF v6
+# Language ID
+1091
+# Font and size - dash (-) means default
+-
+-
+# Codepage - dash (-) means ANSI code page
+1252
+# RTL - anything else than RTL means LTR
+-
+# Translation by Emil Garipov [emil.garipov@gmail.com]
+# ^Branding
+Nullsoft Install System %s
+# ^SetupCaption
+O'rnatish $(^Name)
+# ^UninstallCaption
+O'chirish $(^Name)
+# ^LicenseSubCaption
+: Lisenzion kelishuv
+# ^ComponentsSubCaption
+: O'rnatish parametrlari 
+# ^DirSubCaption
+: O'rnatish papkasi
+# ^InstallingSubCaption
+: Fayllarni kopiya qilish
+# ^CompletedSubCaption
+: Operatsiya yakunlandi
+# ^UnComponentsSubCaption
+: O'chirish parametrlari
+# ^UnDirSubCaption
+: O'chirsh papkasi
+# ^ConfirmSubCaption
+: Tasdiqlash
+# ^UninstallingSubCaption
+: Fayllarni o'chirish
+# ^UnCompletedSubCaption
+: Operatsiya yakunlandi
+# ^BackBtn
+< &Orqaga
+# ^NextBtn
+&Oldinga >
+# ^AgreeBtn
+&Qabul qilaman
+# ^AcceptBtn
+Men &kelishuv shartlarini qabul qilaman
+# ^DontAcceptBtn
+Men &kelishuv shartlarini qabul qilmayman
+# ^InstallBtn
+&O'rnatish
+# ^UninstallBtn
+&O'chirish
+# ^CancelBtn
+Bekor qilish
+# ^CloseBtn
+&Yopish
+# ^BrowseBtn
+&Ko'rish ...
+# ^ShowDetailsBtn
+&Äåòàëè...
+# ^ClickNext
+Davom etish uchun 'Oldinga'tugmachasini bosing.
+# ^ClickInstall
+Dasturni o'rnatish uchun'O'rnatish' tugmachasini bosing.
+# ^ClickUninstall
+Dasturni o'chirish uchun 'O'chirsh' tugmachasini bosing.
+# ^Name
+Ism
+# ^Completed
+Tayor
+# ^LicenseText
+$(^NameDA)ni o'rnatishdan oldin lisenzion kelishuv bilan tanishib oling. Kelishuv shartlarini qabul qilsangiz 'Qabul qilaman' tugmachasini bosing.
+# ^LicenseTextCB
+$(^NameDA)ni o'rnatishdan oldin lisenzion kelishuv bilan tanishib oling. Kelishuv shartlarini qabul qilsangiz bayroqchani joylashtiring. $_CLICK
+# ^LicenseTextRB
+$(^NameDA)ni o'rnatishdan oldin lisenzion kelishuv bilan tanishib oling. Kelishuv shartlarini qabul qilsangiz quyida taklif etilganlardan birinchi variantni tanlang. $_CLICK
+# ^UnLicenseText
+$(^NameDA)ni o'rnatishdan oldin lisenzion kelishuv bilan tanishib oling. Kelishuv shartlarini qabul qilsangiz 'Qabul qilaman' tugmachasini bosing.
+# ^UnLicenseTextCB
+$(^NameDA)ni o'rnatishdan oldin lisenzion kelishuv bilan tanishib oling. Kelishuv shartlarini qabul qilsangiz bayroqchani joylashtiring. $_CLICK
+# ^UnLicenseTextRB
+$(^NameDA)ni o'rnatishdan oldin lisenzion kelishuv bilan tanishib oling. Kelishuv shartlarini qabul qilsangiz quyida taklif etilganlardan birinchi variantni tanlang. $_CLICK
+# ^Custom
+Tanlash bo'icha
+# ^ComponentsText
+O'rnatish ucun dastur komponentlarini tanlang. $_CLICK
+# ^ComponentsSubText1
+O'rnatish jarayonini tanlang:
+# ^ComponentsSubText2_NoInstTypes
+O'rnatish uchun dastur komponentlarini tanlang:
+# ^ComponentsSubText2
+Yoki o'rnatish uchun qushimcha komponentlarini tanlang:
+# ^UnComponentsText
+O'chirish uchun dastur komponentlarini tanlang. $_CLICK
+# ^UnComponentsSubText1
+O'chirish jarayonini tanlang:
+# ^UnComponentsSubText2_NoInstTypes
+O'chirish uchun dastur komponentlarini tanlang:
+# ^UnComponentsSubText2
+Yoki o'chirish uchun qushimcha komponentlarini tanlang:
+# ^DirText
+Dastur $(^NameDA)ni ko'rsatilgan papkaga o'rnatadi. Boshqa papkaga o'rnatish uchun, 'Ko'rish'tugmachasini bosing va uni ko'rsatib bering. $_CLICK
+# ^DirSubText
+O'rnatish papkasi
+# ^DirBrowseText
+O'rnatish papkasini ko'rsating $(^NameDA):
+# ^UnDirText
+Dastur $(^NameDA)ni ko'rsatilgan papkadan o'chiradi. Boshqa papkaga o'rnatish uchun, 'Ko'rish'tugmachasini bosing va uni ko'rsatib bering. $_CLICK
+# ^UnDirSubText
+""
+# ^UnDirBrowseText
+$(^NameDA)ni o'chirish uchun papkani ko'rsating:
+# ^SpaceAvailable
+"Diskda joriy qilingan: "
+# ^SpaceRequired
+"Diskda talab qilinadigan: "
+# ^UninstallingText
+$(^NameDA) dasturi kompyuterizdan uchiriladi. $_CLICK
+# ^UninstallingSubText
+O'chirilish:
+# ^FileError
+Yozish uchun faylni ochish imkoniyati yuq: \r\n\t"$0"\r\n'Tuxtashish': O'rnatishni tuxtatish;\r\n"Takrorlash":yana bir o'rinib ko'rish;\r\n"Taylab ketish": shu xarakatni taylab ketish.
+# ^FileError_NoIgnore
+Yozish uchun faylni ochish imkoniyati yuq: \r\n\t"$0"\r\n'Takrorlash': yana bir o'rinib ko'rish;\r\n'Bekor qilish': o'rnatish protsessini bekor qilish.
+# ^CantWrite
+"Yozish uchun imkoniyat yuq: "
+# ^CopyFailed
+Kopiya qilganda xato bor
+# ^CopyTo
+"Kopiya qilish "
+# ^Registering
+"Ro'yxatga olish: "
+# ^Unregistering
+"Ro'xatdan chiqish: "
+# ^SymbolNotFound
+"Simvolni topish imkoniyati yuq: "
+# ^CouldNotLoad
+"Zagruzka qilish imkoniyati yuq: "
+# ^CreateFolder
+"Papkani yaratish: "
+# ^CreateShortcut
+"Belgini yaratish: "
+# ^CreatedUninstaller
+"O'chirish dasturini yaratish: "
+# ^Delete
+"Faylni o'chirish: "
+# ^DeleteOnReboot
+"Kompyuter qayta yuklash jaraonida o'chirish: "
+# ^ErrorCreatingShortcut
+"Belgini yaratish jarayonida xato: " 
+# ^ErrorCreating
+"Yaratish xatosi: "
+# ^ErrorDecompressing
+Ma'lumotlarni asilga qaytarish xatosi! Distributiv ziyonlangan bulishi mumkin.
+# ^ErrorRegistering
+Kutubxonani ro'xatga olish imkoniyati yuq (DLL)
+# ^ExecShell
+"Qoplang'ich komandasini bajarish: " 
+# ^Exec
+"Bajarish: "
+# ^Extract
+"Ichidan olish: "
+# ^ErrorWriting
+"Ichidan olish: fayl yozish xatosi "
+# ^InvalidOpcode
+Distributiv ziyonlangan: ruxsatlanmangan kod
+# ^NoOLE
+"Quydagilarga OLE yuq: " 
+# ^OutputFolder
+"Papkani o'rnatish: "
+# ^RemoveFolder
+"Papkani o'chirish: "
+# ^RenameOnReboot
+"Kompyuter qayta yuklanish jarayonida ismni qaita quyish: "
+# ^Rename
+"Ismni qayta quyish: "
+# ^Skipped
+"O'tkazib yuborish: "
+# ^CopyDetails
+Bufer obmenaga ma'lumotlarni kopiya qilish
+# ^LogInstall
+O'rnatish xisobotini chiqorish
+# byte
+áàéò
+# kilo
+ Ê
+# mega
+ Ì
+# giga
+ Ã
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/Language files/German.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/Language files/German.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/Language files/German.nsh	(revision 728)
@@ -0,0 +1,129 @@
+;Language: German (1031)
+;By L.King, changes by K. Windszus & R. Bisswanger & M. Simmack & D. Weiß
+
+!insertmacro LANGFILE "German" "Deutsch"
+
+!ifdef MUI_WELCOMEPAGE
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Willkommen beim Installations-$\r$\nAssistenten für $(^NameDA)"
+  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Dieser Assistent wird Sie durch die Installation von $(^NameDA) begleiten.$\r$\n$\r$\nEs wird empfohlen, vor der Installation alle anderen Programme zu schließen, damit bestimmte Systemdateien ohne Neustart ersetzt werden können.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_UNWELCOMEPAGE
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "Willkommen beim Deinstallations-$\r$\nAssistenten für $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Dieser Assistent wird Sie durch die Deinstallation von $(^NameDA) begleiten.$\r$\n$\r$\nBitte beenden Sie $(^NameDA), bevor Sie mit der Deinstallation fortfahren.$\r$\n$\r$\n$_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE
+  ${LangFileString} MUI_TEXT_LICENSE_TITLE "Lizenzabkommen"
+  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Bitte lesen Sie die Lizenzbedingungen durch, bevor Sie mit der Installation fortfahren."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "Falls Sie alle Bedingungen des Abkommens akzeptieren, klicken Sie auf Annehmen. Sie müssen die Lizenzvereinbarungen anerkennen, um $(^NameDA) installieren zu können."
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "Falls Sie alle Bedingungen des Abkommens akzeptieren, aktivieren Sie das Kästchen. Sie müssen die Lizenzvereinbarungen anerkennen, um $(^NameDA) installieren zu können. $_CLICK"
+  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Falls Sie alle Bedingungen des Abkommens akzeptieren, wählen Sie unten die entsprechende Option. Sie müssen die Lizenzvereinbarungen anerkennen, um $(^NameDA) installieren zu können. $_CLICK"
+!endif
+
+!ifdef MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE "Lizenzabkommen"
+  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "Bitte lesen Sie die Lizenzbedingungen durch, bevor Sie mit der Deinstallation von $(^NameDA) fortfahren."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "Falls Sie alle Bedingungen des Abkommens akzeptieren, klicken Sie auf Annehmen. Sie müssen die Lizenzvereinbarungen anerkennen, um $(^NameDA) deinstallieren zu können."
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "Falls Sie alle Bedingungen des Abkommens akzeptieren, aktivieren Sie das Kästchen. Sie müssen die Lizenzvereinbarungen anerkennen, um $(^NameDA) deinstallieren zu können. $_CLICK"
+  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "Falls Sie alle Bedingungen des Abkommens akzeptieren, wählen Sie unten die entsprechende Option. Sie müssen die Lizenzvereinbarungen anerkennen, um $(^NameDA) deinstallieren zu können. $_CLICK"
+!endif
+
+!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
+  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP "Drücken Sie die Bild-nach-unten Taste, um den Rest des Abkommens zu sehen."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE
+  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE "Komponenten auswählen"
+  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "Wählen Sie die Komponenten aus, die Sie installieren möchten."
+!endif
+
+!ifdef MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "Komponenten auswählen"
+  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "Wählen Sie die Komponenten aus, die Sie entfernen möchten."
+!endif
+
+!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
+  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "Beschreibung"
+  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Bewegen Sie den Mauszeiger über eine Komponente, um ihre Beschreibung zu sehen."
+  !else
+    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "Bewegen Sie den Mauszeiger über eine Komponente, um ihre Beschreibung zu sehen."
+  !endif
+!endif
+
+!ifdef MUI_DIRECTORYPAGE
+  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE "Zielverzeichnis auswählen"
+  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE "Wählen Sie das Verzeichnis aus, in das $(^NameDA) installiert werden soll."
+!endif
+
+!ifdef MUI_UNDIRECTORYPAGE
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE "Verzeichnis für Deinstallation auswählen"
+  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE "Wählen Sie das Verzeichnis aus, aus dem $(^NameDA) entfernt werden soll."
+!endif
+
+!ifdef MUI_INSTFILESPAGE
+  ${LangFileString} MUI_TEXT_INSTALLING_TITLE "Installiere..."
+  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Bitte warten Sie, während $(^NameDA) installiert wird."
+  ${LangFileString} MUI_TEXT_FINISH_TITLE "Die Installation ist vollständig"
+  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "Die Installation wurde erfolgreich abgeschlossen."
+  ${LangFileString} MUI_TEXT_ABORT_TITLE "Abbruch der Installation"
+  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "Die Installation wurde nicht vollständig abgeschlossen."
+!endif
+
+!ifdef MUI_UNINSTFILESPAGE
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Deinstalliere..."
+  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Bitte warten Sie, während $(^NameDA) entfernt wird."
+  ${LangFileString} MUI_UNTEXT_FINISH_TITLE "Die Deinstallation ist vollständig"
+  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "Die Deinstallation wurde erfolgreich abgeschlossen."
+  ${LangFileString} MUI_UNTEXT_ABORT_TITLE "Abbruch der Deinstallation"
+  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "Die Deinstallation wurde nicht vollständig abgeschlossen."
+!endif
+
+!ifdef MUI_FINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "Die Installation von $(^NameDA) wird abgeschlossen"
+  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) wurde auf Ihrem Computer installiert.$\r$\n$\r$\nKlicken Sie auf Fertig stellen, um den Installations-Assistenten zu schließen."
+  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Windows muss neu gestartet werden, um die Installation von $(^NameDA) zu vervollständigen. Möchten Sie Windows jetzt neu starten?"
+!endif
+
+!ifdef MUI_UNFINISHPAGE
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "Die Deinstallation von $(^NameDA) wird abgeschlossen"
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) ist von Ihrem Computer entfernt worden.$\r$\n$\r$\nKlicken Sie auf Fertig stellen, um den Assistenten zu schließen."
+  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "Windows muss neu gestartet werden, um die Deinstallation von $(^NameDA) zu vervollständigen. Möchten Sie Windows jetzt neu starten?"
+!endif
+
+!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "Jetzt neu starten"
+  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Windows später selbst neu starten"
+  ${LangFileString} MUI_TEXT_FINISH_RUN "$(^NameDA) ausführen"
+  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Liesmich anzeigen"
+  ${LangFileString} MUI_BUTTONTEXT_FINISH "&Fertig stellen"  
+!endif
+
+!ifdef MUI_STARTMENUPAGE
+  ${LangFileString} MUI_TEXT_STARTMENU_TITLE "Startmenü-Ordner bestimmen"
+  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE "Bestimmen Sie einen Startmenü-Ordner für die Programmverknüpfungen."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP "Wählen Sie den Startmenü-Ordner für die Programmverknüpfungen aus. Falls Sie einen neuen Ordner erstellen möchten, geben Sie dessen Namen ein."
+  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX "Keine Verknüpfungen erstellen"
+!endif
+
+!ifdef MUI_UNCONFIRMPAGE
+  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "Deinstallation von $(^NameDA)"
+  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "$(^NameDA) wird von Ihrem Computer entfernt."
+!endif
+
+!ifdef MUI_ABORTWARNING
+  ${LangFileString} MUI_TEXT_ABORTWARNING "Sind Sie sicher, dass Sie die Installation von $(^Name) abbrechen wollen?"
+!endif
+
+!ifdef MUI_UNABORTWARNING
+  ${LangFileString} MUI_UNTEXT_ABORTWARNING "Sind Sie sicher, dass Sie die Deinstallation von $(^Name) abbrechen möchten?"
+!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "Benutzer auswählen"
+  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "Wählen Sie die Benutzer aus, für die Sie $(^NameDA) installieren wollen."
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "Wählen Sie aus, ob Sie $(^NameDA) nur für den eigenen Gebrauch oder für die Nutzung durch alle Benutzer dieses Systems installieren möchten. $(^ClickNext)"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "Installation für alle Benutzer dieses Computers"
+  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Installation nur für mich"
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Contrib/zip2exe/Classic.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/zip2exe/Classic.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/zip2exe/Classic.nsh	(revision 728)
@@ -0,0 +1,4 @@
+;Change this file to customize zip2exe generated installers with a classic interface
+
+Page directory
+Page instfiles
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/zip2exe/Modern.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/zip2exe/Modern.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/zip2exe/Modern.nsh	(revision 728)
@@ -0,0 +1,8 @@
+;Change this file to customize zip2exe generated installers with a modern interface
+
+!include "MUI.nsh"
+
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES
+
+!insertmacro MUI_LANGUAGE "English"
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Contrib/zip2exe/Base.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Contrib/zip2exe/Base.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Contrib/zip2exe/Base.nsh	(revision 728)
@@ -0,0 +1,87 @@
+;Change this file to customize zip2exe generated installers
+
+Name "${ZIP2EXE_NAME}"
+OutFile "${ZIP2EXE_OUTFILE}"
+
+AllowRootDirInstall true
+
+
+!ifdef ZIP2EXE_COMPRESSOR_SOLID
+  !define SETCOMPRESSOR_SWITCH /SOLID
+!else
+  !define SETCOMPRESSOR_SWITCH
+!endif
+
+!ifdef ZIP2EXE_COMPRESSOR_ZLIB
+  SetCompressor ${SETCOMPRESSOR_SWITCH} zlib
+!else ifdef ZIP2EXE_COMPRESSOR_BZIP2
+  SetCompressor ${SETCOMPRESSOR_SWITCH} bzip2
+!else ifdef ZIP2EXE_COMPRESSOR_LZMA
+  SetCompressor ${SETCOMPRESSOR_SWITCH} lzma
+!endif
+
+!ifdef ZIP2EXE_INSTALLDIR
+
+  InstallDir "${ZIP2EXE_INSTALLDIR}"
+
+  Function zip2exe.SetOutPath
+    SetOutPath "$INSTDIR"
+  FunctionEnd
+
+!else ifdef ZIP2EXE_INSTALLDIR_WINAMP
+
+  InstallDir "$PROGRAMFILES\Winamp"
+  InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" "UninstallString"
+
+  Function .onVerifyInstDir
+    IfFileExists $INSTDIR\winamp.exe WinampInstalled
+      Abort
+    WinampInstalled:
+  FunctionEnd
+
+  !ifdef ZIP2EXE_INSTALLDIR_WINAMPMODE
+ 
+    Var ZIP2EXE_TEMP1
+    Var ZIP2EXE_TEMP2
+
+    Function zip2exe.SetOutPath
+       !ifdef ZIP2EXE_INSTALLDIR_SKINS
+         StrCpy $ZIP2EXE_TEMP1 "$INSTDIR\Skins"
+       !else
+         StrCpy $ZIP2EXE_TEMP1 "$INSTDIR\Plugins"
+       !endif
+       ReadINIStr $ZIP2EXE_TEMP2 "$INSTDIR\winamp.ini" "Winamp" "${ZIP2EXE_INSTALLDIR_WINAMPMODE}"
+         StrCmp $ZIP2EXE_TEMP2 "" End
+         IfFileExists $ZIP2EXE_TEMP2 0 End
+         StrCpy $ZIP2EXE_TEMP1 $ZIP2EXE_TEMP2
+       End:
+         SetOutPath $ZIP2EXE_TEMP1
+    FunctionEnd
+
+  !else
+
+    Function zip2exe.SetOutPath
+      !ifdef ZIP2EXE_INSTALLDIR_PLUGINS
+        SetOutPath "$INSTDIR\Plugins"
+      !else
+        SetOutPath "$INSTDIR"
+      !endif
+    FunctionEnd
+
+  !endif
+
+!endif
+
+!macro SECTION_BEGIN
+
+  Section ""
+  
+    Call zip2exe.SetOutPath
+  
+!macroend
+
+!macro SECTION_END
+
+  SectionEnd
+  
+!macroend
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Stubs/bzip2_solid
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Stubs/bzip2_solid
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Stubs/uninst
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Stubs/uninst
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Stubs/zlib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Stubs/zlib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Stubs/lzma
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Stubs/lzma
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Stubs/bzip2
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Stubs/bzip2
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Stubs/zlib_solid
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Stubs/zlib_solid
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Stubs/lzma_solid
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Stubs/lzma_solid
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/AccessControl.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/AccessControl.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/Banner.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/Banner.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/TypeLib.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/TypeLib.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/LangDLL.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/LangDLL.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/InstallOptions.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/InstallOptions.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/StartMenu.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/StartMenu.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/nsDialogs.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/nsDialogs.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/System.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/System.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/nsExec.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/nsExec.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/AdvSplash.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/AdvSplash.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/VPatch.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/VPatch.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/Math.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/Math.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/Splash.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/Splash.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/UserInfo.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/UserInfo.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/BgImage.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/BgImage.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/NSISdl.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/NSISdl.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Plugins/Dialer.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Plugins/Dialer.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/makensisw.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/makensisw.exe
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/NSIS.chm
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/NSIS.chm
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Include/InstallOptions.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/InstallOptions.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/InstallOptions.nsh	(revision 728)
@@ -0,0 +1,240 @@
+/*
+
+InstallOptions.nsh
+Macros and conversion functions for InstallOptions
+
+*/
+
+!ifndef ___NSIS__INSTALL_OPTIONS__NSH___
+!define ___NSIS__INSTALL_OPTIONS__NSH___
+
+!include LogicLib.nsh
+
+!macro INSTALLOPTIONS_FUNCTION_READ_CONVERT
+  !insertmacro INSTALLOPTIONS_FUNCTION_IO2NSIS ""
+!macroend
+
+!macro INSTALLOPTIONS_UNFUNCTION_READ_CONVERT
+  !insertmacro INSTALLOPTIONS_FUNCTION_IO2NSIS un.
+!macroend
+
+!macro INSTALLOPTIONS_FUNCTION_WRITE_CONVERT
+  !insertmacro INSTALLOPTIONS_FUNCTION_NSIS2IO ""
+!macroend
+
+!macro INSTALLOPTIONS_UNFUNCTION_WRITE_CONVERT
+  !insertmacro INSTALLOPTIONS_FUNCTION_NSIS2IO un.
+!macroend
+
+!macro INSTALLOPTIONS_FUNCTION_NSIS2IO UNINSTALLER_FUNCPREFIX
+
+  ; Convert an NSIS string to a form suitable for use by InstallOptions
+  ; Usage:
+  ;   Push <NSIS-string>
+  ;   Call Nsis2Io
+  ;   Pop <IO-string>
+
+  Function ${UNINSTALLER_FUNCPREFIX}Nsis2Io
+
+    Exch $0 ; The source
+    Push $1 ; The output
+    Push $2 ; Temporary char
+    Push $3 ; Length
+    Push $4 ; Loop index
+    StrCpy $1 "" ; Initialise the output
+
+    StrLen $3 $0
+    IntOp $3 $3 - 1
+
+    ${For} $4 0 $3
+      StrCpy $2 $0 1 $4
+      ${If}     $2 == '\'
+        StrCpy $2 '\\'
+      ${ElseIf} $2 == '$\r'
+        StrCpy $2 '\r'
+      ${ElseIf} $2 == '$\n'
+        StrCpy $2 '\n'
+      ${ElseIf} $2 == '$\t'
+        StrCpy $2 '\t'
+      ${EndIf}
+      StrCpy $1 $1$2
+    ${Next}
+
+    StrCpy $0 $1
+    Pop $4
+    Pop $3
+    Pop $2
+    Pop $1
+    Exch $0
+
+  FunctionEnd
+
+!macroend
+
+!macro INSTALLOPTIONS_FUNCTION_IO2NSIS UNINSTALLER_FUNCPREFIX
+
+  ; Convert an InstallOptions string to a form suitable for use by NSIS
+  ; Usage:
+  ;   Push <IO-string>
+  ;   Call Io2Nsis
+  ;   Pop <NSIS-string>
+
+  Function ${UNINSTALLER_FUNCPREFIX}Io2Nsis
+
+    Exch $0 ; The source
+    Push $1 ; The output
+    Push $2 ; Temporary char
+    Push $3 ; Length
+    Push $4 ; Loop index
+    StrCpy $1 "" ; Initialise the output
+
+    StrLen $3 $0
+    IntOp $3 $3 - 1
+
+    ${For} $4 0 $3
+      StrCpy $2 $0 2 $4
+      ${If}     $2 == '\\'
+        StrCpy $2 '\'
+        IntOp $4 $4 + 1
+      ${ElseIf} $2 == '\r'
+        StrCpy $2 '$\r'
+        IntOp $4 $4 + 1
+      ${ElseIf} $2 == '\n'
+        StrCpy $2 '$\n'
+        IntOp $4 $4 + 1
+      ${ElseIf} $2 == '\t'
+        StrCpy $2 '$\t'
+        IntOp $4 $4 + 1
+      ${EndIf}
+      StrCpy $2 $2 1
+      StrCpy $1 $1$2
+    ${Next}
+
+    StrCpy $0 $1
+    Pop $4
+    Pop $3
+    Pop $2
+    Pop $1
+    Exch $0
+
+  FunctionEnd
+
+!macroend
+
+!macro INSTALLOPTIONS_EXTRACT FILE
+
+  InitPluginsDir
+  File "/oname=$PLUGINSDIR\${FILE}" "${FILE}"
+  !insertmacro INSTALLOPTIONS_WRITE "${FILE}" "Settings" "RTL" "$(^RTL)"
+
+  !verbose pop
+
+!macroend
+
+!macro INSTALLOPTIONS_EXTRACT_AS FILE FILENAME
+
+  InitPluginsDir
+  File "/oname=$PLUGINSDIR\${FILENAME}" "${FILE}"
+  !insertmacro INSTALLOPTIONS_WRITE "${FILENAME}" "Settings" "RTL" "$(^RTL)"
+
+!macroend
+
+!macro INSTALLOPTIONS_DISPLAY FILE
+
+  Push $0
+
+  InstallOptions::dialog "$PLUGINSDIR\${FILE}"
+  Pop $0
+
+  Pop $0
+
+!macroend
+
+!macro INSTALLOPTIONS_DISPLAY_RETURN FILE
+
+  InstallOptions::dialog "$PLUGINSDIR\${FILE}"
+
+!macroend
+
+!macro INSTALLOPTIONS_INITDIALOG FILE
+
+  InstallOptions::initDialog "$PLUGINSDIR\${FILE}"
+
+!macroend
+
+!macro INSTALLOPTIONS_SHOW
+
+  Push $0
+
+  InstallOptions::show
+  Pop $0
+
+  Pop $0
+
+!macroend
+
+!macro INSTALLOPTIONS_SHOW_RETURN
+
+  InstallOptions::show
+
+!macroend
+
+!macro INSTALLOPTIONS_READ VAR FILE SECTION KEY
+
+  ReadIniStr ${VAR} "$PLUGINSDIR\${FILE}" "${SECTION}" "${KEY}"
+
+!macroend
+
+!macro INSTALLOPTIONS_WRITE FILE SECTION KEY VALUE
+
+  WriteIniStr "$PLUGINSDIR\${FILE}" "${SECTION}" "${KEY}" "${VALUE}"
+
+!macroend
+
+!macro INSTALLOPTIONS_READ_CONVERT VAR FILE SECTION KEY
+
+  ReadIniStr ${VAR} "$PLUGINSDIR\${FILE}" "${SECTION}" "${KEY}"
+  Push ${VAR}
+  Call Io2Nsis
+  Pop ${VAR}
+
+!macroend
+
+!macro INSTALLOPTIONS_READ_UNCONVERT VAR FILE SECTION KEY
+
+  ReadIniStr ${VAR} "$PLUGINSDIR\${FILE}" "${SECTION}" "${KEY}"
+  Push ${VAR}
+  Call un.Io2Nsis
+  Pop ${VAR}
+
+!macroend
+
+!macro INSTALLOPTIONS_WRITE_CONVERT FILE SECTION KEY VALUE
+
+  Push $0
+  StrCpy $0 "${VALUE}"
+  Push $0
+  Call Nsis2Io
+  Pop $0
+  
+  WriteIniStr "$PLUGINSDIR\${FILE}" "${SECTION}" "${KEY}" $0
+
+  Pop $0
+
+!macroend
+  
+!macro INSTALLOPTIONS_WRITE_UNCONVERT FILE SECTION KEY VALUE
+
+  Push $0
+  StrCpy $0 "${VALUE}"
+  Push $0
+  Call un.Nsis2Io
+  Pop $0
+  
+  WriteIniStr "$PLUGINSDIR\${FILE}" "${SECTION}" "${KEY}" $0
+
+  Pop $0
+
+!macroend
+
+!endif # ___NSIS__INSTALL_OPTIONS__NSH___
Index: tmp/trunk/org.txm.setups/nsis/Include/nsDialogs.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/nsDialogs.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/nsDialogs.nsh	(revision 728)
@@ -0,0 +1,860 @@
+/*
+
+nsDialogs.nsh
+Header file for creating custom installer pages with nsDialogs
+
+*/
+
+!ifndef NSDIALOGS_INCLUDED
+!define NSDIALOGS_INCLUDED
+!verbose push
+!verbose 3
+
+!include LogicLib.nsh
+!include WinMessages.nsh
+
+!define WS_EX_DLGMODALFRAME  0x00000001
+!define WS_EX_NOPARENTNOTIFY 0x00000004
+!define WS_EX_TOPMOST        0x00000008
+!define WS_EX_ACCEPTFILES    0x00000010
+!define WS_EX_TRANSPARENT    0x00000020
+!define WS_EX_MDICHILD       0x00000040
+!define WS_EX_TOOLWINDOW     0x00000080
+!define WS_EX_WINDOWEDGE     0x00000100
+!define WS_EX_CLIENTEDGE     0x00000200
+!define WS_EX_CONTEXTHELP    0x00000400
+!define WS_EX_RIGHT          0x00001000
+!define WS_EX_LEFT           0x00000000
+!define WS_EX_RTLREADING     0x00002000
+!define WS_EX_LTRREADING     0x00000000
+!define WS_EX_LEFTSCROLLBAR  0x00004000
+!define WS_EX_RIGHTSCROLLBAR 0x00000000
+!define WS_EX_CONTROLPARENT  0x00010000
+!define WS_EX_STATICEDGE     0x00020000
+!define WS_EX_APPWINDOW      0x00040000
+
+!define WS_CHILD             0x40000000
+!define WS_VISIBLE           0x10000000
+!define WS_DISABLED          0x08000000
+!define WS_CLIPSIBLINGS      0x04000000
+!define WS_CLIPCHILDREN      0x02000000
+!define WS_MAXIMIZE          0x01000000
+!define WS_VSCROLL           0x00200000
+!define WS_HSCROLL           0x00100000
+!define WS_GROUP             0x00020000
+!define WS_TABSTOP           0x00010000
+
+!define ES_LEFT              0x00000000
+!define ES_CENTER            0x00000001
+!define ES_RIGHT             0x00000002
+!define ES_MULTILINE         0x00000004
+!define ES_UPPERCASE         0x00000008
+!define ES_LOWERCASE         0x00000010
+!define ES_PASSWORD          0x00000020
+!define ES_AUTOVSCROLL       0x00000040
+!define ES_AUTOHSCROLL       0x00000080
+!define ES_NOHIDESEL         0x00000100
+!define ES_OEMCONVERT        0x00000400
+!define ES_READONLY          0x00000800
+!define ES_WANTRETURN        0x00001000
+!define ES_NUMBER            0x00002000
+
+!define SS_LEFT              0x00000000
+!define SS_CENTER            0x00000001
+!define SS_RIGHT             0x00000002
+!define SS_ICON              0x00000003
+!define SS_BLACKRECT         0x00000004
+!define SS_GRAYRECT          0x00000005
+!define SS_WHITERECT         0x00000006
+!define SS_BLACKFRAME        0x00000007
+!define SS_GRAYFRAME         0x00000008
+!define SS_WHITEFRAME        0x00000009
+!define SS_USERITEM          0x0000000A
+!define SS_SIMPLE            0x0000000B
+!define SS_LEFTNOWORDWRAP    0x0000000C
+!define SS_OWNERDRAW         0x0000000D
+!define SS_BITMAP            0x0000000E
+!define SS_ENHMETAFILE       0x0000000F
+!define SS_ETCHEDHORZ        0x00000010
+!define SS_ETCHEDVERT        0x00000011
+!define SS_ETCHEDFRAME       0x00000012
+!define SS_TYPEMASK          0x0000001F
+!define SS_REALSIZECONTROL   0x00000040
+!define SS_NOPREFIX          0x00000080
+!define SS_NOTIFY            0x00000100
+!define SS_CENTERIMAGE       0x00000200
+!define SS_RIGHTJUST         0x00000400
+!define SS_REALSIZEIMAGE     0x00000800
+!define SS_SUNKEN            0x00001000
+!define SS_EDITCONTROL       0x00002000
+!define SS_ENDELLIPSIS       0x00004000
+!define SS_PATHELLIPSIS      0x00008000
+!define SS_WORDELLIPSIS      0x0000C000
+!define SS_ELLIPSISMASK      0x0000C000
+
+!define BS_PUSHBUTTON        0x00000000
+!define BS_DEFPUSHBUTTON     0x00000001
+!define BS_CHECKBOX          0x00000002
+!define BS_AUTOCHECKBOX      0x00000003
+!define BS_RADIOBUTTON       0x00000004
+!define BS_3STATE            0x00000005
+!define BS_AUTO3STATE        0x00000006
+!define BS_GROUPBOX          0x00000007
+!define BS_USERBUTTON        0x00000008
+!define BS_AUTORADIOBUTTON   0x00000009
+!define BS_PUSHBOX           0x0000000A
+!define BS_OWNERDRAW         0x0000000B
+!define BS_TYPEMASK          0x0000000F
+!define BS_LEFTTEXT          0x00000020
+!define BS_TEXT              0x00000000
+!define BS_ICON              0x00000040
+!define BS_BITMAP            0x00000080
+!define BS_LEFT              0x00000100
+!define BS_RIGHT             0x00000200
+!define BS_CENTER            0x00000300
+!define BS_TOP               0x00000400
+!define BS_BOTTOM            0x00000800
+!define BS_VCENTER           0x00000C00
+!define BS_PUSHLIKE          0x00001000
+!define BS_MULTILINE         0x00002000
+!define BS_NOTIFY            0x00004000
+!define BS_FLAT              0x00008000
+!define BS_RIGHTBUTTON       ${BS_LEFTTEXT}
+
+!define CBS_SIMPLE            0x0001
+!define CBS_DROPDOWN          0x0002
+!define CBS_DROPDOWNLIST      0x0003
+!define CBS_OWNERDRAWFIXED    0x0010
+!define CBS_OWNERDRAWVARIABLE 0x0020
+!define CBS_AUTOHSCROLL       0x0040
+!define CBS_OEMCONVERT        0x0080
+!define CBS_SORT              0x0100
+!define CBS_HASSTRINGS        0x0200
+!define CBS_NOINTEGRALHEIGHT  0x0400
+!define CBS_DISABLENOSCROLL   0x0800
+!define CBS_UPPERCASE         0x2000
+!define CBS_LOWERCASE         0x4000
+
+!define LBS_NOTIFY            0x0001
+!define LBS_SORT              0x0002
+!define LBS_NOREDRAW          0x0004
+!define LBS_MULTIPLESEL       0x0008
+!define LBS_OWNERDRAWFIXED    0x0010
+!define LBS_OWNERDRAWVARIABLE 0x0020
+!define LBS_HASSTRINGS        0x0040
+!define LBS_USETABSTOPS       0x0080
+!define LBS_NOINTEGRALHEIGHT  0x0100
+!define LBS_MULTICOLUMN       0x0200
+!define LBS_WANTKEYBOARDINPUT 0x0400
+!define LBS_EXTENDEDSEL       0x0800
+!define LBS_DISABLENOSCROLL   0x1000
+!define LBS_NODATA            0x2000
+!define LBS_NOSEL             0x4000
+!define LBS_COMBOBOX          0x8000
+
+!define LR_DEFAULTCOLOR     0x0000
+!define LR_MONOCHROME       0x0001
+!define LR_COLOR            0x0002
+!define LR_COPYRETURNORG    0x0004
+!define LR_COPYDELETEORG    0x0008
+!define LR_LOADFROMFILE     0x0010
+!define LR_LOADTRANSPARENT  0x0020
+!define LR_DEFAULTSIZE      0x0040
+!define LR_VGACOLOR         0x0080
+!define LR_LOADMAP3DCOLORS  0x1000
+!define LR_CREATEDIBSECTION 0x2000
+!define LR_COPYFROMRESOURCE 0x4000
+!define LR_SHARED           0x8000
+
+!define IMAGE_BITMAP        0
+!define IMAGE_ICON          1
+!define IMAGE_CURSOR        2
+!define IMAGE_ENHMETAFILE   3
+
+!define GWL_STYLE           -16
+!define GWL_EXSTYLE         -20
+
+!define DEFAULT_STYLES ${WS_CHILD}|${WS_VISIBLE}|${WS_CLIPSIBLINGS}
+
+!define __NSD_HLine_CLASS STATIC
+!define __NSD_HLine_STYLE ${DEFAULT_STYLES}|${SS_ETCHEDHORZ}|${SS_SUNKEN}
+!define __NSD_HLine_EXSTYLE ${WS_EX_TRANSPARENT}
+
+!define __NSD_VLine_CLASS STATIC
+!define __NSD_VLine_STYLE ${DEFAULT_STYLES}|${SS_ETCHEDVERT}|${SS_SUNKEN}
+!define __NSD_VLine_EXSTYLE ${WS_EX_TRANSPARENT}
+
+!define __NSD_Label_CLASS STATIC
+!define __NSD_Label_STYLE ${DEFAULT_STYLES}|${SS_NOTIFY}
+!define __NSD_Label_EXSTYLE ${WS_EX_TRANSPARENT}
+
+!define __NSD_Icon_CLASS STATIC
+!define __NSD_Icon_STYLE ${DEFAULT_STYLES}|${SS_ICON}|${SS_NOTIFY}
+!define __NSD_Icon_EXSTYLE 0
+
+!define __NSD_Bitmap_CLASS STATIC
+!define __NSD_Bitmap_STYLE ${DEFAULT_STYLES}|${SS_BITMAP}|${SS_NOTIFY}
+!define __NSD_Bitmap_EXSTYLE 0
+
+!define __NSD_BrowseButton_CLASS BUTTON
+!define __NSD_BrowseButton_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}
+!define __NSD_BrowseButton_EXSTYLE 0
+
+!define __NSD_Link_CLASS LINK
+!define __NSD_Link_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${BS_OWNERDRAW}
+!define __NSD_Link_EXSTYLE 0
+
+!define __NSD_Button_CLASS BUTTON
+!define __NSD_Button_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}
+!define __NSD_Button_EXSTYLE 0
+
+!define __NSD_GroupBox_CLASS BUTTON
+!define __NSD_GroupBox_STYLE ${DEFAULT_STYLES}|${BS_GROUPBOX}
+!define __NSD_GroupBox_EXSTYLE ${WS_EX_TRANSPARENT}
+
+!define __NSD_CheckBox_CLASS BUTTON
+!define __NSD_CheckBox_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${BS_TEXT}|${BS_VCENTER}|${BS_AUTOCHECKBOX}|${BS_MULTILINE}
+!define __NSD_CheckBox_EXSTYLE 0
+
+!define __NSD_RadioButton_CLASS BUTTON
+!define __NSD_RadioButton_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${BS_TEXT}|${BS_VCENTER}|${BS_AUTORADIOBUTTON}|${BS_MULTILINE}
+!define __NSD_RadioButton_EXSTYLE 0
+
+!define __NSD_Text_CLASS EDIT
+!define __NSD_Text_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}
+!define __NSD_Text_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
+
+!define __NSD_Password_CLASS EDIT
+!define __NSD_Password_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_PASSWORD}
+!define __NSD_Password_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
+
+!define __NSD_Number_CLASS EDIT
+!define __NSD_Number_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_NUMBER}
+!define __NSD_Number_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
+
+!define __NSD_FileRequest_CLASS EDIT
+!define __NSD_FileRequest_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}
+!define __NSD_FileRequest_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
+
+!define __NSD_DirRequest_CLASS EDIT
+!define __NSD_DirRequest_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}
+!define __NSD_DirRequest_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
+
+!define __NSD_ComboBox_CLASS COMBOBOX
+!define __NSD_ComboBox_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${WS_VSCROLL}|${WS_CLIPCHILDREN}|${CBS_AUTOHSCROLL}|${CBS_HASSTRINGS}|${CBS_DROPDOWN}
+!define __NSD_ComboBox_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
+
+!define __NSD_DropList_CLASS COMBOBOX
+!define __NSD_DropList_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${WS_VSCROLL}|${WS_CLIPCHILDREN}|${CBS_AUTOHSCROLL}|${CBS_HASSTRINGS}|${CBS_DROPDOWNLIST}
+!define __NSD_DropList_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
+
+!define __NSD_ListBox_CLASS LISTBOX
+!define __NSD_ListBox_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${WS_VSCROLL}|${LBS_DISABLENOSCROLL}|${LBS_HASSTRINGS}|${LBS_NOINTEGRALHEIGHT}|${LBS_NOTIFY}
+!define __NSD_ListBox_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
+
+!define __NSD_ProgressBar_CLASS msctls_progress32
+!define __NSD_ProgressBar_STYLE ${DEFAULT_STYLES}
+!define __NSD_ProgressBar_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
+
+!macro __NSD_DefineControl NAME
+
+	!define NSD_Create${NAME} "nsDialogs::CreateControl ${__NSD_${Name}_CLASS} ${__NSD_${Name}_STYLE} ${__NSD_${Name}_EXSTYLE}"
+
+!macroend
+
+!insertmacro __NSD_DefineControl HLine
+!insertmacro __NSD_DefineControl VLine
+!insertmacro __NSD_DefineControl Label
+!insertmacro __NSD_DefineControl Icon
+!insertmacro __NSD_DefineControl Bitmap
+!insertmacro __NSD_DefineControl BrowseButton
+!insertmacro __NSD_DefineControl Link
+!insertmacro __NSD_DefineControl Button
+!insertmacro __NSD_DefineControl GroupBox
+!insertmacro __NSD_DefineControl CheckBox
+!insertmacro __NSD_DefineControl RadioButton
+!insertmacro __NSD_DefineControl Text
+!insertmacro __NSD_DefineControl Password
+!insertmacro __NSD_DefineControl Number
+!insertmacro __NSD_DefineControl FileRequest
+!insertmacro __NSD_DefineControl DirRequest
+!insertmacro __NSD_DefineControl ComboBox
+!insertmacro __NSD_DefineControl DropList
+!insertmacro __NSD_DefineControl ListBox
+!insertmacro __NSD_DefineControl ProgressBar
+
+!macro __NSD_OnControlEvent EVENT HWND FUNCTION
+
+	Push $0
+	Push $1
+
+	StrCpy $1 "${HWND}"
+
+	GetFunctionAddress $0 "${FUNCTION}"
+	nsDialogs::On${EVENT} $1 $0
+
+	Pop $1
+	Pop $0
+
+!macroend
+
+!macro __NSD_DefineControlCallback EVENT
+
+	!define NSD_On${EVENT} `!insertmacro __NSD_OnControlEvent ${EVENT}`
+
+!macroend
+
+!macro __NSD_OnDialogEvent EVENT FUNCTION
+
+	Push $0
+
+	GetFunctionAddress $0 "${FUNCTION}"
+	nsDialogs::On${EVENT} $0
+
+	Pop $0
+
+!macroend
+
+!macro __NSD_DefineDialogCallback EVENT
+
+	!define NSD_On${EVENT} `!insertmacro __NSD_OnDialogEvent ${EVENT}`
+
+!macroend
+
+!insertmacro __NSD_DefineControlCallback Click
+!insertmacro __NSD_DefineControlCallback Change
+!insertmacro __NSD_DefineControlCallback Notify
+!insertmacro __NSD_DefineDialogCallback Back
+
+!macro _NSD_CreateTimer FUNCTION INTERVAL
+
+	Push $0
+
+	GetFunctionAddress $0 "${FUNCTION}"
+	nsDialogs::CreateTimer $0 "${INTERVAL}"
+
+	Pop $0
+
+!macroend
+
+!define NSD_CreateTimer `!insertmacro _NSD_CreateTimer`
+
+!macro _NSD_KillTimer FUNCTION
+
+	Push $0
+
+	GetFunctionAddress $0 "${FUNCTION}"
+	nsDialogs::KillTimer $0
+
+	Pop $0
+
+!macroend
+
+!define NSD_KillTimer `!insertmacro _NSD_KillTimer`
+
+!macro _NSD_AddStyle CONTROL STYLE
+
+	Push $0
+
+	System::Call "user32::GetWindowLong(i ${CONTROL}, i ${GWL_STYLE}) i .r0"
+	System::Call "user32::SetWindowLong(i ${CONTROL}, i ${GWL_STYLE}, i $0|${STYLE})"
+
+	Pop $0
+
+!macroend
+
+!define NSD_AddStyle "!insertmacro _NSD_AddStyle"
+
+!macro _NSD_AddExStyle CONTROL EXSTYLE
+
+	Push $0
+
+	System::Call "user32::GetWindowLong(i ${CONTROL}, i ${GWL_EXSTYLE}) i .r0"
+	System::Call "user32::SetWindowLong(i ${CONTROL}, i ${GWL_EXSTYLE}, i $0|${EXSTYLE})"
+
+	Pop $0
+
+!macroend
+
+!define NSD_AddExStyle "!insertmacro _NSD_AddExStyle"
+
+!macro __NSD_GetText CONTROL VAR
+
+	System::Call user32::GetWindowText(i${CONTROL},t.s,i${NSIS_MAX_STRLEN})
+	Pop ${VAR}
+
+!macroend
+
+!define NSD_GetText `!insertmacro __NSD_GetText`
+
+!macro __NSD_SetText CONTROL TEXT
+
+	SendMessage ${CONTROL} ${WM_SETTEXT} 0 `STR:${TEXT}`
+
+!macroend
+
+!define NSD_SetText `!insertmacro __NSD_SetText`
+
+!macro _NSD_SetTextLimit CONTROL LIMIT
+
+	SendMessage ${CONTROL} ${EM_SETLIMITTEXT} ${LIMIT} 0
+
+!macroend
+
+!define NSD_SetTextLimit "!insertmacro _NSD_SetTextLimit"
+
+!macro __NSD_GetState CONTROL VAR
+
+	SendMessage ${CONTROL} ${BM_GETCHECK} 0 0 ${VAR}
+
+!macroend
+
+!define NSD_GetState `!insertmacro __NSD_GetState`
+
+!macro __NSD_SetState CONTROL STATE
+
+	SendMessage ${CONTROL} ${BM_SETCHECK} ${STATE} 0
+
+!macroend
+
+!define NSD_SetState `!insertmacro __NSD_SetState`
+
+!macro __NSD_Check CONTROL
+
+	${NSD_SetState} ${CONTROL} ${BST_CHECKED}
+
+!macroend
+
+!define NSD_Check `!insertmacro __NSD_Check`
+
+!macro __NSD_Uncheck CONTROL
+
+	${NSD_SetState} ${CONTROL} ${BST_UNCHECKED}
+
+!macroend
+
+!define NSD_Uncheck `!insertmacro __NSD_Uncheck`
+
+!macro __NSD_SetFocus HWND
+
+	System::Call "user32::SetFocus(i${HWND})"
+  
+!macroend
+
+!define NSD_SetFocus `!insertmacro __NSD_SetFocus`
+
+!macro _NSD_CB_AddString CONTROL STRING
+
+	SendMessage ${CONTROL} ${CB_ADDSTRING} 0 `STR:${STRING}`
+
+!macroend
+
+!define NSD_CB_AddString "!insertmacro _NSD_CB_AddString"
+
+!macro _NSD_CB_SelectString CONTROL STRING
+
+	SendMessage ${CONTROL} ${CB_SELECTSTRING} -1 `STR:${STRING}`
+
+!macroend
+
+!define NSD_CB_SelectString "!insertmacro _NSD_CB_SelectString"
+
+!macro _NSD_LB_AddString CONTROL STRING
+
+	SendMessage ${CONTROL} ${LB_ADDSTRING} 0 `STR:${STRING}`
+
+!macroend
+
+!define NSD_LB_AddString "!insertmacro _NSD_LB_AddString"
+
+!macro __NSD_LB_DelString CONTROL STRING
+
+	SendMessage ${CONTROL} ${LB_DELETESTRING} 0 `STR:${STRING}`
+
+!macroend
+
+!define NSD_LB_DelString `!insertmacro __NSD_LB_DelString`
+
+!macro __NSD_LB_Clear CONTROL VAR
+
+	SendMessage ${CONTROL} ${LB_RESETCONTENT} 0 0 ${VAR}
+
+!macroend
+
+!define NSD_LB_Clear `!insertmacro __NSD_LB_Clear`
+
+!macro __NSD_LB_GetCount CONTROL VAR
+
+	SendMessage ${CONTROL} ${LB_GETCOUNT} 0 0 ${VAR}
+
+!macroend
+
+!define NSD_LB_GetCount `!insertmacro __NSD_LB_GetCount`
+
+!macro _NSD_LB_SelectString CONTROL STRING
+
+	SendMessage ${CONTROL} ${LB_SELECTSTRING} -1 `STR:${STRING}`
+
+!macroend
+
+!define NSD_LB_SelectString "!insertmacro _NSD_LB_SelectString"
+
+!macro __NSD_LB_GetSelection CONTROL VAR
+
+	SendMessage ${CONTROL} ${LB_GETCURSEL} 0 0 ${VAR}
+	System::Call 'user32::SendMessage(i ${CONTROL}, i ${LB_GETTEXT}, i ${VAR}, t .s)'
+	Pop ${VAR}
+
+!macroend
+
+!define NSD_LB_GetSelection `!insertmacro __NSD_LB_GetSelection`
+
+
+!macro __NSD_LoadAndSetImage _LIHINSTMODE _IMGTYPE _LIHINSTSRC _LIFLAGS CONTROL IMAGE HANDLE
+	
+	Push $0
+	Push $R0
+
+	StrCpy $R0 ${CONTROL} # in case ${CONTROL} is $0
+	
+	!if "${_LIHINSTMODE}" == "exeresource"
+		System::Call 'kernel32::GetModuleHandle(i0) i.r0'
+		!undef _LIHINSTSRC
+		!define _LIHINSTSRC r0
+	!endif
+	
+	System::Call 'user32::LoadImage(i ${_LIHINSTSRC}, ts, i ${_IMGTYPE}, i0, i0, i${_LIFLAGS}) i.r0' "${IMAGE}"
+	SendMessage $R0 ${STM_SETIMAGE} ${_IMGTYPE} $0
+
+	Pop $R0
+	Exch $0
+
+	Pop ${HANDLE}
+
+!macroend
+
+!macro __NSD_SetIconFromExeResource CONTROL IMAGE HANDLE
+	!insertmacro __NSD_LoadAndSetImage exeresource ${IMAGE_ICON} 0 ${LR_DEFAULTSIZE} "${CONTROL}" "${IMAGE}" ${HANDLE}
+!macroend
+
+!macro __NSD_SetIconFromInstaller CONTROL HANDLE
+	!insertmacro __NSD_SetIconFromExeResource "${CONTROL}" "#103" ${HANDLE}
+!macroend
+
+!define NSD_SetImage `!insertmacro __NSD_LoadAndSetImage file ${IMAGE_BITMAP} 0 "${LR_LOADFROMFILE}"`
+!define NSD_SetBitmap `${NSD_SetImage}`
+
+!define NSD_SetIcon `!insertmacro __NSD_LoadAndSetImage file ${IMAGE_ICON} 0 "${LR_LOADFROMFILE}|${LR_DEFAULTSIZE}"`
+!define NSD_SetIconFromExeResource `!insertmacro __NSD_SetIconFromExeResource`
+!define NSD_SetIconFromInstaller `!insertmacro __NSD_SetIconFromInstaller`
+
+
+!macro __NSD_SetStretchedImage CONTROL IMAGE HANDLE
+
+	Push $0
+	Push $1
+	Push $2
+	Push $R0
+
+	StrCpy $R0 ${CONTROL} # in case ${CONTROL} is $0
+
+	StrCpy $1 ""
+	StrCpy $2 ""
+
+	System::Call '*(i, i, i, i) i.s'
+	Pop $0
+
+	${If} $0 <> 0
+	
+		System::Call 'user32::GetClientRect(iR0, ir0)'
+		System::Call '*$0(i, i, i .s, i .s)'
+		System::Free $0
+		Pop $1
+		Pop $2
+
+	${EndIf}
+
+	System::Call 'user32::LoadImage(i0, ts, i ${IMAGE_BITMAP}, ir1, ir2, i${LR_LOADFROMFILE}) i.s' "${IMAGE}"
+	Pop $0
+    SendMessage $R0 ${STM_SETIMAGE} ${IMAGE_BITMAP} $0
+
+	Pop $R0
+	Pop $2
+	Pop $1
+	Exch $0
+
+	Pop ${HANDLE}
+
+!macroend
+
+!define NSD_SetStretchedImage `!insertmacro __NSD_SetStretchedImage`
+
+!macro __NSD_FreeImage IMAGE
+
+	${If} ${IMAGE} <> 0
+
+		System::Call gdi32::DeleteObject(is) ${IMAGE}
+
+	${EndIf}
+
+!macroend
+
+!define NSD_FreeImage `!insertmacro __NSD_FreeImage`
+!define NSD_FreeBitmap `${NSD_FreeImage}`
+
+!macro __NSD_FreeIcon IMAGE
+	System::Call user32::DestroyIcon(is) ${IMAGE}
+!macroend
+
+!define NSD_FreeIcon `!insertmacro __NSD_FreeIcon`
+
+!macro __NSD_ClearImage _IMGTYPE CONTROL
+
+	SendMessage ${CONTROL} ${STM_SETIMAGE} ${_IMGTYPE} 0
+
+!macroend
+
+!define NSD_ClearImage `!insertmacro __NSD_ClearImage ${IMAGE_BITMAP}`
+!define NSD_ClearIcon  `!insertmacro __NSD_ClearImage ${IMAGE_ICON}`
+
+
+!define DEBUG `System::Call kernel32::OutputDebugString(ts)`
+
+!macro __NSD_ControlCase TYPE
+
+	${Case} ${TYPE}
+		${NSD_Create${TYPE}} $R3u $R4u $R5u $R6u $R7
+		Pop $R9
+		${Break}
+
+!macroend
+
+!macro __NSD_ControlCaseEx TYPE
+
+	${Case} ${TYPE}
+		Call ${TYPE}
+		${Break}
+
+!macroend
+
+!macro NSD_FUNCTION_INIFILE
+
+	!insertmacro NSD_INIFILE ""
+
+!macroend
+
+!macro NSD_UNFUNCTION_INIFILE
+
+	!insertmacro NSD_INIFILE un.
+
+!macroend
+
+!macro NSD_INIFILE UNINSTALLER_FUNCPREFIX
+
+	;Functions to create dialogs based on old InstallOptions INI files
+
+	Function ${UNINSTALLER_FUNCPREFIX}CreateDialogFromINI
+
+		# $0 = ini
+
+		ReadINIStr $R0 $0 Settings RECT
+		${If} $R0 == ""
+			StrCpy $R0 1018
+		${EndIf}
+
+		nsDialogs::Create $R0
+		Pop $R9
+
+		ReadINIStr $R0 $0 Settings RTL
+		nsDialogs::SetRTL $R0
+
+		ReadINIStr $R0 $0 Settings NumFields
+
+		${DEBUG} "NumFields = $R0"
+
+		${For} $R1 1 $R0
+			${DEBUG} "Creating field $R1"
+			ReadINIStr $R2 $0 "Field $R1" Type
+			${DEBUG} "  Type = $R2"
+			ReadINIStr $R3 $0 "Field $R1" Left
+			${DEBUG} "  Left = $R3"
+			ReadINIStr $R4 $0 "Field $R1" Top
+			${DEBUG} "  Top = $R4"
+			ReadINIStr $R5 $0 "Field $R1" Right
+			${DEBUG} "  Right = $R5"
+			ReadINIStr $R6 $0 "Field $R1" Bottom
+			${DEBUG} "  Bottom = $R6"
+			IntOp $R5 $R5 - $R3
+			${DEBUG} "  Width = $R5"
+			IntOp $R6 $R6 - $R4
+			${DEBUG} "  Height = $R6"
+			ReadINIStr $R7 $0 "Field $R1" Text
+			${DEBUG} "  Text = $R7"
+			${Switch} $R2
+				!insertmacro __NSD_ControlCase   HLine
+				!insertmacro __NSD_ControlCase   VLine
+				!insertmacro __NSD_ControlCase   Label
+				!insertmacro __NSD_ControlCase   Icon
+				!insertmacro __NSD_ControlCase   Bitmap
+				!insertmacro __NSD_ControlCaseEx Link
+				!insertmacro __NSD_ControlCase   Button
+				!insertmacro __NSD_ControlCase   GroupBox
+				!insertmacro __NSD_ControlCase   CheckBox
+				!insertmacro __NSD_ControlCase   RadioButton
+				!insertmacro __NSD_ControlCase   Text
+				!insertmacro __NSD_ControlCase   Password
+				!insertmacro __NSD_ControlCaseEx FileRequest
+				!insertmacro __NSD_ControlCaseEx DirRequest
+				!insertmacro __NSD_ControlCase   ComboBox
+				!insertmacro __NSD_ControlCase   DropList
+				!insertmacro __NSD_ControlCase   ListBox
+			${EndSwitch}
+
+			WriteINIStr $0 "Field $R1" HWND $R9
+		${Next}
+
+		nsDialogs::Show
+
+	FunctionEnd
+
+	Function ${UNINSTALLER_FUNCPREFIX}UpdateINIState
+
+		${DEBUG} "Updating INI state"
+
+		ReadINIStr $R0 $0 Settings NumFields
+
+		${DEBUG} "NumField = $R0"
+
+		${For} $R1 1 $R0
+			ReadINIStr $R2 $0 "Field $R1" HWND
+			ReadINIStr $R3 $0 "Field $R1" "Type"
+			${Switch} $R3
+				${Case} "CheckBox"
+				${Case} "RadioButton"
+					${DEBUG} "  HWND = $R2"
+					${NSD_GetState} $R2 $R2
+					${DEBUG} "  Window selection = $R2"
+				${Break}
+				${CaseElse}
+					${DEBUG} "  HWND = $R2"
+					${NSD_GetText} $R2 $R2
+					${DEBUG} "  Window text = $R2"
+				${Break}
+			${EndSwitch}
+			WriteINIStr $0 "Field $R1" STATE $R2
+		${Next}
+
+	FunctionEnd
+
+	Function ${UNINSTALLER_FUNCPREFIX}FileRequest
+
+		IntOp $R5 $R5 - 15
+		IntOp $R8 $R3 + $R5
+
+		${NSD_CreateBrowseButton} $R8u $R4u 15u $R6u ...
+		Pop $R8
+
+		nsDialogs::SetUserData $R8 $R1 # remember field id
+
+		WriteINIStr $0 "Field $R1" HWND2 $R8
+
+		${NSD_OnClick} $R8 ${UNINSTALLER_FUNCPREFIX}OnFileBrowseButton
+
+		ReadINIStr $R9 $0 "Field $R1" State
+
+		${NSD_CreateFileRequest} $R3u $R4u $R5u $R6u $R9
+		Pop $R9
+
+	FunctionEnd
+
+	Function ${UNINSTALLER_FUNCPREFIX}DirRequest
+
+		IntOp $R5 $R5 - 15
+		IntOp $R8 $R3 + $R5
+
+		${NSD_CreateBrowseButton} $R8u $R4u 15u $R6u ...
+		Pop $R8
+
+		nsDialogs::SetUserData $R8 $R1 # remember field id
+
+		WriteINIStr $0 "Field $R1" HWND2 $R8
+
+		${NSD_OnClick} $R8 ${UNINSTALLER_FUNCPREFIX}OnDirBrowseButton
+
+		ReadINIStr $R9 $0 "Field $R1" State
+
+		${NSD_CreateFileRequest} $R3u $R4u $R5u $R6u $R9
+		Pop $R9
+
+	FunctionEnd
+
+	Function ${UNINSTALLER_FUNCPREFIX}OnFileBrowseButton
+
+		Pop $R0
+
+		nsDialogs::GetUserData $R0
+		Pop $R1
+
+		ReadINIStr $R2 $0 "Field $R1" HWND
+		ReadINIStr $R4 $0 "Field $R1" Filter
+
+		${NSD_GetText} $R2 $R3
+
+		nsDialogs::SelectFileDialog save $R3 $R4
+		Pop $R3
+
+		${If} $R3 != ""
+			SendMessage $R2 ${WM_SETTEXT} 0 STR:$R3
+		${EndIf}
+
+	FunctionEnd
+
+	Function ${UNINSTALLER_FUNCPREFIX}OnDirBrowseButton
+
+		Pop $R0
+
+		nsDialogs::GetUserData $R0
+		Pop $R1
+
+		ReadINIStr $R2 $0 "Field $R1" HWND
+		ReadINIStr $R3 $0 "Field $R1" Text
+
+		${NSD_GetText} $R2 $R4
+
+		nsDialogs::SelectFolderDialog $R3 $R4
+		Pop $R3
+
+		${If} $R3 != error
+			SendMessage $R2 ${WM_SETTEXT} 0 STR:$R3
+		${EndIf}
+
+	FunctionEnd
+
+	Function ${UNINSTALLER_FUNCPREFIX}Link
+
+		${NSD_CreateLink} $R3u $R4u $R5u $R6u $R7
+		Pop $R9
+
+		nsDialogs::SetUserData $R9 $R1 # remember field id
+
+		${NSD_OnClick} $R9 ${UNINSTALLER_FUNCPREFIX}OnLink
+
+	FunctionEnd
+
+	Function ${UNINSTALLER_FUNCPREFIX}OnLink
+
+		Pop $R0
+
+		nsDialogs::GetUserData $R0
+		Pop $R1
+
+		ReadINIStr $R1 $0 "Field $R1" STATE
+
+		ExecShell "" $R1
+
+	FunctionEnd
+
+!macroend
+
+!verbose pop
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Include/UpgradeDLL.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/UpgradeDLL.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/UpgradeDLL.nsh	(revision 728)
@@ -0,0 +1,203 @@
+/*
+
+NOTE:
+-----
+This macro is provided for backwards compatibility with NSIS 2.0 scripts.
+It's recommended you update your scripts to use the new Library.nsh macros.
+
+
+Macro - Upgrade DLL File
+Written by Joost Verburg
+------------------------
+
+Parameters:
+LOCALFILE		Location of the new DLL file (on the compiler system)
+DESTFILE		Location of the DLL file that should be upgraded (on the user's system)
+TEMPBASEDIR		Directory on the user's system to store a temporary file when the system has
+				to be rebooted.
+				For Win9x/ME support, this should be on the same volume as DESTFILE.
+				The Windows temp directory could be located on any volume, so you cannot use
+				this directory.
+
+Define UPGRADEDLL_NOREGISTER if you want to upgrade a DLL that does not have to be registered.
+
+Notes:
+
+* If you want to support Windows 9x/ME, you can only use short filenames (8.3).
+
+* This macro uses the GetDLLVersionLocal command to retrieve the version of local libraries.
+  This command is only supported when compiling on a Windows system.
+
+------------------------
+
+Example:
+
+!insertmacro UpgradeDLL "dllname.dll" "$SYSDIR\dllname.dll" "$SYSDIR"
+
+*/
+
+!ifndef UPGRADEDLL_INCLUDED
+
+!define UPGRADEDLL_INCLUDED
+
+!macro __UpgradeDLL_Helper_AddRegToolEntry mode filename tempdir
+
+  Push $R0
+  Push $R1
+  Push $R2
+  Push $R3
+
+  ;------------------------
+  ;Copy the parameters
+
+  Push "${filename}"
+  Push "${tempdir}"
+
+  Pop $R2 ; temporary directory
+  Pop $R1 ; file name to register
+
+  ;------------------------
+  ;Advance counter
+
+  StrCpy $R0 0
+  ReadRegDWORD $R0 HKLM "Software\NSIS.Library.RegTool.v2\UpgradeDLLSession" "count"
+  IntOp $R0 $R0 + 1
+  WriteRegDWORD HKLM "Software\NSIS.Library.RegTool.v2\UpgradeDLLSession" "count" "$R0"
+
+  ;------------------------
+  ;Setup RegTool
+
+  ReadRegStr $R3 HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" "NSIS.Library.RegTool.v2"
+  StrCpy $R3 $R3 -4 1
+  IfFileExists $R3 +3
+
+    File /oname=$R2\NSIS.Library.RegTool.v2.$HWNDPARENT.exe "${NSISDIR}\Bin\RegTool.bin"
+    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" \
+      "NSIS.Library.RegTool.v2" '"$R2\NSIS.Library.RegTool.v2.$HWNDPARENT.exe" /S'
+
+  ;------------------------
+  ;Add RegTool entry
+
+  WriteRegStr HKLM "Software\NSIS.Library.RegTool.v2\UpgradeDLLSession" "$R0.file" "$R1"
+  WriteRegStr HKLM "Software\NSIS.Library.RegTool.v2\UpgradeDLLSession" "$R0.mode" "${mode}"
+
+  Pop $R3
+  Pop $R2
+  Pop $R1
+  Pop $R0
+
+!macroend
+
+!macro UpgradeDLL LOCALFILE DESTFILE TEMPBASEDIR
+
+  Push $R0
+  Push $R1
+  Push $R2
+  Push $R3
+  Push $R4
+  Push $R5
+
+  !define UPGRADEDLL_UNIQUE "${__FILE__}${__LINE__}"
+
+  SetOverwrite try
+
+  ;------------------------
+  ;Copy the parameters used on run-time to a variable
+  ;This allows the usage of variables as paramter
+
+  StrCpy $R4 "${DESTFILE}"
+  StrCpy $R5 "${TEMPBASEDIR}"
+
+  ;------------------------
+  ;Get version information
+
+  IfFileExists $R4 0 "upgradedll.copy_${UPGRADEDLL_UNIQUE}"
+
+  ClearErrors
+    GetDLLVersionLocal "${LOCALFILE}" $R0 $R1
+    GetDLLVersion $R4 $R2 $R3
+  IfErrors "upgradedll.upgrade_${UPGRADEDLL_UNIQUE}"
+
+  IntCmpU $R0 $R2 0 "upgradedll.done_${UPGRADEDLL_UNIQUE}" "upgradedll.upgrade_${UPGRADEDLL_UNIQUE}"
+  IntCmpU $R1 $R3 "upgradedll.done_${UPGRADEDLL_UNIQUE}" "upgradedll.done_${UPGRADEDLL_UNIQUE}" \
+    "upgradedll.upgrade_${UPGRADEDLL_UNIQUE}"
+
+  ;------------------------
+  ;Upgrade
+
+  "upgradedll.upgrade_${UPGRADEDLL_UNIQUE}:"
+    !ifndef UPGRADEDLL_NOREGISTER
+      ;Unregister the DLL
+      UnRegDLL $R4
+    !endif
+
+  ;------------------------
+  ;Copy
+
+  ClearErrors
+    StrCpy $R0 $R4
+    Call ":upgradedll.file_${UPGRADEDLL_UNIQUE}"
+  IfErrors 0 "upgradedll.noreboot_${UPGRADEDLL_UNIQUE}"
+
+  ;------------------------
+  ;Copy on reboot
+
+  GetTempFileName $R0 $R5
+    Call ":upgradedll.file_${UPGRADEDLL_UNIQUE}"
+  Rename /REBOOTOK $R0 $R4
+
+  ;------------------------
+  ;Register on reboot
+
+  !insertmacro __UpgradeDLL_Helper_AddRegToolEntry 'D' $R4 $R5
+
+  Goto "upgradedll.done_${UPGRADEDLL_UNIQUE}"
+
+  ;------------------------
+  ;DLL does not exist
+
+  "upgradedll.copy_${UPGRADEDLL_UNIQUE}:"
+    StrCpy $R0 $R4
+    Call ":upgradedll.file_${UPGRADEDLL_UNIQUE}"
+
+  ;------------------------
+  ;Register
+
+  "upgradedll.noreboot_${UPGRADEDLL_UNIQUE}:"
+    !ifndef UPGRADEDLL_NOREGISTER
+      RegDLL $R4
+    !endif
+
+  ;------------------------
+  ;Done
+
+  "upgradedll.done_${UPGRADEDLL_UNIQUE}:"
+
+  Pop $R5
+  Pop $R4
+  Pop $R3
+  Pop $R2
+  Pop $R1
+  Pop $R0
+
+  ;------------------------
+  ;End
+
+  Goto "upgradedll.end_${UPGRADEDLL_UNIQUE}"
+
+  ;------------------------
+  ;Extract
+
+  "upgradedll.file_${UPGRADEDLL_UNIQUE}:"
+    File /oname=$R0 "${LOCALFILE}"
+    Return
+
+  "upgradedll.end_${UPGRADEDLL_UNIQUE}:"
+
+  SetOverwrite lastused
+  
+  !undef UPGRADEDLL_UNIQUE
+
+!macroend
+
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Include/LogicLib.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/LogicLib.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/LogicLib.nsh	(revision 728)
@@ -0,0 +1,834 @@
+; NSIS LOGIC LIBRARY - LogicLib.nsh
+; Version 2.6 - 08/12/2007
+; By dselkirk@hotmail.com
+; and eccles@users.sf.net
+; with IfNot support added by Message
+;
+; Questions/Comments -
+; See http://forums.winamp.com/showthread.php?s=&postid=1116241
+;
+; Description:
+;   Provides the use of various logic statements within NSIS.
+;
+; Usage:
+;   The following "statements" are available:
+;       If|IfNot|Unless..{ElseIf|ElseIfNot|ElseUnless}..[Else]..EndIf|EndUnless
+;         - Conditionally executes a block of statements, depending on the value
+;           of an expression. IfNot and Unless are equivalent and
+;           interchangeable, as are ElseIfNot and ElseUnless.
+;       AndIf|AndIfNot|AndUnless|OrIf|OrIfNot|OrUnless
+;         - Adds any number of extra conditions to If, IfNot, Unless, ElseIf,
+;           ElseIfNot and ElseUnless statements.
+;       IfThen|IfNotThen..|..|
+;         - Conditionally executes an inline statement, depending on the value
+;           of an expression.
+;       IfCmd..||..|
+;         - Conditionally executes an inline statement, depending on a true
+;           value of the provided NSIS function.
+;       Select..{Case[2|3|4|5]}..[CaseElse|Default]..EndSelect
+;         - Executes one of several blocks of statements, depending on the value
+;           of an expression.
+;       Switch..{Case|CaseElse|Default}..EndSwitch
+;         - Jumps to one of several labels, depending on the value of an
+;           expression.
+;       Do[While|Until]..{ExitDo|Continue|Break}..Loop[While|Until]
+;         - Repeats a block of statements until stopped, or depending on the
+;           value of an expression.
+;       While..{ExitWhile|Continue|Break}..EndWhile
+;         - An alias for DoWhile..Loop (for backwards-compatibility)
+;       For[Each]..{ExitFor|Continue|Break}..Next
+;         - Repeats a block of statements varying the value of a variable.
+;
+;   The following "expressions" are available:
+;       Standard (built-in) string tests (which are case-insensitive):
+;         a == b; a != b
+;       Additional case-insensitive string tests (using System.dll):
+;         a S< b; a S>= b; a S> b; a S<= b
+;       Case-sensitive string tests:
+;         a S== b; a S!= b
+;       Standard (built-in) signed integer tests:
+;         a = b; a <> b; a < b; a >= b; a > b; a <= b
+;       Standard (built-in) unsigned integer tests:
+;         a U< b; a U>= b; a U> b; a U<= b
+;       64-bit integer tests (using System.dll):
+;         a L= b; a L<> b; a L< b; a L>= b; a L> b; a L<= b
+;       ptrdiff_t integer tests
+;         a P= b; a P<> b; a P< b; a P>= b; a P> b; a P<= b
+;       size_t integer tests
+;         a Z= b; a Z<> b; a Z< b; a Z>= b; a Z> b; a Z<= b
+;       Built-in NSIS flag tests:
+;         ${Abort}; ${Errors}; ${RebootFlag}; ${Silent}
+;       Built-in NSIS other tests:
+;         ${FileExists} a
+;       Any conditional NSIS instruction test:
+;         ${Cmd} a
+;       Section flag tests:
+;         ${SectionIsSelected} a; ${SectionIsSectionGroup} a;
+;         ${SectionIsSectionGroupEnd} a; ${SectionIsBold} a;
+;         ${SectionIsReadOnly} a; ${SectionIsExpanded} a;
+;         ${SectionIsPartiallySelected} a
+;
+; Examples:
+;   See LogicLib.nsi in the Examples folder for lots of example usage.
+
+!verbose push
+!verbose 3
+!ifndef LOGICLIB_VERBOSITY
+  !define LOGICLIB_VERBOSITY 3
+!endif
+!define _LOGICLIB_VERBOSITY ${LOGICLIB_VERBOSITY}
+!undef LOGICLIB_VERBOSITY
+!verbose ${_LOGICLIB_VERBOSITY}
+
+!ifndef LOGICLIB
+  !define LOGICLIB
+  !define | "'"
+  !define || "' '"
+  !define LOGICLIB_COUNTER 0
+
+  !include Sections.nsh
+
+  !macro _LOGICLIB_TEMP
+    !ifndef _LOGICLIB_TEMP
+      !define _LOGICLIB_TEMP
+      Var /GLOBAL _LOGICLIB_TEMP  ; Temporary variable to aid the more elaborate logic tests
+    !endif
+  !macroend
+
+  !macro _IncreaseCounter
+    !define _LOGICLIB_COUNTER ${LOGICLIB_COUNTER}
+    !undef LOGICLIB_COUNTER
+    !define /math LOGICLIB_COUNTER ${_LOGICLIB_COUNTER} + 1
+    !undef _LOGICLIB_COUNTER
+  !macroend
+
+  !macro _PushLogic
+    !insertmacro _PushScope Logic _LogicLib_Label_${LOGICLIB_COUNTER}
+    !insertmacro _IncreaseCounter
+  !macroend
+
+  !macro _PopLogic
+    !insertmacro _PopScope Logic
+  !macroend
+
+  !macro _PushScope Type label
+    !ifdef _${Type}                                       ; If we already have a statement
+      !define _Cur${Type} ${_${Type}}
+      !undef _${Type}
+      !define _${Type} ${label}
+      !define ${_${Type}}Prev${Type} ${_Cur${Type}}       ; Save the current logic
+      !undef _Cur${Type}
+    !else
+      !define _${Type} ${label}                           ; Initialise for first statement
+    !endif
+  !macroend
+
+  !macro _PopScope Type
+    !ifndef _${Type}
+      !error "Cannot use _Pop${Type} without a preceding _Push${Type}"
+    !endif
+    !ifdef ${_${Type}}Prev${Type}                         ; If a previous statment was active then restore it
+      !define _Cur${Type} ${_${Type}}
+      !undef _${Type}
+      !define _${Type} ${${_Cur${Type}}Prev${Type}}
+      !undef ${_Cur${Type}}Prev${Type}
+      !undef _Cur${Type}
+    !else
+      !undef _${Type}
+    !endif
+  !macroend
+
+  ; String tests
+  !macro _== _a _b _t _f
+    StrCmp `${_a}` `${_b}` `${_t}` `${_f}`
+  !macroend
+
+  !macro _!= _a _b _t _f
+    !insertmacro _== `${_a}` `${_b}` `${_f}` `${_t}`
+  !macroend
+
+  ; Case-sensitive string tests
+  !macro _S== _a _b _t _f
+    StrCmpS `${_a}` `${_b}` `${_t}` `${_f}`
+  !macroend
+
+  !macro _S!= _a _b _t _f
+    !insertmacro _S== `${_a}` `${_b}` `${_f}` `${_t}`
+  !macroend
+
+  ; Extra string tests (cannot do these case-sensitively - I tried and lstrcmp still ignored the case)
+  !macro _StrCmpI _a _b _e _l _m
+    !insertmacro _LOGICLIB_TEMP
+    System::Call `kernel32::lstrcmpiA(ts, ts) i.s` `${_a}` `${_b}`
+    Pop $_LOGICLIB_TEMP
+    IntCmp $_LOGICLIB_TEMP 0 `${_e}` `${_l}` `${_m}`
+  !macroend
+
+  !macro _S< _a _b _t _f
+    !insertmacro _StrCmpI `${_a}` `${_b}` `${_f}` `${_t}` `${_f}`
+  !macroend
+
+  !macro _S>= _a _b _t _f
+    !insertmacro _S< `${_a}` `${_b}` `${_f}` `${_t}`
+  !macroend
+
+  !macro _S> _a _b _t _f
+    !insertmacro _StrCmpI `${_a}` `${_b}` `${_f}` `${_f}` `${_t}`
+  !macroend
+
+  !macro _S<= _a _b _t _f
+    !insertmacro _S> `${_a}` `${_b}` `${_f}` `${_t}`
+  !macroend
+
+  ; Integer tests
+  !macro _= _a _b _t _f
+    IntCmp `${_a}` `${_b}` `${_t}` `${_f}` `${_f}`
+  !macroend
+
+  !macro _<> _a _b _t _f
+    !insertmacro _= `${_a}` `${_b}` `${_f}` `${_t}`
+  !macroend
+
+  !macro _< _a _b _t _f
+    IntCmp `${_a}` `${_b}` `${_f}` `${_t}` `${_f}`
+  !macroend
+
+  !macro _>= _a _b _t _f
+    !insertmacro _< `${_a}` `${_b}` `${_f}` `${_t}`
+  !macroend
+
+  !macro _> _a _b _t _f
+    IntCmp `${_a}` `${_b}` `${_f}` `${_f}` `${_t}`
+  !macroend
+
+  !macro _<= _a _b _t _f
+    !insertmacro _> `${_a}` `${_b}` `${_f}` `${_t}`
+  !macroend
+
+  ; Unsigned integer tests (NB: no need for extra equality tests)
+  !macro _U< _a _b _t _f
+    IntCmpU `${_a}` `${_b}` `${_f}` `${_t}` `${_f}`
+  !macroend
+
+  !macro _U>= _a _b _t _f
+    !insertmacro _U< `${_a}` `${_b}` `${_f}` `${_t}`
+  !macroend
+
+  !macro _U> _a _b _t _f
+    IntCmpU `${_a}` `${_b}` `${_f}` `${_f}` `${_t}`
+  !macroend
+
+  !macro _U<= _a _b _t _f
+    !insertmacro _U> `${_a}` `${_b}` `${_f}` `${_t}`
+  !macroend
+
+  ; Int64 tests
+  !macro _Int64Cmp _a _o _b _t _f
+    !insertmacro _LOGICLIB_TEMP
+    System::Int64Op `${_a}` `${_o}` `${_b}`
+    Pop $_LOGICLIB_TEMP
+    !insertmacro _= $_LOGICLIB_TEMP 0 `${_f}` `${_t}`
+  !macroend
+
+  !macro _L= _a _b _t _f
+    !insertmacro _Int64Cmp `${_a}` = `${_b}` `${_t}` `${_f}`
+  !macroend
+
+  !macro _L<> _a _b _t _f
+    !insertmacro _L= `${_a}` `${_b}` `${_f}` `${_t}`
+  !macroend
+
+  !macro _L< _a _b _t _f
+    !insertmacro _Int64Cmp `${_a}` < `${_b}` `${_t}` `${_f}`
+  !macroend
+
+  !macro _L>= _a _b _t _f
+    !insertmacro _L< `${_a}` `${_b}` `${_f}` `${_t}`
+  !macroend
+
+  !macro _L> _a _b _t _f
+    !insertmacro _Int64Cmp `${_a}` > `${_b}` `${_t}` `${_f}`
+  !macroend
+
+  !macro _L<= _a _b _t _f
+    !insertmacro _L> `${_a}` `${_b}` `${_f}` `${_t}`
+  !macroend
+
+  ; ptrdiff_t & size_t tests
+  !macro _P= _a _b _t _f
+    !insertmacro _= `${_a}` `${_b}` `${_t}` `${_f}`
+  !macroend
+  !macro _P<> _a _b _t _f
+    !insertmacro _<> `${_a}` `${_b}` `${_t}` `${_f}`
+  !macroend
+  !macro _P< _a _b _t _f
+    !insertmacro _< `${_a}` `${_b}` `${_t}` `${_f}`
+  !macroend
+  !macro _P>= _a _b _t _f
+    !insertmacro _>= `${_a}` `${_b}` `${_t}` `${_f}`
+  !macroend
+  !macro _P> _a _b _t _f
+    !insertmacro _> `${_a}` `${_b}` `${_t}` `${_f}`
+  !macroend
+  !macro _P<= _a _b _t _f
+    !insertmacro _<= `${_a}` `${_b}` `${_t}` `${_f}`
+  !macroend
+  !macro _Z= _a _b _t _f
+    !insertmacro _= `${_a}` `${_b}` `${_t}` `${_f}`
+  !macroend
+  !macro _Z<> _a _b _t _f
+    !insertmacro _<> `${_a}` `${_b}` `${_t}` `${_f}`
+  !macroend
+  !macro _Z< _a _b _t _f
+    !insertmacro _U< `${_a}` `${_b}` `${_t}` `${_f}`
+  !macroend
+  !macro _Z>= _a _b _t _f
+    !insertmacro _U>= `${_a}` `${_b}` `${_t}` `${_f}`
+  !macroend
+  !macro _Z> _a _b _t _f
+    !insertmacro _U> `${_a}` `${_b}` `${_t}` `${_f}`
+  !macroend
+  !macro _Z<= _a _b _t _f
+    !insertmacro _U<= `${_a}` `${_b}` `${_t}` `${_f}`
+  !macroend
+
+  ; Flag tests
+  !macro _Abort _a _b _t _f
+    IfAbort `${_t}` `${_f}`
+  !macroend
+  !define Abort `"" Abort ""`
+
+  !macro _Errors _a _b _t _f
+    IfErrors `${_t}` `${_f}`
+  !macroend
+  !define Errors `"" Errors ""`
+
+  !macro _FileExists _a _b _t _f
+    IfFileExists `${_b}` `${_t}` `${_f}`
+  !macroend
+  !define FileExists `"" FileExists`
+
+  !macro _RebootFlag _a _b _t _f
+    IfRebootFlag `${_t}` `${_f}`
+  !macroend
+  !define RebootFlag `"" RebootFlag ""`
+
+  !macro _Silent _a _b _t _f
+    IfSilent `${_t}` `${_f}`
+  !macroend
+  !define Silent `"" Silent ""`
+
+  ; "Any instruction" test
+  !macro _Cmd _a _b _t _f
+    !define _t=${_t}
+    !ifdef _t=                                            ; If no true label then make one
+      !define __t _LogicLib_Label_${LOGICLIB_COUNTER}
+      !insertmacro _IncreaseCounter
+    !else
+      !define __t ${_t}
+    !endif
+    ${_b} ${__t}
+    !define _f=${_f}
+    !ifndef _f=                                           ; If a false label then go there
+      Goto ${_f}
+    !endif
+    !undef _f=${_f}
+    !ifdef _t=                                            ; If we made our own true label then place it
+      ${__t}:
+    !endif
+    !undef __t
+    !undef _t=${_t}
+  !macroend
+  !define Cmd `"" Cmd`
+
+  ; Section flag test
+  !macro _SectionFlagIsSet _a _b _t _f
+    !insertmacro _LOGICLIB_TEMP
+    SectionGetFlags `${_b}` $_LOGICLIB_TEMP
+    IntOp $_LOGICLIB_TEMP $_LOGICLIB_TEMP & `${_a}`
+    !insertmacro _= $_LOGICLIB_TEMP `${_a}` `${_t}` `${_f}`
+  !macroend
+  !define SectionIsSelected `${SF_SELECTED} SectionFlagIsSet`
+  !define SectionIsSubSection `${SF_SUBSEC} SectionFlagIsSet`
+  !define SectionIsSubSectionEnd `${SF_SUBSECEND} SectionFlagIsSet`
+  !define SectionIsSectionGroup `${SF_SECGRP} SectionFlagIsSet`
+  !define SectionIsSectionGroupEnd `${SF_SECGRPEND} SectionFlagIsSet`
+  !define SectionIsBold `${SF_BOLD} SectionFlagIsSet`
+  !define SectionIsReadOnly `${SF_RO} SectionFlagIsSet`
+  !define SectionIsExpanded `${SF_EXPAND} SectionFlagIsSet`
+  !define SectionIsPartiallySelected `${SF_PSELECTED} SectionFlagIsSet`
+
+  !define IfCmd `!insertmacro _IfThen "" Cmd ${|}`
+
+  !macro _If _c _a _o _b
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    !insertmacro _PushLogic
+    !define ${_Logic}If
+    !define ${_Logic}Else _LogicLib_Label_${LOGICLIB_COUNTER}                    ; Get a label for the Else
+    !insertmacro _IncreaseCounter
+    !define _c=${_c}
+    !ifdef _c=true                                        ; If is true
+      !insertmacro _${_o} `${_a}` `${_b}` "" ${${_Logic}Else}
+    !else                                                 ; If condition is false
+      !insertmacro _${_o} `${_a}` `${_b}` ${${_Logic}Else} ""
+    !endif
+    !undef _c=${_c}
+    !verbose pop
+  !macroend
+  !define If     `!insertmacro _If true`
+  !define Unless `!insertmacro _If false`
+  !define IfNot  `!insertmacro _If false`
+
+  !macro _And _c _a _o _b
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    !ifndef _Logic | ${_Logic}If
+      !error "Cannot use And without a preceding If or IfNot/Unless"
+    !endif
+    !ifndef ${_Logic}Else
+      !error "Cannot use And following an Else"
+    !endif
+    !define _c=${_c}
+    !ifdef _c=true                                        ; If is true
+      !insertmacro _${_o} `${_a}` `${_b}` "" ${${_Logic}Else}
+    !else                                                 ; If condition is false
+      !insertmacro _${_o} `${_a}` `${_b}` ${${_Logic}Else} ""
+    !endif
+    !undef _c=${_c}
+    !verbose pop
+  !macroend
+  !define AndIf     `!insertmacro _And true`
+  !define AndUnless `!insertmacro _And false`
+  !define AndIfNot  `!insertmacro _And false`
+
+  !macro _Or _c _a _o _b
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    !ifndef _Logic | ${_Logic}If
+      !error "Cannot use Or without a preceding If or IfNot/Unless"
+    !endif
+    !ifndef ${_Logic}Else
+      !error "Cannot use Or following an Else"
+    !endif
+    !define _label _LogicLib_Label_${LOGICLIB_COUNTER}                           ; Skip this test as we already
+    !insertmacro _IncreaseCounter
+    Goto ${_label}                                        ; have a successful result
+    ${${_Logic}Else}:                                     ; Place the Else label
+    !undef ${_Logic}Else                                  ; and remove it
+    !define ${_Logic}Else _LogicLib_Label_${LOGICLIB_COUNTER}                    ; Get a label for the next Else and perform the new If
+    !insertmacro _IncreaseCounter
+    !define _c=${_c}
+    !ifdef _c=true                                        ; If is true
+      !insertmacro _${_o} `${_a}` `${_b}` "" ${${_Logic}Else}
+    !else                                                 ; If condition is false
+      !insertmacro _${_o} `${_a}` `${_b}` ${${_Logic}Else} ""
+    !endif
+    !undef _c=${_c}
+    ${_label}:
+    !undef _label
+    !verbose pop
+  !macroend
+  !define OrIf     `!insertmacro _Or true`
+  !define OrUnless `!insertmacro _Or false`
+  !define OrIfNot  `!insertmacro _Or false`
+
+  !macro _Else
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    !ifndef _Logic | ${_Logic}If
+      !error "Cannot use Else without a preceding If or IfNot/Unless"
+    !endif
+    !ifndef ${_Logic}Else
+      !error "Cannot use Else following an Else"
+    !endif
+    !ifndef ${_Logic}EndIf                                ; First Else for this If?
+      !define ${_Logic}EndIf _LogicLib_Label_${LOGICLIB_COUNTER}                 ; Get a label for the EndIf
+      !insertmacro _IncreaseCounter
+    !endif
+    Goto ${${_Logic}EndIf}                                ; Go to the EndIf
+    ${${_Logic}Else}:                                     ; Place the Else label
+    !undef ${_Logic}Else                                  ; and remove it
+    !verbose pop
+  !macroend
+  !define Else `!insertmacro _Else`
+
+  !macro _ElseIf _c _a _o _b
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    ${Else}                                               ; Perform the Else
+    !define ${_Logic}Else _LogicLib_Label_${LOGICLIB_COUNTER}                    ; Get a label for the next Else and perform the new If
+    !insertmacro _IncreaseCounter
+    !define _c=${_c}
+    !ifdef _c=true                                        ; If is true
+      !insertmacro _${_o} `${_a}` `${_b}` "" ${${_Logic}Else}
+    !else                                                 ; If condition is false
+      !insertmacro _${_o} `${_a}` `${_b}` ${${_Logic}Else} ""
+    !endif
+    !undef _c=${_c}
+    !verbose pop
+  !macroend
+  !define ElseIf     `!insertmacro _ElseIf true`
+  !define ElseUnless `!insertmacro _ElseIf false`
+  !define ElseIfNot  `!insertmacro _ElseIf false`
+
+  !macro _EndIf _n
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    !ifndef _Logic | ${_Logic}If
+      !error "Cannot use End${_n} without a preceding If or IfNot/Unless"
+    !endif
+    !ifdef ${_Logic}Else
+      ${${_Logic}Else}:                                   ; Place the Else label
+      !undef ${_Logic}Else                                ; and remove it
+    !endif
+    !ifdef ${_Logic}EndIf
+      ${${_Logic}EndIf}:                                  ; Place the EndIf
+      !undef ${_Logic}EndIf                               ; and remove it
+    !endif
+    !undef ${_Logic}If
+    !insertmacro _PopLogic
+    !verbose pop
+  !macroend
+  !define EndIf     `!insertmacro _EndIf If`
+  !define EndUnless `!insertmacro _EndIf Unless`
+
+  !macro _IfThen _a _o _b _t
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    ${If} `${_a}` `${_o}` `${_b}`
+      ${_t}
+    ${EndIf}
+    !verbose pop
+  !macroend
+  !define IfThen `!insertmacro _IfThen`
+
+  !macro _IfNotThen _a _o _b _t
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    ${IfNot} `${_a}` `${_o}` `${_b}`
+      ${_t}
+    ${EndIf}
+    !verbose pop
+  !macroend
+  !define IfNotThen `!insertmacro _IfNotThen`
+
+  !macro _ForEach _v _f _t _o _s
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    StrCpy "${_v}" "${_f}"                                ; Assign the initial value
+    Goto +2                                               ; Skip the loop expression for the first iteration
+    !define _DoLoopExpression `IntOp "${_v}" "${_v}" "${_o}" "${_s}"` ; Define the loop expression
+    !define _o=${_o}
+    !ifdef _o=+                                           ; Check the loop expression operator
+      !define __o >                                       ; to determine the correct loop condition
+    !else ifdef _o=-
+      !define __o <
+    !else
+      !error "Unsupported ForEach step operator (must be + or -)"
+    !endif
+    !undef _o=${_o}
+    !insertmacro _Do For false `${_v}` `${__o}` `${_t}`   ; Let Do do the rest
+    !undef __o
+    !verbose pop
+  !macroend
+  !define ForEach `!insertmacro _ForEach`
+
+  !macro _For _v _f _t
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    ${ForEach} `${_v}` `${_f}` `${_t}` + 1                ; Pass on to ForEach
+    !verbose pop
+  !macroend
+  !define For `!insertmacro _For`
+
+  !define ExitFor `!insertmacro _Goto ExitFor For`
+
+  !define Next      `!insertmacro _Loop For Next "" "" "" ""`
+
+  !define While     `!insertmacro _Do While true`
+
+  !define ExitWhile `!insertmacro _Goto ExitWhile While`
+
+  !define EndWhile  `!insertmacro _Loop While EndWhile "" "" "" ""`
+
+  !macro _Do _n _c _a _o _b
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    !insertmacro _PushLogic
+    !define ${_Logic}${_n} _LogicLib_Label_${LOGICLIB_COUNTER}                   ; Get a label for the start of the loop
+    !insertmacro _IncreaseCounter
+    ${${_Logic}${_n}}:
+    !insertmacro _PushScope Exit${_n} _LogicLib_Label_${LOGICLIB_COUNTER}        ; Get a label for the end of the loop
+    !insertmacro _IncreaseCounter
+    !insertmacro _PushScope Break ${_Exit${_n}}           ; Break goes to the end of the loop
+    !ifdef _DoLoopExpression
+      ${_DoLoopExpression}                                ; Special extra parameter for inserting code
+      !undef _DoLoopExpression                            ; between the Continue label and the loop condition
+    !endif
+    !define _c=${_c}
+    !ifdef _c=                                            ; No starting condition
+      !insertmacro _PushScope Continue _LogicLib_Label_${LOGICLIB_COUNTER}       ; Get a label for Continue at the end of the loop
+      !insertmacro _IncreaseCounter
+    !else
+      !insertmacro _PushScope Continue ${${_Logic}${_n}}  ; Continue goes to the start of the loop
+      !ifdef _c=true                                      ; If is true
+        !insertmacro _${_o} `${_a}` `${_b}` "" ${_Exit${_n}}
+      !else                                               ; If condition is false
+        !insertmacro _${_o} `${_a}` `${_b}` ${_Exit${_n}} ""
+      !endif
+    !endif
+    !undef _c=${_c}
+    !define ${_Logic}Condition ${_c}                      ; Remember the condition used
+    !verbose pop
+  !macroend
+  !define Do      `!insertmacro _Do Do "" "" "" ""`
+  !define DoWhile `!insertmacro _Do Do true`
+  !define DoUntil `!insertmacro _Do Do false`
+
+  !macro _Goto _n _s
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    !ifndef _${_n}
+      !error "Cannot use ${_n} without a preceding ${_s}"
+    !endif
+    Goto ${_${_n}}
+    !verbose pop
+  !macroend
+  !define ExitDo   `!insertmacro _Goto ExitDo Do`
+
+  !macro _Loop _n _e _c _a _o _b
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    !ifndef _Logic | ${_Logic}${_n}
+      !error "Cannot use ${_e} without a preceding ${_n}"
+    !endif
+    !define _c=${${_Logic}Condition}
+    !ifdef _c=                                            ; If Do had no condition place the Continue label
+      ${_Continue}:
+    !endif
+    !undef _c=${${_Logic}Condition}
+    !define _c=${_c}
+    !ifdef _c=                                            ; No ending condition
+      Goto ${${_Logic}${_n}}
+    !else ifdef _c=true                                   ; If condition is true
+      !insertmacro _${_o} `${_a}` `${_b}` ${${_Logic}${_n}} ${_Exit${_n}}
+    !else                                                 ; If condition is false
+      !insertmacro _${_o} `${_a}` `${_b}` ${_Exit${_n}} ${${_Logic}${_n}}
+    !endif
+    !undef _c=${_c}
+    Goto ${_Continue}                                     ; Just to ensure it is referenced at least once
+	Goto ${_Exit${_n}}                                    ; Just to ensure it is referenced at least once
+    ${_Exit${_n}}:                                        ; Place the loop exit point
+    !undef ${_Logic}Condition
+    !insertmacro _PopScope Continue
+    !insertmacro _PopScope Break
+    !insertmacro _PopScope Exit${_n}
+    !undef ${_Logic}${_n}
+    !insertmacro _PopLogic
+    !verbose pop
+  !macroend
+  !define Loop      `!insertmacro _Loop Do Loop "" "" "" ""`
+  !define LoopWhile `!insertmacro _Loop Do LoopWhile true`
+  !define LoopUntil `!insertmacro _Loop Do LoopUntil false`
+
+  !define Continue `!insertmacro _Goto Continue "For or Do or While"`
+  !define Break    `!insertmacro _Goto Break "For or Do or While"`
+
+  !macro _Select _a
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    !insertmacro _PushLogic
+    !define ${_Logic}Select `${_a}`                       ; Remember the left hand side of the comparison
+    !verbose pop
+  !macroend
+  !define Select `!insertmacro _Select`
+
+  !macro _Select_CaseElse
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    !ifndef _Logic | ${_Logic}Select
+      !error "Cannot use Case without a preceding Select"
+    !endif
+    !ifdef ${_Logic}EndSelect                             ; This is set only after the first case
+      !ifndef ${_Logic}Else
+        !error "Cannot use Case following a CaseElse"
+      !endif
+      Goto ${${_Logic}EndSelect}                          ; Go to the EndSelect
+      ${${_Logic}Else}:                                   ; Place the Else label
+      !undef ${_Logic}Else                                ; and remove it
+    !else
+      !define ${_Logic}EndSelect _LogicLib_Label_${LOGICLIB_COUNTER}             ; Get a label for the EndSelect
+      !insertmacro _IncreaseCounter
+    !endif
+    !verbose pop
+  !macroend
+  !define CaseElse `!insertmacro _CaseElse`
+  !define Case_Else `!insertmacro _CaseElse`              ; Compatibility with 2.2 and earlier
+  !define Default `!insertmacro _CaseElse`                ; For the C-minded
+
+  !macro _Select_Case _a
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    ${CaseElse}                                           ; Perform the CaseElse
+    !define ${_Logic}Else _LogicLib_Label_${LOGICLIB_COUNTER}                    ; Get a label for the next Else and perform the new Case
+    !insertmacro _IncreaseCounter
+    !insertmacro _== `${${_Logic}Select}` `${_a}` "" ${${_Logic}Else}
+    !verbose pop
+  !macroend
+  !define Case `!insertmacro _Case`
+
+  !macro _Case2 _a _b
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    ${CaseElse}                                           ; Perform the CaseElse
+    !define ${_Logic}Else _LogicLib_Label_${LOGICLIB_COUNTER}                    ; Get a label for the next Else and perform the new Case
+    !insertmacro _IncreaseCounter
+    !insertmacro _== `${${_Logic}Select}` `${_a}` +2 ""
+    !insertmacro _== `${${_Logic}Select}` `${_b}` "" ${${_Logic}Else}
+    !verbose pop
+  !macroend
+  !define Case2 `!insertmacro _Case2`
+
+  !macro _Case3 _a _b _c
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    ${CaseElse}                                           ; Perform the CaseElse
+    !define ${_Logic}Else _LogicLib_Label_${LOGICLIB_COUNTER}                    ; Get a label for the next Else and perform the new Case
+    !insertmacro _IncreaseCounter
+    !insertmacro _== `${${_Logic}Select}` `${_a}` +3 ""
+    !insertmacro _== `${${_Logic}Select}` `${_b}` +2 ""
+    !insertmacro _== `${${_Logic}Select}` `${_c}` "" ${${_Logic}Else}
+    !verbose pop
+  !macroend
+  !define Case3 `!insertmacro _Case3`
+
+  !macro _Case4 _a _b _c _d
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    ${CaseElse}                                           ; Perform the CaseElse
+    !define ${_Logic}Else _LogicLib_Label_${LOGICLIB_COUNTER}                    ; Get a label for the next Else and perform the new Case
+    !insertmacro _IncreaseCounter
+    !insertmacro _== `${${_Logic}Select}` `${_a}` +4 ""
+    !insertmacro _== `${${_Logic}Select}` `${_b}` +3 ""
+    !insertmacro _== `${${_Logic}Select}` `${_c}` +2 ""
+    !insertmacro _== `${${_Logic}Select}` `${_d}` "" ${${_Logic}Else}
+    !verbose pop
+  !macroend
+  !define Case4 `!insertmacro _Case4`
+
+  !macro _Case5 _a _b _c _d _e
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    ${CaseElse}                                           ; Perform the CaseElse
+    !define ${_Logic}Else _LogicLib_Label_${LOGICLIB_COUNTER}                    ; Get a label for the next Else and perform the new Case
+    !insertmacro _IncreaseCounter
+    !insertmacro _== `${${_Logic}Select}` `${_a}` +5 ""
+    !insertmacro _== `${${_Logic}Select}` `${_b}` +4 ""
+    !insertmacro _== `${${_Logic}Select}` `${_c}` +3 ""
+    !insertmacro _== `${${_Logic}Select}` `${_d}` +2 ""
+    !insertmacro _== `${${_Logic}Select}` `${_e}` "" ${${_Logic}Else}
+    !verbose pop
+  !macroend
+  !define Case5 `!insertmacro _Case5`
+
+  !macro _EndSelect
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    !ifndef _Logic | ${_Logic}Select
+      !error "Cannot use EndSelect without a preceding Select"
+    !endif
+    !ifdef ${_Logic}Else
+      ${${_Logic}Else}:                                   ; Place the Else label
+      !undef ${_Logic}Else                                ; and remove it
+    !endif
+    !ifdef ${_Logic}EndSelect                             ; This won't be set if there weren't any cases
+      ${${_Logic}EndSelect}:                              ; Place the EndSelect
+      !undef ${_Logic}EndSelect                           ; and remove it
+    !endif
+    !undef ${_Logic}Select
+    !insertmacro _PopLogic
+    !verbose pop
+  !macroend
+  !define EndSelect `!insertmacro _EndSelect`
+
+  !macro _Switch _a
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    !insertmacro _PushLogic
+    !insertmacro _PushScope Switch ${_Logic}              ; Keep a separate stack for switch data
+    !insertmacro _PushScope Break _LogicLib_Label_${LOGICLIB_COUNTER}            ; Get a lable for beyond the end of the switch
+    !insertmacro _IncreaseCounter
+    !define ${_Switch}Var `${_a}`                         ; Remember the left hand side of the comparison
+    !tempfile ${_Switch}Tmp                               ; Create a temporary file
+    !define ${_Logic}Switch _LogicLib_Label_${LOGICLIB_COUNTER}                  ; Get a label for the end of the switch
+    !insertmacro _IncreaseCounter
+    Goto ${${_Logic}Switch}                               ; and go there
+    !verbose pop
+  !macroend
+  !define Switch `!insertmacro _Switch`
+
+  !macro _Case _a
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    !ifdef _Logic & ${_Logic}Select                       ; Check for an active Select
+      !insertmacro _Select_Case `${_a}`
+    !else ifndef _Switch                                  ; If not then check for an active Switch
+      !error "Cannot use Case without a preceding Select or Switch"
+    !else
+      !define _label _LogicLib_Label_${LOGICLIB_COUNTER}                         ; Get a label for this case,
+      !insertmacro _IncreaseCounter
+      ${_label}:                                          ; place it and add it's check to the temp file
+      !appendfile "${${_Switch}Tmp}" `!insertmacro _== $\`${${_Switch}Var}$\` $\`${_a}$\` ${_label} ""$\n`
+      !undef _label
+    !endif
+    !verbose pop
+  !macroend
+
+  !macro _CaseElse
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    !ifdef _Logic & ${_Logic}Select                       ; Check for an active Select
+      !insertmacro _Select_CaseElse
+    !else ifndef _Switch                                  ; If not then check for an active Switch
+      !error "Cannot use Case without a preceding Select or Switch"
+    !else ifdef ${_Switch}Else                            ; Already had a default case?
+      !error "Cannot use CaseElse following a CaseElse"
+    !else
+      !define ${_Switch}Else _LogicLib_Label_${LOGICLIB_COUNTER}                 ; Get a label for the default case,
+      !insertmacro _IncreaseCounter
+      ${${_Switch}Else}:                                  ; and place it
+    !endif
+    !verbose pop
+  !macroend
+
+  !macro _EndSwitch
+    !verbose push
+    !verbose ${LOGICLIB_VERBOSITY}
+    !ifndef _Logic | ${_Logic}Switch
+      !error "Cannot use EndSwitch without a preceding Switch"
+    !endif
+    Goto ${_Break}                                        ; Skip the jump table
+    ${${_Logic}Switch}:                                   ; Place the end of the switch
+    !undef ${_Logic}Switch
+    !include "${${_Switch}Tmp}"                           ; Include the jump table
+    !delfile "${${_Switch}Tmp}"                           ; and clear it up
+    !ifdef ${_Switch}Else                                 ; Was there a default case?
+      Goto ${${_Switch}Else}                              ; then go there if all else fails
+      !undef ${_Switch}Else
+    !endif
+    !undef ${_Switch}Tmp
+    !undef ${_Switch}Var
+    ${_Break}:                                            ; Place the break label
+    !insertmacro _PopScope Break
+    !insertmacro _PopScope Switch
+    !insertmacro _PopLogic
+    !verbose pop
+  !macroend
+  !define EndSwitch `!insertmacro _EndSwitch`
+
+!endif ; LOGICLIB
+!verbose 3
+!define LOGICLIB_VERBOSITY ${_LOGICLIB_VERBOSITY}
+!undef _LOGICLIB_VERBOSITY
+!verbose pop
Index: tmp/trunk/org.txm.setups/nsis/Include/StrFunc.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/StrFunc.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/StrFunc.nsh	(revision 728)
@@ -0,0 +1,1784 @@
+/*
+o-----------------------------------------------------------------------------o
+|String Functions Header File 1.09                                            |
+(-----------------------------------------------------------------------------)
+| By deguix                                     / A Header file for NSIS 2.01 |
+| <cevo_deguix@yahoo.com.br>                   -------------------------------|
+|                                                                             |
+|    This header file contains NSIS functions for string manipulation.        |
+o-----------------------------------------------------------------------------o
+*/
+
+!verbose push
+!verbose 3
+!ifndef STRFUNC_VERBOSITY
+  !define STRFUNC_VERBOSITY 3
+!endif
+!define _STRFUNC_VERBOSITY ${STRFUNC_VERBOSITY}
+!undef STRFUNC_VERBOSITY
+!verbose ${_STRFUNC_VERBOSITY}
+
+!include LogicLib.nsh
+
+!ifndef STRFUNC
+
+  !define FALSE 0
+  !define TRUE 1
+
+  ;Header File Identification
+
+  !define STRFUNC `String Functions Header File`
+  !define STRFUNC_SHORT `StrFunc`
+  !define STRFUNC_CREDITS `2004 Diego Pedroso`
+
+  ;Header File Version
+
+  !define STRFUNC_VERMAJ 1
+  !define STRFUNC_VERMED 09
+ ;!define STRFUNC_VERMIN 0
+ ;!define STRFUNC_VERBLD 0
+
+  !define STRFUNC_VER `${STRFUNC_VERMAJ}.${STRFUNC_VERMED}`
+
+  ;Header File Init Message Prefix and Postfix
+
+  !define STRFUNC_INITMSGPRE `----------------------------------------------------------------------$\r$\n`
+  !define STRFUNC_INITMSGPOST `$\r$\n----------------------------------------------------------------------$\r$\n`
+
+  ;Header File Init Message
+
+  !verbose push
+  !verbose 4
+  !echo `${STRFUNC_INITMSGPRE}NSIS ${STRFUNC} ${STRFUNC_VER} - Copyright ${STRFUNC_CREDITS}${STRFUNC_INITMSGPOST}`
+  !verbose pop
+
+  ;Header File Function Init Message Prefix and Postfix
+
+  !define STRFUNC_FUNCMSGPRE ``
+  !define STRFUNC_FUNCMSGPOST ``
+  
+  ;Header File Function Macros
+
+  !macro STRFUNC_FUNCLIST_INSERT Name
+    !ifdef StrFunc_List
+      !define StrFunc_List2 `${StrFunc_List}`
+      !undef StrFunc_List
+      !define StrFunc_List `${StrFunc_List2}|${Name}`
+      !undef StrFunc_List2
+    !else
+      !define StrFunc_List `${Name}`
+    !endif
+  !macroend
+
+  !macro STRFUNC_DEFFUNC Name
+    !insertmacro STRFUNC_FUNCLIST_INSERT ${Name}
+  
+    !define `${Name}` `!insertmacro FUNCTION_STRING_${Name}`
+    !define `Un${Name}` `!insertmacro FUNCTION_STRING_Un${Name}`
+  !macroend
+  
+  !macro STRFUNC_FUNC ShortName Credits
+    !verbose push
+    !verbose 4
+
+    !ifndef `Un${ShortName}`
+      !echo `${STRFUNC_FUNCMSGPRE}$ {Un${ShortName}} - Copyright ${Credits}${STRFUNC_FUNCMSGPOST}`
+      !verbose pop
+      !define `Un${ShortName}` `!insertmacro FUNCTION_STRING_Un${ShortName}_Call`
+      !define `Un${ShortName}_INCLUDED`
+      Function `un.${ShortName}`
+    !else
+      !echo `${STRFUNC_FUNCMSGPRE}$ {${ShortName}} - Copyright ${Credits}${STRFUNC_FUNCMSGPOST}`
+      !verbose pop
+      !undef `${ShortName}`
+      !define `${ShortName}` `!insertmacro FUNCTION_STRING_${ShortName}_Call`
+      !define `${ShortName}_INCLUDED`
+      Function `${ShortName}`
+    !endif
+  !macroend
+
+  ;Function Names Startup Definition
+
+  !insertmacro STRFUNC_DEFFUNC StrCase
+  !define StrCase_List `ResultVar|String|Type`
+  !define StrCase_TypeList `Output|Text|Option  U L T S <>`
+  !macro `FUNCTION_STRING_UnStrCase`
+    !undef UnStrCase
+    !insertmacro FUNCTION_STRING_StrCase
+  !macroend
+  
+  !insertmacro STRFUNC_DEFFUNC StrClb
+  !define StrClb_List `ResultVar|String|Action`
+  !define StrClb_TypeList `Output|Text|Option  > < <>`
+  !macro `FUNCTION_STRING_UnStrClb`
+    !undef UnStrClb
+    !insertmacro FUNCTION_STRING_StrClb
+  !macroend
+
+  !insertmacro STRFUNC_DEFFUNC StrIOToNSIS
+  !define StrIOToNSIS_List `ResultVar|String`
+  !define StrIOToNSIS_TypeList `Output|Text`
+  !macro `FUNCTION_STRING_UnStrIOToNSIS`
+    !undef UnStrIOToNSIS
+    !insertmacro FUNCTION_STRING_StrIOToNSIS
+  !macroend
+
+  !insertmacro STRFUNC_DEFFUNC StrLoc
+  !define StrLoc_List `ResultVar|String|StrToSearchFor|CounterDirection`
+  !define StrLoc_TypeList `Output|Text|Text|Option > <`
+  !macro `FUNCTION_STRING_UnStrLoc`
+    !undef UnStrLoc
+    !insertmacro FUNCTION_STRING_StrLoc
+  !macroend
+
+  !insertmacro STRFUNC_DEFFUNC StrNSISToIO
+  !define StrNSISToIO_List `ResultVar|String`
+  !define StrNSISToIO_TypeList `Output|Text`
+  !macro `FUNCTION_STRING_UnStrNSISToIO`
+    !undef UnStrNSISToIO
+    !insertmacro FUNCTION_STRING_StrNSISToIO
+  !macroend
+
+  !insertmacro STRFUNC_DEFFUNC StrRep
+  !define StrRep_List `ResultVar|String|StrToReplace|ReplacementString`
+  !define StrRep_TypeList `Output|Text|Text|Text`
+  !macro `FUNCTION_STRING_UnStrRep`
+    !undef UnStrRep
+    !insertmacro FUNCTION_STRING_StrRep
+  !macroend
+
+  !insertmacro STRFUNC_DEFFUNC StrSort
+  !define StrSort_List `ResultVar|String|LeftStr|CenterStr|RightStr|IncludeLeftStr|IncludeCenterStr|IncludeRightStr`
+  !define StrSort_TypeList `Output|Text|Text|Text|Text|Option 1 0|Option 1 0|Option 1 0`
+  !macro `FUNCTION_STRING_UnStrSort`
+    !undef UnStrSort
+    !insertmacro FUNCTION_STRING_StrSort
+  !macroend
+
+  !insertmacro STRFUNC_DEFFUNC StrStr
+  !define StrStr_List `ResultVar|String|StrToSearchFor`
+  !define StrStr_TypeList `Output|Text|Text`
+  !macro `FUNCTION_STRING_UnStrStr`
+    !undef UnStrStr
+    !insertmacro FUNCTION_STRING_StrStr
+  !macroend
+
+  !insertmacro STRFUNC_DEFFUNC StrStrAdv
+  !define StrStrAdv_List `ResultVar|String|StrToSearchFor|SearchDirection|ResultStrDirection|DisplayStrToSearch|Loops|CaseSensitive`
+  !define StrStrAdv_TypeList `Output|Text|Text|Option > <|Option > <|Option 1 0|Text|Option 0 1`
+  !macro `FUNCTION_STRING_UnStrStrAdv`
+    !undef UnStrStrAdv
+    !insertmacro FUNCTION_STRING_StrStrAdv
+  !macroend
+
+  !insertmacro STRFUNC_DEFFUNC StrTok
+  !define StrTok_List `ResultVar|String|Separators|ResultPart|SkipEmptyParts`
+  !define StrTok_TypeList `Output|Text|Text|Mixed L|Option 1 0`
+  !macro `FUNCTION_STRING_UnStrTok`
+    !undef UnStrTok
+    !insertmacro FUNCTION_STRING_StrTok
+  !macroend
+
+  !insertmacro STRFUNC_DEFFUNC StrTrimNewLines
+  !define StrTrimNewLines_List `ResultVar|String`
+  !define StrTrimNewLines_TypeList `Output|Text`
+  !macro `FUNCTION_STRING_UnStrTrimNewLines`
+    !undef UnStrTrimNewLines
+    !insertmacro FUNCTION_STRING_StrTrimNewLines
+  !macroend
+
+  ;Function Codes for Install and Uninstall
+
+  # Function StrCase
+  ################
+
+  !macro FUNCTION_STRING_StrCase
+    !insertmacro STRFUNC_FUNC `StrCase` `2004 Diego Pedroso - Based on functions by Dave Laundon`
+
+    /*After this point:
+      ------------------------------------------
+       $0 = String (input)
+       $1 = Type (input)
+       $2 = StrLength (temp)
+       $3 = StartChar (temp)
+       $4 = EndChar (temp)
+       $5 = ResultStr (temp)
+       $6 = CurrentChar (temp)
+       $7 = LastChar (temp)
+       $8 = Temp (temp)*/
+
+      ;Get input from user
+      Exch $1
+      Exch
+      Exch $0
+      Exch
+      Push $2
+      Push $3
+      Push $4
+      Push $5
+      Push $6
+      Push $7
+      Push $8
+
+      ;Initialize variables
+      StrCpy $2 ""
+      StrCpy $3 ""
+      StrCpy $4 ""
+      StrCpy $5 ""
+      StrCpy $6 ""
+      StrCpy $7 ""
+      StrCpy $8 ""
+
+      ;Upper and lower cases are simple to use
+      ${If} $1 == "U"
+
+        ;Upper Case System:
+        ;------------------
+        ; Convert all characters to upper case.
+
+        System::Call "User32::CharUpper(t r0 r5)i"
+        Goto StrCase_End
+      ${ElseIf} $1 == "L"
+
+        ;Lower Case System:
+        ;------------------
+        ; Convert all characters to lower case.
+
+        System::Call "User32::CharLower(t r0 r5)i"
+        Goto StrCase_End
+      ${EndIf}
+
+      ;For the rest of cases:
+      ;Get "String" length
+      StrLen $2 $0
+
+      ;Make a loop until the end of "String"
+      ${For} $3 0 $2
+        ;Add 1 to "EndChar" counter also
+        IntOp $4 $3 + 1
+
+        # Step 1: Detect one character at a time
+
+        ;Remove characters before "StartChar" except when
+        ;"StartChar" is the first character of "String"
+        ${If} $3 <> 0
+          StrCpy $6 $0 `` $3
+        ${EndIf}
+
+        ;Remove characters after "EndChar" except when
+        ;"EndChar" is the last character of "String"
+        ${If} $4 <> $2
+          ${If} $3 = 0
+            StrCpy $6 $0 1
+          ${Else}
+            StrCpy $6 $6 1
+          ${EndIf}
+        ${EndIf}
+
+        # Step 2: Convert to the advanced case user chose:
+
+        ${If} $1 == "T"
+
+          ;Title Case System:
+          ;------------------
+          ; Convert all characters after a non-alphabetic character to upper case.
+          ; Else convert to lower case.
+
+          ;Use "IsCharAlpha" for the job
+          System::Call "*(&t1 r7) i .r8"
+          System::Call "*$8(&i1 .r7)"
+          System::Free $8
+          System::Call "user32::IsCharAlpha(i r7) i .r8"
+          
+          ;Verify "IsCharAlpha" result and convert the character
+          ${If} $8 = 0
+            System::Call "User32::CharUpper(t r6 r6)i"
+          ${Else}
+            System::Call "User32::CharLower(t r6 r6)i"
+          ${EndIf}
+        ${ElseIf} $1 == "S"
+
+          ;Sentence Case System:
+          ;------------------
+          ; Convert all characters after a ".", "!" or "?" character to upper case.
+          ; Else convert to lower case. Spaces or tabs after these marks are ignored.
+
+          ;Detect current characters and ignore if necessary
+          ${If} $6 == " "
+          ${OrIf} $6 == "$\t"
+            Goto IgnoreLetter
+          ${EndIf}
+
+          ;Detect last characters and convert
+          ${If} $7 == "."
+          ${OrIf} $7 == "!"
+          ${OrIf} $7 == "?"
+          ${OrIf} $7 == ""
+            System::Call "User32::CharUpper(t r6 r6)i"
+          ${Else}
+            System::Call "User32::CharLower(t r6 r6)i"
+          ${EndIf}
+        ${ElseIf} $1 == "<>"
+
+          ;Switch Case System:
+          ;------------------
+          ; Switch all characters cases to their inverse case.
+
+          ;Use "IsCharUpper" for the job
+          System::Call "*(&t1 r6) i .r8"
+          System::Call "*$8(&i1 .r7)"
+          System::Free $8
+          System::Call "user32::IsCharUpper(i r7) i .r8"
+          
+          ;Verify "IsCharUpper" result and convert the character
+          ${If} $8 = 0
+            System::Call "User32::CharUpper(t r6 r6)i"
+          ${Else}
+            System::Call "User32::CharLower(t r6 r6)i"
+          ${EndIf}
+        ${EndIf}
+
+        ;Write the character to "LastChar"
+        StrCpy $7 $6
+
+        IgnoreLetter:
+        ;Add this character to "ResultStr"
+        StrCpy $5 `$5$6`
+      ${Next}
+
+      StrCase_End:
+
+    /*After this point:
+      ------------------------------------------
+       $0 = OutVar (output)*/
+
+      ; Copy "ResultStr" to "OutVar"
+      StrCpy $0 $5
+
+      ;Return output to user
+      Pop $8
+      Pop $7
+      Pop $6
+      Pop $5
+      Pop $4
+      Pop $3
+      Pop $2
+      Pop $1
+      Exch $0
+    FunctionEnd
+
+  !macroend
+
+  !macro FUNCTION_STRING_StrClb
+    !insertmacro STRFUNC_FUNC `StrClb` `2004 Diego Pedroso - Based on functions by Nik Medved`
+
+    /*After this point:
+      ------------------------------------------
+       $0 = String (input)
+       $1 = Action (input)
+       $2 = Lock/Unlock (temp)
+       $3 = Temp (temp)
+       $4 = Temp2 (temp)*/
+
+      ;Get input from user
+
+      Exch $1
+      Exch
+      Exch $0
+      Exch
+      Push $2
+      Push $3
+      Push $4
+      
+      StrCpy $2 ""
+      StrCpy $3 ""
+      StrCpy $4 ""
+
+      ;Open the clipboard to do the operations the user chose (kichik's fix)
+      System::Call 'user32::OpenClipboard(i $HWNDPARENT)'
+
+      ${If} $1 == ">" ;Set
+
+        ;Step 1: Clear the clipboard
+        System::Call 'user32::EmptyClipboard()'
+
+        ;Step 2: Allocate global heap
+        StrLen $2 $0
+        IntOp $2 $2 + 1
+        System::Call 'kernel32::GlobalAlloc(i 2, i r2) i.r2'
+
+        ;Step 3: Lock the handle
+        System::Call 'kernel32::GlobalLock(i r2) i.r3'
+
+        ;Step 4: Copy the text to locked clipboard buffer
+        System::Call 'kernel32::lstrcpyA(i r3, t r0)'
+
+        ;Step 5: Unlock the handle again
+        System::Call 'kernel32::GlobalUnlock(i r2)'
+
+        ;Step 6: Set the information to the clipboard
+        System::Call 'user32::SetClipboardData(i 1, i r2)'
+
+        StrCpy $0 ""
+
+      ${ElseIf} $1 == "<" ;Get
+
+        ;Step 1: Get clipboard data
+        System::Call 'user32::GetClipboardData(i 1) i .r2'
+
+        ;Step 2: Lock and copy data (kichik's fix)
+        System::Call 'kernel32::GlobalLock(i r2) t .r0'
+
+        ;Step 3: Unlock (kichik's fix)
+        System::Call 'kernel32::GlobalUnlock(i r2)'
+
+      ${ElseIf} $1 == "<>" ;Swap
+
+        ;Step 1: Get clipboard data
+        System::Call 'user32::GetClipboardData(i 1) i .r2'
+
+        ;Step 2: Lock and copy data (kichik's fix)
+        System::Call 'kernel32::GlobalLock(i r2) t .r4'
+
+        ;Step 3: Unlock (kichik's fix)
+        System::Call 'kernel32::GlobalUnlock(i r2)'
+
+        ;Step 4: Clear the clipboard
+        System::Call 'user32::EmptyClipboard()'
+
+        ;Step 5: Allocate global heap
+        StrLen $2 $0
+        IntOp $2 $2 + 1
+        System::Call 'kernel32::GlobalAlloc(i 2, i r2) i.r2'
+
+        ;Step 6: Lock the handle
+        System::Call 'kernel32::GlobalLock(i r2) i.r3'
+
+        ;Step 7: Copy the text to locked clipboard buffer
+        System::Call 'kernel32::lstrcpyA(i r3, t r0)'
+
+        ;Step 8: Unlock the handle again
+        System::Call 'kernel32::GlobalUnlock(i r2)'
+
+        ;Step 9: Set the information to the clipboard
+        System::Call 'user32::SetClipboardData(i 1, i r2)'
+        
+        StrCpy $0 $4
+      ${Else} ;Clear
+
+        ;Step 1: Clear the clipboard
+        System::Call 'user32::EmptyClipboard()'
+
+        StrCpy $0 ""
+      ${EndIf}
+
+      ;Close the clipboard
+      System::Call 'user32::CloseClipboard()'
+
+    /*After this point:
+      ------------------------------------------
+       $0 = OutVar (output)*/
+
+      ;Return result to user
+      Pop $4
+      Pop $3
+      Pop $2
+      Pop $1
+      Exch $0
+    FunctionEnd
+
+  !macroend
+
+  # Function StrIOToNSIS
+  ####################
+
+  !macro FUNCTION_STRING_StrIOToNSIS
+    !insertmacro STRFUNC_FUNC `StrIOToNSIS` `2004 "bluenet" - Based on functions by Amir Szekely, Joost Verburg, Dave Laundon and Diego Pedroso`
+
+    /*After this point:
+      ------------------------------------------
+       $R0 = String (input/output)
+       $R1 = StartCharPos (temp)
+       $R2 = StrLen (temp)
+       $R3 = TempStr (temp)
+       $R4 = TempRepStr (temp)*/
+
+      ;Get input from user
+      Exch $R0
+      Push $R1
+      Push $R2
+      Push $R3
+      Push $R4
+      
+      ;Get "String" length
+      StrLen $R2 $R0
+
+      ;Loop until "String" end is reached
+      ${For} $R1 0 $R2
+        ;Get the next "String" characters
+        StrCpy $R3 $R0 2 $R1
+        
+        ;Detect if current character is:
+        ${If} $R3 == "\\" ;Back-slash
+          StrCpy $R4 "\"
+        ${ElseIf} $R3 == "\r" ;Carriage return
+          StrCpy $R4 "$\r"
+        ${ElseIf} $R3 == "\n" ;Line feed
+          StrCpy $R4 "$\n"
+        ${ElseIf} $R3 == "\t" ;Tab
+          StrCpy $R4 "$\t"
+        ${Else} ;Anything else
+          StrCpy $R4 ""
+        ${EndIf}
+
+        ;Detect if "TempRepStr" is not empty
+        ${If} $R4 != ""
+          ;Replace the old characters with the new one
+          StrCpy $R3 $R0 $R1
+          IntOp $R1 $R1 + 2
+          StrCpy $R0 $R0 "" $R1
+          StrCpy $R0 "$R3$R4$R0"
+          IntOp $R2 $R2 - 1 ;Decrease "StrLen"
+          IntOp $R1 $R1 - 2 ;Go back to the next character
+        ${EndIf}
+      ${Next}
+      Pop $R4
+      Pop $R3
+      Pop $R2
+      Pop $R1
+      Exch $R0
+    FunctionEnd
+  !macroend
+
+  # Function StrLoc
+  ###############
+
+  !macro FUNCTION_STRING_StrLoc
+    !insertmacro STRFUNC_FUNC `StrLoc` `2004 Diego Pedroso - Based on functions by Ximon Eighteen`
+
+    /*After this point:
+      ------------------------------------------
+       $R0 = OffsetDirection (input)
+       $R1 = StrToSearch (input)
+       $R2 = String (input)
+       $R3 = StrToSearchLen (temp)
+       $R4 = StrLen (temp)
+       $R5 = StartCharPos (temp)
+       $R6 = TempStr (temp)*/
+
+      ;Get input from user
+      Exch $R0
+      Exch
+      Exch $R1
+      Exch 2
+      Exch $R2
+      Push $R3
+      Push $R4
+      Push $R5
+      Push $R6
+
+      ;Get "String" and "StrToSearch" length
+      StrLen $R3 $R1
+      StrLen $R4 $R2
+      ;Start "StartCharPos" counter
+      StrCpy $R5 0
+
+      ;Loop until "StrToSearch" is found or "String" reaches its end
+      ${Do}
+        ;Remove everything before and after the searched part ("TempStr")
+        StrCpy $R6 $R2 $R3 $R5
+
+        ;Compare "TempStr" with "StrToSearch"
+        ${If} $R6 == $R1
+          ${If} $R0 == `<`
+            IntOp $R6 $R3 + $R5
+            IntOp $R0 $R4 - $R6
+          ${Else}
+            StrCpy $R0 $R5
+          ${EndIf}
+          ${ExitDo}
+        ${EndIf}
+        ;If not "StrToSearch", this could be "String" end
+        ${If} $R5 >= $R4
+          StrCpy $R0 ``
+          ${ExitDo}
+        ${EndIf}
+        ;If not, continue the loop
+        IntOp $R5 $R5 + 1
+      ${Loop}
+
+      ;Return output to user
+      Pop $R6
+      Pop $R5
+      Pop $R4
+      Pop $R3
+      Pop $R2
+      Exch
+      Pop $R1
+      Exch $R0
+    FunctionEnd
+
+  !macroend
+
+  # Function StrNSISToIO
+  ####################
+
+  !macro FUNCTION_STRING_StrNSISToIO
+    !insertmacro STRFUNC_FUNC `StrNSISToIO` `2004 "bluenet" - Based on functions by Amir Szekely, Joost Verburg, Dave Laundon and Diego Pedroso`
+
+    /*After this point:
+      ------------------------------------------
+       $R0 = String (input/output)
+       $R1 = StartCharPos (temp)
+       $R2 = StrLen (temp)
+       $R3 = TempStr (temp)
+       $R4 = TempRepStr (temp)*/
+
+      ;Get input from user
+      Exch $R0
+      Push $R1
+      Push $R2
+      Push $R3
+      Push $R4
+      
+      ;Get "String" length
+      StrLen $R2 $R0
+
+      ;Loop until "String" end is reached
+      ${For} $R1 0 $R2
+        ;Get the next "String" character
+        StrCpy $R3 $R0 1 $R1
+
+        ;Detect if current character is:
+        ${If} $R3 == "$\r" ;Back-slash
+          StrCpy $R4 "\r"
+        ${ElseIf} $R3 == "$\n" ;Carriage return
+          StrCpy $R4 "\n"
+        ${ElseIf} $R3 == "$\t" ;Line feed
+          StrCpy $R4 "\t"
+        ${ElseIf} $R3 == "\" ;Tab
+          StrCpy $R4 "\\"
+        ${Else} ;Anything else
+          StrCpy $R4 ""
+        ${EndIf}
+
+        ;Detect if "TempRepStr" is not empty
+        ${If} $R4 != ""
+          ;Replace the old character with the new ones
+          StrCpy $R3 $R0 $R1
+          IntOp $R1 $R1 + 1
+          StrCpy $R0 $R0 "" $R1
+          StrCpy $R0 "$R3$R4$R0"
+          IntOp $R2 $R2 + 1 ;Increase "StrLen"
+        ${EndIf}
+      ${Next}
+
+      ;Return output to user
+      Pop $R4
+      Pop $R3
+      Pop $R2
+      Pop $R1
+      Exch $R0
+    FunctionEnd
+  !macroend
+
+  # Function StrRep
+  ###############
+
+  !macro FUNCTION_STRING_StrRep
+    !insertmacro STRFUNC_FUNC `StrRep` `2004 Diego Pedroso - Based on functions by Hendri Adriaens`
+
+    /*After this point:
+      ------------------------------------------
+       $R0 = ReplacementString (input)
+       $R1 = StrToSearch (input)
+       $R2 = String (input)
+       $R3 = RepStrLen (temp)
+       $R4 = StrToSearchLen (temp)
+       $R5 = StrLen (temp)
+       $R6 = StartCharPos (temp)
+       $R7 = TempStrL (temp)
+       $R8 = TempStrR (temp)*/
+
+      ;Get input from user
+      Exch $R0
+      Exch
+      Exch $R1
+      Exch
+      Exch 2
+      Exch $R2
+      Push $R3
+      Push $R4
+      Push $R5
+      Push $R6
+      Push $R7
+      Push $R8
+
+      ;Return "String" if "StrToSearch" is ""
+      ${IfThen} $R1 == "" ${|} Goto Done ${|}
+
+      ;Get "ReplacementString", "String" and "StrToSearch" length
+      StrLen $R3 $R0
+      StrLen $R4 $R1
+      StrLen $R5 $R2
+      ;Start "StartCharPos" counter
+      StrCpy $R6 0
+
+      ;Loop until "StrToSearch" is found or "String" reaches its end
+      ${Do}
+        ;Remove everything before and after the searched part ("TempStrL")
+        StrCpy $R7 $R2 $R4 $R6
+
+        ;Compare "TempStrL" with "StrToSearch"
+        ${If} $R7 == $R1
+          ;Split "String" to replace the string wanted
+          StrCpy $R7 $R2 $R6 ;TempStrL
+
+          ;Calc: "StartCharPos" + "StrToSearchLen" = EndCharPos
+          IntOp $R8 $R6 + $R4
+
+          StrCpy $R8 $R2 "" $R8 ;TempStrR
+
+          ;Insert the new string between the two separated parts of "String"
+          StrCpy $R2 $R7$R0$R8
+          ;Now calculate the new "StrLen" and "StartCharPos"
+          StrLen $R5 $R2
+          IntOp $R6 $R6 + $R3
+          ${Continue}
+        ${EndIf}
+
+        ;If not "StrToSearch", this could be "String" end
+        ${IfThen} $R6 >= $R5 ${|} ${ExitDo} ${|}
+        ;If not, continue the loop
+        IntOp $R6 $R6 + 1
+      ${Loop}
+
+      Done:
+
+    /*After this point:
+      ------------------------------------------
+       $R0 = OutVar (output)*/
+
+      ;Return output to user
+      StrCpy $R0 $R2
+      Pop $R8
+      Pop $R7
+      Pop $R6
+      Pop $R5
+      Pop $R4
+      Pop $R3
+      Pop $R2
+      Pop $R1
+      Exch $R0
+    FunctionEnd
+
+  !macroend
+
+  # Function StrSort
+  ################
+
+  !macro FUNCTION_STRING_StrSort
+    !insertmacro STRFUNC_FUNC `StrSort` `2004 Diego Pedroso - Based on functions by Stuart Welch`
+
+    /*After this point:
+      ------------------------------------------
+       $R0 = String (input)
+       $R1 = LeftStr (input)
+       $R2 = CenterStr (input)
+       $R3 = RightStr (input)
+       $R4 = IncludeLeftStr (input)
+       $R5 = IncludeCenterStr (input)
+       $R6 = IncludeRightStr (input)
+
+       $0 = StrLen (temp)
+       $1 = LeftStrLen (temp)
+       $2 = CenterStrLen (temp)
+       $3 = RightStrLen (temp)
+       $4 = StartPos (temp)
+       $5 = EndPos (temp)
+       $6 = StartCharPos (temp)
+       $7 = EndCharPos (temp)
+       $8 = TempStr (temp)*/
+
+      ;Get input from user
+      Exch $R6
+      Exch
+      Exch $R5
+      Exch
+      Exch 2
+      Exch $R4
+      Exch 2
+      Exch 3
+      Exch $R3
+      Exch 3
+      Exch 4
+      Exch $R2
+      Exch 4
+      Exch 5
+      Exch $R1
+      Exch 5
+      Exch 6
+      Exch $R0
+      Exch 6
+      Push $0
+      Push $1
+      Push $2
+      Push $3
+      Push $4
+      Push $5
+      Push $6
+      Push $7
+      Push $8
+
+      ;Parameter defaults
+      ${IfThen} $R4 == `` ${|} StrCpy $R4 `1` ${|}
+      ${IfThen} $R5 == `` ${|} StrCpy $R5 `1` ${|}
+      ${IfThen} $R6 == `` ${|} StrCpy $R6 `1` ${|}
+
+      ;Get "String", "CenterStr", "LeftStr" and "RightStr" length
+      StrLen $0 $R0
+      StrLen $1 $R1
+      StrLen $2 $R2
+      StrLen $3 $R3
+      ;Start "StartCharPos" counter
+      StrCpy $6 0
+      ;Start "EndCharPos" counter based on "CenterStr" length
+      IntOp $7 $6 + $2
+
+      ;Loop until "CenterStr" is found or "String" reaches its end
+      ${Do}
+        ;Remove everything before and after the searched part ("TempStr")
+        StrCpy $8 $R0 $2 $6
+
+        ;Compare "TempStr" with "CenterStr"
+        ${IfThen} $8 == $R2 ${|} ${ExitDo} ${|}
+        ;If not, this could be "String" end
+        ${IfThen} $7 >= $0 ${|} Goto Done ${|}
+        ;If not, continue the loop
+        IntOp $6 $6 + 1
+        IntOp $7 $7 + 1
+      ${Loop}
+
+      # "CenterStr" was found
+
+      ;Remove "CenterStr" from "String" if the user wants
+      ${If} $R5 = ${FALSE}
+        StrCpy $8 $R0 $6
+        StrCpy $R0 $R0 `` $7
+        StrCpy $R0 $8$R0
+      ${EndIf}
+
+      ;"StartPos" and "EndPos" will record "CenterStr" coordinates for now
+      StrCpy $4 $6
+      StrCpy $5 $7
+      ;"StartCharPos" and "EndCharPos" should be before "CenterStr"
+      IntOp $6 $6 - $1
+      IntOp $7 $6 + $1
+
+      ;Loop until "LeftStr" is found or "String" reaches its start
+      ${Do}
+        ;Remove everything before and after the searched part ("TempStr")
+        StrCpy $8 $R0 $1 $6
+
+        ;If "LeftStr" is empty
+        ${If} $R1 == ``
+          StrCpy $6 0
+          StrCpy $7 0
+          ${ExitDo}
+        ${EndIf}
+
+        ;Compare "TempStr" with "LeftStr"
+        ${IfThen} $8 == $R1 ${|} ${ExitDo} ${|}
+        ;If not, this could be "String" start
+        ${IfThen} $6 <= 0 ${|} ${ExitDo} ${|}
+        ;If not, continue the loop
+        IntOp $6 $6 - 1
+        IntOp $7 $7 - 1
+      ${Loop}
+
+      # "LeftStr" is found or "String" start was reached
+
+      ;Remove "LeftStr" from "String" if the user wants
+      ${If} $R4 = ${FALSE}
+        IntOp $6 $6 + $1
+      ${EndIf}
+
+      ;Record "LeftStr" first character position on "TempStr" (temporarily)
+      StrCpy $8 $6
+
+      ;"StartCharPos" and "EndCharPos" should be after "CenterStr"
+      ${If} $R5 = ${FALSE}
+        StrCpy $6 $4
+      ${Else}
+        IntOp $6 $4 + $2
+      ${EndIf}
+      IntOp $7 $6 + $3
+      
+      ;Record "LeftStr" first character position on "StartPos"
+      StrCpy $4 $8
+
+      ;Loop until "RightStr" is found or "String" reaches its end
+      ${Do}
+        ;Remove everything before and after the searched part ("TempStr")
+        StrCpy $8 $R0 $3 $6
+
+        ;If "RightStr" is empty
+        ${If} $R3 == ``
+          StrCpy $6 $0
+          StrCpy $7 $0
+          ${ExitDo}
+        ${EndIf}
+
+        ;Compare "TempStr" with "RightStr"
+        ${IfThen} $8 == $R3 ${|} ${ExitDo} ${|}
+        ;If not, this could be "String" end
+        ${IfThen} $7 >= $0 ${|} ${ExitDo} ${|}
+        ;If not, continue the loop
+        IntOp $6 $6 + 1
+        IntOp $7 $7 + 1
+      ${Loop}
+
+      ;Remove "RightStr" from "String" if the user wants
+      ${If} $R6 = ${FALSE}
+        IntOp $7 $7 - $3
+      ${EndIf}
+
+      ;Record "RightStr" last character position on "StartPos"
+      StrCpy $5 $7
+
+      ;As the positionment is relative...
+      IntOp $5 $5 - $4
+
+      ;Write the string and finish the job
+      StrCpy $R0 $R0 $5 $4
+      Goto +2
+
+      Done:
+      StrCpy $R0 ``
+
+    /*After this point:
+      ------------------------------------------
+       $R0 = OutVar (output)*/
+
+      ;Return output to user
+      Pop $8
+      Pop $7
+      Pop $6
+      Pop $5
+      Pop $4
+      Pop $3
+      Pop $2
+      Pop $1
+      Pop $0
+      Pop $R6
+      Pop $R5
+      Pop $R4
+      Pop $R3
+      Pop $R2
+      Pop $R1
+      Exch $R0
+    FunctionEnd
+
+  !macroend
+  
+  # Function StrStr
+  ###############
+
+  !macro FUNCTION_STRING_StrStr
+    !insertmacro STRFUNC_FUNC `StrStr` `2004 Diego Pedroso - Based on functions by Ximon Eighteen`
+
+    /*After this point:
+      ------------------------------------------
+       $R0 = StrToSearch (input)
+       $R1 = String (input)
+       $R2 = StrToSearchLen (temp)
+       $R3 = StrLen (temp)
+       $R4 = StartCharPos (temp)
+       $R5 = TempStr (temp)*/
+
+      ;Get input from user
+      Exch $R0
+      Exch
+      Exch $R1
+      Push $R2
+      Push $R3
+      Push $R4
+      Push $R5
+
+      ;Get "String" and "StrToSearch" length
+      StrLen $R2 $R0
+      StrLen $R3 $R1
+      ;Start "StartCharPos" counter
+      StrCpy $R4 0
+
+      ;Loop until "StrToSearch" is found or "String" reaches its end
+      ${Do}
+        ;Remove everything before and after the searched part ("TempStr")
+        StrCpy $R5 $R1 $R2 $R4
+
+        ;Compare "TempStr" with "StrToSearch"
+        ${IfThen} $R5 == $R0 ${|} ${ExitDo} ${|}
+        ;If not "StrToSearch", this could be "String" end
+        ${IfThen} $R4 >= $R3 ${|} ${ExitDo} ${|}
+        ;If not, continue the loop
+        IntOp $R4 $R4 + 1
+      ${Loop}
+
+    /*After this point:
+      ------------------------------------------
+       $R0 = OutVar (output)*/
+
+      ;Remove part before "StrToSearch" on "String" (if there has one)
+      StrCpy $R0 $R1 `` $R4
+
+      ;Return output to user
+      Pop $R5
+      Pop $R4
+      Pop $R3
+      Pop $R2
+      Pop $R1
+      Exch $R0
+    FunctionEnd
+
+  !macroend
+
+  # Function StrStrAdv
+  ##################
+
+  !macro FUNCTION_STRING_StrStrAdv
+    !insertmacro STRFUNC_FUNC `StrStrAdv` `2003-2004 Diego Pedroso`
+
+    /*After this point:
+      ------------------------------------------
+       $0 = String (input)
+       $1 = StringToSearch (input)
+       $2 = DirectionOfSearch (input)
+       $3 = DirectionOfReturn (input)
+       $4 = ShowStrToSearch (input)
+       $5 = NumLoops (input)
+       $6 = CaseSensitive (input)
+       $7 = StringLength (temp)
+       $8 = StrToSearchLength (temp)
+       $9 = CurrentLoop (temp)
+       $R0 = EndCharPos (temp)
+       $R1 = StartCharPos (temp)
+       $R2 = OutVar (output)
+       $R3 = Temp (temp)*/
+
+      ;Get input from user
+
+      Exch $6
+      Exch
+      Exch $5
+      Exch
+      Exch 2
+      Exch $4
+      Exch 2
+      Exch 3
+      Exch $3
+      Exch 3
+      Exch 4
+      Exch $2
+      Exch 4
+      Exch 5
+      Exch $1
+      Exch 5
+      Exch 6
+      Exch $0
+      Exch 6
+      Push $7
+      Push $8
+      Push $9
+      Push $R3
+      Push $R2
+      Push $R1
+      Push $R0
+
+      ; Clean $R0-$R3 variables
+      StrCpy $R0 ""
+      StrCpy $R1 ""
+      StrCpy $R2 ""
+      StrCpy $R3 ""
+
+      ; Verify if we have the correct values on the variables
+      ${If} $0 == ``
+        SetErrors ;AdvStrStr_StrToSearch not found
+        Goto AdvStrStr_End
+      ${EndIf}
+
+      ${If} $1 == ``
+        SetErrors ;No text to search
+        Goto AdvStrStr_End
+      ${EndIf}
+
+      ${If} $2 != <
+        StrCpy $2 >
+      ${EndIf}
+
+      ${If} $3 != <
+        StrCpy $3 >
+      ${EndIf}
+
+      ${If} $4 <> 0
+        StrCpy $4 1
+      ${EndIf}
+
+      ${If} $5 <= 0
+        StrCpy $5 0
+      ${EndIf}
+
+      ${If} $6 <> 1
+        StrCpy $6 0
+      ${EndIf}
+
+      ; Find "AdvStrStr_String" length
+      StrLen $7 $0
+
+      ; Then find "AdvStrStr_StrToSearch" length
+      StrLen $8 $1
+
+      ; Now set up basic variables
+
+      ${If} $2 == <
+        IntOp $R1 $7 - $8
+        StrCpy $R2 $7
+      ${Else}
+        StrCpy $R1 0
+        StrCpy $R2 $8
+      ${EndIf}
+
+      StrCpy $9 0 ; First loop
+
+      ;Let's begin the search
+
+      ${Do}
+        ; Step 1: If the starting or ending numbers are negative
+        ;         or more than AdvStrStr_StringLen, we return
+        ;         error
+
+        ${If} $R1 < 0
+          StrCpy $R1 ``
+          StrCpy $R2 ``
+          StrCpy $R3 ``
+          SetErrors ;AdvStrStr_StrToSearch not found
+          Goto AdvStrStr_End
+        ${ElseIf} $R2 > $7
+          StrCpy $R1 ``
+          StrCpy $R2 ``
+          StrCpy $R3 ``
+          SetErrors ;AdvStrStr_StrToSearch not found
+          Goto AdvStrStr_End
+        ${EndIf}
+
+        ; Step 2: Start the search depending on
+        ;         AdvStrStr_DirectionOfSearch. Chop down not needed
+        ;         characters.
+
+        ${If} $R1 <> 0
+          StrCpy $R3 $0 `` $R1
+        ${EndIf}
+
+        ${If} $R2 <> $7
+          ${If} $R1 = 0
+            StrCpy $R3 $0 $8
+          ${Else}
+            StrCpy $R3 $R3 $8
+          ${EndIf}
+        ${EndIf}
+
+        ; Step 3: Make sure that's the string we want
+
+        ; Case-Sensitive Support <- Use "AdvStrStr_Temp"
+        ; variable because it won't be used anymore
+
+        ${If} $6 == 1
+          System::Call `kernel32::lstrcmpA(ts, ts) i.s` `$R3` `$1`
+          Pop $R3
+          ${If} $R3 = 0
+            StrCpy $R3 1 ; Continue
+          ${Else}
+            StrCpy $R3 0 ; Break
+          ${EndIf}
+        ${Else}
+          ${If} $R3 == $1
+            StrCpy $R3 1 ; Continue
+          ${Else}
+            StrCpy $R3 0 ; Break
+          ${EndIf}
+        ${EndIf}
+
+        ; After the comparasion, confirm that it is the
+        ; value we want.
+
+        ${If} $R3 = 1
+
+          ;We found it, return except if the user has set up to
+          ;search for another one:
+          ${If} $9 >= $5
+
+            ;Now, let's see if the user wants
+            ;AdvStrStr_StrToSearch to appear:
+            ${If} $4 == 0
+              ;Return depends on AdvStrStr_DirectionOfReturn
+              ${If} $3 == <
+                ; RTL
+                StrCpy $R0 $0 $R1
+              ${Else}
+                ; LTR
+                StrCpy $R0 $0 `` $R2
+              ${EndIf}
+              ${Break}
+            ${Else}
+              ;Return depends on AdvStrStr_DirectionOfReturn
+              ${If} $3 == <
+                ; RTL
+                StrCpy $R0 $0 $R2
+              ${Else}
+                ; LTR
+                StrCpy $R0 $0 `` $R1
+              ${EndIf}
+              ${Break}
+            ${EndIf}
+          ${Else}
+            ;If the user wants to have more loops, let's do it so!
+            IntOp $9 $9 + 1
+
+            ${If} $2 == <
+              IntOp $R1 $R1 - 1
+              IntOp $R2 $R2 - 1
+            ${Else}
+              IntOp $R1 $R1 + 1
+              IntOp $R2 $R2 + 1
+            ${EndIf}
+          ${EndIf}
+        ${Else}
+          ; Step 4: We didn't find it, so do steps 1 thru 3 again
+
+          ${If} $2 == <
+            IntOp $R1 $R1 - 1
+            IntOp $R2 $R2 - 1
+          ${Else}
+            IntOp $R1 $R1 + 1
+            IntOp $R2 $R2 + 1
+          ${EndIf}
+        ${EndIf}
+      ${Loop}
+
+      AdvStrStr_End:
+
+      ;Add 1 to AdvStrStr_EndCharPos to be supportable
+      ;by "StrCpy"
+
+      IntOp $R2 $R2 - 1
+
+      ;Return output to user
+
+      Exch $R0
+      Exch
+      Pop $R1
+      Exch
+      Pop $R2
+      Exch
+      Pop $R3
+      Exch
+      Pop $9
+      Exch
+      Pop $8
+      Exch
+      Pop $7
+      Exch
+      Pop $6
+      Exch
+      Pop $5
+      Exch
+      Pop $4
+      Exch
+      Pop $3
+      Exch
+      Pop $2
+      Exch
+      Pop $1
+      Exch
+      Pop $0
+
+    FunctionEnd
+
+  !macroend
+
+  # Function StrTok
+  ###############
+
+  !macro FUNCTION_STRING_StrTok
+    !insertmacro STRFUNC_FUNC `StrTok` `2004 Diego Pedroso - Based on functions by "bigmac666"`
+    /*After this point:
+      ------------------------------------------
+       $0 = SkipEmptyParts (input)
+       $1 = ResultPart (input)
+       $2 = Separators (input)
+       $3 = String (input)
+       $4 = StrToSearchLen (temp)
+       $5 = StrLen (temp)
+       $6 = StartCharPos (temp)
+       $7 = TempStr (temp)
+       $8 = CurrentLoop
+       $9 = CurrentSepChar
+       $R0 = CurrentSepCharNum
+       */
+
+      ;Get input from user
+      Exch $0
+      Exch
+      Exch $1
+      Exch
+      Exch 2
+      Exch $2
+      Exch 2
+      Exch 3
+      Exch $3
+      Exch 3
+      Push $4
+      Push $5
+      Push $6
+      Push $7
+      Push $8
+      Push $9
+      Push $R0
+
+      ;Parameter defaults
+      ${IfThen} $2 == `` ${|} StrCpy $2 `|` ${|}
+      ${IfThen} $1 == `` ${|} StrCpy $1 `L` ${|}
+      ${IfThen} $0 == `` ${|} StrCpy $0 `0` ${|}
+
+      ;Get "String" and "StrToSearch" length
+      StrLen $4 $2
+      StrLen $5 $3
+      ;Start "StartCharPos" and "ResultPart" counters
+      StrCpy $6 0
+      StrCpy $8 -1
+
+      ;Loop until "ResultPart" is met, "StrToSearch" is found or
+      ;"String" reaches its end
+      ResultPartLoop: ;"CurrentLoop" Loop
+
+        ;Increase "CurrentLoop" counter
+        IntOp $8 $8 + 1
+
+        StrSearchLoop:
+        ${Do} ;"String" Loop
+          ;Remove everything before and after the searched part ("TempStr")
+          StrCpy $7 $3 1 $6
+
+          ;Verify if it's the "String" end
+          ${If} $6 >= $5
+            ;If "CurrentLoop" is what the user wants, remove the part
+            ;after "TempStr" and itself and get out of here
+            ${If} $8 == $1
+            ${OrIf} $1 == `L`
+              StrCpy $3 $3 $6
+            ${Else} ;If not, empty "String" and get out of here
+              StrCpy $3 ``
+            ${EndIf}
+            StrCpy $R0 `End`
+            ${ExitDo}
+          ${EndIf}
+
+          ;Start "CurrentSepCharNum" counter (for "Separators" Loop)
+          StrCpy $R0 0
+
+          ${Do} ;"Separators" Loop
+            ;Use one "Separators" character at a time
+            ${If} $R0 <> 0
+              StrCpy $9 $2 1 $R0
+            ${Else}
+              StrCpy $9 $2 1
+            ${EndIf}
+
+            ;Go to the next "String" char if it's "Separators" end
+            ${IfThen} $R0 >= $4 ${|} ${ExitDo} ${|}
+
+            ;Or, if "TempStr" equals "CurrentSepChar", then...
+            ${If} $7 == $9
+              StrCpy $7 $3 $6
+
+              ;If "String" is empty because this result part doesn't
+              ;contain data, verify if "SkipEmptyParts" is activated,
+              ;so we don't return the output to user yet
+
+              ${If} $7 == ``
+              ${AndIf} $0 = ${TRUE}
+                IntOp $6 $6 + 1
+                StrCpy $3 $3 `` $6
+                StrCpy $6 0
+                Goto StrSearchLoop
+              ${ElseIf} $8 == $1
+                StrCpy $3 $3 $6
+                StrCpy $R0 "End"
+                ${ExitDo}
+              ${EndIf} ;If not, go to the next result part
+              IntOp $6 $6 + 1
+              StrCpy $3 $3 `` $6
+              StrCpy $6 0
+              Goto ResultPartLoop
+            ${EndIf}
+
+            ;Increase "CurrentSepCharNum" counter
+            IntOp $R0 $R0 + 1
+          ${Loop}
+          ${IfThen} $R0 == "End" ${|} ${ExitDo} ${|}
+          
+          ;Increase "StartCharPos" counter
+          IntOp $6 $6 + 1
+        ${Loop}
+
+    /*After this point:
+      ------------------------------------------
+       $3 = OutVar (output)*/
+
+      ;Return output to user
+
+      Pop $R0
+      Pop $9
+      Pop $8
+      Pop $7
+      Pop $6
+      Pop $5
+      Pop $4
+      Pop $0
+      Pop $1
+      Pop $2
+      Exch $3
+    FunctionEnd
+
+  !macroend
+
+  # Function StrTrimNewLines
+  ########################
+
+  !macro FUNCTION_STRING_StrTrimNewLines
+    !insertmacro STRFUNC_FUNC `StrTrimNewLines` `2004 Diego Pedroso - Based on functions by Ximon Eighteen`
+
+    /*After this point:
+      ------------------------------------------
+       $R0 = String (input)
+       $R1 = TrimCounter (temp)
+       $R2 = Temp (temp)*/
+
+      ;Get input from user
+      Exch $R0
+      Push $R1
+      Push $R2
+      
+      ;Initialize trim counter
+      StrCpy $R1 0
+
+      loop:
+        ;Subtract to get "String"'s last characters
+        IntOp $R1 $R1 - 1
+
+        ;Verify if they are either $\r or $\n
+        StrCpy $R2 $R0 1 $R1
+        ${If} $R2 == `$\r`
+        ${OrIf} $R2 == `$\n`
+          Goto loop
+        ${EndIf}
+
+      ;Trim characters (if needed)
+      IntOp $R1 $R1 + 1
+      ${If} $R1 < 0
+        StrCpy $R0 $R0 $R1
+      ${EndIf}
+
+    /*After this point:
+      ------------------------------------------
+       $R0 = OutVar (output)*/
+
+      ;Return output to user
+      Pop $R2
+      Pop $R1
+      Exch $R0
+    FunctionEnd
+
+  !macroend
+
+  ;Function Calls for Install and Uninstall
+
+  !macro FUNCTION_STRING_StrCase_Call ResultVar String Type
+    !verbose push
+    !verbose 4
+    !echo `$ {StrCase} "${ResultVar}" "${String}" "${Type}"`
+    !verbose pop
+
+    Push `${String}`
+    Push `${Type}`
+    Call StrCase
+    Pop `${ResultVar}`
+  !macroend
+  !macro FUNCTION_STRING_UnStrCase_Call ResultVar String Type
+    !verbose push
+    !verbose 4
+    !echo `$ {UnStrCase} "${ResultVar}" "${String}" "${Type}"`
+    !verbose pop
+
+    Push `${String}`
+    Push `${Type}`
+    Call un.StrCase
+    Pop `${ResultVar}`
+  !macroend
+
+  !macro FUNCTION_STRING_StrClb_Call ResultVar String Action
+    !verbose push
+    !verbose 4
+    !echo `$ {StrClb} "${ResultVar}" "${String}" "${Action}"`
+    !verbose pop
+
+    Push `${String}`
+    Push `${Action}`
+    Call StrClb
+    Pop `${ResultVar}`
+  !macroend
+  !macro FUNCTION_STRING_UnStrClb_Call ResultVar String Action
+    !verbose push
+    !verbose 4
+    !echo `$ {UnStrClb} "${ResultVar}" "${String}" "${Action}"`
+    !verbose pop
+
+    Push `${String}`
+    Push `${Action}`
+    Call un.StrClb
+    Pop `${ResultVar}`
+  !macroend
+
+  !macro FUNCTION_STRING_StrIOToNSIS_Call ResultVar String
+    !verbose push
+    !verbose 4
+    !echo `$ {StrIOToNSIS} "${ResultVar}" "${String}"`
+    !verbose pop
+
+    Push `${String}`
+    Call StrIOToNSIS
+    Pop `${ResultVar}`
+  !macroend
+  !macro FUNCTION_STRING_UnStrIOToNSIS_Call ResultVar String
+    !verbose push
+    !verbose 4
+    !echo `$ {UnStrIOToNSIS} "${ResultVar}" "${String}"`
+    !verbose pop
+
+    Push `${String}`
+    Call un.StrIOToNSIS
+    Pop `${ResultVar}`
+  !macroend
+
+  !macro FUNCTION_STRING_StrLoc_Call ResultVar String StrToSearchFor OffsetDirection
+    !verbose push
+    !verbose 4
+    !echo `$ {StrLoc} "${ResultVar}" "${String}" "${StrToSearchFor}" "${OffsetDirection}"`
+    !verbose pop
+
+    Push `${String}`
+    Push `${StrToSearchFor}`
+    Push `${OffsetDirection}`
+    Call StrLoc
+    Pop `${ResultVar}`
+  !macroend
+  !macro FUNCTION_STRING_UnStrLoc_Call ResultVar String StrToSearchFor OffsetDirection
+    !verbose push
+    !verbose 4
+    !echo `$ {UnStrLoc} "${ResultVar}" "${String}" "${StrToSearchFor}" "${OffsetDirection}"`
+    !verbose pop
+
+    Push `${String}`
+    Push `${StrToSearchFor}`
+    Push `${OffsetDirection}`
+    Call un.StrLoc
+    Pop `${ResultVar}`
+  !macroend
+
+  !macro FUNCTION_STRING_StrNSISToIO_Call ResultVar String
+    !verbose push
+    !verbose 4
+    !echo `$ {StrNSISToIO} "${ResultVar}" "${String}"`
+    !verbose pop
+
+    Push `${String}`
+    Call StrNSISToIO
+    Pop `${ResultVar}`
+  !macroend
+  !macro FUNCTION_STRING_UnStrNSISToIO_Call ResultVar String
+    !verbose push
+    !verbose 4
+    !echo `$ {UnStrNSISToIO} "${ResultVar}" "${String}"`
+    !verbose pop
+
+    Push `${String}`
+    Call un.StrNSISToIO
+    Pop `${ResultVar}`
+  !macroend
+
+  !macro FUNCTION_STRING_StrRep_Call ResultVar String StringToReplace ReplacementString
+    !verbose push
+    !verbose 4
+    !echo `$ {StrRep} "${ResultVar}" "${String}" "${StringToReplace}" "${ReplacementString}"`
+    !verbose pop
+
+    Push `${String}`
+    Push `${StringToReplace}`
+    Push `${ReplacementString}`
+    Call StrRep
+    Pop `${ResultVar}`
+  !macroend
+  !macro FUNCTION_STRING_UnStrRep_Call ResultVar String StringToReplace ReplacementString
+    !verbose push
+    !verbose 4
+    !echo `$ {UnStrRep} "${ResultVar}" "${String}" "${StringToReplace}" "${ReplacementString}"`
+    !verbose pop
+
+    Push `${String}`
+    Push `${StringToReplace}`
+    Push `${ReplacementString}`
+    Call un.StrRep
+    Pop `${ResultVar}`
+  !macroend
+
+  !macro FUNCTION_STRING_StrSort_Call ResultVar String CenterStr LeftStr RightStr IncludeCenterStr IncludeLeftStr IncludeRightStr
+    !verbose push
+    !verbose 4
+    !echo `$ {StrSort} "${ResultVar}" "${String}" "${CenterStr}" "${LeftStr}" "${RightStr}" "${IncludeCenterStr}" "${IncludeLeftStr}" "${IncludeRightStr}"`
+    !verbose pop
+
+    Push `${String}`
+    Push `${CenterStr}`
+    Push `${LeftStr}`
+    Push `${RightStr}`
+    Push `${IncludeCenterStr}`
+    Push `${IncludeLeftStr}`
+    Push `${IncludeRightStr}`
+    Call StrSort
+    Pop `${ResultVar}`
+  !macroend
+  !macro FUNCTION_STRING_UnStrSort_Call ResultVar String CenterStr LeftStr RightStr IncludeCenterStr IncludeLeftStr IncludeRightStr
+    !verbose push
+    !verbose 4
+    !echo `$ {UnStrSort} "${ResultVar}" "${String}" "${CenterStr}" "${LeftStr}" "${RightStr}" "${IncludeCenterStr}" "${IncludeLeftStr}" "${IncludeRightStr}"`
+    !verbose pop
+
+    Push `${String}`
+    Push `${CenterStr}`
+    Push `${LeftStr}`
+    Push `${RightStr}`
+    Push `${IncludeCenterStr}`
+    Push `${IncludeLeftStr}`
+    Push `${IncludeRightStr}`
+    Call un.StrSort
+    Pop `${ResultVar}`
+  !macroend
+
+  !macro FUNCTION_STRING_StrStr_Call ResultVar String StrToSearchFor
+    !verbose push
+    !verbose 4
+    !echo `$ {StrStr} "${ResultVar}" "${String}" "${StrToSearchFor}"`
+    !verbose pop
+
+    Push `${String}`
+    Push `${StrToSearchFor}`
+    Call StrStr
+    Pop `${ResultVar}`
+  !macroend
+  !macro FUNCTION_STRING_UnStrStr_Call ResultVar String StrToSearchFor
+    !verbose push
+    !verbose 4
+    !echo `$ {UnStrStr} "${ResultVar}" "${String}" "${StrToSearchFor}"`
+    !verbose pop
+
+    Push `${String}`
+    Push `${StrToSearchFor}`
+    Call un.StrStr
+    Pop `${ResultVar}`
+  !macroend
+
+  !macro FUNCTION_STRING_StrStrAdv_Call ResultVar String StrToSearchFor SearchDirection ResultStrDirection DisplayStrToSearch Loops CaseSensitive
+    !verbose push
+    !verbose 4
+    !echo `$ {StrStrAdv} "${ResultVar}" "${String}" "${StrToSearchFor}" "${SearchDirection}" "${ResultStrDirection}" "${DisplayStrToSearch}" "${Loops}" "${CaseSensitive}"`
+    !verbose pop
+
+    Push `${String}`
+    Push `${StrToSearchFor}`
+    Push `${SearchDirection}`
+    Push `${ResultStrDirection}`
+    Push `${DisplayStrToSearch}`
+    Push `${Loops}`
+    Push `${CaseSensitive}`
+    Call StrStrAdv
+    Pop `${ResultVar}`
+  !macroend
+  !macro FUNCTION_STRING_UnStrStrAdv_Call ResultVar String StrToSearchFor SearchDirection ResultStrDirection DisplayStrToSearch Loops CaseSensitive
+    !verbose push
+    !verbose 4
+    !echo `$ {UnStrStrAdv} "${ResultVar}" "${String}" "${StrToSearchFor}" "${SearchDirection}" "${ResultStrDirection}" "${DisplayStrToSearch}" "${Loops}" "${CaseSensitive}"`
+    !verbose pop
+
+    Push `${String}`
+    Push `${StrToSearchFor}`
+    Push `${SearchDirection}`
+    Push `${ResultStrDirection}`
+    Push `${DisplayStrToSearch}`
+    Push `${Loops}`
+    Push `${CaseSensitive}`
+    Call un.StrStrAdv
+    Pop `${ResultVar}`
+  !macroend
+
+  !macro FUNCTION_STRING_StrTok_Call ResultVar String Separators ResultPart SkipEmptyParts
+    !verbose push
+    !verbose 4
+    !echo `$ {StrTok} "${ResultVar}" "${String}" "${Separators}" "${ResultPart}" "${SkipEmptyParts}"`
+    !verbose pop
+
+    Push `${String}`
+    Push `${Separators}`
+    Push `${ResultPart}`
+    Push `${SkipEmptyParts}`
+    Call StrTok
+    Pop `${ResultVar}`
+  !macroend
+  !macro FUNCTION_STRING_UnStrTok_Call ResultVar String Separators ResultPart SkipEmptyParts
+    !verbose push
+    !verbose 4
+    !echo `$ {UnStrTok} "${ResultVar}" "${String}" "${Separators}" "${ResultPart}" "${SkipEmptyParts}"`
+    !verbose pop
+
+    Push `${String}`
+    Push `${Separators}`
+    Push `${ResultPart}`
+    Push `${SkipEmptyParts}`
+    Call un.StrTok
+    Pop `${ResultVar}`
+  !macroend
+
+  !macro FUNCTION_STRING_StrTrimNewLines_Call ResultVar String
+    !verbose push
+    !verbose 4
+    !echo `$ {StrTrimNewLines} "${ResultVar}" "${String}"`
+    !verbose pop
+
+    Push `${String}`
+    Call StrTrimNewLines
+    Pop `${ResultVar}`
+  !macroend
+  !macro FUNCTION_STRING_UnStrTrimNewLines_Call ResultVar String
+    !verbose push
+    !verbose 4
+    !echo `$ {UnStrTrimNewLines} "${ResultVar}" "${String}"`
+    !verbose pop
+
+    Push `${String}`
+    Call un.StrTrimNewLines
+    Pop `${ResultVar}`
+  !macroend
+
+!endif
+!verbose 3
+!define STRFUNC_VERBOSITY ${_STRFUNC_VERBOSITY}
+!undef _STRFUNC_VERBOSITY
+!verbose pop
Index: tmp/trunk/org.txm.setups/nsis/Include/WinMessages.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/WinMessages.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/WinMessages.nsh	(revision 728)
@@ -0,0 +1,592 @@
+/*
+_____________________________________________________________________________
+
+                       List of common Windows Messages
+_____________________________________________________________________________
+
+ 2005 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
+
+
+Usage example:
+---------------------------------------------------
+Name "Output"
+OutFile "Output.exe"
+
+!include "WinMessages.nsh"
+
+Section
+	FindWindow $0 '#32770' '' $HWNDPARENT
+	GetDlgItem $1 $0 1027
+	SendMessage $1 ${WM_SETTEXT} 0 'STR:MyText'
+SectionEnd
+---------------------------------------------------
+
+
+Prefix  Message category
+-------------------------
+SW      ShowWindow Commands
+BM      Button control
+CB      Combo box control
+EM      Edit control
+LB      List box control
+WM      General window
+ABM     Application desktop toolbar
+DBT     Device
+DM      Default push button control
+HDM     Header control
+LVM     List view control
+SB      Status bar window
+SBM     Scroll bar control
+STM     Static control
+TCM     Tab control
+PBM     Progress bar
+-----------------------------------
+
+NOT included messages (WM_USER + X)
+-----------------------------------
+CBEM    Extended combo box control
+CDM     Common dialog box
+DL      Drag list box
+DTM     Date and time picker control
+HKM     Hot key control
+IPM     IP address control
+MCM     Month calendar control
+PGM     Pager control
+PSM     Property sheet
+RB      Rebar control
+TB      Toolbar
+TBM     Trackbar
+TTM     Tooltip control
+TVM     Tree-view control
+UDM     Up-down control
+-----------------------------------
+*/
+
+
+!ifndef WINMESSAGES_INCLUDED
+!define WINMESSAGES_INCLUDED
+!verbose push
+!verbose 3
+
+!define HWND_BROADCAST      0xFFFF
+
+#ShowWindow Commands#
+!define SW_HIDE             0
+!define SW_SHOWNORMAL       1
+!define SW_NORMAL           1
+!define SW_SHOWMINIMIZED    2
+!define SW_SHOWMAXIMIZED    3
+!define SW_MAXIMIZE         3
+!define SW_SHOWNOACTIVATE   4
+!define SW_SHOW             5
+!define SW_MINIMIZE         6
+!define SW_SHOWMINNOACTIVE  7
+!define SW_SHOWNA           8
+!define SW_RESTORE          9
+!define SW_SHOWDEFAULT      10
+!define SW_FORCEMINIMIZE    11
+!define SW_MAX              11
+
+#Button Control Messages#
+!define BM_CLICK           0x00F5
+!define BM_GETCHECK        0x00F0
+!define BM_GETIMAGE        0x00F6
+!define BM_GETSTATE        0x00F2
+!define BM_SETCHECK        0x00F1
+!define BM_SETIMAGE        0x00F7
+!define BM_SETSTATE        0x00F3
+!define BM_SETSTYLE        0x00F4
+
+!define BST_UNCHECKED      0
+!define BST_CHECKED        1
+!define BST_INDETERMINATE  2
+!define BST_PUSHED         4
+!define BST_FOCUS          8
+
+#Combo Box Messages#
+!define CB_ADDSTRING                0x0143
+!define CB_DELETESTRING             0x0144
+!define CB_DIR                      0x0145
+!define CB_FINDSTRING               0x014C
+!define CB_FINDSTRINGEXACT          0x0158
+!define CB_GETCOUNT                 0x0146
+!define CB_GETCURSEL                0x0147
+!define CB_GETDROPPEDCONTROLRECT    0x0152
+!define CB_GETDROPPEDSTATE          0x0157
+!define CB_GETDROPPEDWIDTH          0x015f
+!define CB_GETEDITSEL               0x0140
+!define CB_GETEXTENDEDUI            0x0156
+!define CB_GETHORIZONTALEXTENT      0x015d
+!define CB_GETITEMDATA              0x0150
+!define CB_GETITEMHEIGHT            0x0154
+!define CB_GETLBTEXT                0x0148
+!define CB_GETLBTEXTLEN             0x0149
+!define CB_GETLOCALE                0x015A
+!define CB_GETTOPINDEX              0x015b
+!define CB_INITSTORAGE              0x0161
+!define CB_INSERTSTRING             0x014A
+!define CB_LIMITTEXT                0x0141
+!define CB_MSGMAX                   0x015B  # 0x0162 0x0163
+!define CB_MULTIPLEADDSTRING        0x0163
+!define CB_RESETCONTENT             0x014B
+!define CB_SELECTSTRING             0x014D
+!define CB_SETCURSEL                0x014E
+!define CB_SETDROPPEDWIDTH          0x0160
+!define CB_SETEDITSEL               0x0142
+!define CB_SETEXTENDEDUI            0x0155
+!define CB_SETHORIZONTALEXTENT      0x015e
+!define CB_SETITEMDATA              0x0151
+!define CB_SETITEMHEIGHT            0x0153
+!define CB_SETLOCALE                0x0159
+!define CB_SETTOPINDEX              0x015c
+!define CB_SHOWDROPDOWN             0x014F
+
+!define CB_ERR                      -1
+
+#Edit Control Messages#
+!define EM_CANUNDO              0x00C6
+!define EM_CHARFROMPOS          0x00D7
+!define EM_EMPTYUNDOBUFFER      0x00CD
+!define EM_EXLIMITTEXT          0x0435
+!define EM_FMTLINES             0x00C8
+!define EM_GETFIRSTVISIBLELINE  0x00CE
+!define EM_GETHANDLE            0x00BD
+!define EM_GETIMESTATUS         0x00D9
+!define EM_GETLIMITTEXT         0x00D5
+!define EM_GETLINE              0x00C4
+!define EM_GETLINECOUNT         0x00BA
+!define EM_GETMARGINS           0x00D4
+!define EM_GETMODIFY            0x00B8
+!define EM_GETPASSWORDCHAR      0x00D2
+!define EM_GETRECT              0x00B2
+!define EM_GETSEL               0x00B0
+!define EM_GETTHUMB             0x00BE
+!define EM_GETWORDBREAKPROC     0x00D1
+!define EM_LIMITTEXT            0x00C5
+!define EM_LINEFROMCHAR         0x00C9
+!define EM_LINEINDEX            0x00BB
+!define EM_LINELENGTH           0x00C1
+!define EM_LINESCROLL           0x00B6
+!define EM_POSFROMCHAR          0x00D6
+!define EM_REPLACESEL           0x00C2
+!define EM_SCROLL               0x00B5
+!define EM_SCROLLCARET          0x00B7
+!define EM_SETHANDLE            0x00BC
+!define EM_SETIMESTATUS         0x00D8
+!define EM_SETLIMITTEXT         0x00C5  # Same as EM_LIMITTEXT
+!define EM_SETMARGINS           0x00D3
+!define EM_SETMODIFY            0x00B9
+!define EM_SETPASSWORDCHAR      0x00CC
+!define EM_SETREADONLY          0x00CF
+!define EM_SETRECT              0x00B3
+!define EM_SETRECTNP            0x00B4
+!define EM_SETSEL               0x00B1
+!define EM_SETTABSTOPS          0x00CB
+!define EM_SETWORDBREAKPROC     0x00D0
+!define EM_UNDO                 0x00C7
+
+#Listbox Messages#
+!define LB_ADDFILE              0x0196
+!define LB_ADDSTRING            0x0180
+!define LB_DELETESTRING         0x0182
+!define LB_DIR                  0x018D
+!define LB_FINDSTRING           0x018F
+!define LB_FINDSTRINGEXACT      0x01A2
+!define LB_GETANCHORINDEX       0x019D
+!define LB_GETCARETINDEX        0x019F
+!define LB_GETCOUNT             0x018B
+!define LB_GETCURSEL            0x0188
+!define LB_GETHORIZONTALEXTENT  0x0193
+!define LB_GETITEMDATA          0x0199
+!define LB_GETITEMHEIGHT        0x01A1
+!define LB_GETITEMRECT          0x0198
+!define LB_GETLOCALE            0x01A6
+!define LB_GETSEL               0x0187
+!define LB_GETSELCOUNT          0x0190
+!define LB_GETSELITEMS          0x0191
+!define LB_GETTEXT              0x0189
+!define LB_GETTEXTLEN           0x018A
+!define LB_GETTOPINDEX          0x018E
+!define LB_INITSTORAGE          0x01A8
+!define LB_INSERTSTRING         0x0181
+!define LB_ITEMFROMPOINT        0x01A9
+!define LB_MSGMAX               0x01A8  # 0x01B0 0x01B1
+!define LB_MULTIPLEADDSTRING    0x01B1
+!define LB_RESETCONTENT         0x0184
+!define LB_SELECTSTRING         0x018C
+!define LB_SELITEMRANGE         0x019B
+!define LB_SELITEMRANGEEX       0x0183
+!define LB_SETANCHORINDEX       0x019C
+!define LB_SETCARETINDEX        0x019E
+!define LB_SETCOLUMNWIDTH       0x0195
+!define LB_SETCOUNT             0x01A7
+!define LB_SETCURSEL            0x0186
+!define LB_SETHORIZONTALEXTENT  0x0194
+!define LB_SETITEMDATA          0x019A
+!define LB_SETITEMHEIGHT        0x01A0
+!define LB_SETLOCALE            0x01A5
+!define LB_SETSEL               0x0185
+!define LB_SETTABSTOPS          0x0192
+!define LB_SETTOPINDEX          0x0197
+
+!define LB_ERR                  -1
+
+#Window Messages#
+!define WM_ACTIVATE                     0x0006
+!define WM_ACTIVATEAPP                  0x001C
+!define WM_AFXFIRST                     0x0360
+!define WM_AFXLAST                      0x037F
+!define WM_APP                          0x8000
+!define WM_APPCOMMAND                   0x0319
+!define WM_ASKCBFORMATNAME              0x030C
+!define WM_CANCELJOURNAL                0x004B
+!define WM_CANCELMODE                   0x001F
+!define WM_CAPTURECHANGED               0x0215
+!define WM_CHANGECBCHAIN                0x030D
+!define WM_CHANGEUISTATE                0x0127
+!define WM_CHAR                         0x0102
+!define WM_CHARTOITEM                   0x002F
+!define WM_CHILDACTIVATE                0x0022
+!define WM_CLEAR                        0x0303
+!define WM_CLOSE                        0x0010
+!define WM_COMMAND                      0x0111
+!define WM_COMMNOTIFY                   0x0044  # no longer suported
+!define WM_COMPACTING                   0x0041
+!define WM_COMPAREITEM                  0x0039
+!define WM_CONTEXTMENU                  0x007B
+!define WM_CONVERTREQUESTEX             0x108
+!define WM_COPY                         0x0301
+!define WM_COPYDATA                     0x004A
+!define WM_CREATE                       0x0001
+!define WM_CTLCOLOR                     0x0019
+!define WM_CTLCOLORBTN                  0x0135
+!define WM_CTLCOLORDLG                  0x0136
+!define WM_CTLCOLOREDIT                 0x0133
+!define WM_CTLCOLORLISTBOX              0x0134
+!define WM_CTLCOLORMSGBOX               0x0132
+!define WM_CTLCOLORSCROLLBAR            0x0137
+!define WM_CTLCOLORSTATIC               0x0138
+!define WM_CUT                          0x0300
+!define WM_DDE_FIRST                    0x3E0
+!define WM_DEADCHAR                     0x0103
+!define WM_DELETEITEM                   0x002D
+!define WM_DESTROY                      0x0002
+!define WM_DESTROYCLIPBOARD             0x0307
+!define WM_DEVICECHANGE                 0x0219
+!define WM_DEVMODECHANGE                0x001B
+!define WM_DISPLAYCHANGE                0x007E
+!define WM_DRAWCLIPBOARD                0x0308
+!define WM_DRAWITEM                     0x002B
+!define WM_DROPFILES                    0x0233
+!define WM_ENABLE                       0x000A
+!define WM_ENDSESSION                   0x0016
+!define WM_ENTERIDLE                    0x0121
+!define WM_ENTERMENULOOP                0x0211
+!define WM_ENTERSIZEMOVE                0x0231
+!define WM_ERASEBKGND                   0x0014
+!define WM_EXITMENULOOP                 0x0212
+!define WM_EXITSIZEMOVE                 0x0232
+!define WM_FONTCHANGE                   0x001D
+!define WM_GETDLGCODE                   0x0087
+!define WM_GETFONT                      0x0031
+!define WM_GETHOTKEY                    0x0033
+!define WM_GETICON                      0x007F
+!define WM_GETMINMAXINFO                0x0024
+!define WM_GETOBJECT                    0x003D
+!define WM_GETTEXT                      0x000D
+!define WM_GETTEXTLENGTH                0x000E
+!define WM_HANDHELDFIRST                0x0358
+!define WM_HANDHELDLAST                 0x035F
+!define WM_HELP                         0x0053
+!define WM_HOTKEY                       0x0312
+!define WM_HSCROLL                      0x0114
+!define WM_HSCROLLCLIPBOARD             0x030E
+!define WM_ICONERASEBKGND               0x0027
+!define WM_IME_CHAR                     0x0286
+!define WM_IME_COMPOSITION              0x010F
+!define WM_IME_COMPOSITIONFULL          0x0284
+!define WM_IME_CONTROL                  0x0283
+!define WM_IME_ENDCOMPOSITION           0x010E
+!define WM_IME_KEYDOWN                  0x0290
+!define WM_IME_KEYLAST                  0x010F
+!define WM_IME_KEYUP                    0x0291
+!define WM_IME_NOTIFY                   0x0282
+!define WM_IME_REQUEST                  0x0288
+!define WM_IME_SELECT                   0x0285
+!define WM_IME_SETCONTEXT               0x0281
+!define WM_IME_STARTCOMPOSITION         0x010D
+!define WM_INITDIALOG                   0x0110
+!define WM_INITMENU                     0x0116
+!define WM_INITMENUPOPUP                0x0117
+!define WM_INPUT                        0x00FF
+!define WM_INPUTLANGCHANGE              0x0051
+!define WM_INPUTLANGCHANGEREQUEST       0x0050
+!define WM_KEYDOWN                      0x0100
+!define WM_KEYFIRST                     0x0100
+!define WM_KEYLAST                      0x0108
+!define WM_KEYUP                        0x0101
+!define WM_KILLFOCUS                    0x0008
+!define WM_LBUTTONDBLCLK                0x0203
+!define WM_LBUTTONDOWN                  0x0201
+!define WM_LBUTTONUP                    0x0202
+!define WM_MBUTTONDBLCLK                0x0209
+!define WM_MBUTTONDOWN                  0x0207
+!define WM_MBUTTONUP                    0x0208
+!define WM_MDIACTIVATE                  0x0222
+!define WM_MDICASCADE                   0x0227
+!define WM_MDICREATE                    0x0220
+!define WM_MDIDESTROY                   0x0221
+!define WM_MDIGETACTIVE                 0x0229
+!define WM_MDIICONARRANGE               0x0228
+!define WM_MDIMAXIMIZE                  0x0225
+!define WM_MDINEXT                      0x0224
+!define WM_MDIREFRESHMENU               0x0234
+!define WM_MDIRESTORE                   0x0223
+!define WM_MDISETMENU                   0x0230
+!define WM_MDITILE                      0x0226
+!define WM_MEASUREITEM                  0x002C
+!define WM_MENUCHAR                     0x0120
+!define WM_MENUCOMMAND                  0x0126
+!define WM_MENUDRAG                     0x0123
+!define WM_MENUGETOBJECT                0x0124
+!define WM_MENURBUTTONUP                0x0122
+!define WM_MENUSELECT                   0x011F
+!define WM_MOUSEACTIVATE                0x0021
+!define WM_MOUSEFIRST                   0x0200
+!define WM_MOUSEHOVER                   0x02A1
+!define WM_MOUSELAST                    0x0209  # 0x020A 0x020D
+!define WM_MOUSELEAVE                   0x02A3
+!define WM_MOUSEMOVE                    0x0200
+!define WM_MOUSEWHEEL                   0x020A
+!define WM_MOVE                         0x0003
+!define WM_MOVING                       0x0216
+!define WM_NCACTIVATE                   0x0086
+!define WM_NCCALCSIZE                   0x0083
+!define WM_NCCREATE                     0x0081
+!define WM_NCDESTROY                    0x0082
+!define WM_NCHITTEST                    0x0084
+!define WM_NCLBUTTONDBLCLK              0x00A3
+!define WM_NCLBUTTONDOWN                0x00A1
+!define WM_NCLBUTTONUP                  0x00A2
+!define WM_NCMBUTTONDBLCLK              0x00A9
+!define WM_NCMBUTTONDOWN                0x00A7
+!define WM_NCMBUTTONUP                  0x00A8
+!define WM_NCMOUSEHOVER                 0x02A0
+!define WM_NCMOUSELEAVE                 0x02A2
+!define WM_NCMOUSEMOVE                  0x00A0
+!define WM_NCPAINT                      0x0085
+!define WM_NCRBUTTONDBLCLK              0x00A6
+!define WM_NCRBUTTONDOWN                0x00A4
+!define WM_NCRBUTTONUP                  0x00A5
+!define WM_NCXBUTTONDBLCLK              0x00AD
+!define WM_NCXBUTTONDOWN                0x00AB
+!define WM_NCXBUTTONUP                  0x00AC
+!define WM_NEXTDLGCTL                   0x0028
+!define WM_NEXTMENU                     0x0213
+!define WM_NOTIFY                       0x004E
+!define WM_NOTIFYFORMAT                 0x0055
+!define WM_NULL                         0x0000
+!define WM_PAINT                        0x000F
+!define WM_PAINTCLIPBOARD               0x0309
+!define WM_PAINTICON                    0x0026
+!define WM_PALETTECHANGED               0x0311
+!define WM_PALETTEISCHANGING            0x0310
+!define WM_PARENTNOTIFY                 0x0210
+!define WM_PASTE                        0x0302
+!define WM_PENWINFIRST                  0x0380
+!define WM_PENWINLAST                   0x038F
+!define WM_POWER                        0x0048
+!define WM_POWERBROADCAST               0x0218
+!define WM_PRINT                        0x0317
+!define WM_PRINTCLIENT                  0x0318
+!define WM_QUERYDRAGICON                0x0037
+!define WM_QUERYENDSESSION              0x0011
+!define WM_QUERYNEWPALETTE              0x030F
+!define WM_QUERYOPEN                    0x0013
+!define WM_QUERYUISTATE                 0x0129
+!define WM_QUEUESYNC                    0x0023
+!define WM_QUIT                         0x0012
+!define WM_RBUTTONDBLCLK                0x0206
+!define WM_RBUTTONDOWN                  0x0204
+!define WM_RBUTTONUP                    0x0205
+!define WM_RASDIALEVENT                 0xCCCD
+!define WM_RENDERALLFORMATS             0x0306
+!define WM_RENDERFORMAT                 0x0305
+!define WM_SETCURSOR                    0x0020
+!define WM_SETFOCUS                     0x0007
+!define WM_SETFONT                      0x0030
+!define WM_SETHOTKEY                    0x0032
+!define WM_SETICON                      0x0080
+!define WM_SETREDRAW                    0x000B
+!define WM_SETTEXT                      0x000C
+!define WM_SETTINGCHANGE                0x001A  # Same as WM_WININICHANGE
+!define WM_SHOWWINDOW                   0x0018
+!define WM_SIZE                         0x0005
+!define WM_SIZECLIPBOARD                0x030B
+!define WM_SIZING                       0x0214
+!define WM_SPOOLERSTATUS                0x002A
+!define WM_STYLECHANGED                 0x007D
+!define WM_STYLECHANGING                0x007C
+!define WM_SYNCPAINT                    0x0088
+!define WM_SYSCHAR                      0x0106
+!define WM_SYSCOLORCHANGE               0x0015
+!define WM_SYSCOMMAND                   0x0112
+!define WM_SYSDEADCHAR                  0x0107
+!define WM_SYSKEYDOWN                   0x0104
+!define WM_SYSKEYUP                     0x0105
+!define WM_TABLET_FIRST                 0x02C0
+!define WM_TABLET_LAST                  0x02DF
+!define WM_THEMECHANGED                 0x031A
+!define WM_TCARD                        0x0052
+!define WM_TIMECHANGE                   0x001E
+!define WM_TIMER                        0x0113
+!define WM_UNDO                         0x0304
+!define WM_UNICHAR                      0x0109
+!define WM_UNINITMENUPOPUP              0x0125
+!define WM_UPDATEUISTATE                0x0128
+!define WM_USER                         0x400
+!define WM_USERCHANGED                  0x0054
+!define WM_VKEYTOITEM                   0x002E
+!define WM_VSCROLL                      0x0115
+!define WM_VSCROLLCLIPBOARD             0x030A
+!define WM_WINDOWPOSCHANGED             0x0047
+!define WM_WINDOWPOSCHANGING            0x0046
+!define WM_WININICHANGE                 0x001A
+!define WM_WTSSESSION_CHANGE            0x02B1
+!define WM_XBUTTONDBLCLK                0x020D
+!define WM_XBUTTONDOWN                  0x020B
+!define WM_XBUTTONUP                    0x020C
+
+
+#Application desktop toolbar#
+!define ABM_ACTIVATE         0x00000006  # lParam == TRUE/FALSE means activate/deactivate
+!define ABM_GETAUTOHIDEBAR   0x00000007
+!define ABM_GETSTATE         0x00000004
+!define ABM_GETTASKBARPOS    0x00000005
+!define ABM_NEW              0x00000000
+!define ABM_QUERYPOS         0x00000002
+!define ABM_REMOVE           0x00000001
+!define ABM_SETAUTOHIDEBAR   0x00000008  # This can fail, you MUST check the result
+!define ABM_SETPOS           0x00000003
+!define ABM_WINDOWPOSCHANGED 0x0000009
+
+#Device#
+!define DBT_APPYBEGIN                   0x0000
+!define DBT_APPYEND                     0x0001
+!define DBT_CONFIGCHANGECANCELED        0x0019
+!define DBT_CONFIGCHANGED               0x0018
+!define DBT_CONFIGMGAPI32               0x0022
+!define DBT_CONFIGMGPRIVATE             0x7FFF
+!define DBT_CUSTOMEVENT                 0x8006  # User-defined event
+!define DBT_DEVICEARRIVAL               0x8000  # System detected a new device
+!define DBT_DEVICEQUERYREMOVE           0x8001  # Wants to remove, may fail
+!define DBT_DEVICEQUERYREMOVEFAILED     0x8002  # Removal aborted
+!define DBT_DEVICEREMOVECOMPLETE        0x8004  # Device is gone
+!define DBT_DEVICEREMOVEPENDING         0x8003  # About to remove, still avail.
+!define DBT_DEVICETYPESPECIFIC          0x8005  # Type specific event
+!define DBT_DEVNODES_CHANGED            0x0007
+!define DBT_DEVTYP_DEVICEINTERFACE      0x00000005  # Device interface class
+!define DBT_DEVTYP_DEVNODE              0x00000001  # Devnode number
+!define DBT_DEVTYP_HANDLE               0x00000006  # File system handle
+!define DBT_DEVTYP_NET                  0x00000004  # Network resource
+!define DBT_DEVTYP_OEM                  0x00000000  # Oem-defined device type
+!define DBT_DEVTYP_PORT                 0x00000003  # Serial, parallel
+!define DBT_DEVTYP_VOLUME               0x00000002  # Logical volume
+!define DBT_LOW_DISK_SPACE              0x0048
+!define DBT_MONITORCHANGE               0x001B
+!define DBT_NO_DISK_SPACE               0x0047
+!define DBT_QUERYCHANGECONFIG           0x0017
+!define DBT_SHELLLOGGEDON               0x0020
+!define DBT_USERDEFINED                 0xFFFF
+!define DBT_VOLLOCKLOCKFAILED           0x8043
+!define DBT_VOLLOCKLOCKRELEASED         0x8045
+!define DBT_VOLLOCKLOCKTAKEN            0x8042
+!define DBT_VOLLOCKQUERYLOCK            0x8041
+!define DBT_VOLLOCKQUERYUNLOCK          0x8044
+!define DBT_VOLLOCKUNLOCKFAILED         0x8046
+!define DBT_VPOWERDAPI                  0x8100  # VPOWERD API for Win95
+!define DBT_VXDINITCOMPLETE             0x0023
+
+#Default push button control#
+!define DM_BITSPERPEL       0x00040000
+!define DM_COLLATE          0x00008000
+!define DM_COLOR            0x00000800
+!define DM_COPIES           0x00000100
+!define DM_DEFAULTSOURCE    0x00000200
+!define DM_DISPLAYFLAGS     0x00200000
+!define DM_DISPLAYFREQUENCY 0x00400000
+!define DM_DITHERTYPE       0x04000000
+!define DM_DUPLEX           0x00001000
+!define DM_FORMNAME         0x00010000
+!define DM_GRAYSCALE        0x00000001  # This flag is no longer valid
+!define DM_ICMINTENT        0x01000000
+!define DM_ICMMETHOD        0x00800000
+!define DM_INTERLACED       0x00000002  # This flag is no longer valid
+!define DM_LOGPIXELS        0x00020000
+!define DM_MEDIATYPE        0x02000000
+!define DM_NUP              0x00000040
+!define DM_ORIENTATION      0x00000001
+!define DM_PANNINGHEIGHT    0x10000000
+!define DM_PANNINGWIDTH     0x08000000
+!define DM_PAPERLENGTH      0x00000004
+!define DM_PAPERSIZE        0x00000002
+!define DM_PAPERWIDTH       0x00000008
+!define DM_PELSHEIGHT       0x00100000
+!define DM_PELSWIDTH        0x00080000
+!define DM_POSITION         0x00000020
+!define DM_PRINTQUALITY     0x00000400
+!define DM_SCALE            0x00000010
+!define DM_SPECVERSION      0x0320       # 0x0400 0x0401
+!define DM_TTOPTION         0x00004000
+!define DM_YRESOLUTION      0x00002000
+
+#Header control#
+!define HDM_FIRST           0x1200
+
+#List view control#
+!define LVM_FIRST           0x1000
+
+#Status bar window#
+!define SB_CONST_ALPHA      0x00000001
+!define SB_GRAD_RECT        0x00000010
+!define SB_GRAD_TRI         0x00000020
+!define SB_NONE             0x00000000
+!define SB_PIXEL_ALPHA      0x00000002
+!define SB_PREMULT_ALPHA    0x00000004
+!define SB_SIMPLEID         0x00ff
+
+#Scroll bar control#
+!define SBM_ENABLE_ARROWS           0x00E4  # Not in win3.1
+!define SBM_GETPOS                  0x00E1  # Not in win3.1
+!define SBM_GETRANGE                0x00E3  # Not in win3.1
+!define SBM_GETSCROLLINFO           0x00EA
+!define SBM_SETPOS                  0x00E0  # Not in win3.1
+!define SBM_SETRANGE                0x00E2  # Not in win3.1
+!define SBM_SETRANGEREDRAW          0x00E6  # Not in win3.1
+!define SBM_SETSCROLLINFO           0x00E9
+
+#Static control#
+!define STM_GETICON                 0x0171
+!define STM_GETIMAGE                0x0173
+!define STM_MSGMAX                  0x0174
+!define STM_ONLY_THIS_INTERFACE     0x00000001
+!define STM_ONLY_THIS_NAME          0x00000008
+!define STM_ONLY_THIS_PROTOCOL      0x00000002
+!define STM_ONLY_THIS_TYPE          0x00000004
+!define STM_SETICON                 0x0170
+!define STM_SETIMAGE                0x0172
+
+#Tab control#
+!define TCM_FIRST                   0x1300
+
+#Progress bar control#
+!define PBM_SETRANGE   0x0401
+!define PBM_SETPOS     0x0402
+!define PBM_DELTAPOS   0x0403
+!define PBM_SETSTEP    0x0404
+!define PBM_STEPIT     0x0405
+!define PBM_GETPOS     0x0408
+!define PBM_SETMARQUEE 0x040a
+
+!verbose pop
+!endif
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Include/WordFunc.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/WordFunc.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/WordFunc.nsh	(revision 728)
@@ -0,0 +1,1803 @@
+/*
+_____________________________________________________________________________
+
+                       Word Functions Header v3.3
+_____________________________________________________________________________
+
+ 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
+
+ See documentation for more information about the following functions.
+
+ Usage in script:
+ 1. !include "WordFunc.nsh"
+ 2. [Section|Function]
+      ${WordFunction} "Param1" "Param2" "..." $var
+    [SectionEnd|FunctionEnd]
+
+
+ WordFunction=[WordFind|WordFindS|WordFind2X|WordFind2XS|WordFind3X|WordFind3XS|
+               WordReplace|WordReplaceS|WordAdd|WordAddS|WordInsert|WordInsertS|
+               StrFilter|StrFilterS|VersionCompare|VersionConvert]
+
+_____________________________________________________________________________
+
+                       Thanks to:
+_____________________________________________________________________________
+
+WordFind3X
+	Afrow UK (Based on his idea of Function "StrSortLR")
+StrFilter
+	sunjammer (Function "StrUpper")
+VersionCompare
+	Afrow UK (Based on his Function "VersionCheckNew2")
+VersionConvert
+	Afrow UK (Based on his idea of Function "CharIndexReplace")
+*/
+
+
+;_____________________________________________________________________________
+;
+;                         Macros
+;_____________________________________________________________________________
+;
+; Change log window verbosity (default: 3=no script)
+;
+; Example:
+; !include "WordFunc.nsh"
+; !insertmacro WordFind
+; ${WORDFUNC_VERBOSE} 4   # all verbosity
+; !insertmacro WordReplace
+; ${WORDFUNC_VERBOSE} 3   # no script
+
+!ifndef WORDFUNC_INCLUDED
+!define WORDFUNC_INCLUDED
+
+!include Util.nsh
+
+!verbose push
+!verbose 3
+!ifndef _WORDFUNC_VERBOSE
+	!define _WORDFUNC_VERBOSE 3
+!endif
+!verbose ${_WORDFUNC_VERBOSE}
+!define WORDFUNC_VERBOSE `!insertmacro WORDFUNC_VERBOSE`
+!verbose pop
+
+!macro WORDFUNC_VERBOSE _VERBOSE
+	!verbose push
+	!verbose 3
+	!undef _WORDFUNC_VERBOSE
+	!define _WORDFUNC_VERBOSE ${_VERBOSE}
+	!verbose pop
+!macroend
+
+
+!macro WordFindCall _ART _STRING _DELIMITER _OPTION _RESULT
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+	Push `${_STRING}`
+	Push `${_DELIMITER}`
+	Push `${_OPTION}`
+	${CallArtificialFunction}${_ART} WordFind_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro WordFindSCall _ART _STRING _DELIMITER _OPTION _RESULT
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+	Push `${_STRING}`
+	Push `${_DELIMITER}`
+	Push `${_OPTION}`
+	${CallArtificialFunction}${_ART} WordFindS_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro WordFind2XCall _STRING _DELIMITER1 _DELIMITER2 _NUMBER _RESULT
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+	Push `${_STRING}`
+	Push `${_DELIMITER1}`
+	Push `${_DELIMITER2}`
+	Push `${_NUMBER}`
+	${CallArtificialFunction} WordFind2X_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro WordFind2XSCall _STRING _DELIMITER1 _DELIMITER2 _NUMBER _RESULT
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+	Push `${_STRING}`
+	Push `${_DELIMITER1}`
+	Push `${_DELIMITER2}`
+	Push `${_NUMBER}`
+	${CallArtificialFunction} WordFind2XS_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro WordFind3XCall _STRING _DELIMITER1 _CENTER _DELIMITER2 _NUMBER _RESULT
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+	Push `${_STRING}`
+	Push `${_DELIMITER1}`
+	Push `${_CENTER}`
+	Push `${_DELIMITER2}`
+	Push `${_NUMBER}`
+	${CallArtificialFunction} WordFind3X_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro WordFind3XSCall _STRING _DELIMITER1 _CENTER _DELIMITER2 _NUMBER _RESULT
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+	Push `${_STRING}`
+	Push `${_DELIMITER1}`
+	Push `${_CENTER}`
+	Push `${_DELIMITER2}`
+	Push `${_NUMBER}`
+	${CallArtificialFunction} WordFind3XS_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro WordReplaceCall _STRING _WORD1 _WORD2 _NUMBER _RESULT
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+	Push `${_STRING}`
+	Push `${_WORD1}`
+	Push `${_WORD2}`
+	Push `${_NUMBER}`
+	${CallArtificialFunction} WordReplace_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro WordReplaceSCall _STRING _WORD1 _WORD2 _NUMBER _RESULT
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+	Push `${_STRING}`
+	Push `${_WORD1}`
+	Push `${_WORD2}`
+	Push `${_NUMBER}`
+	${CallArtificialFunction} WordReplaceS_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro WordAddCall _STRING1 _DELIMITER _STRING2 _RESULT
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+	Push `${_STRING1}`
+	Push `${_DELIMITER}`
+	Push `${_STRING2}`
+	${CallArtificialFunction} WordAdd_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro WordAddSCall _STRING1 _DELIMITER _STRING2 _RESULT
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+	Push `${_STRING1}`
+	Push `${_DELIMITER}`
+	Push `${_STRING2}`
+	${CallArtificialFunction} WordAddS_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro WordInsertCall _STRING _DELIMITER _WORD _NUMBER _RESULT
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+	Push `${_STRING}`
+	Push `${_DELIMITER}`
+	Push `${_WORD}`
+	Push `${_NUMBER}`
+	${CallArtificialFunction} WordInsert_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro WordInsertSCall _STRING _DELIMITER _WORD _NUMBER _RESULT
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+	Push `${_STRING}`
+	Push `${_DELIMITER}`
+	Push `${_WORD}`
+	Push `${_NUMBER}`
+	${CallArtificialFunction} WordInsertS_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro StrFilterCall _STRING _FILTER _INCLUDE _EXCLUDE _RESULT
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+	Push `${_STRING}`
+	Push `${_FILTER}`
+	Push `${_INCLUDE}`
+	Push `${_EXCLUDE}`
+	${CallArtificialFunction} StrFilter_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro StrFilterSCall _STRING _FILTER _INCLUDE _EXCLUDE _RESULT
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+	Push `${_STRING}`
+	Push `${_FILTER}`
+	Push `${_INCLUDE}`
+	Push `${_EXCLUDE}`
+	${CallArtificialFunction} StrFilterS_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro VersionCompareCall _VER1 _VER2 _RESULT
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+	Push `${_VER1}`
+	Push `${_VER2}`
+	${CallArtificialFunction} VersionCompare_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro VersionConvertCall _VERSION _CHARLIST _RESULT
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+	Push `${_VERSION}`
+	Push `${_CHARLIST}`
+	${CallArtificialFunction} VersionConvert_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro WordFindBody _WORDFUNC_S
+	Exch $1
+	Exch
+	Exch $0
+	Exch
+	Exch 2
+	Exch $R0
+	Exch 2
+	Push $2
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+	Push $8
+	Push $9
+	Push $R1
+	Push $R2
+	ClearErrors
+
+	StrCpy $9 ''
+	StrCpy $2 $1 1
+	StrCpy $1 $1 '' 1
+	StrCmp $2 'E' 0 +3
+	StrCpy $9 E
+	goto -4
+
+	StrCpy $3 ''
+	StrCmp${_WORDFUNC_S} $2 '+' +6
+	StrCmp${_WORDFUNC_S} $2 '-' +5
+	StrCmp${_WORDFUNC_S} $2 '/' WordFunc_WordFind${_WORDFUNC_S}_restart
+	StrCmp${_WORDFUNC_S} $2 '#' WordFunc_WordFind${_WORDFUNC_S}_restart
+	StrCmp${_WORDFUNC_S} $2 '*' WordFunc_WordFind${_WORDFUNC_S}_restart
+	goto WordFunc_WordFind${_WORDFUNC_S}_error3
+
+	StrCpy $4 $1 1 -1
+	StrCmp${_WORDFUNC_S} $4 '*' +4
+	StrCmp${_WORDFUNC_S} $4 '}' +3
+	StrCmp${_WORDFUNC_S} $4 '{' +2
+	goto +4
+	StrCpy $1 $1 -1
+	StrCpy $3 '$4$3'
+	goto -7
+	StrCmp${_WORDFUNC_S} $3 '*' WordFunc_WordFind${_WORDFUNC_S}_error3
+	StrCmp${_WORDFUNC_S} $3 '**' WordFunc_WordFind${_WORDFUNC_S}_error3
+	StrCmp${_WORDFUNC_S} $3 '}{' WordFunc_WordFind${_WORDFUNC_S}_error3
+	IntOp $1 $1 + 0
+	StrCmp${_WORDFUNC_S} $1 0 WordFunc_WordFind${_WORDFUNC_S}_error2
+
+	WordFunc_WordFind${_WORDFUNC_S}_restart:
+	StrCmp${_WORDFUNC_S} $R0 '' WordFunc_WordFind${_WORDFUNC_S}_error1
+	StrCpy $4 0
+	StrCpy $5 0
+	StrCpy $6 0
+	StrLen $7 $0
+	goto WordFunc_WordFind${_WORDFUNC_S}_loop
+
+	WordFunc_WordFind${_WORDFUNC_S}_preloop:
+	IntOp $6 $6 + 1
+
+	WordFunc_WordFind${_WORDFUNC_S}_loop:
+	StrCpy $8 $R0 $7 $6
+	StrCmp${_WORDFUNC_S} $8$5 0 WordFunc_WordFind${_WORDFUNC_S}_error1
+	StrLen $R2 $8
+	IntCmp $R2 0 +2
+	StrCmp${_WORDFUNC_S} $8 $0 +5 WordFunc_WordFind${_WORDFUNC_S}_preloop
+	StrCmp${_WORDFUNC_S} $3 '{' WordFunc_WordFind${_WORDFUNC_S}_minus
+	StrCmp${_WORDFUNC_S} $3 '}' WordFunc_WordFind${_WORDFUNC_S}_minus
+	StrCmp${_WORDFUNC_S} $2 '*' WordFunc_WordFind${_WORDFUNC_S}_minus
+	StrCmp${_WORDFUNC_S} $5 $6 WordFunc_WordFind${_WORDFUNC_S}_minus +5
+	StrCmp${_WORDFUNC_S} $3 '{' +4
+	StrCmp${_WORDFUNC_S} $3 '}' +3
+	StrCmp${_WORDFUNC_S} $2 '*' +2
+	StrCmp${_WORDFUNC_S} $5 $6 WordFunc_WordFind${_WORDFUNC_S}_nextword
+	IntOp $4 $4 + 1
+	StrCmp${_WORDFUNC_S} $2$4 +$1 WordFunc_WordFind${_WORDFUNC_S}_plus
+	StrCmp${_WORDFUNC_S} $2 '/' 0 WordFunc_WordFind${_WORDFUNC_S}_nextword
+	IntOp $8 $6 - $5
+	StrCpy $8 $R0 $8 $5
+	StrCmp${_WORDFUNC_S} $1 $8 0 WordFunc_WordFind${_WORDFUNC_S}_nextword
+	StrCpy $R1 $4
+	goto WordFunc_WordFind${_WORDFUNC_S}_end
+	WordFunc_WordFind${_WORDFUNC_S}_nextword:
+	IntOp $6 $6 + $7
+	StrCpy $5 $6
+	goto WordFunc_WordFind${_WORDFUNC_S}_loop
+
+	WordFunc_WordFind${_WORDFUNC_S}_minus:
+	StrCmp${_WORDFUNC_S} $2 '-' 0 WordFunc_WordFind${_WORDFUNC_S}_sum
+	StrCpy $2 '+'
+	IntOp $1 $4 - $1
+	IntOp $1 $1 + 1
+	IntCmp $1 0 WordFunc_WordFind${_WORDFUNC_S}_error2 WordFunc_WordFind${_WORDFUNC_S}_error2 WordFunc_WordFind${_WORDFUNC_S}_restart
+	WordFunc_WordFind${_WORDFUNC_S}_sum:
+	StrCmp${_WORDFUNC_S} $2 '#' 0 WordFunc_WordFind${_WORDFUNC_S}_sumdelim
+	StrCpy $R1 $4
+	goto WordFunc_WordFind${_WORDFUNC_S}_end
+	WordFunc_WordFind${_WORDFUNC_S}_sumdelim:
+	StrCmp${_WORDFUNC_S} $2 '*' 0 WordFunc_WordFind${_WORDFUNC_S}_error2
+	StrCpy $R1 $4
+	goto WordFunc_WordFind${_WORDFUNC_S}_end
+
+	WordFunc_WordFind${_WORDFUNC_S}_plus:
+	StrCmp${_WORDFUNC_S} $3 '' 0 +4
+	IntOp $6 $6 - $5
+	StrCpy $R1 $R0 $6 $5
+	goto WordFunc_WordFind${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $3 '{' 0 +3
+	StrCpy $R1 $R0 $6
+	goto WordFunc_WordFind${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $3 '}' 0 +4
+	IntOp $6 $6 + $7
+	StrCpy $R1 $R0 '' $6
+	goto WordFunc_WordFind${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $3 '{*' +2
+	StrCmp${_WORDFUNC_S} $3 '*{' 0 +3
+	StrCpy $R1 $R0 $6
+	goto WordFunc_WordFind${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $3 '*}' +2
+	StrCmp${_WORDFUNC_S} $3 '}*' 0 +3
+	StrCpy $R1 $R0 '' $5
+	goto WordFunc_WordFind${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $3 '}}' 0 +3
+	StrCpy $R1 $R0 '' $6
+	goto WordFunc_WordFind${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $3 '{{' 0 +3
+	StrCpy $R1 $R0 $5
+	goto WordFunc_WordFind${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $3 '{}' 0 WordFunc_WordFind${_WORDFUNC_S}_error3
+	StrLen $3 $R0
+	StrCmp${_WORDFUNC_S} $3 $6 0 +3
+	StrCpy $0 ''
+	goto +2
+	IntOp $6 $6 + $7
+	StrCpy $8 $R0 '' $6
+	StrCmp${_WORDFUNC_S} $4$8 1 +6
+	StrCmp${_WORDFUNC_S} $4 1 +2 +7
+	IntOp $6 $6 + $7
+	StrCpy $3 $R0 $7 $6
+	StrCmp${_WORDFUNC_S} $3 '' +2
+	StrCmp${_WORDFUNC_S} $3 $0 -3 +3
+	StrCpy $R1 ''
+	goto WordFunc_WordFind${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $5 0 0 +3
+	StrCpy $0 ''
+	goto +2
+	IntOp $5 $5 - $7
+	StrCpy $3 $R0 $5
+	StrCpy $R1 '$3$0$8'
+	goto WordFunc_WordFind${_WORDFUNC_S}_end
+
+	WordFunc_WordFind${_WORDFUNC_S}_error3:
+	StrCpy $R1 3
+	goto WordFunc_WordFind${_WORDFUNC_S}_error
+	WordFunc_WordFind${_WORDFUNC_S}_error2:
+	StrCpy $R1 2
+	goto WordFunc_WordFind${_WORDFUNC_S}_error
+	WordFunc_WordFind${_WORDFUNC_S}_error1:
+	StrCpy $R1 1
+	WordFunc_WordFind${_WORDFUNC_S}_error:
+	StrCmp $9 'E' 0 +3
+	SetErrors
+
+	WordFunc_WordFind${_WORDFUNC_S}_end:
+	StrCpy $R0 $R1
+
+	Pop $R2
+	Pop $R1
+	Pop $9
+	Pop $8
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Pop $0
+	Exch $R0
+!macroend
+
+!define WordFind `!insertmacro WordFindCall ''`
+!define un.WordFind `!insertmacro WordFindCall ''`
+
+!macro WordFind
+!macroend
+
+!macro un.WordFind
+!macroend
+
+!macro WordFind_
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+
+	!insertmacro WordFindBody ''
+
+	!verbose pop
+!macroend
+
+!define WordFindS `!insertmacro WordFindSCall ''`
+!define un.WordFindS `!insertmacro WordFindSCall ''`
+
+!macro WordFindS
+!macroend
+
+!macro un.WordFindS
+!macroend
+
+!macro WordFindS_
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+
+	!insertmacro WordFindBody 'S'
+
+	!verbose pop
+!macroend
+
+!macro WordFind2XBody _WORDFUNC_S
+	Exch $2
+	Exch
+	Exch $1
+	Exch
+	Exch 2
+	Exch $0
+	Exch 2
+	Exch 3
+	Exch $R0
+	Exch 3
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+	Push $8
+	Push $9
+	Push $R1
+	Push $R2
+	ClearErrors
+
+	StrCpy $R2 ''
+	StrCpy $3 $2 1
+	StrCpy $2 $2 '' 1
+	StrCmp $3 'E' 0 +3
+	StrCpy $R2 E
+	goto -4
+
+	StrCmp${_WORDFUNC_S} $3 '+' +5
+	StrCmp${_WORDFUNC_S} $3 '-' +4
+	StrCmp${_WORDFUNC_S} $3 '#' WordFunc_WordFind2X${_WORDFUNC_S}_restart
+	StrCmp${_WORDFUNC_S} $3 '/' WordFunc_WordFind2X${_WORDFUNC_S}_restart
+	goto WordFunc_WordFind2X${_WORDFUNC_S}_error3
+
+	StrCpy $4 $2 2 -2
+	StrCmp${_WORDFUNC_S} $4 '{{' +9
+	StrCmp${_WORDFUNC_S} $4 '}}' +8
+	StrCmp${_WORDFUNC_S} $4 '{*' +7
+	StrCmp${_WORDFUNC_S} $4 '*{' +6
+	StrCmp${_WORDFUNC_S} $4 '*}' +5
+	StrCmp${_WORDFUNC_S} $4 '}*' +4
+	StrCmp${_WORDFUNC_S} $4 '{}' +3
+	StrCpy $4 ''
+	goto +2
+	StrCpy $2 $2 -2
+	IntOp $2 $2 + 0
+	StrCmp${_WORDFUNC_S} $2 0 WordFunc_WordFind2X${_WORDFUNC_S}_error2
+
+	WordFunc_WordFind2X${_WORDFUNC_S}_restart:
+	StrCmp${_WORDFUNC_S} $R0 '' WordFunc_WordFind2X${_WORDFUNC_S}_error1
+	StrCpy $5 -1
+	StrCpy $6 0
+	StrCpy $7 ''
+	StrLen $8 $0
+	StrLen $9 $1
+
+	WordFunc_WordFind2X${_WORDFUNC_S}_loop:
+	IntOp $5 $5 + 1
+
+	WordFunc_WordFind2X${_WORDFUNC_S}_delim1:
+	StrCpy $R1 $R0 $8 $5
+	StrCmp${_WORDFUNC_S} $R1$6 0 WordFunc_WordFind2X${_WORDFUNC_S}_error1
+	StrCmp${_WORDFUNC_S} $R1 '' WordFunc_WordFind2X${_WORDFUNC_S}_minus
+	StrCmp${_WORDFUNC_S} $R1 $0 +2
+	StrCmp${_WORDFUNC_S} $7 '' WordFunc_WordFind2X${_WORDFUNC_S}_loop WordFunc_WordFind2X${_WORDFUNC_S}_delim2
+	StrCmp${_WORDFUNC_S} $0 $1 0 +2
+	StrCmp${_WORDFUNC_S} $7 '' 0 WordFunc_WordFind2X${_WORDFUNC_S}_delim2
+	IntOp $7 $5 + $8
+	StrCpy $5 $7
+	goto WordFunc_WordFind2X${_WORDFUNC_S}_delim1
+
+	WordFunc_WordFind2X${_WORDFUNC_S}_delim2:
+	StrCpy $R1 $R0 $9 $5
+	StrCmp${_WORDFUNC_S} $R1 $1 0 WordFunc_WordFind2X${_WORDFUNC_S}_loop
+	IntOp $6 $6 + 1
+	StrCmp${_WORDFUNC_S} $3$6 '+$2' WordFunc_WordFind2X${_WORDFUNC_S}_plus
+	StrCmp${_WORDFUNC_S} $3 '/' 0 WordFunc_WordFind2X${_WORDFUNC_S}_nextword
+	IntOp $R1 $5 - $7
+	StrCpy $R1 $R0 $R1 $7
+	StrCmp${_WORDFUNC_S} $R1 $2 0 +3
+	StrCpy $R1 $6
+	goto WordFunc_WordFind2X${_WORDFUNC_S}_end
+	WordFunc_WordFind2X${_WORDFUNC_S}_nextword:
+	IntOp $5 $5 + $9
+	StrCpy $7 ''
+	goto WordFunc_WordFind2X${_WORDFUNC_S}_delim1
+
+	WordFunc_WordFind2X${_WORDFUNC_S}_minus:
+	StrCmp${_WORDFUNC_S} $3 '-' 0 WordFunc_WordFind2X${_WORDFUNC_S}_sum
+	StrCpy $3 +
+	IntOp $2 $6 - $2
+	IntOp $2 $2 + 1
+	IntCmp $2 0 WordFunc_WordFind2X${_WORDFUNC_S}_error2 WordFunc_WordFind2X${_WORDFUNC_S}_error2 WordFunc_WordFind2X${_WORDFUNC_S}_restart
+	WordFunc_WordFind2X${_WORDFUNC_S}_sum:
+	StrCmp${_WORDFUNC_S} $3 '#' 0 WordFunc_WordFind2X${_WORDFUNC_S}_error2
+	StrCpy $R1 $6
+	goto WordFunc_WordFind2X${_WORDFUNC_S}_end
+
+	WordFunc_WordFind2X${_WORDFUNC_S}_plus:
+	StrCmp${_WORDFUNC_S} $4 '' 0 +4
+	IntOp $R1 $5 - $7
+	StrCpy $R1 $R0 $R1 $7
+	goto WordFunc_WordFind2X${_WORDFUNC_S}_end
+	IntOp $5 $5 + $9
+	IntOp $7 $7 - $8
+	StrCmp${_WORDFUNC_S} $4 '{*' +2
+	StrCmp${_WORDFUNC_S} $4 '*{' 0 +3
+	StrCpy $R1 $R0 $5
+	goto WordFunc_WordFind2X${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $4 '*}' +2
+	StrCmp${_WORDFUNC_S} $4 '}*' 0 +3
+	StrCpy $R1 $R0 '' $7
+	goto WordFunc_WordFind2X${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $4 '}}' 0 +3
+	StrCpy $R1 $R0 '' $5
+	goto WordFunc_WordFind2X${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $4 '{{' 0 +3
+	StrCpy $R1 $R0 $7
+	goto WordFunc_WordFind2X${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $4 '{}' 0 WordFunc_WordFind2X${_WORDFUNC_S}_error3
+	StrCpy $5 $R0 '' $5
+	StrCpy $7 $R0 $7
+	StrCpy $R1 '$7$5'
+	goto WordFunc_WordFind2X${_WORDFUNC_S}_end
+
+	WordFunc_WordFind2X${_WORDFUNC_S}_error3:
+	StrCpy $R1 3
+	goto WordFunc_WordFind2X${_WORDFUNC_S}_error
+	WordFunc_WordFind2X${_WORDFUNC_S}_error2:
+	StrCpy $R1 2
+	goto WordFunc_WordFind2X${_WORDFUNC_S}_error
+	WordFunc_WordFind2X${_WORDFUNC_S}_error1:
+	StrCpy $R1 1
+	WordFunc_WordFind2X${_WORDFUNC_S}_error:
+	StrCmp $R2 'E' 0 +3
+	SetErrors
+
+	WordFunc_WordFind2X${_WORDFUNC_S}_end:
+	StrCpy $R0 $R1
+
+	Pop $R2
+	Pop $R1
+	Pop $9
+	Pop $8
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Pop $0
+	Exch $R0
+!macroend
+
+!define WordFind2X `!insertmacro WordFind2XCall`
+!define un.WordFind2X `!insertmacro WordFind2XCall`
+
+!macro WordFind2X
+!macroend
+
+!macro un.WordFind2X
+!macroend
+
+!macro WordFind2X_
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+
+	!insertmacro WordFind2XBody ''
+
+	!verbose pop
+!macroend
+
+!define WordFind2XS `!insertmacro WordFind2XSCall`
+!define un.WordFind2XS `!insertmacro WordFind2XSCall`
+
+!macro WordFind2XS
+!macroend
+
+!macro un.WordFind2XS
+!macroend
+
+!macro WordFind2XS_
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+
+	!insertmacro WordFind2XBody 'S'
+
+	!verbose pop
+!macroend
+
+!macro WordFind3XBody _WORDFUNC_S
+	Exch $3
+	Exch
+	Exch $2
+	Exch
+	Exch 2
+	Exch $1
+	Exch 2
+	Exch 3
+	Exch $0
+	Exch 3
+	Exch 4
+	Exch $R0
+	Exch 4
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+	Push $8
+	Push $9
+	Push $R1
+	Push $R2
+	Push $R3
+	Push $R4
+	Push $R5
+	ClearErrors
+
+	StrCpy $R5 ''
+	StrCpy $4 $3 1
+	StrCpy $3 $3 '' 1
+	StrCmp $4 'E' 0 +3
+	StrCpy $R5 E
+	goto -4
+
+	StrCmp${_WORDFUNC_S} $4 '+' +5
+	StrCmp${_WORDFUNC_S} $4 '-' +4
+	StrCmp${_WORDFUNC_S} $4 '#' WordFunc_WordFind3X${_WORDFUNC_S}_restart
+	StrCmp${_WORDFUNC_S} $4 '/' WordFunc_WordFind3X${_WORDFUNC_S}_restart
+	goto WordFunc_WordFind3X${_WORDFUNC_S}_error3
+
+	StrCpy $5 $3 2 -2
+	StrCmp${_WORDFUNC_S} $5 '{{' +9
+	StrCmp${_WORDFUNC_S} $5 '}}' +8
+	StrCmp${_WORDFUNC_S} $5 '{*' +7
+	StrCmp${_WORDFUNC_S} $5 '*{' +6
+	StrCmp${_WORDFUNC_S} $5 '*}' +5
+	StrCmp${_WORDFUNC_S} $5 '}*' +4
+	StrCmp${_WORDFUNC_S} $5 '{}' +3
+	StrCpy $5 ''
+	goto +2
+	StrCpy $3 $3 -2
+	IntOp $3 $3 + 0
+	StrCmp${_WORDFUNC_S} $3 0 WordFunc_WordFind3X${_WORDFUNC_S}_error2
+
+	WordFunc_WordFind3X${_WORDFUNC_S}_restart:
+	StrCmp${_WORDFUNC_S} $R0 '' WordFunc_WordFind3X${_WORDFUNC_S}_error1
+	StrCpy $6 -1
+	StrCpy $7 0
+	StrCpy $8 ''
+	StrCpy $9 ''
+	StrLen $R1 $0
+	StrLen $R2 $1
+	StrLen $R3 $2
+
+	WordFunc_WordFind3X${_WORDFUNC_S}_loop:
+	IntOp $6 $6 + 1
+
+	WordFunc_WordFind3X${_WORDFUNC_S}_delim1:
+	StrCpy $R4 $R0 $R1 $6
+	StrCmp${_WORDFUNC_S} $R4$7 0 WordFunc_WordFind3X${_WORDFUNC_S}_error1
+	StrCmp${_WORDFUNC_S} $R4 '' WordFunc_WordFind3X${_WORDFUNC_S}_minus
+	StrCmp${_WORDFUNC_S} $R4 $0 +2
+	StrCmp${_WORDFUNC_S} $8 '' WordFunc_WordFind3X${_WORDFUNC_S}_loop WordFunc_WordFind3X${_WORDFUNC_S}_center
+	StrCmp${_WORDFUNC_S} $0 $1 +2
+	StrCmp${_WORDFUNC_S} $0 $2 0 +2
+	StrCmp${_WORDFUNC_S} $8 '' 0 WordFunc_WordFind3X${_WORDFUNC_S}_center
+	IntOp $8 $6 + $R1
+	StrCpy $6 $8
+	goto WordFunc_WordFind3X${_WORDFUNC_S}_delim1
+
+	WordFunc_WordFind3X${_WORDFUNC_S}_center:
+	StrCmp${_WORDFUNC_S} $9 '' 0 WordFunc_WordFind3X${_WORDFUNC_S}_delim2
+	StrCpy $R4 $R0 $R2 $6
+	StrCmp${_WORDFUNC_S} $R4 $1 0 WordFunc_WordFind3X${_WORDFUNC_S}_loop
+	IntOp $9 $6 + $R2
+	StrCpy $6 $9
+	goto WordFunc_WordFind3X${_WORDFUNC_S}_delim1
+
+	WordFunc_WordFind3X${_WORDFUNC_S}_delim2:
+	StrCpy $R4 $R0 $R3 $6
+	StrCmp${_WORDFUNC_S} $R4 $2 0 WordFunc_WordFind3X${_WORDFUNC_S}_loop
+	IntOp $7 $7 + 1
+	StrCmp${_WORDFUNC_S} $4$7 '+$3' WordFunc_WordFind3X${_WORDFUNC_S}_plus
+	StrCmp${_WORDFUNC_S} $4 '/' 0 WordFunc_WordFind3X${_WORDFUNC_S}_nextword
+	IntOp $R4 $6 - $8
+	StrCpy $R4 $R0 $R4 $8
+	StrCmp${_WORDFUNC_S} $R4 $3 0 +3
+	StrCpy $R4 $7
+	goto WordFunc_WordFind3X${_WORDFUNC_S}_end
+	WordFunc_WordFind3X${_WORDFUNC_S}_nextword:
+	IntOp $6 $6 + $R3
+	StrCpy $8 ''
+	StrCpy $9 ''
+	goto WordFunc_WordFind3X${_WORDFUNC_S}_delim1
+
+	WordFunc_WordFind3X${_WORDFUNC_S}_minus:
+	StrCmp${_WORDFUNC_S} $4 '-' 0 WordFunc_WordFind3X${_WORDFUNC_S}_sum
+	StrCpy $4 +
+	IntOp $3 $7 - $3
+	IntOp $3 $3 + 1
+	IntCmp $3 0 WordFunc_WordFind3X${_WORDFUNC_S}_error2 WordFunc_WordFind3X${_WORDFUNC_S}_error2 WordFunc_WordFind3X${_WORDFUNC_S}_restart
+	WordFunc_WordFind3X${_WORDFUNC_S}_sum:
+	StrCmp${_WORDFUNC_S} $4 '#' 0 WordFunc_WordFind3X${_WORDFUNC_S}_error2
+	StrCpy $R4 $7
+	goto WordFunc_WordFind3X${_WORDFUNC_S}_end
+
+	WordFunc_WordFind3X${_WORDFUNC_S}_plus:
+	StrCmp${_WORDFUNC_S} $5 '' 0 +4
+	IntOp $R4 $6 - $8
+	StrCpy $R4 $R0 $R4 $8
+	goto WordFunc_WordFind3X${_WORDFUNC_S}_end
+	IntOp $6 $6 + $R3
+	IntOp $8 $8 - $R1
+	StrCmp${_WORDFUNC_S} $5 '{*' +2
+	StrCmp${_WORDFUNC_S} $5 '*{' 0 +3
+	StrCpy $R4 $R0 $6
+	goto WordFunc_WordFind3X${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $5 '*}' +2
+	StrCmp${_WORDFUNC_S} $5 '}*' 0 +3
+	StrCpy $R4 $R0 '' $8
+	goto WordFunc_WordFind3X${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $5 '}}' 0 +3
+	StrCpy $R4 $R0 '' $6
+	goto WordFunc_WordFind3X${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $5 '{{' 0 +3
+	StrCpy $R4 $R0 $8
+	goto WordFunc_WordFind3X${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $5 '{}' 0 WordFunc_WordFind3X${_WORDFUNC_S}_error3
+	StrCpy $6 $R0 '' $6
+	StrCpy $8 $R0 $8
+	StrCpy $R4 '$8$6'
+	goto WordFunc_WordFind3X${_WORDFUNC_S}_end
+
+	WordFunc_WordFind3X${_WORDFUNC_S}_error3:
+	StrCpy $R4 3
+	goto WordFunc_WordFind3X${_WORDFUNC_S}_error
+	WordFunc_WordFind3X${_WORDFUNC_S}_error2:
+	StrCpy $R4 2
+	goto WordFunc_WordFind3X${_WORDFUNC_S}_error
+	WordFunc_WordFind3X${_WORDFUNC_S}_error1:
+	StrCpy $R4 1
+	WordFunc_WordFind3X${_WORDFUNC_S}_error:
+	StrCmp $R5 'E' 0 +3
+	SetErrors
+
+	WordFunc_WordFind3X${_WORDFUNC_S}_end:
+	StrCpy $R0 $R4
+	Pop $R5
+	Pop $R4
+	Pop $R3
+	Pop $R2
+	Pop $R1
+	Pop $9
+	Pop $8
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Pop $0
+	Exch $R0
+!macroend
+
+!define WordFind3X `!insertmacro WordFind3XCall`
+!define un.WordFind3X `!insertmacro WordFind3XCall`
+
+!macro WordFind3X
+!macroend
+
+!macro un.WordFind3X
+!macroend
+
+!macro WordFind3X_
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+
+	!insertmacro WordFind3XBody ''
+
+	!verbose pop
+!macroend
+
+!define WordFind3XS `!insertmacro WordFind3XSCall`
+!define un.WordFind3XS `!insertmacro WordFind3XSCall`
+
+!macro WordFind3XS
+!macroend
+
+!macro un.WordFind3XS
+!macroend
+
+!macro WordFind3XS_
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+
+	!insertmacro WordFind3XBody 'S'
+
+	!verbose pop
+!macroend
+
+!macro WordReplaceBody _WORDFUNC_S
+	Exch $2
+	Exch
+	Exch $1
+	Exch
+	Exch 2
+	Exch $0
+	Exch 2
+	Exch 3
+	Exch $R0
+	Exch 3
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+	Push $8
+	Push $9
+	Push $R1
+	ClearErrors
+
+	StrCpy $R1 $R0
+	StrCpy $9 ''
+	StrCpy $3 $2 1
+	StrCpy $2 $2 '' 1
+	StrCmp $3 'E' 0 +3
+	StrCpy $9 E
+	goto -4
+
+	StrCpy $4 $2 1 -1
+	StrCpy $5 ''
+	StrCpy $6 ''
+	StrLen $7 $0
+
+	StrCmp${_WORDFUNC_S} $7 0 WordFunc_WordReplace${_WORDFUNC_S}_error1
+	StrCmp${_WORDFUNC_S} $R0 '' WordFunc_WordReplace${_WORDFUNC_S}_error1
+	StrCmp${_WORDFUNC_S} $3 '{' WordFunc_WordReplace${_WORDFUNC_S}_beginning
+	StrCmp${_WORDFUNC_S} $3 '}' WordFunc_WordReplace${_WORDFUNC_S}_ending WordFunc_WordReplace${_WORDFUNC_S}_errorchk
+
+	WordFunc_WordReplace${_WORDFUNC_S}_beginning:
+	StrCpy $8 $R0 $7
+	StrCmp${_WORDFUNC_S} $8 $0 0 +4
+	StrCpy $R0 $R0 '' $7
+	StrCpy $5 '$5$1'
+	goto -4
+	StrCpy $3 $2 1
+	StrCmp${_WORDFUNC_S} $3 '}' 0 WordFunc_WordReplace${_WORDFUNC_S}_merge
+
+	WordFunc_WordReplace${_WORDFUNC_S}_ending:
+	StrCpy $8 $R0 '' -$7
+	StrCmp${_WORDFUNC_S} $8 $0 0 +4
+	StrCpy $R0 $R0 -$7
+	StrCpy $6 '$6$1'
+	goto -4
+
+	WordFunc_WordReplace${_WORDFUNC_S}_merge:
+	StrCmp${_WORDFUNC_S} $4 '*' 0 +5
+	StrCmp${_WORDFUNC_S} $5 '' +2
+	StrCpy $5 $1
+	StrCmp${_WORDFUNC_S} $6 '' +2
+	StrCpy $6 $1
+	StrCpy $R0 '$5$R0$6'
+	goto WordFunc_WordReplace${_WORDFUNC_S}_end
+
+	WordFunc_WordReplace${_WORDFUNC_S}_errorchk:
+	StrCmp${_WORDFUNC_S} $3 '+' +2
+	StrCmp${_WORDFUNC_S} $3 '-' 0 WordFunc_WordReplace${_WORDFUNC_S}_error3
+
+	StrCpy $5 $2 1
+	IntOp $2 $2 + 0
+	StrCmp${_WORDFUNC_S} $2 0 0 WordFunc_WordReplace${_WORDFUNC_S}_one
+	StrCmp${_WORDFUNC_S} $5 0 WordFunc_WordReplace${_WORDFUNC_S}_error2
+	StrCpy $3 ''
+
+	WordFunc_WordReplace${_WORDFUNC_S}_all:
+	StrCpy $5 0
+	StrCpy $2 $R0 $7 $5
+	StrCmp${_WORDFUNC_S} $2 '' +4
+	StrCmp${_WORDFUNC_S} $2 $0 +6
+	IntOp $5 $5 + 1
+	goto -4
+	StrCmp${_WORDFUNC_S} $R0 $R1 WordFunc_WordReplace${_WORDFUNC_S}_error1
+	StrCpy $R0 '$3$R0'
+	goto WordFunc_WordReplace${_WORDFUNC_S}_end
+	StrCpy $2 $R0 $5
+	IntOp $5 $5 + $7
+	StrCmp${_WORDFUNC_S} $4 '*' 0 +3
+	StrCpy $6 $R0 $7 $5
+	StrCmp${_WORDFUNC_S} $6 $0 -3
+	StrCpy $R0 $R0 '' $5
+	StrCpy $3 '$3$2$1'
+	goto WordFunc_WordReplace${_WORDFUNC_S}_all
+
+	WordFunc_WordReplace${_WORDFUNC_S}_one:
+	StrCpy $5 0
+	StrCpy $8 0
+	goto WordFunc_WordReplace${_WORDFUNC_S}_loop
+
+	WordFunc_WordReplace${_WORDFUNC_S}_preloop:
+	IntOp $5 $5 + 1
+
+	WordFunc_WordReplace${_WORDFUNC_S}_loop:
+	StrCpy $6 $R0 $7 $5
+	StrCmp${_WORDFUNC_S} $6$8 0 WordFunc_WordReplace${_WORDFUNC_S}_error1
+	StrCmp${_WORDFUNC_S} $6 '' WordFunc_WordReplace${_WORDFUNC_S}_minus
+	StrCmp${_WORDFUNC_S} $6 $0 0 WordFunc_WordReplace${_WORDFUNC_S}_preloop
+	IntOp $8 $8 + 1
+	StrCmp${_WORDFUNC_S} $3$8 +$2 WordFunc_WordReplace${_WORDFUNC_S}_found
+	IntOp $5 $5 + $7
+	goto WordFunc_WordReplace${_WORDFUNC_S}_loop
+
+	WordFunc_WordReplace${_WORDFUNC_S}_minus:
+	StrCmp${_WORDFUNC_S} $3 '-' 0 WordFunc_WordReplace${_WORDFUNC_S}_error2
+	StrCpy $3 +
+	IntOp $2 $8 - $2
+	IntOp $2 $2 + 1
+	IntCmp $2 0 WordFunc_WordReplace${_WORDFUNC_S}_error2 WordFunc_WordReplace${_WORDFUNC_S}_error2 WordFunc_WordReplace${_WORDFUNC_S}_one
+
+	WordFunc_WordReplace${_WORDFUNC_S}_found:
+	StrCpy $3 $R0 $5
+	StrCmp${_WORDFUNC_S} $4 '*' 0 +5
+	StrCpy $6 $3 '' -$7
+	StrCmp${_WORDFUNC_S} $6 $0 0 +3
+	StrCpy $3 $3 -$7
+	goto -3
+	IntOp $5 $5 + $7
+	StrCmp${_WORDFUNC_S} $4 '*' 0 +3
+	StrCpy $6 $R0 $7 $5
+	StrCmp${_WORDFUNC_S} $6 $0 -3
+	StrCpy $R0 $R0 '' $5
+	StrCpy $R0 '$3$1$R0'
+	goto WordFunc_WordReplace${_WORDFUNC_S}_end
+
+	WordFunc_WordReplace${_WORDFUNC_S}_error3:
+	StrCpy $R0 3
+	goto WordFunc_WordReplace${_WORDFUNC_S}_error
+	WordFunc_WordReplace${_WORDFUNC_S}_error2:
+	StrCpy $R0 2
+	goto WordFunc_WordReplace${_WORDFUNC_S}_error
+	WordFunc_WordReplace${_WORDFUNC_S}_error1:
+	StrCpy $R0 1
+	WordFunc_WordReplace${_WORDFUNC_S}_error:
+	StrCmp $9 'E' +3
+	StrCpy $R0 $R1
+	goto +2
+	SetErrors
+
+	WordFunc_WordReplace${_WORDFUNC_S}_end:
+	Pop $R1
+	Pop $9
+	Pop $8
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Pop $0
+	Exch $R0
+!macroend
+
+!define WordReplace `!insertmacro WordReplaceCall`
+!define un.WordReplace `!insertmacro WordReplaceCall`
+
+!macro WordReplace
+!macroend
+
+!macro un.WordReplace
+!macroend
+
+!macro WordReplace_
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+
+	!insertmacro WordReplaceBody ''
+
+	!verbose pop
+!macroend
+
+!define WordReplaceS `!insertmacro WordReplaceSCall`
+!define un.WordReplaceS `!insertmacro WordReplaceSCall`
+
+!macro WordReplaceS
+!macroend
+
+!macro un.WordReplaceS
+!macroend
+
+!macro WordReplaceS_
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+
+	!insertmacro WordReplaceBody 'S'
+
+	!verbose pop
+!macroend
+
+!macro WordAddBody _WORDFUNC_S
+	Exch $1
+	Exch
+	Exch $0
+	Exch
+	Exch 2
+	Exch $R0
+	Exch 2
+	Push $2
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+	Push $R1
+	ClearErrors
+
+	StrCpy $7 ''
+	StrCpy $2 $1 1
+	StrCmp $2 'E' 0 +4
+	StrCpy $7 E
+	StrCpy $1 $1 '' 1
+	goto -4
+
+	StrCpy $5 0
+	StrCpy $R1 $R0
+	StrCpy $2 $1 '' 1
+	StrCpy $1 $1 1
+	StrCmp${_WORDFUNC_S} $1 '+' +2
+	StrCmp${_WORDFUNC_S} $1 '-' 0 WordFunc_WordAdd${_WORDFUNC_S}_error3
+
+	StrCmp${_WORDFUNC_S} $0 '' WordFunc_WordAdd${_WORDFUNC_S}_error1
+	StrCmp${_WORDFUNC_S} $2 '' WordFunc_WordAdd${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $R0 '' 0 +5
+	StrCmp${_WORDFUNC_S} $1 '-' WordFunc_WordAdd${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $1 '+' 0 +3
+	StrCpy $R0 $2
+	goto WordFunc_WordAdd${_WORDFUNC_S}_end
+
+	WordFunc_WordAdd${_WORDFUNC_S}_loop:
+	IntOp $5 $5 + 1
+	!insertmacro WordFind${_WORDFUNC_S}Call 2 $2 $0 E+$5 $3
+	IfErrors 0 WordFunc_WordAdd${_WORDFUNC_S}_/word
+	StrCmp${_WORDFUNC_S} $3 2 +4
+	StrCmp${_WORDFUNC_S} $3$5 11 0 +3
+	StrCpy $3 $2
+	goto WordFunc_WordAdd${_WORDFUNC_S}_/word
+	StrCmp${_WORDFUNC_S} $1 '-' WordFunc_WordAdd${_WORDFUNC_S}_end WordFunc_WordAdd${_WORDFUNC_S}_preend
+
+	WordFunc_WordAdd${_WORDFUNC_S}_/word:
+	!insertmacro WordFind${_WORDFUNC_S}Call 2 $R0 $0 E/$3 $4
+	IfErrors +2
+	StrCmp${_WORDFUNC_S} $1 '-' WordFunc_WordAdd${_WORDFUNC_S}_delete WordFunc_WordAdd${_WORDFUNC_S}_loop
+	StrCmp${_WORDFUNC_S} $1$4 '-1' +2
+	StrCmp${_WORDFUNC_S} $1 '-' WordFunc_WordAdd${_WORDFUNC_S}_loop +4
+	StrCmp${_WORDFUNC_S} $R0 $3 0 WordFunc_WordAdd${_WORDFUNC_S}_loop
+	StrCpy $R0 ''
+	goto WordFunc_WordAdd${_WORDFUNC_S}_end
+	StrCmp${_WORDFUNC_S} $1$4 '+1' 0 +2
+	StrCmp${_WORDFUNC_S} $R0 $3 WordFunc_WordAdd${_WORDFUNC_S}_loop
+	StrCmp${_WORDFUNC_S} $R0 $R1 +3
+	StrCpy $R1 '$R1$0$3'
+	goto WordFunc_WordAdd${_WORDFUNC_S}_loop
+	StrLen $6 $0
+	StrCpy $6 $R0 '' -$6
+	StrCmp${_WORDFUNC_S} $6 $0 0 -4
+	StrCpy $R1 '$R1$3'
+	goto WordFunc_WordAdd${_WORDFUNC_S}_loop
+
+	WordFunc_WordAdd${_WORDFUNC_S}_delete:
+	!insertmacro WordFind${_WORDFUNC_S}Call 2 $R0 $0 E+$4{} $R0
+	goto WordFunc_WordAdd${_WORDFUNC_S}_/word
+
+	WordFunc_WordAdd${_WORDFUNC_S}_error3:
+	StrCpy $R1 3
+	goto WordFunc_WordAdd${_WORDFUNC_S}_error
+	WordFunc_WordAdd${_WORDFUNC_S}_error1:
+	StrCpy $R1 1
+	WordFunc_WordAdd${_WORDFUNC_S}_error:
+	StrCmp $7 'E' 0 WordFunc_WordAdd${_WORDFUNC_S}_end
+	SetErrors
+
+	WordFunc_WordAdd${_WORDFUNC_S}_preend:
+	StrCpy $R0 $R1
+
+	WordFunc_WordAdd${_WORDFUNC_S}_end:
+	Pop $R1
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Pop $0
+	Exch $R0
+!macroend
+
+!define WordAdd `!insertmacro WordAddCall`
+!define un.WordAdd `!insertmacro WordAddCall`
+
+!macro WordAdd
+!macroend
+
+!macro un.WordAdd
+!macroend
+
+!macro WordAdd_
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+
+	!insertmacro WordAddBody ''
+
+	!verbose pop
+!macroend
+
+!define WordAddS `!insertmacro WordAddSCall`
+!define un.WordAddS `!insertmacro WordAddSCall`
+
+!macro WordAddS
+!macroend
+
+!macro un.WordAddS
+!macroend
+
+!macro WordAddS_
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+
+	!insertmacro WordAddBody 'S'
+
+	!verbose pop
+!macroend
+
+!macro WordInsertBody _WORDFUNC_S
+	Exch $2
+	Exch
+	Exch $1
+	Exch
+	Exch 2
+	Exch $0
+	Exch 2
+	Exch 3
+	Exch $R0
+	Exch 3
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+	Push $8
+	Push $9
+	Push $R1
+	ClearErrors
+
+	StrCpy $5 ''
+	StrCpy $6 $0
+	StrCpy $7 }
+
+	StrCpy $9 ''
+	StrCpy $R1 $R0
+	StrCpy $3 $2 1
+	StrCpy $2 $2 '' 1
+	StrCmp $3 'E' 0 +3
+	StrCpy $9 'E'
+	goto -4
+
+	StrCmp${_WORDFUNC_S} $3 '+' +2
+	StrCmp${_WORDFUNC_S} $3 '-' 0 WordFunc_WordInsert${_WORDFUNC_S}_error3
+	IntOp $2 $2 + 0
+	StrCmp${_WORDFUNC_S} $2 0 WordFunc_WordInsert${_WORDFUNC_S}_error2
+	StrCmp${_WORDFUNC_S} $0 '' WordFunc_WordInsert${_WORDFUNC_S}_error1
+
+	StrCmp${_WORDFUNC_S} $2 1 0 WordFunc_WordInsert${_WORDFUNC_S}_two
+	GetLabelAddress $8 WordFunc_WordInsert${_WORDFUNC_S}_oneback
+	StrCmp${_WORDFUNC_S} $3 '+' WordFunc_WordInsert${_WORDFUNC_S}_call
+	StrCpy $7 {
+	goto WordFunc_WordInsert${_WORDFUNC_S}_call
+	WordFunc_WordInsert${_WORDFUNC_S}_oneback:
+	IfErrors 0 +2
+	StrCpy $4 $R0
+	StrCmp${_WORDFUNC_S} $3 '+' 0 +3
+	StrCpy $R0 '$1$0$4'
+	goto WordFunc_WordInsert${_WORDFUNC_S}_end
+	StrCpy $R0 '$4$0$1'
+	goto WordFunc_WordInsert${_WORDFUNC_S}_end
+
+	WordFunc_WordInsert${_WORDFUNC_S}_two:
+	IntOp $2 $2 - 1
+	GetLabelAddress $8 WordFunc_WordInsert${_WORDFUNC_S}_twoback
+	StrCmp${_WORDFUNC_S} $3 '+' 0 WordFunc_WordInsert${_WORDFUNC_S}_call
+	StrCpy $7 {
+	goto WordFunc_WordInsert${_WORDFUNC_S}_call
+	WordFunc_WordInsert${_WORDFUNC_S}_twoback:
+	IfErrors 0 WordFunc_WordInsert${_WORDFUNC_S}_tree
+	StrCmp${_WORDFUNC_S} $2$4 11 0 WordFunc_WordInsert${_WORDFUNC_S}_error2
+	StrCmp${_WORDFUNC_S} $3 '+' 0 +3
+	StrCpy $R0 '$R0$0$1'
+	goto WordFunc_WordInsert${_WORDFUNC_S}_end
+	StrCpy $R0 '$1$0$R0'
+	goto WordFunc_WordInsert${_WORDFUNC_S}_end
+
+	WordFunc_WordInsert${_WORDFUNC_S}_tree:
+	StrCpy $7 }
+	StrCpy $5 $4
+	IntOp $2 $2 + 1
+	GetLabelAddress $8 WordFunc_WordInsert${_WORDFUNC_S}_treeback
+	StrCmp${_WORDFUNC_S} $3 '+' WordFunc_WordInsert${_WORDFUNC_S}_call
+	StrCpy $7 {
+	goto WordFunc_WordInsert${_WORDFUNC_S}_call
+	WordFunc_WordInsert${_WORDFUNC_S}_treeback:
+	IfErrors 0 +3
+	StrCpy $4 ''
+	StrCpy $6 ''
+	StrCmp${_WORDFUNC_S} $3 '+' 0 +3
+	StrCpy $R0 '$5$0$1$6$4'
+	goto WordFunc_WordInsert${_WORDFUNC_S}_end
+	StrCpy $R0 '$4$6$1$0$5'
+	goto WordFunc_WordInsert${_WORDFUNC_S}_end
+
+	WordFunc_WordInsert${_WORDFUNC_S}_call:
+	!insertmacro WordFind${_WORDFUNC_S}Call 2 $R0 $0 E$3$2*$7 $4
+	goto $8
+
+	WordFunc_WordInsert${_WORDFUNC_S}_error3:
+	StrCpy $R0 3
+	goto WordFunc_WordInsert${_WORDFUNC_S}_error
+	WordFunc_WordInsert${_WORDFUNC_S}_error2:
+	StrCpy $R0 2
+	goto WordFunc_WordInsert${_WORDFUNC_S}_error
+	WordFunc_WordInsert${_WORDFUNC_S}_error1:
+	StrCpy $R0 1
+	WordFunc_WordInsert${_WORDFUNC_S}_error:
+	StrCmp $9 'E' +3
+	StrCpy $R0 $R1
+	goto +2
+	SetErrors
+
+	WordFunc_WordInsert${_WORDFUNC_S}_end:
+	Pop $R1
+	Pop $9
+	Pop $8
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Pop $0
+	Exch $R0
+!macroend
+
+!define WordInsert `!insertmacro WordInsertCall`
+!define un.WordInsert `!insertmacro WordInsertCall`
+
+!macro WordInsert
+!macroend
+
+!macro un.WordInsert
+!macroend
+
+!macro WordInsert_
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+
+	!insertmacro WordInsertBody ''
+
+	!verbose pop
+!macroend
+
+
+!define WordInsertS `!insertmacro WordInsertSCall`
+!define un.WordInsertS `!insertmacro WordInsertSCall`
+
+!macro WordInsertS
+!macroend
+
+!macro un.WordInsertS
+!macroend
+
+!macro WordInsertS_
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+
+	!insertmacro WordInsertBody 'S'
+
+	!verbose pop
+!macroend
+
+!macro StrFilterBody _WORDFUNC_S
+	Exch $2
+	Exch
+	Exch $1
+	Exch
+	Exch 2
+	Exch $0
+	Exch 2
+	Exch 3
+	Exch $R0
+	Exch 3
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+	Push $R1
+	Push $R2
+	Push $R3
+	Push $R4
+	Push $R5
+	Push $R6
+	Push $R7
+	Push $R8
+	ClearErrors
+
+	StrCpy $R2 $0 '' -3
+	StrCmp $R2 "eng" WordFunc_StrFilter${_WORDFUNC_S}_eng
+	StrCmp $R2 "rus" WordFunc_StrFilter${_WORDFUNC_S}_rus
+	WordFunc_StrFilter${_WORDFUNC_S}_eng:
+	StrCpy $4 65
+	StrCpy $5 90
+	StrCpy $6 97
+	StrCpy $7 122
+	goto WordFunc_StrFilter${_WORDFUNC_S}_langend
+	WordFunc_StrFilter${_WORDFUNC_S}_rus:
+	StrCpy $4 192
+	StrCpy $5 223
+	StrCpy $6 224
+	StrCpy $7 255
+	goto WordFunc_StrFilter${_WORDFUNC_S}_langend
+	;...
+
+	WordFunc_StrFilter${_WORDFUNC_S}_langend:
+	StrCpy $R7 ''
+	StrCpy $R8 ''
+
+	StrCmp${_WORDFUNC_S} $2 '' 0 WordFunc_StrFilter${_WORDFUNC_S}_begin
+
+	WordFunc_StrFilter${_WORDFUNC_S}_restart1:
+	StrCpy $2 ''
+	StrCpy $3 $0 1
+	StrCmp${_WORDFUNC_S} $3 '+' +2
+	StrCmp${_WORDFUNC_S} $3 '-' 0 +3
+	StrCpy $0 $0 '' 1
+	goto +2
+	StrCpy $3 ''
+
+	IntOp $0 $0 + 0
+	StrCmp${_WORDFUNC_S} $0 0 +5
+	StrCpy $R7 $0 1 0
+	StrCpy $R8 $0 1 1
+	StrCpy $R2 $0 1 2
+	StrCmp${_WORDFUNC_S} $R2 '' WordFunc_StrFilter${_WORDFUNC_S}_filter WordFunc_StrFilter${_WORDFUNC_S}_error
+
+	WordFunc_StrFilter${_WORDFUNC_S}_restart2:
+	StrCmp${_WORDFUNC_S} $3 '' WordFunc_StrFilter${_WORDFUNC_S}_end
+	StrCpy $R7 ''
+	StrCpy $R8 '+-'
+	goto WordFunc_StrFilter${_WORDFUNC_S}_begin
+
+	WordFunc_StrFilter${_WORDFUNC_S}_filter:
+	StrCmp${_WORDFUNC_S} $R7 '1' +3
+	StrCmp${_WORDFUNC_S} $R7 '2' +2
+	StrCmp${_WORDFUNC_S} $R7 '3' 0 WordFunc_StrFilter${_WORDFUNC_S}_error
+
+	StrCmp${_WORDFUNC_S} $R8 '' WordFunc_StrFilter${_WORDFUNC_S}_begin
+	StrCmp${_WORDFUNC_S} $R7$R8 '23' +2
+	StrCmp${_WORDFUNC_S} $R7$R8 '32' 0 +3
+	StrCpy $R7 -1
+	goto WordFunc_StrFilter${_WORDFUNC_S}_begin
+	StrCmp${_WORDFUNC_S} $R7$R8 '13' +2
+	StrCmp${_WORDFUNC_S} $R7$R8 '31' 0 +3
+	StrCpy $R7 -2
+	goto WordFunc_StrFilter${_WORDFUNC_S}_begin
+	StrCmp${_WORDFUNC_S} $R7$R8 '12' +2
+	StrCmp${_WORDFUNC_S} $R7$R8 '21' 0 WordFunc_StrFilter${_WORDFUNC_S}_error
+	StrCpy $R7 -3
+
+	WordFunc_StrFilter${_WORDFUNC_S}_begin:
+	StrCpy $R6 0
+	StrCpy $R1 ''
+
+	WordFunc_StrFilter${_WORDFUNC_S}_loop:
+	StrCpy $R2 $R0 1 $R6
+	StrCmp${_WORDFUNC_S} $R2 '' WordFunc_StrFilter${_WORDFUNC_S}_restartchk
+
+	StrCmp${_WORDFUNC_S} $2 '' +7
+	StrCpy $R4 0
+	StrCpy $R5 $2 1 $R4
+	StrCmp${_WORDFUNC_S} $R5 '' WordFunc_StrFilter${_WORDFUNC_S}_addsymbol
+	StrCmp${_WORDFUNC_S} $R5 $R2 WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol
+	IntOp $R4 $R4 + 1
+	goto -4
+
+	StrCmp${_WORDFUNC_S} $1 '' +7
+	StrCpy $R4 0
+	StrCpy $R5 $1 1 $R4
+	StrCmp${_WORDFUNC_S} $R5 '' +4
+	StrCmp${_WORDFUNC_S} $R5 $R2 WordFunc_StrFilter${_WORDFUNC_S}_addsymbol
+	IntOp $R4 $R4 + 1
+	goto -4
+
+	StrCmp${_WORDFUNC_S} $R7 '1' +2
+	StrCmp${_WORDFUNC_S} $R7 '-1' 0 +4
+	StrCpy $R4 48
+	StrCpy $R5 57
+	goto WordFunc_StrFilter${_WORDFUNC_S}_loop2
+	StrCmp${_WORDFUNC_S} $R8 '+-' 0 +2
+	StrCmp${_WORDFUNC_S} $3 '+' 0 +4
+	StrCpy $R4 $4
+	StrCpy $R5 $5
+	goto WordFunc_StrFilter${_WORDFUNC_S}_loop2
+	StrCpy $R4 $6
+	StrCpy $R5 $7
+
+	WordFunc_StrFilter${_WORDFUNC_S}_loop2:
+	IntFmt $R3 '%c' $R4
+	StrCmp $R2 $R3 WordFunc_StrFilter${_WORDFUNC_S}_found
+	StrCmp $R4 $R5 WordFunc_StrFilter${_WORDFUNC_S}_notfound
+	IntOp $R4 $R4 + 1
+	goto WordFunc_StrFilter${_WORDFUNC_S}_loop2
+
+	WordFunc_StrFilter${_WORDFUNC_S}_found:
+	StrCmp${_WORDFUNC_S} $R8 '+-' WordFunc_StrFilter${_WORDFUNC_S}_setcase
+	StrCmp${_WORDFUNC_S} $R7 '3' WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol
+	StrCmp${_WORDFUNC_S} $R7 '-3' WordFunc_StrFilter${_WORDFUNC_S}_addsymbol
+	StrCmp${_WORDFUNC_S} $R8 '' WordFunc_StrFilter${_WORDFUNC_S}_addsymbol WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol
+
+	WordFunc_StrFilter${_WORDFUNC_S}_notfound:
+	StrCmp${_WORDFUNC_S} $R8 '+-' WordFunc_StrFilter${_WORDFUNC_S}_addsymbol
+	StrCmp${_WORDFUNC_S} $R7 '3' 0 +2
+	StrCmp${_WORDFUNC_S} $R5 57 WordFunc_StrFilter${_WORDFUNC_S}_addsymbol +3
+	StrCmp${_WORDFUNC_S} $R7 '-3' 0 +5
+	StrCmp${_WORDFUNC_S} $R5 57 WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol
+	StrCpy $R4 48
+	StrCpy $R5 57
+	goto WordFunc_StrFilter${_WORDFUNC_S}_loop2
+	StrCmp${_WORDFUNC_S} $R8 '' WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol WordFunc_StrFilter${_WORDFUNC_S}_addsymbol
+
+	WordFunc_StrFilter${_WORDFUNC_S}_setcase:
+	StrCpy $R2 $R3
+	WordFunc_StrFilter${_WORDFUNC_S}_addsymbol:
+	StrCpy $R1 $R1$R2
+	WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol:
+	IntOp $R6 $R6 + 1
+	goto WordFunc_StrFilter${_WORDFUNC_S}_loop
+
+	WordFunc_StrFilter${_WORDFUNC_S}_error:
+	SetErrors
+	StrCpy $R0 ''
+	goto WordFunc_StrFilter${_WORDFUNC_S}_end
+
+	WordFunc_StrFilter${_WORDFUNC_S}_restartchk:
+	StrCpy $R0 $R1
+	StrCmp${_WORDFUNC_S} $2 '' 0 WordFunc_StrFilter${_WORDFUNC_S}_restart1
+	StrCmp${_WORDFUNC_S} $R8 '+-' 0 WordFunc_StrFilter${_WORDFUNC_S}_restart2
+
+	WordFunc_StrFilter${_WORDFUNC_S}_end:
+	Pop $R8
+	Pop $R7
+	Pop $R6
+	Pop $R5
+	Pop $R4
+	Pop $R3
+	Pop $R2
+	Pop $R1
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Pop $0
+	Exch $R0
+!macroend
+
+!define StrFilter `!insertmacro StrFilterCall`
+!define un.StrFilter `!insertmacro StrFilterCall`
+
+!macro StrFilter
+!macroend
+
+!macro un.StrFilter
+!macroend
+
+!macro StrFilter_
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+
+	!insertmacro StrFilterBody ''
+
+	!verbose pop
+!macroend
+
+
+!define StrFilterS `!insertmacro StrFilterSCall`
+!define un.StrFilterS `!insertmacro StrFilterSCall`
+
+!macro StrFilterS
+!macroend
+
+!macro un.StrFilterS
+!macroend
+
+!macro StrFilterS_
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+
+	!insertmacro StrFilterBody 'S'
+
+	!verbose pop
+!macroend
+
+!define VersionCompare `!insertmacro VersionCompareCall`
+!define un.VersionCompare `!insertmacro VersionCompareCall`
+
+!macro VersionCompare
+!macroend
+
+!macro un.VersionCompare
+!macroend
+
+!macro VersionCompare_
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+
+	Exch $1
+	Exch
+	Exch $0
+	Exch
+	Push $2
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+
+	WordFunc_VersionCompare_begin:
+	StrCpy $2 -1
+	IntOp $2 $2 + 1
+	StrCpy $3 $0 1 $2
+	StrCmp $3 '' +2
+	StrCmp $3 '.' 0 -3
+	StrCpy $4 $0 $2
+	IntOp $2 $2 + 1
+	StrCpy $0 $0 '' $2
+
+	StrCpy $2 -1
+	IntOp $2 $2 + 1
+	StrCpy $3 $1 1 $2
+	StrCmp $3 '' +2
+	StrCmp $3 '.' 0 -3
+	StrCpy $5 $1 $2
+	IntOp $2 $2 + 1
+	StrCpy $1 $1 '' $2
+
+	StrCmp $4$5 '' WordFunc_VersionCompare_equal
+
+	StrCpy $6 -1
+	IntOp $6 $6 + 1
+	StrCpy $3 $4 1 $6
+	StrCmp $3 '0' -2
+	StrCmp $3 '' 0 +2
+	StrCpy $4 0
+
+	StrCpy $7 -1
+	IntOp $7 $7 + 1
+	StrCpy $3 $5 1 $7
+	StrCmp $3 '0' -2
+	StrCmp $3 '' 0 +2
+	StrCpy $5 0
+
+	StrCmp $4 0 0 +2
+	StrCmp $5 0 WordFunc_VersionCompare_begin WordFunc_VersionCompare_newer2
+	StrCmp $5 0 WordFunc_VersionCompare_newer1
+	IntCmp $6 $7 0 WordFunc_VersionCompare_newer1 WordFunc_VersionCompare_newer2
+
+	StrCpy $4 '1$4'
+	StrCpy $5 '1$5'
+	IntCmp $4 $5 WordFunc_VersionCompare_begin WordFunc_VersionCompare_newer2 WordFunc_VersionCompare_newer1
+
+	WordFunc_VersionCompare_equal:
+	StrCpy $0 0
+	goto WordFunc_VersionCompare_end
+	WordFunc_VersionCompare_newer1:
+	StrCpy $0 1
+	goto WordFunc_VersionCompare_end
+	WordFunc_VersionCompare_newer2:
+	StrCpy $0 2
+
+	WordFunc_VersionCompare_end:
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!define VersionConvert `!insertmacro VersionConvertCall`
+!define un.VersionConvert `!insertmacro VersionConvertCall`
+
+!macro VersionConvert
+!macroend
+
+!macro un.VersionConvert
+!macroend
+
+!macro VersionConvert_
+	!verbose push
+	!verbose ${_WORDFUNC_VERBOSE}
+
+	Exch $1
+	Exch
+	Exch $0
+	Exch
+	Push $2
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+
+	StrCmp $1 '' 0 +2
+	StrCpy $1 'abcdefghijklmnopqrstuvwxyz'
+	StrCpy $1 $1 99
+
+	StrCpy $2 0
+	StrCpy $7 'dot'
+	goto WordFunc_VersionConvert_loop
+
+	WordFunc_VersionConvert_preloop:
+	IntOp $2 $2 + 1
+
+	WordFunc_VersionConvert_loop:
+	StrCpy $3 $0 1 $2
+	StrCmp $3 '' WordFunc_VersionConvert_endcheck
+	StrCmp $3 '.' WordFunc_VersionConvert_dot
+	StrCmp $3 '0' WordFunc_VersionConvert_digit
+	IntCmp $3 '0' WordFunc_VersionConvert_letter WordFunc_VersionConvert_letter WordFunc_VersionConvert_digit
+
+	WordFunc_VersionConvert_dot:
+	StrCmp $7 'dot' WordFunc_VersionConvert_replacespecial
+	StrCpy $7 'dot'
+	goto WordFunc_VersionConvert_preloop
+
+	WordFunc_VersionConvert_digit:
+	StrCmp $7 'letter' WordFunc_VersionConvert_insertdot
+	StrCpy $7 'digit'
+	goto WordFunc_VersionConvert_preloop
+
+	WordFunc_VersionConvert_letter:
+	StrCpy $5 0
+	StrCpy $4 $1 1 $5
+	IntOp $5 $5 + 1
+	StrCmp $4 '' WordFunc_VersionConvert_replacespecial
+	StrCmp $4 $3 0 -3
+	IntCmp $5 9 0 0 +2
+	StrCpy $5 '0$5'
+
+	StrCmp $7 'letter' +2
+	StrCmp $7 'dot' 0 +3
+	StrCpy $6 ''
+	goto +2
+	StrCpy $6 '.'
+
+	StrCpy $4 $0 $2
+	IntOp $2 $2 + 1
+	StrCpy $0 $0 '' $2
+	StrCpy $0 '$4$6$5$0'
+	StrLen $4 '$6$5'
+	IntOp $2 $2 + $4
+	IntOp $2 $2 - 1
+	StrCpy $7 'letter'
+	goto WordFunc_VersionConvert_loop
+
+	WordFunc_VersionConvert_replacespecial:
+	StrCmp $7 'dot' 0 +3
+	StrCpy $6 ''
+	goto +2
+	StrCpy $6 '.'
+
+	StrCpy $4 $0 $2
+	IntOp $2 $2 + 1
+	StrCpy $0 $0 '' $2
+	StrCpy $0 '$4$6$0'
+	StrLen $4 $6
+	IntOp $2 $2 + $4
+	IntOp $2 $2 - 1
+	StrCpy $7 'dot'
+	goto WordFunc_VersionConvert_loop
+
+	WordFunc_VersionConvert_insertdot:
+	StrCpy $4 $0 $2
+	StrCpy $0 $0 '' $2
+	StrCpy $0 '$4.$0'
+	StrCpy $7 'dot'
+	goto WordFunc_VersionConvert_preloop
+
+	WordFunc_VersionConvert_endcheck:
+	StrCpy $4 $0 1 -1
+	StrCmp $4 '.' 0 WordFunc_VersionConvert_end
+	StrCpy $0 $0 -1
+	goto -3
+
+	WordFunc_VersionConvert_end:
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Include/Sections.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/Sections.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/Sections.nsh	(revision 728)
@@ -0,0 +1,273 @@
+; Sections.nsh
+;
+; Defines and macros for section control
+;
+; Include in your script using:
+; !include "Sections.nsh"
+
+;--------------------------------
+
+!ifndef SECTIONS_INCLUDED
+
+!define SECTIONS_INCLUDED
+
+;--------------------------------
+
+; Generic section defines
+
+# section or section group is selected
+!define SF_SELECTED   1
+# section group
+!define SF_SECGRP     2
+!define SF_SUBSEC     2  # deprecated
+# section group end marker
+!define SF_SECGRPEND  4
+!define SF_SUBSECEND  4  # deprecated
+# bold text (Section !blah)
+!define SF_BOLD       8
+# read only (SectionIn RO)
+!define SF_RO         16
+# expanded section group (SectionGroup /e blah)
+!define SF_EXPAND     32
+# section group is partially selected
+!define SF_PSELECTED  64  # internal
+# internal
+!define SF_TOGGLED    128 # internal
+!define SF_NAMECHG    256 # internal
+
+# mask to toggle off the selected flag
+!define SECTION_OFF   0xFFFFFFFE
+
+;--------------------------------
+
+; Select / unselect / reserve section
+
+!macro SelectSection SECTION
+
+  Push $0
+  Push $1
+    StrCpy $1 "${SECTION}"
+    SectionGetFlags $1 $0
+    IntOp $0 $0 | ${SF_SELECTED}
+    SectionSetFlags $1 $0
+  Pop $1
+  Pop $0
+
+!macroend
+
+!macro UnselectSection SECTION
+
+  Push $0
+  Push $1
+    StrCpy $1 "${SECTION}"
+    SectionGetFlags $1 $0
+    IntOp $0 $0 & ${SECTION_OFF}
+    SectionSetFlags $1 $0
+  Pop $1
+  Pop $0
+
+!macroend
+
+; If section selected, will unselect, if unselected, will select
+
+!macro ReverseSection SECTION
+
+  Push $0
+  Push $1
+    StrCpy $1 "${SECTION}"
+    SectionGetFlags $1 $0
+    IntOp $0 $0 ^ ${SF_SELECTED}
+    SectionSetFlags $1 $0
+  Pop $1
+  Pop $0
+
+!macroend
+
+;--------------------------------
+
+; Macros for mutually exclusive section selection
+; Written by Tim Gallagher
+;
+; See one-section.nsi for an example of usage
+
+; Starts the Radio Button Block
+; You should pass a variable that keeps the selected section
+; as the first parameter for this macro. This variable should
+; be initialized to the default section's index.
+;
+; As this macro uses $R0 and $R1 you can't use those two as the
+; varible which will keep the selected section.
+
+!macro StartRadioButtons var
+
+  !define StartRadioButtons_Var "${var}"
+
+  Push $R0
+  
+   SectionGetFlags "${StartRadioButtons_Var}" $R0
+   IntOp $R0 $R0 & ${SECTION_OFF}
+   SectionSetFlags "${StartRadioButtons_Var}" $R0
+   
+  Push $R1
+  
+    StrCpy $R1 "${StartRadioButtons_Var}"
+   
+!macroend
+
+; A radio button
+
+!macro RadioButton SECTION_NAME
+
+  SectionGetFlags ${SECTION_NAME} $R0
+  IntOp $R0 $R0 & ${SF_SELECTED}
+  IntCmp $R0 ${SF_SELECTED} 0 +2 +2
+  StrCpy "${StartRadioButtons_Var}" ${SECTION_NAME}
+
+!macroend
+
+; Ends the radio button block
+
+!macro EndRadioButtons
+  
+  StrCmp $R1 "${StartRadioButtons_Var}" 0 +4 ; selection hasn't changed
+    SectionGetFlags "${StartRadioButtons_Var}" $R0
+    IntOp $R0 $R0 | ${SF_SELECTED}
+    SectionSetFlags "${StartRadioButtons_Var}" $R0
+
+  Pop $R1
+  Pop $R0
+  
+  !undef StartRadioButtons_Var
+
+!macroend
+
+;--------------------------------
+
+; These are two macros you can use to set a Section in an InstType
+; or clear it from an InstType.
+;
+; Written by Robert Kehl
+;
+; For details, see http://nsis.sourceforge.net/wiki/SetSectionInInstType%2C_ClearSectionInInstType
+;
+; Use the defines below for the WANTED_INSTTYPE paramter.
+
+!define INSTTYPE_1 1
+!define INSTTYPE_2 2
+!define INSTTYPE_3 4
+!define INSTTYPE_4 8
+!define INSTTYPE_5 16
+!define INSTTYPE_6 32
+!define INSTTYPE_7 64
+!define INSTTYPE_8 128
+!define INSTTYPE_9 256
+!define INSTTYPE_10 512
+!define INSTTYPE_11 1024
+!define INSTTYPE_12 2048
+!define INSTTYPE_13 4096
+!define INSTTYPE_14 8192
+!define INSTTYPE_15 16384
+!define INSTTYPE_16 32768
+!define INSTTYPE_17 65536
+!define INSTTYPE_18 131072
+!define INSTTYPE_19 262144
+!define INSTTYPE_20 524288
+!define INSTTYPE_21 1048576
+!define INSTTYPE_22 2097152
+!define INSTTYPE_23 4194304
+!define INSTTYPE_24 8388608
+!define INSTTYPE_25 16777216
+!define INSTTYPE_26 33554432
+!define INSTTYPE_27 67108864
+!define INSTTYPE_28 134217728
+!define INSTTYPE_29 268435456
+!define INSTTYPE_30 536870912
+!define INSTTYPE_31 1073741824
+!define INSTTYPE_32 2147483648
+
+!macro SetSectionInInstType SECTION_NAME WANTED_INSTTYPE
+
+  Push $0
+  Push $1
+    StrCpy $1 "${SECTION_NAME}"
+    SectionGetInstTypes $1 $0
+    IntOp $0 $0 | ${WANTED_INSTTYPE}
+    SectionSetInstTypes $1 $0
+  Pop $1
+  Pop $0
+
+!macroend
+
+!macro ClearSectionInInstType SECTION_NAME WANTED_INSTTYPE
+
+  Push $0
+  Push $1
+  Push $2
+    StrCpy $2 "${SECTION_NAME}"
+    SectionGetInstTypes $2 $0
+    StrCpy $1 ${WANTED_INSTTYPE}
+    IntOp $1 $1 ~
+    IntOp $0 $0 & $1
+    SectionSetInstTypes $2 $0
+  Pop $2
+  Pop $1
+  Pop $0
+
+!macroend
+
+;--------------------------------
+
+; Set / clear / check bits in a section's flags
+; Written by derekrprice
+
+; Set one or more bits in a sections's flags
+
+!macro SetSectionFlag SECTION BITS
+
+  Push $R0
+  Push $R1
+    StrCpy $R1 "${SECTION}"
+    SectionGetFlags $R1 $R0
+    IntOp $R0 $R0 | "${BITS}"
+    SectionSetFlags $R1 $R0
+  Pop $R1
+  Pop $R0
+ 
+!macroend
+
+; Clear one or more bits in section's flags
+
+!macro ClearSectionFlag SECTION BITS
+
+  Push $R0
+  Push $R1
+  Push $R2
+    StrCpy $R2 "${SECTION}"
+    SectionGetFlags $R2 $R0
+    IntOp $R1 "${BITS}" ~
+    IntOp $R0 $R0 & $R1
+    SectionSetFlags $R2 $R0
+  Pop $R2
+  Pop $R1
+  Pop $R0
+
+!macroend
+
+; Check if one or more bits in section's flags are set
+; If they are, jump to JUMPIFSET
+; If not, jump to JUMPIFNOTSET
+
+!macro SectionFlagIsSet SECTION BITS JUMPIFSET JUMPIFNOTSET
+	Push $R0
+	SectionGetFlags "${SECTION}" $R0
+	IntOp $R0 $R0 & "${BITS}"
+	IntCmp $R0 "${BITS}" +3
+	Pop $R0
+	StrCmp "" "${JUMPIFNOTSET}" +3 "${JUMPIFNOTSET}"
+	Pop $R0
+	Goto "${JUMPIFSET}"
+!macroend
+
+;--------------------------------
+
+!endif
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Include/MultiUser.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/MultiUser.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/MultiUser.nsh	(revision 728)
@@ -0,0 +1,469 @@
+/*
+
+MultiUser.nsh
+
+Installer configuration for multi-user Windows environments
+
+Copyright 2008-2015 Joost Verburg
+
+*/
+
+!ifndef MULTIUSER_INCLUDED
+!define MULTIUSER_INCLUDED
+!verbose push
+!verbose 3
+
+;Standard NSIS header files
+
+!ifdef MULTIUSER_MUI
+  !include MUI2.nsh
+!endif
+!include nsDialogs.nsh
+!include LogicLib.nsh
+!include WinVer.nsh
+!include FileFunc.nsh
+
+;Variables
+
+Var MultiUser.Privileges
+Var MultiUser.InstallMode
+
+;Command line installation mode setting
+
+!ifdef MULTIUSER_INSTALLMODE_COMMANDLINE
+  !include StrFunc.nsh
+  !ifndef StrStr_INCLUDED
+    ${StrStr}
+  !endif
+  !ifndef MULTIUSER_NOUNINSTALL
+    !ifndef UnStrStr_INCLUDED
+      ${UnStrStr}
+    !endif
+  !endif
+  
+  Var MultiUser.Parameters
+  Var MultiUser.Result
+!endif
+
+;Installation folder stored in registry
+
+!ifdef MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY & MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME
+  Var MultiUser.InstDir
+!endif
+
+!ifdef MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY & MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME
+  Var MultiUser.DefaultKeyValue
+!endif
+
+;Windows Vista UAC setting
+
+!if "${MULTIUSER_EXECUTIONLEVEL}" == Admin
+  RequestExecutionLevel admin
+  !define MULTIUSER_EXECUTIONLEVEL_ALLUSERS
+!else if "${MULTIUSER_EXECUTIONLEVEL}" == Power
+  RequestExecutionLevel admin
+  !define MULTIUSER_EXECUTIONLEVEL_ALLUSERS
+!else if "${MULTIUSER_EXECUTIONLEVEL}" == Highest
+  RequestExecutionLevel highest
+  !define MULTIUSER_EXECUTIONLEVEL_ALLUSERS
+!else
+  RequestExecutionLevel user
+!endif
+
+/*
+
+Install modes
+
+*/
+
+!macro MULTIUSER_INSTALLMODE_ALLUSERS UNINSTALLER_PREFIX UNINSTALLER_FUNCPREFIX
+
+  ;Install mode initialization - per-machine
+
+  ${ifnot} ${IsNT}
+    ${orif} $MultiUser.Privileges == "Admin"
+    ${orif} $MultiUser.Privileges == "Power"
+  
+    StrCpy $MultiUser.InstallMode AllUsers
+  
+    SetShellVarContext all
+  
+    !if "${UNINSTALLER_PREFIX}" != UN
+      ;Set default installation location for installer
+      !ifdef MULTIUSER_INSTALLMODE_INSTDIR
+        StrCpy $INSTDIR "$PROGRAMFILES\${MULTIUSER_INSTALLMODE_INSTDIR}"
+      !endif
+    !endif
+  
+    !ifdef MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY & MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME
+  
+      ReadRegStr $MultiUser.InstDir HKLM "${MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY}" "${MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME}"
+  
+      ${if} $MultiUser.InstDir != ""
+        StrCpy $INSTDIR $MultiUser.InstDir
+      ${endif}
+  
+    !endif
+  
+    !ifdef MULTIUSER_INSTALLMODE_${UNINSTALLER_PREFIX}FUNCTION
+      Call "${MULTIUSER_INSTALLMODE_${UNINSTALLER_PREFIX}FUNCTION}"
+    !endif
+    
+  ${endif}
+
+!macroend
+
+!macro MULTIUSER_INSTALLMODE_CURRENTUSER UNINSTALLER_PREFIX UNINSTALLER_FUNCPREFIX
+
+  ;Install mode initialization - per-user
+  
+  ${if} ${IsNT}  
+  
+    StrCpy $MultiUser.InstallMode CurrentUser
+    
+    SetShellVarContext current
+  
+    !if "${UNINSTALLER_PREFIX}" != UN
+      ;Set default installation location for installer  
+      !ifdef MULTIUSER_INSTALLMODE_INSTDIR
+        ${if} ${AtLeastWin2000}
+          StrCpy $INSTDIR "$LOCALAPPDATA\${MULTIUSER_INSTALLMODE_INSTDIR}"
+        ${else}
+          StrCpy $INSTDIR "$PROGRAMFILES\${MULTIUSER_INSTALLMODE_INSTDIR}"
+        ${endif}
+      !endif
+    !endif
+  
+    !ifdef MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY & MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME
+  
+      ReadRegStr $MultiUser.InstDir HKCU "${MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY}" "${MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME}"
+  
+      ${if} $MultiUser.InstDir != ""
+        StrCpy $INSTDIR $MultiUser.InstDir
+      ${endif}
+  
+    !endif
+  
+    !ifdef MULTIUSER_INSTALLMODE_${UNINSTALLER_PREFIX}FUNCTION
+      Call "${MULTIUSER_INSTALLMODE_${UNINSTALLER_PREFIX}FUNCTION}"
+    !endif
+  
+  ${endif}
+
+!macroend
+
+Function MultiUser.InstallMode.AllUsers
+  !insertmacro MULTIUSER_INSTALLMODE_ALLUSERS "" ""
+FunctionEnd
+
+Function MultiUser.InstallMode.CurrentUser
+  !insertmacro MULTIUSER_INSTALLMODE_CURRENTUSER "" ""
+FunctionEnd
+
+!ifndef MULTIUSER_NOUNINSTALL
+
+Function un.MultiUser.InstallMode.AllUsers
+  !insertmacro MULTIUSER_INSTALLMODE_ALLUSERS UN .un
+FunctionEnd
+
+Function un.MultiUser.InstallMode.CurrentUser
+  !insertmacro MULTIUSER_INSTALLMODE_CURRENTUSER UN .un
+FunctionEnd
+
+!endif
+
+/*
+
+Installer/uninstaller initialization
+
+*/
+
+!macro MULTIUSER_INIT_QUIT UNINSTALLER_FUNCPREFIX
+
+  !ifdef MULTIUSER_INIT_${UNINSTALLER_FUNCPREFIX}FUNCTIONQUIT
+    Call "${MULTIUSER_INIT_${UNINSTALLER_FUNCPREFIX}FUCTIONQUIT}
+  !else
+    Quit
+  !endif
+
+!macroend
+
+!macro MULTIUSER_INIT_TEXTS
+
+  !ifndef MULTIUSER_INIT_TEXT_ADMINREQUIRED
+    !define MULTIUSER_INIT_TEXT_ADMINREQUIRED "$(^Caption) requires administrator priviledges."
+  !endif
+
+  !ifndef MULTIUSER_INIT_TEXT_POWERREQUIRED
+    !define MULTIUSER_INIT_TEXT_POWERREQUIRED "$(^Caption) requires at least Power User priviledges."
+  !endif
+
+  !ifndef MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE
+    !define MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE "Your user account does not have sufficient privileges to install $(^Name) for all users of this compuetr."
+  !endif
+
+!macroend
+
+!macro MULTIUSER_INIT_CHECKS UNINSTALLER_PREFIX UNINSTALLER_FUNCPREFIX
+
+  ;Installer initialization - check privileges and set install mode
+
+  !insertmacro MULTIUSER_INIT_TEXTS
+
+  UserInfo::GetAccountType
+  Pop $MultiUser.Privileges
+  
+  ${if} ${IsNT}
+  
+    ;Check privileges
+  
+    !if "${MULTIUSER_EXECUTIONLEVEL}" == Admin
+  
+      ${if} $MultiUser.Privileges != "Admin"
+        MessageBox MB_OK|MB_ICONSTOP "${MULTIUSER_INIT_TEXT_ADMINREQUIRED}"
+        !insertmacro MULTIUSER_INIT_QUIT "${UNINSTALLER_FUNCPREFIX}"
+      ${endif}
+  
+    !else if "${MULTIUSER_EXECUTIONLEVEL}" == Power
+  
+      ${if} $MultiUser.Privileges != "Power"
+        ${andif} $MultiUser.Privileges != "Admin"
+        ${if} ${AtMostWinXP}
+           MessageBox MB_OK|MB_ICONSTOP "${MULTIUSER_INIT_TEXT_POWERREQUIRED}"
+        ${else}
+           MessageBox MB_OK|MB_ICONSTOP "${MULTIUSER_INIT_TEXT_ADMINREQUIRED}"
+        ${endif}        
+        !insertmacro MULTIUSER_INIT_QUIT "${UNINSTALLER_FUNCPREFIX}"
+      ${endif}
+  
+    !endif
+    
+    !ifdef MULTIUSER_EXECUTIONLEVEL_ALLUSERS
+    
+      ;Default to per-machine installation if possible
+    
+      ${if} $MultiUser.Privileges == "Admin"
+        ${orif} $MultiUser.Privileges == "Power"
+        !ifndef MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER
+          Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.AllUsers
+        !else
+          Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.CurrentUser
+        !endif
+
+        !ifdef MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY & MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME
+
+          ;Set installation mode to setting from a previous installation
+
+          !ifndef MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER
+            ReadRegStr $MultiUser.DefaultKeyValue HKLM "${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY}" "${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME}"
+            ${if} $MultiUser.DefaultKeyValue == ""
+              ReadRegStr $MultiUser.DefaultKeyValue HKCU "${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY}" "${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME}"
+              ${if} $MultiUser.DefaultKeyValue != ""
+                Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.CurrentUser
+              ${endif}
+            ${endif}
+          !else
+            ReadRegStr $MultiUser.DefaultKeyValue HKCU "${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY}" "${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME}"
+            ${if} $MultiUser.DefaultKeyValue == ""
+              ReadRegStr $MultiUser.DefaultKeyValue HKLM "${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY}" "${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME}"
+              ${if} $MultiUser.DefaultKeyValue != ""
+                Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.AllUsers
+              ${endif}
+            ${endif}
+          !endif
+
+        !endif
+
+      ${else}
+        Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.CurrentUser
+      ${endif}
+    
+    !else
+
+      Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.CurrentUser
+
+    !endif  
+  
+    !ifdef MULTIUSER_INSTALLMODE_COMMANDLINE
+    
+      ;Check for install mode setting on command line
+
+      ${${UNINSTALLER_FUNCPREFIX}GetParameters} $MultiUser.Parameters
+  
+      ${${UNINSTALLER_PREFIX}StrStr} $MultiUser.Result $MultiUser.Parameters "/CurrentUser"    
+    
+      ${if} $MultiUser.Result != ""
+        Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.CurrentUser
+      ${endif}    
+  
+      ${${UNINSTALLER_PREFIX}StrStr} $MultiUser.Result $MultiUser.Parameters "/AllUsers"    
+    
+      ${if} $MultiUser.Result != ""
+        ${if} $MultiUser.Privileges == "Admin"
+          ${orif} $MultiUser.Privileges == "Power"
+          Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.AllUsers
+        ${else}
+          MessageBox MB_OK|MB_ICONSTOP "${MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE}"
+        ${endif}
+      ${endif}
+  
+    !endif
+    
+  ${else}
+  
+    ;Not running Windows NT, per-user installation not supported
+    
+    Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.AllUsers
+  
+  ${endif}
+
+!macroend
+
+!macro MULTIUSER_INIT
+  !verbose push
+  !verbose 3
+  
+  !insertmacro MULTIUSER_INIT_CHECKS "" ""
+  
+  !verbose pop 
+!macroend
+
+!ifndef MULTIUSER_NOUNINSTALL
+
+!macro MULTIUSER_UNINIT
+  !verbose push
+  !verbose 3
+  
+  !insertmacro MULTIUSER_INIT_CHECKS Un un.
+  
+  !verbose pop 
+!macroend
+
+!endif
+
+/*
+
+Modern UI 2 page
+
+*/
+
+!ifdef MULTIUSER_MUI
+
+!macro MULTIUSER_INSTALLMODEPAGE_INTERFACE
+
+  !ifndef MULTIUSER_INSTALLMODEPAGE_INTERFACE
+    !define MULTIUSER_INSTALLMODEPAGE_INTERFACE
+    Var MultiUser.InstallModePage
+    
+    Var MultiUser.InstallModePage.Text
+    
+    Var MultiUser.InstallModePage.AllUsers
+    Var MultiUser.InstallModePage.CurrentUser
+    
+    Var MultiUser.InstallModePage.ReturnValue
+  !endif
+
+!macroend
+
+!macro MULTIUSER_PAGEDECLARATION_INSTALLMODE
+
+  !insertmacro MUI_SET MULTIUSER_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLMODEPAGE ""
+  !insertmacro MULTIUSER_INSTALLMODEPAGE_INTERFACE
+
+  !insertmacro MUI_DEFAULT MULTIUSER_INSTALLMODEPAGE_TEXT_TOP "$(MULTIUSER_INNERTEXT_INSTALLMODE_TOP)"
+  !insertmacro MUI_DEFAULT MULTIUSER_INSTALLMODEPAGE_TEXT_ALLUSERS "$(MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS)"
+  !insertmacro MUI_DEFAULT MULTIUSER_INSTALLMODEPAGE_TEXT_CURRENTUSER "$(MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER)"  
+
+  PageEx custom
+
+    PageCallbacks MultiUser.InstallModePre_${MUI_UNIQUEID} MultiUser.InstallModeLeave_${MUI_UNIQUEID}
+
+    Caption " "
+
+  PageExEnd
+
+  !insertmacro MULTIUSER_FUNCTION_INSTALLMODEPAGE MultiUser.InstallModePre_${MUI_UNIQUEID} MultiUser.InstallModeLeave_${MUI_UNIQUEID}
+
+  !undef MULTIUSER_INSTALLMODEPAGE_TEXT_TOP
+  !undef MULTIUSER_INSTALLMODEPAGE_TEXT_ALLUSERS
+  !undef MULTIUSER_INSTALLMODEPAGE_TEXT_CURRENTUSER
+
+!macroend
+
+!macro MULTIUSER_PAGE_INSTALLMODE
+
+  ;Modern UI page for install mode
+
+  !verbose push
+  !verbose 3
+  
+  !ifndef MULTIUSER_EXECUTIONLEVEL_ALLUSERS
+    !error "A mixed-mode installation requires MULTIUSER_EXECUTIONLEVEL to be set to Admin, Power or Highest."
+  !endif
+  
+  !insertmacro MUI_PAGE_INIT
+  !insertmacro MULTIUSER_PAGEDECLARATION_INSTALLMODE
+  
+  !verbose pop
+
+!macroend
+
+!macro MULTIUSER_FUNCTION_INSTALLMODEPAGE PRE LEAVE
+
+  ;Page functions of Modern UI page
+
+  Function "${PRE}"
+  
+    ${ifnot} ${IsNT}
+      Abort
+    ${endif}
+  
+    ${if} $MultiUser.Privileges != "Power"
+      ${andif} $MultiUser.Privileges != "Admin"
+      Abort
+    ${endif}
+    
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+    !insertmacro MUI_HEADER_TEXT_PAGE $(MULTIUSER_TEXT_INSTALLMODE_TITLE) $(MULTIUSER_TEXT_INSTALLMODE_SUBTITLE)
+    
+    nsDialogs::Create 1018
+    Pop $MultiUser.InstallModePage
+
+    ${NSD_CreateLabel} 0u 0u 300u 20u "${MULTIUSER_INSTALLMODEPAGE_TEXT_TOP}"
+    Pop $MultiUser.InstallModePage.Text
+
+    ${NSD_CreateRadioButton} 20u 50u 280u 10u "${MULTIUSER_INSTALLMODEPAGE_TEXT_ALLUSERS}"
+    Pop $MultiUser.InstallModePage.AllUsers
+    
+    ${NSD_CreateRadioButton} 20u 70u 280u 10u "${MULTIUSER_INSTALLMODEPAGE_TEXT_CURRENTUSER}"
+    Pop $MultiUser.InstallModePage.CurrentUser
+    
+    ${if} $MultiUser.InstallMode == "AllUsers"
+      SendMessage $MultiUser.InstallModePage.AllUsers ${BM_SETCHECK} ${BST_CHECKED} 0
+    ${else}
+      SendMessage $MultiUser.InstallModePage.CurrentUser ${BM_SETCHECK} ${BST_CHECKED} 0
+    ${endif}
+    
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
+    nsDialogs::Show
+    
+  FunctionEnd
+
+  Function "${LEAVE}"
+     SendMessage $MultiUser.InstallModePage.AllUsers ${BM_GETCHECK} 0 0 $MultiUser.InstallModePage.ReturnValue
+     
+     ${if} $MultiUser.InstallModePage.ReturnValue = ${BST_CHECKED}
+        Call MultiUser.InstallMode.AllUsers
+     ${else}
+        Call MultiUser.InstallMode.CurrentUser
+     ${endif}
+  
+    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+  FunctionEnd
+
+!macroend
+
+!endif
+
+!verbose pop
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Include/MUI.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/MUI.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/MUI.nsh	(revision 728)
@@ -0,0 +1 @@
+!include "${NSISDIR}\Contrib\Modern UI\System.nsh"
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Include/FileFunc.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/FileFunc.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/FileFunc.nsh	(revision 728)
@@ -0,0 +1,2017 @@
+/*
+_____________________________________________________________________________
+
+                       File Functions Header v3.4
+_____________________________________________________________________________
+
+ 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
+
+ See documentation for more information about the following functions.
+
+ Usage in script:
+ 1. !include "FileFunc.nsh"
+ 2. [Section|Function]
+      ${FileFunction} "Param1" "Param2" "..." $var
+    [SectionEnd|FunctionEnd]
+
+
+ FileFunction=[Locate|GetSize|DriveSpace|GetDrives|GetTime|GetFileAttributes|
+               GetFileVersion|GetExeName|GetExePath|GetParameters|GetOptions|
+               GetOptionsS|GetRoot|GetParent|GetFileName|GetBaseName|GetFileExt|
+               BannerTrimPath|DirState|RefreshShellIcons]
+
+_____________________________________________________________________________
+
+                       Thanks to:
+_____________________________________________________________________________
+
+GetSize
+	KiCHiK (Function "FindFiles")
+DriveSpace
+	sunjammer (Function "CheckSpaceFree")
+GetDrives
+	deguix (Based on his idea of Function "DetectDrives")
+GetTime
+	Takhir (Script "StatTest") and deguix (Function "FileModifiedDate")
+GetFileVersion
+	KiCHiK (Based on his example for command "GetDLLVersion")
+GetParameters
+	sunjammer (Based on his Function "GetParameters")
+GetRoot
+	KiCHiK (Based on his Function "GetRoot")
+GetParent
+	sunjammer (Based on his Function "GetParent")
+GetFileName
+	KiCHiK (Based on his Function "GetFileName")
+GetBaseName
+	comperio (Based on his idea of Function "GetBaseName")
+GetFileExt
+	opher (author)
+RefreshShellIcons
+	jerome tremblay (author)
+*/
+
+
+;_____________________________________________________________________________
+;
+;                         Macros
+;_____________________________________________________________________________
+;
+; Change log window verbosity (default: 3=no script)
+;
+; Example:
+; !include "FileFunc.nsh"
+; !insertmacro Locate
+; ${FILEFUNC_VERBOSE} 4   # all verbosity
+; !insertmacro VersionCompare
+; ${FILEFUNC_VERBOSE} 3   # no script
+
+!ifndef FILEFUNC_INCLUDED
+!define FILEFUNC_INCLUDED
+
+!include Util.nsh
+
+!verbose push
+!verbose 3
+!ifndef _FILEFUNC_VERBOSE
+	!define _FILEFUNC_VERBOSE 3
+!endif
+!verbose ${_FILEFUNC_VERBOSE}
+!define FILEFUNC_VERBOSE `!insertmacro FILEFUNC_VERBOSE`
+!verbose pop
+
+!macro FILEFUNC_VERBOSE _VERBOSE
+	!verbose push
+	!verbose 3
+	!undef _FILEFUNC_VERBOSE
+	!define _FILEFUNC_VERBOSE ${_VERBOSE}
+	!verbose pop
+!macroend
+
+!macro LocateCall _PATH _OPTIONS _FUNC
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	Push $0
+	Push `${_PATH}`
+	Push `${_OPTIONS}`
+	GetFunctionAddress $0 `${_FUNC}`
+	Push `$0`
+	${CallArtificialFunction} Locate_
+	Pop $0
+	!verbose pop
+!macroend
+
+!macro GetSizeCall _PATH _OPTIONS _RESULT1 _RESULT2 _RESULT3
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	Push `${_PATH}`
+	Push `${_OPTIONS}`
+	${CallArtificialFunction} GetSize_
+	Pop ${_RESULT1}
+	Pop ${_RESULT2}
+	Pop ${_RESULT3}
+	!verbose pop
+!macroend
+
+!macro DriveSpaceCall _DRIVE _OPTIONS _RESULT
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	Push `${_DRIVE}`
+	Push `${_OPTIONS}`
+	${CallArtificialFunction} DriveSpace_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro GetDrivesCall _DRV _FUNC
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	Push $0
+	Push `${_DRV}`
+	GetFunctionAddress $0 `${_FUNC}`
+	Push `$0`
+	${CallArtificialFunction} GetDrives_
+	Pop $0
+	!verbose pop
+!macroend
+
+!macro GetTimeCall _FILE _OPTION _RESULT1 _RESULT2 _RESULT3 _RESULT4 _RESULT5 _RESULT6 _RESULT7
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	Push `${_FILE}`
+	Push `${_OPTION}`
+	${CallArtificialFunction} GetTime_
+	Pop ${_RESULT1}
+	Pop ${_RESULT2}
+	Pop ${_RESULT3}
+	Pop ${_RESULT4}
+	Pop ${_RESULT5}
+	Pop ${_RESULT6}
+	Pop ${_RESULT7}
+	!verbose pop
+!macroend
+
+!macro GetFileAttributesCall _PATH _ATTR _RESULT
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	Push `${_PATH}`
+	Push `${_ATTR}`
+	${CallArtificialFunction} GetFileAttributes_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro GetFileVersionCall _FILE _RESULT
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	Push `${_FILE}`
+	${CallArtificialFunction} GetFileVersion_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro GetExeNameCall _RESULT
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	${CallArtificialFunction} GetExeName_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro GetExePathCall _RESULT
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	${CallArtificialFunction} GetExePath_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro GetParametersCall _RESULT
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	${CallArtificialFunction} GetParameters_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro GetOptionsCall _PARAMETERS _OPTION _RESULT
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	Push `${_PARAMETERS}`
+	Push `${_OPTION}`
+	${CallArtificialFunction} GetOptions_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro GetOptionsSCall _PARAMETERS _OPTION _RESULT
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	Push `${_PARAMETERS}`
+	Push `${_OPTION}`
+	${CallArtificialFunction} GetOptionsS_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro GetRootCall _FULLPATH _RESULT
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	Push `${_FULLPATH}`
+	${CallArtificialFunction} GetRoot_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro GetParentCall _PATHSTRING _RESULT
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	Push `${_PATHSTRING}`
+	${CallArtificialFunction} GetParent_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro GetFileNameCall _PATHSTRING _RESULT
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	Push `${_PATHSTRING}`
+	${CallArtificialFunction} GetFileName_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro GetBaseNameCall _FILESTRING _RESULT
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	Push `${_FILESTRING}`
+	${CallArtificialFunction} GetBaseName_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro GetFileExtCall _FILESTRING _RESULT
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	Push `${_FILESTRING}`
+	${CallArtificialFunction} GetFileExt_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro BannerTrimPathCall _PATH _LENGHT _RESULT
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	Push `${_PATH}`
+	Push `${_LENGHT}`
+	${CallArtificialFunction} BannerTrimPath_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro DirStateCall _PATH _RESULT
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	Push `${_PATH}`
+	${CallArtificialFunction} DirState_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro RefreshShellIconsCall
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	${CallArtificialFunction} RefreshShellIcons_
+	!verbose pop
+!macroend
+
+!define Locate `!insertmacro LocateCall`
+!define un.Locate `!insertmacro LocateCall`
+
+!macro Locate
+!macroend
+
+!macro un.Locate
+!macroend
+
+!macro Locate_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+		
+	Exch $2
+	Exch
+	Exch $1
+	Exch
+	Exch 2
+	Exch $0
+	Exch 2
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+	Push $8
+	Push $9
+	Push $R6
+	Push $R7
+	Push $R8
+	Push $R9
+	ClearErrors
+
+	StrCpy $3 ''
+	StrCpy $4 ''
+	StrCpy $5 ''
+	StrCpy $6 ''
+	StrCpy $7 ''
+	StrCpy $8 0
+	StrCpy $R7 ''
+
+	StrCpy $R9 $0 1 -1
+	StrCmp $R9 '\' 0 +3
+	StrCpy $0 $0 -1
+	goto -3
+	IfFileExists '$0\*.*' 0 FileFunc_Locate_error
+
+	FileFunc_Locate_option:
+	StrCpy $R9 $1 1
+	StrCpy $1 $1 '' 1
+	StrCmp $R9 ' ' -2
+	StrCmp $R9 '' FileFunc_Locate_sizeset
+	StrCmp $R9 '/' 0 -4
+	StrCpy $9 -1
+	IntOp $9 $9 + 1
+	StrCpy $R9 $1 1 $9
+	StrCmp $R9 '' +2
+	StrCmp $R9 '/' 0 -3
+	StrCpy $R8 $1 $9
+	StrCpy $R8 $R8 '' 2
+	StrCpy $R9 $R8 '' -1
+	StrCmp $R9 ' ' 0 +3
+	StrCpy $R8 $R8 -1
+	goto -3
+	StrCpy $R9 $1 2
+	StrCpy $1 $1 '' $9
+
+	StrCmp $R9 'L=' 0 FileFunc_Locate_mask
+	StrCpy $3 $R8
+	StrCmp $3 '' +6
+	StrCmp $3 'FD' +5
+	StrCmp $3 'F' +4
+	StrCmp $3 'D' +3
+	StrCmp $3 'DE' +2
+	StrCmp $3 'FDE' 0 FileFunc_Locate_error
+	goto FileFunc_Locate_option
+
+	FileFunc_Locate_mask:
+	StrCmp $R9 'M=' 0 FileFunc_Locate_size
+	StrCpy $4 $R8
+	goto FileFunc_Locate_option
+
+	FileFunc_Locate_size:
+	StrCmp $R9 'S=' 0 FileFunc_Locate_gotosubdir
+	StrCpy $6 $R8
+	goto FileFunc_Locate_option
+
+	FileFunc_Locate_gotosubdir:
+	StrCmp $R9 'G=' 0 FileFunc_Locate_banner
+	StrCpy $7 $R8
+	StrCmp $7 '' +3
+	StrCmp $7 '1' +2
+	StrCmp $7 '0' 0 FileFunc_Locate_error
+	goto FileFunc_Locate_option
+
+	FileFunc_Locate_banner:
+	StrCmp $R9 'B=' 0 FileFunc_Locate_error
+	StrCpy $R7 $R8
+	StrCmp $R7 '' +3
+	StrCmp $R7 '1' +2
+	StrCmp $R7 '0' 0 FileFunc_Locate_error
+	goto FileFunc_Locate_option
+
+	FileFunc_Locate_sizeset:
+	StrCmp $6 '' FileFunc_Locate_default
+	StrCpy $9 0
+	StrCpy $R9 $6 1 $9
+	StrCmp $R9 '' +4
+	StrCmp $R9 ':' +3
+	IntOp $9 $9 + 1
+	goto -4
+	StrCpy $5 $6 $9
+	IntOp $9 $9 + 1
+	StrCpy $1 $6 1 -1
+	StrCpy $6 $6 -1 $9
+	StrCmp $5 '' +2
+	IntOp $5 $5 + 0
+	StrCmp $6 '' +2
+	IntOp $6 $6 + 0
+
+	StrCmp $1 'B' 0 +3
+	StrCpy $1 1
+	goto FileFunc_Locate_default
+	StrCmp $1 'K' 0 +3
+	StrCpy $1 1024
+	goto FileFunc_Locate_default
+	StrCmp $1 'M' 0 +3
+	StrCpy $1 1048576
+	goto FileFunc_Locate_default
+	StrCmp $1 'G' 0 FileFunc_Locate_error
+	StrCpy $1 1073741824
+
+	FileFunc_Locate_default:
+	StrCmp $3 '' 0 +2
+	StrCpy $3 'FD'
+	StrCmp $4 '' 0 +2
+	StrCpy $4 '*.*'
+	StrCmp $7 '' 0 +2
+	StrCpy $7 '1'
+	StrCmp $R7 '' 0 +2
+	StrCpy $R7 '0'
+	StrCpy $7 'G$7B$R7'
+
+	StrCpy $8 1
+	Push $0
+	SetDetailsPrint textonly
+
+	FileFunc_Locate_nextdir:
+	IntOp $8 $8 - 1
+	Pop $R8
+
+	StrCpy $9 $7 2 2
+	StrCmp $9 'B0' +3
+	GetLabelAddress $9 FileFunc_Locate_findfirst
+	goto call
+	DetailPrint 'Search in: $R8'
+
+	FileFunc_Locate_findfirst:
+	FindFirst $0 $R7 '$R8\$4'
+	IfErrors FileFunc_Locate_subdir
+	StrCmp $R7 '.' 0 FileFunc_Locate_dir
+	FindNext $0 $R7
+	StrCmp $R7 '..' 0 FileFunc_Locate_dir
+	FindNext $0 $R7
+	IfErrors 0 FileFunc_Locate_dir
+	FindClose $0
+	goto FileFunc_Locate_subdir
+
+	FileFunc_Locate_dir:
+	IfFileExists '$R8\$R7\*.*' 0 FileFunc_Locate_file
+	StrCpy $R6 ''
+	StrCmp $3 'DE' +4
+	StrCmp $3 'FDE' +3
+	StrCmp $3 'FD' FileFunc_Locate_precall
+	StrCmp $3 'F' FileFunc_Locate_findnext FileFunc_Locate_precall
+	FindFirst $9 $R9 '$R8\$R7\*.*'
+	StrCmp $R9 '.' 0 +4
+	FindNext $9 $R9
+	StrCmp $R9 '..' 0 +2
+	FindNext $9 $R9
+	FindClose $9
+	IfErrors FileFunc_Locate_precall FileFunc_Locate_findnext
+
+	FileFunc_Locate_file:
+	StrCmp $3 'FDE' +3
+	StrCmp $3 'FD' +2
+	StrCmp $3 'F' 0 FileFunc_Locate_findnext
+	StrCpy $R6 0
+	StrCmp $5$6 '' FileFunc_Locate_precall
+	FileOpen $9 '$R8\$R7' r
+	IfErrors +3
+	FileSeek $9 0 END $R6
+	FileClose $9
+	System::Int64Op $R6 / $1
+	Pop $R6
+	StrCmp $5 '' +2
+	IntCmp $R6 $5 0 FileFunc_Locate_findnext
+	StrCmp $6 '' +2
+	IntCmp $R6 $6 0 0 FileFunc_Locate_findnext
+
+	FileFunc_Locate_precall:
+	StrCpy $9 0
+	StrCpy $R9 '$R8\$R7'
+
+	call:
+	Push $0
+	Push $1
+	Push $2
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+	Push $8
+	Push $9
+	Push $R7
+	Push $R8
+	StrCmp $9 0 +4
+	StrCpy $R6 ''
+	StrCpy $R7 ''
+	StrCpy $R9 ''
+	Call $2
+	Pop $R9
+	Pop $R8
+	Pop $R7
+	Pop $9
+	Pop $8
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Pop $0
+
+	IfErrors 0 +3
+	FindClose $0
+	goto FileFunc_Locate_error
+	StrCmp $R9 'StopLocate' 0 +3
+	FindClose $0
+	goto FileFunc_Locate_clearstack
+	goto $9
+
+	FileFunc_Locate_findnext:
+	FindNext $0 $R7
+	IfErrors 0 FileFunc_Locate_dir
+	FindClose $0
+
+	FileFunc_Locate_subdir:
+	StrCpy $9 $7 2
+	StrCmp $9 'G0' FileFunc_Locate_end
+	FindFirst $0 $R7 '$R8\*.*'
+	StrCmp $R7 '.' 0 FileFunc_Locate_pushdir
+	FindNext $0 $R7
+	StrCmp $R7 '..' 0 FileFunc_Locate_pushdir
+	FindNext $0 $R7
+	IfErrors 0 FileFunc_Locate_pushdir
+	FindClose $0
+	StrCmp $8 0 FileFunc_Locate_end FileFunc_Locate_nextdir
+
+	FileFunc_Locate_pushdir:
+	IfFileExists '$R8\$R7\*.*' 0 +3
+	Push '$R8\$R7'
+	IntOp $8 $8 + 1
+	FindNext $0 $R7
+	IfErrors 0 FileFunc_Locate_pushdir
+	FindClose $0
+	StrCmp $8 0 FileFunc_Locate_end FileFunc_Locate_nextdir
+
+	FileFunc_Locate_error:
+	SetErrors
+
+	FileFunc_Locate_clearstack:
+	StrCmp $8 0 FileFunc_Locate_end
+	IntOp $8 $8 - 1
+	Pop $R8
+	goto FileFunc_Locate_clearstack
+
+	FileFunc_Locate_end:
+	SetDetailsPrint both
+	Pop $R9
+	Pop $R8
+	Pop $R7
+	Pop $R6
+	Pop $9
+	Pop $8
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Pop $0
+
+	!verbose pop
+!macroend
+
+!define GetSize `!insertmacro GetSizeCall`
+!define un.GetSize `!insertmacro GetSizeCall`
+
+!macro GetSize
+!macroend
+
+!macro un.GetSize
+!macroend
+
+!macro GetSize_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	Exch $1
+	Exch
+	Exch $0
+	Exch
+	Push $2
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+	Push $8
+	Push $9
+	Push $R3
+	Push $R4
+	Push $R5
+	Push $R6
+	Push $R7
+	Push $R8
+	Push $R9
+	ClearErrors
+
+	StrCpy $R9 $0 1 -1
+	StrCmp $R9 '\' 0 +3
+	StrCpy $0 $0 -1
+	goto -3
+	IfFileExists '$0\*.*' 0 FileFunc_GetSize_error
+
+	StrCpy $3 ''
+	StrCpy $4 ''
+	StrCpy $5 ''
+	StrCpy $6 ''
+	StrCpy $8 0
+	StrCpy $R3 ''
+	StrCpy $R4 ''
+	StrCpy $R5 ''
+
+	FileFunc_GetSize_option:
+	StrCpy $R9 $1 1
+	StrCpy $1 $1 '' 1
+	StrCmp $R9 ' ' -2
+	StrCmp $R9 '' FileFunc_GetSize_sizeset
+	StrCmp $R9 '/' 0 -4
+
+	StrCpy $9 -1
+	IntOp $9 $9 + 1
+	StrCpy $R9 $1 1 $9
+	StrCmp $R9 '' +2
+	StrCmp $R9 '/' 0 -3
+	StrCpy $8 $1 $9
+	StrCpy $8 $8 '' 2
+	StrCpy $R9 $8 '' -1
+	StrCmp $R9 ' ' 0 +3
+	StrCpy $8 $8 -1
+	goto -3
+	StrCpy $R9 $1 2
+	StrCpy $1 $1 '' $9
+
+	StrCmp $R9 'M=' 0 FileFunc_GetSize_size
+	StrCpy $4 $8
+	goto FileFunc_GetSize_option
+
+	FileFunc_GetSize_size:
+	StrCmp $R9 'S=' 0 FileFunc_GetSize_gotosubdir
+	StrCpy $6 $8
+	goto FileFunc_GetSize_option
+
+	FileFunc_GetSize_gotosubdir:
+	StrCmp $R9 'G=' 0 FileFunc_GetSize_error
+	StrCpy $7 $8
+	StrCmp $7 '' +3
+	StrCmp $7 '1' +2
+	StrCmp $7 '0' 0 FileFunc_GetSize_error
+	goto FileFunc_GetSize_option
+
+	FileFunc_GetSize_sizeset:
+	StrCmp $6 '' FileFunc_GetSize_default
+	StrCpy $9 0
+	StrCpy $R9 $6 1 $9
+	StrCmp $R9 '' +4
+	StrCmp $R9 ':' +3
+	IntOp $9 $9 + 1
+	goto -4
+	StrCpy $5 $6 $9
+	IntOp $9 $9 + 1
+	StrCpy $1 $6 1 -1
+	StrCpy $6 $6 -1 $9
+	StrCmp $5 '' +2
+	IntOp $5 $5 + 0
+	StrCmp $6 '' +2
+	IntOp $6 $6 + 0
+
+	StrCmp $1 'B' 0 +4
+	StrCpy $1 1
+	StrCpy $2 bytes
+	goto FileFunc_GetSize_default
+	StrCmp $1 'K' 0 +4
+	StrCpy $1 1024
+	StrCpy $2 Kb
+	goto FileFunc_GetSize_default
+	StrCmp $1 'M' 0 +4
+	StrCpy $1 1048576
+	StrCpy $2 Mb
+	goto FileFunc_GetSize_default
+	StrCmp $1 'G' 0 FileFunc_GetSize_error
+	StrCpy $1 1073741824
+	StrCpy $2 Gb
+
+	FileFunc_GetSize_default:
+	StrCmp $4 '' 0 +2
+	StrCpy $4 '*.*'
+	StrCmp $7 '' 0 +2
+	StrCpy $7 '1'
+
+	StrCpy $8 1
+	Push $0
+	SetDetailsPrint textonly
+
+	FileFunc_GetSize_nextdir:
+	IntOp $8 $8 - 1
+	Pop $R8
+	FindFirst $0 $R7 '$R8\$4'
+	IfErrors FileFunc_GetSize_show
+	StrCmp $R7 '.' 0 FileFunc_GetSize_dir
+	FindNext $0 $R7
+	StrCmp $R7 '..' 0 FileFunc_GetSize_dir
+	FindNext $0 $R7
+	IfErrors 0 FileFunc_GetSize_dir
+	FindClose $0
+	goto FileFunc_GetSize_show
+
+	FileFunc_GetSize_dir:
+	IfFileExists '$R8\$R7\*.*' 0 FileFunc_GetSize_file
+	IntOp $R5 $R5 + 1
+	goto FileFunc_GetSize_findnext
+
+	FileFunc_GetSize_file:
+	StrCpy $R6 0
+	StrCmp $5$6 '' 0 +3
+	IntOp $R4 $R4 + 1
+	goto FileFunc_GetSize_findnext
+	FileOpen $9 '$R8\$R7' r
+	IfErrors +3
+	FileSeek $9 0 END $R6
+	FileClose $9
+	StrCmp $5 '' +2
+	IntCmp $R6 $5 0 FileFunc_GetSize_findnext
+	StrCmp $6 '' +2
+	IntCmp $R6 $6 0 0 FileFunc_GetSize_findnext
+	IntOp $R4 $R4 + 1
+	System::Int64Op $R3 + $R6
+	Pop $R3
+
+	FileFunc_GetSize_findnext:
+	FindNext $0 $R7
+	IfErrors 0 FileFunc_GetSize_dir
+	FindClose $0
+
+	FileFunc_GetSize_show:
+	StrCmp $5$6 '' FileFunc_GetSize_nosize
+	System::Int64Op $R3 / $1
+	Pop $9
+	DetailPrint 'Size:$9 $2  Files:$R4  Folders:$R5'
+	goto FileFunc_GetSize_subdir
+	FileFunc_GetSize_nosize:
+	DetailPrint 'Files:$R4  Folders:$R5'
+
+	FileFunc_GetSize_subdir:
+	StrCmp $7 0 FileFunc_GetSize_preend
+	FindFirst $0 $R7 '$R8\*.*'
+	StrCmp $R7 '.' 0 FileFunc_GetSize_pushdir
+	FindNext $0 $R7
+	StrCmp $R7 '..' 0 FileFunc_GetSize_pushdir
+	FindNext $0 $R7
+	IfErrors 0 FileFunc_GetSize_pushdir
+	FindClose $0
+	StrCmp $8 0 FileFunc_GetSize_preend FileFunc_GetSize_nextdir
+
+	FileFunc_GetSize_pushdir:
+	IfFileExists '$R8\$R7\*.*' 0 +3
+	Push '$R8\$R7'
+	IntOp $8 $8 + 1
+	FindNext $0 $R7
+	IfErrors 0 FileFunc_GetSize_pushdir
+	FindClose $0
+	StrCmp $8 0 FileFunc_GetSize_preend FileFunc_GetSize_nextdir
+
+	FileFunc_GetSize_preend:
+	StrCmp $R3 '' FileFunc_GetSize_nosizeend
+	System::Int64Op $R3 / $1
+	Pop $R3
+	FileFunc_GetSize_nosizeend:
+	StrCpy $2 $R4
+	StrCpy $1 $R5
+	StrCpy $0 $R3
+	goto FileFunc_GetSize_end
+
+	FileFunc_GetSize_error:
+	SetErrors
+	StrCpy $0 ''
+	StrCpy $1 ''
+	StrCpy $2 ''
+
+	FileFunc_GetSize_end:
+	SetDetailsPrint both
+	Pop $R9
+	Pop $R8
+	Pop $R7
+	Pop $R6
+	Pop $R5
+	Pop $R4
+	Pop $R3
+	Pop $9
+	Pop $8
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Exch $2
+	Exch
+	Exch $1
+	Exch 2
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!define DriveSpace `!insertmacro DriveSpaceCall`
+!define un.DriveSpace `!insertmacro DriveSpaceCall`
+
+!macro DriveSpace
+!macroend
+
+!macro un.DriveSpace
+!macroend
+
+!macro DriveSpace_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	Exch $1
+	Exch
+	Exch $0
+	Exch
+	Push $2
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	ClearErrors
+
+	StrCpy $2 $0 1 -1
+	StrCmp $2 '\' 0 +3
+	StrCpy $0 $0 -1
+	goto -3
+	IfFileExists '$0\NUL' 0 FileFunc_DriveSpace_error
+
+	StrCpy $5 ''
+	StrCpy $6 ''
+
+	FileFunc_DriveSpace_option:
+	StrCpy $2 $1 1
+	StrCpy $1 $1 '' 1
+	StrCmp $2 ' ' -2
+	StrCmp $2 '' FileFunc_DriveSpace_default
+	StrCmp $2 '/' 0 -4
+	StrCpy $3 -1
+	IntOp $3 $3 + 1
+	StrCpy $2 $1 1 $3
+	StrCmp $2 '' +2
+	StrCmp $2 '/' 0 -3
+	StrCpy $4 $1 $3
+	StrCpy $4 $4 '' 2
+	StrCpy $2 $4 1 -1
+	StrCmp $2 ' ' 0 +3
+	StrCpy $4 $4 -1
+	goto -3
+	StrCpy $2 $1 2
+	StrCpy $1 $1 '' $3
+
+	StrCmp $2 'D=' 0 FileFunc_DriveSpace_unit
+	StrCpy $5 $4
+	StrCmp $5 '' +4
+	StrCmp $5 'T' +3
+	StrCmp $5 'O' +2
+	StrCmp $5 'F' 0 FileFunc_DriveSpace_error
+	goto FileFunc_DriveSpace_option
+
+	FileFunc_DriveSpace_unit:
+	StrCmp $2 'S=' 0 FileFunc_DriveSpace_error
+	StrCpy $6 $4
+	goto FileFunc_DriveSpace_option
+
+	FileFunc_DriveSpace_default:
+	StrCmp $5 '' 0 +2
+	StrCpy $5 'T'
+	StrCmp $6 '' 0 +3
+	StrCpy $6 '1'
+	goto FileFunc_DriveSpace_getspace
+
+	StrCmp $6 'B' 0 +3
+	StrCpy $6 1
+	goto FileFunc_DriveSpace_getspace
+	StrCmp $6 'K' 0 +3
+	StrCpy $6 1024
+	goto FileFunc_DriveSpace_getspace
+	StrCmp $6 'M' 0 +3
+	StrCpy $6 1048576
+	goto FileFunc_DriveSpace_getspace
+	StrCmp $6 'G' 0 FileFunc_DriveSpace_error
+	StrCpy $6 1073741824
+
+	FileFunc_DriveSpace_getspace:
+	System::Call 'kernel32::GetDiskFreeSpaceExA(t, *l, *l, *l)i(r0,.r2,.r3,.)'
+
+	StrCmp $5 T 0 +3
+	StrCpy $0 $3
+	goto FileFunc_DriveSpace_getsize
+	StrCmp $5 O 0 +4
+	System::Int64Op $3 - $2
+	Pop $0
+	goto FileFunc_DriveSpace_getsize
+	StrCmp $5 F 0 +2
+	StrCpy $0 $2
+
+	FileFunc_DriveSpace_getsize:
+	System::Int64Op $0 / $6
+	Pop $0
+	goto FileFunc_DriveSpace_end
+
+	FileFunc_DriveSpace_error:
+	SetErrors
+	StrCpy $0 ''
+
+	FileFunc_DriveSpace_end:
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!define GetDrives `!insertmacro GetDrivesCall`
+!define un.GetDrives `!insertmacro GetDrivesCall`
+
+!macro GetDrives
+!macroend
+
+!macro un.GetDrives
+!macroend
+
+!macro GetDrives_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	Exch $1
+	Exch
+	Exch $0
+	Exch
+	Push $2
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $8
+	Push $9
+
+	System::Alloc 1024
+	Pop $2
+	System::Call 'kernel32::GetLogicalDriveStringsA(i,i) i(1024, r2)'
+
+	StrCmp $0 ALL FileFunc_GetDrives_drivestring
+	StrCmp $0 '' 0 FileFunc_GetDrives_typeset
+	StrCpy $0 ALL
+	goto FileFunc_GetDrives_drivestring
+
+	FileFunc_GetDrives_typeset:
+	StrCpy $6 -1
+	IntOp $6 $6 + 1
+	StrCpy $8 $0 1 $6
+	StrCmp $8$0 '' FileFunc_GetDrives_enumex
+	StrCmp $8 '' +2
+	StrCmp $8 '+' 0 -4
+	StrCpy $8 $0 $6
+	IntOp $6 $6 + 1
+	StrCpy $0 $0 '' $6
+
+	StrCmp $8 'FDD' 0 +3
+	StrCpy $6 2
+	goto FileFunc_GetDrives_drivestring
+	StrCmp $8 'HDD' 0 +3
+	StrCpy $6 3
+	goto FileFunc_GetDrives_drivestring
+	StrCmp $8 'NET' 0 +3
+	StrCpy $6 4
+	goto FileFunc_GetDrives_drivestring
+	StrCmp $8 'CDROM' 0 +3
+	StrCpy $6 5
+	goto FileFunc_GetDrives_drivestring
+	StrCmp $8 'RAM' 0 FileFunc_GetDrives_typeset
+	StrCpy $6 6
+
+	FileFunc_GetDrives_drivestring:
+	StrCpy $3 $2
+
+	FileFunc_GetDrives_enumok:
+	System::Call 'kernel32::lstrlenA(t) i(i r3) .r4'
+	StrCmp $4$0 '0ALL' FileFunc_GetDrives_enumex
+	StrCmp $4 0 FileFunc_GetDrives_typeset
+	System::Call 'kernel32::GetDriveTypeA(t) i(i r3) .r5'
+
+	StrCmp $0 ALL +2
+	StrCmp $5 $6 FileFunc_GetDrives_letter FileFunc_GetDrives_enumnext
+	StrCmp $5 2 0 +3
+	StrCpy $8 FDD
+	goto FileFunc_GetDrives_letter
+	StrCmp $5 3 0 +3
+	StrCpy $8 HDD
+	goto FileFunc_GetDrives_letter
+	StrCmp $5 4 0 +3
+	StrCpy $8 NET
+	goto FileFunc_GetDrives_letter
+	StrCmp $5 5 0 +3
+	StrCpy $8 CDROM
+	goto FileFunc_GetDrives_letter
+	StrCmp $5 6 0 FileFunc_GetDrives_enumex
+	StrCpy $8 RAM
+
+	FileFunc_GetDrives_letter:
+	System::Call '*$3(&t1024 .r9)'
+
+	Push $0
+	Push $1
+	Push $2
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $8
+	Call $1
+	Pop $9
+	Pop $8
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Pop $0
+	StrCmp $9 'StopGetDrives' FileFunc_GetDrives_enumex
+
+	FileFunc_GetDrives_enumnext:
+	IntOp $3 $3 + $4
+	IntOp $3 $3 + 1
+	goto FileFunc_GetDrives_enumok
+
+	FileFunc_GetDrives_enumex:
+	System::Free $2
+
+	Pop $9
+	Pop $8
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Pop $0
+	
+	!verbose pop
+!macroend
+
+!define GetTime `!insertmacro GetTimeCall`
+!define un.GetTime `!insertmacro GetTimeCall`
+
+!macro GetTime
+!macroend
+
+!macro un.GetTime
+!macroend
+
+!macro GetTime_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	Exch $1
+	Exch
+	Exch $0
+	Exch
+	Push $2
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+	ClearErrors
+
+	StrCmp $1 'L' FileFunc_GetTime_gettime
+	StrCmp $1 'A' FileFunc_GetTime_getfile
+	StrCmp $1 'C' FileFunc_GetTime_getfile
+	StrCmp $1 'M' FileFunc_GetTime_getfile
+	StrCmp $1 'LS' FileFunc_GetTime_gettime
+	StrCmp $1 'AS' FileFunc_GetTime_getfile
+	StrCmp $1 'CS' FileFunc_GetTime_getfile
+	StrCmp $1 'MS' FileFunc_GetTime_getfile
+	goto FileFunc_GetTime_error
+
+	FileFunc_GetTime_getfile:
+	IfFileExists $0 0 FileFunc_GetTime_error
+	System::Call '*(i,l,l,l,i,i,i,i,&t260,&t14) i .r6'
+	System::Call 'kernel32::FindFirstFileA(t,i)i(r0,r6) .r2'
+	System::Call 'kernel32::FindClose(i)i(r2)'
+
+	FileFunc_GetTime_gettime:
+	System::Call '*(&i2,&i2,&i2,&i2,&i2,&i2,&i2,&i2) i .r7'
+	StrCmp $1 'L' 0 FileFunc_GetTime_systemtime
+	System::Call 'kernel32::GetLocalTime(i)i(r7)'
+	goto FileFunc_GetTime_convert
+	FileFunc_GetTime_systemtime:
+	StrCmp $1 'LS' 0 FileFunc_GetTime_filetime
+	System::Call 'kernel32::GetSystemTime(i)i(r7)'
+	goto FileFunc_GetTime_convert
+
+	FileFunc_GetTime_filetime:
+	System::Call '*$6(i,l,l,l,i,i,i,i,&t260,&t14)i(,.r4,.r3,.r2)'
+	System::Free $6
+	StrCmp $1 'A' 0 +3
+	StrCpy $2 $3
+	goto FileFunc_GetTime_tolocal
+	StrCmp $1 'C' 0 +3
+	StrCpy $2 $4
+	goto FileFunc_GetTime_tolocal
+	StrCmp $1 'M' FileFunc_GetTime_tolocal
+
+	StrCmp $1 'AS' FileFunc_GetTime_tosystem
+	StrCmp $1 'CS' 0 +3
+	StrCpy $3 $4
+	goto FileFunc_GetTime_tosystem
+	StrCmp $1 'MS' 0 +3
+	StrCpy $3 $2
+	goto FileFunc_GetTime_tosystem
+
+	FileFunc_GetTime_tolocal:
+	System::Call 'kernel32::FileTimeToLocalFileTime(*l,*l)i(r2,.r3)'
+	FileFunc_GetTime_tosystem:
+	System::Call 'kernel32::FileTimeToSystemTime(*l,i)i(r3,r7)'
+
+	FileFunc_GetTime_convert:
+	System::Call '*$7(&i2,&i2,&i2,&i2,&i2,&i2,&i2,&i2)i(.r5,.r6,.r4,.r0,.r3,.r2,.r1,)'
+	System::Free $7
+
+	IntCmp $0 9 0 0 +2
+	StrCpy $0 '0$0'
+	IntCmp $1 9 0 0 +2
+	StrCpy $1 '0$1'
+	IntCmp $2 9 0 0 +2
+	StrCpy $2 '0$2'
+	IntCmp $6 9 0 0 +2
+	StrCpy $6 '0$6'
+
+	StrCmp $4 0 0 +3
+	StrCpy $4 Sunday
+	goto FileFunc_GetTime_end
+	StrCmp $4 1 0 +3
+	StrCpy $4 Monday
+	goto FileFunc_GetTime_end
+	StrCmp $4 2 0 +3
+	StrCpy $4 Tuesday
+	goto FileFunc_GetTime_end
+	StrCmp $4 3 0 +3
+	StrCpy $4 Wednesday
+	goto FileFunc_GetTime_end
+	StrCmp $4 4 0 +3
+	StrCpy $4 Thursday
+	goto FileFunc_GetTime_end
+	StrCmp $4 5 0 +3
+	StrCpy $4 Friday
+	goto FileFunc_GetTime_end
+	StrCmp $4 6 0 FileFunc_GetTime_error
+	StrCpy $4 Saturday
+	goto FileFunc_GetTime_end
+
+	FileFunc_GetTime_error:
+	SetErrors
+	StrCpy $0 ''
+	StrCpy $1 ''
+	StrCpy $2 ''
+	StrCpy $3 ''
+	StrCpy $4 ''
+	StrCpy $5 ''
+	StrCpy $6 ''
+
+	FileFunc_GetTime_end:
+	Pop $7
+	Exch $6
+	Exch
+	Exch $5
+	Exch 2
+	Exch $4
+	Exch 3
+	Exch $3
+	Exch 4
+	Exch $2
+	Exch 5
+	Exch $1
+	Exch 6
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!define GetFileAttributes `!insertmacro GetFileAttributesCall`
+!define un.GetFileAttributes `!insertmacro GetFileAttributesCall`
+
+!macro GetFileAttributes
+!macroend
+
+!macro un.GetFileAttributes
+!macroend
+
+!macro GetFileAttributes_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	Exch $1
+	Exch
+	Exch $0
+	Exch
+	Push $2
+	Push $3
+	Push $4
+	Push $5
+
+	System::Call 'kernel32::GetFileAttributes(t r0)i .r2'
+	StrCmp $2 -1 FileFunc_GetFileAttributes_error
+	StrCpy $3 ''
+
+	IntOp $0 $2 & 0x4000
+	IntCmp $0 0 +2
+	StrCpy $3 'ENCRYPTED|'
+
+	IntOp $0 $2 & 0x2000
+	IntCmp $0 0 +2
+	StrCpy $3 'NOT_CONTENT_INDEXED|$3'
+
+	IntOp $0 $2 & 0x1000
+	IntCmp $0 0 +2
+	StrCpy $3 'OFFLINE|$3'
+
+	IntOp $0 $2 & 0x0800
+	IntCmp $0 0 +2
+	StrCpy $3 'COMPRESSED|$3'
+
+	IntOp $0 $2 & 0x0400
+	IntCmp $0 0 +2
+	StrCpy $3 'REPARSE_POINT|$3'
+
+	IntOp $0 $2 & 0x0200
+	IntCmp $0 0 +2
+	StrCpy $3 'SPARSE_FILE|$3'
+
+	IntOp $0 $2 & 0x0100
+	IntCmp $0 0 +2
+	StrCpy $3 'TEMPORARY|$3'
+
+	IntOp $0 $2 & 0x0080
+	IntCmp $0 0 +2
+	StrCpy $3 'NORMAL|$3'
+
+	IntOp $0 $2 & 0x0040
+	IntCmp $0 0 +2
+	StrCpy $3 'DEVICE|$3'
+
+	IntOp $0 $2 & 0x0020
+	IntCmp $0 0 +2
+	StrCpy $3 'ARCHIVE|$3'
+
+	IntOp $0 $2 & 0x0010
+	IntCmp $0 0 +2
+	StrCpy $3 'DIRECTORY|$3'
+
+	IntOp $0 $2 & 0x0004
+	IntCmp $0 0 +2
+	StrCpy $3 'SYSTEM|$3'
+
+	IntOp $0 $2 & 0x0002
+	IntCmp $0 0 +2
+	StrCpy $3 'HIDDEN|$3'
+
+	IntOp $0 $2 & 0x0001
+	IntCmp $0 0 +2
+	StrCpy $3 'READONLY|$3'
+
+	StrCpy $0 $3 -1
+	StrCmp $1 '' FileFunc_GetFileAttributes_end
+	StrCmp $1 'ALL' FileFunc_GetFileAttributes_end
+
+	FileFunc_GetFileAttributes_attrcmp:
+	StrCpy $5 0
+	IntOp $5 $5 + 1
+	StrCpy $4 $1 1 $5
+	StrCmp $4 '' +2
+	StrCmp $4 '|'  0 -3
+	StrCpy $2 $1 $5
+	IntOp $5 $5 + 1
+	StrCpy $1 $1 '' $5
+	StrLen $3 $2
+	StrCpy $5 -1
+	IntOp $5 $5 + 1
+	StrCpy $4 $0 $3 $5
+	StrCmp $4 '' FileFunc_GetFileAttributes_notfound
+	StrCmp $4 $2 0 -3
+	StrCmp $1 '' 0 FileFunc_GetFileAttributes_attrcmp
+	StrCpy $0 1
+	goto FileFunc_GetFileAttributes_end
+
+	FileFunc_GetFileAttributes_notfound:
+	StrCpy $0 0
+	goto FileFunc_GetFileAttributes_end
+
+	FileFunc_GetFileAttributes_error:
+	SetErrors
+	StrCpy $0 ''
+
+	FileFunc_GetFileAttributes_end:
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Exch $0
+		
+	!verbose pop
+!macroend
+
+!define GetFileVersion `!insertmacro GetFileVersionCall`
+!define un.GetFileVersion `!insertmacro GetFileVersionCall`
+
+!macro GetFileVersion
+!macroend
+
+!macro un.GetFileVersion
+!macroend
+
+!macro GetFileVersion_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	Exch $0
+	Push $1
+	Push $2
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	ClearErrors
+
+	GetDllVersion '$0' $1 $2
+	IfErrors FileFunc_GetFileVersion_error
+	IntOp $3 $1 >> 16
+	IntOp $3 $3 & 0x0000FFFF
+	IntOp $4 $1 & 0x0000FFFF
+	IntOp $5 $2 >> 16
+	IntOp $5 $5 & 0x0000FFFF
+	IntOp $6 $2 & 0x0000FFFF
+	StrCpy $0 '$3.$4.$5.$6'
+	goto FileFunc_GetFileVersion_end
+
+	FileFunc_GetFileVersion_error:
+	SetErrors
+	StrCpy $0 ''
+
+	FileFunc_GetFileVersion_end:
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!define GetExeName `!insertmacro GetExeNameCall`
+!define un.GetExeName `!insertmacro GetExeNameCall`
+
+!macro GetExeName
+!macroend
+
+!macro un.GetExeName
+!macroend
+
+!macro GetExeName_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	Push $0
+	Push $1
+	Push $2
+	System::Call 'kernel32::GetModuleFileNameA(i 0, t .r0, i 1024)'
+	System::Call 'kernel32::GetLongPathNameA(t r0, t .r1, i 1024)i .r2'
+	StrCmp $2 error +2
+	StrCpy $0 $1
+	Pop $2
+	Pop $1
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!define GetExePath `!insertmacro GetExePathCall`
+!define un.GetExePath `!insertmacro GetExePathCall`
+
+!macro GetExePath
+!macroend
+
+!macro un.GetExePath
+!macroend
+
+!macro GetExePath_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	Push $0
+	Push $1
+	Push $2
+	StrCpy $0 $EXEDIR
+	System::Call 'kernel32::GetLongPathNameA(t r0, t .r1, i 1024)i .r2'
+	StrCmp $2 error +2
+	StrCpy $0 $1
+	Pop $2
+	Pop $1
+	Exch $0
+	
+	!verbose pop
+!macroend
+
+!define GetParameters `!insertmacro GetParametersCall`
+!define un.GetParameters `!insertmacro GetParametersCall`
+
+!macro GetParameters
+!macroend
+
+!macro un.GetParameters
+!macroend
+
+!macro GetParameters_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	;cmdline-check
+	StrCmp $CMDLINE "" 0 +3
+	Push ""
+	Return
+
+	;vars
+	Push $0  ;tmp
+	Push $1  ;length
+	Push $2  ;parameter offset
+	Push $3  ;separator
+
+	;length/offset
+	StrLen $1 $CMDLINE
+	StrCpy $2 2  ;start with third character
+
+	;separator
+	StrCpy $3 $CMDLINE 1 ;first character
+	StrCmp $3 '"' +2
+	StrCpy $3 ' '
+
+	FileFunc_GetParameters_token:  ;finding second separator
+	IntCmp $2 $1 FileFunc_GetParameters_strip 0 FileFunc_GetParameters_strip
+	StrCpy $0 $CMDLINE 1 $2
+	IntOp $2 $2 + 1
+	StrCmp $3 $0 0 FileFunc_GetParameters_token
+
+	FileFunc_GetParameters_strip:  ;strip white space
+	IntCmp $2 $1 FileFunc_GetParameters_copy 0 FileFunc_GetParameters_copy
+	StrCpy $0 $CMDLINE 1 $2
+	StrCmp $0 ' ' 0 FileFunc_GetParameters_copy
+	IntOp $2 $2 + 1
+	Goto FileFunc_GetParameters_strip
+
+	FileFunc_GetParameters_copy:
+	StrCpy $0 $CMDLINE "" $2
+
+	;strip white spaces from end
+	FileFunc_GetParameters_rstrip:
+	StrCpy $1 $0 1 -1
+	StrCmp $1 ' ' 0 FileFunc_GetParameters_done
+	StrCpy $0 $0 -1
+	Goto FileFunc_GetParameters_rstrip
+
+	FileFunc_GetParameters_done:
+	Pop $3
+	Pop $2
+	Pop $1
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!macro GetOptionsBody _FILEFUNC_S
+
+	Exch $1
+	Exch
+	Exch $0
+	Exch
+	Push $2
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+	ClearErrors
+
+	StrCpy $2 $1 '' 1
+	StrCpy $1 $1 1
+	StrLen $3 $2
+	StrCpy $7 0
+
+	FileFunc_GetOptions${_FILEFUNC_S}_begin:
+	StrCpy $4 -1
+	StrCpy $6 ''
+
+	FileFunc_GetOptions${_FILEFUNC_S}_quote:
+	IntOp $4 $4 + 1
+	StrCpy $5 $0 1 $4
+	StrCmp${_FILEFUNC_S} $5$7 '0' FileFunc_GetOptions${_FILEFUNC_S}_notfound
+	StrCmp${_FILEFUNC_S} $5 '' FileFunc_GetOptions${_FILEFUNC_S}_trimright
+	StrCmp${_FILEFUNC_S} $5 '"' 0 +7
+	StrCmp${_FILEFUNC_S} $6 '' 0 +3
+	StrCpy $6 '"'
+	goto FileFunc_GetOptions${_FILEFUNC_S}_quote
+	StrCmp${_FILEFUNC_S} $6 '"' 0 +3
+	StrCpy $6 ''
+	goto FileFunc_GetOptions${_FILEFUNC_S}_quote
+	StrCmp${_FILEFUNC_S} $5 `'` 0 +7
+	StrCmp${_FILEFUNC_S} $6 `` 0 +3
+	StrCpy $6 `'`
+	goto FileFunc_GetOptions${_FILEFUNC_S}_quote
+	StrCmp${_FILEFUNC_S} $6 `'` 0 +3
+	StrCpy $6 ``
+	goto FileFunc_GetOptions${_FILEFUNC_S}_quote
+	StrCmp${_FILEFUNC_S} $5 '`' 0 +7
+	StrCmp${_FILEFUNC_S} $6 '' 0 +3
+	StrCpy $6 '`'
+	goto FileFunc_GetOptions${_FILEFUNC_S}_quote
+	StrCmp${_FILEFUNC_S} $6 '`' 0 +3
+	StrCpy $6 ''
+	goto FileFunc_GetOptions${_FILEFUNC_S}_quote
+	StrCmp${_FILEFUNC_S} $6 '"' FileFunc_GetOptions${_FILEFUNC_S}_quote
+	StrCmp${_FILEFUNC_S} $6 `'` FileFunc_GetOptions${_FILEFUNC_S}_quote
+	StrCmp${_FILEFUNC_S} $6 '`' FileFunc_GetOptions${_FILEFUNC_S}_quote
+	StrCmp${_FILEFUNC_S} $5 $1 0 FileFunc_GetOptions${_FILEFUNC_S}_quote
+	StrCmp${_FILEFUNC_S} $7 0 FileFunc_GetOptions${_FILEFUNC_S}_trimleft FileFunc_GetOptions${_FILEFUNC_S}_trimright
+
+	FileFunc_GetOptions${_FILEFUNC_S}_trimleft:
+	IntOp $4 $4 + 1
+	StrCpy $5 $0 $3 $4
+	StrCmp${_FILEFUNC_S} $5 '' FileFunc_GetOptions${_FILEFUNC_S}_notfound
+	StrCmp${_FILEFUNC_S} $5 $2 0 FileFunc_GetOptions${_FILEFUNC_S}_quote
+	IntOp $4 $4 + $3
+	StrCpy $0 $0 '' $4
+	StrCpy $4 $0 1
+	StrCmp${_FILEFUNC_S} $4 ' ' 0 +3
+	StrCpy $0 $0 '' 1
+	goto -3
+	StrCpy $7 1
+	goto FileFunc_GetOptions${_FILEFUNC_S}_begin
+
+	FileFunc_GetOptions${_FILEFUNC_S}_trimright:
+	StrCpy $0 $0 $4
+	StrCpy $4 $0 1 -1
+	StrCmp${_FILEFUNC_S} $4 ' ' 0 +3
+	StrCpy $0 $0 -1
+	goto -3
+	StrCpy $3 $0 1
+	StrCpy $4 $0 1 -1
+	StrCmp${_FILEFUNC_S} $3 $4 0 FileFunc_GetOptions${_FILEFUNC_S}_end
+	StrCmp${_FILEFUNC_S} $3 '"' +3
+	StrCmp${_FILEFUNC_S} $3 `'` +2
+	StrCmp${_FILEFUNC_S} $3 '`' 0 FileFunc_GetOptions${_FILEFUNC_S}_end
+	StrCpy $0 $0 -1 1
+	goto FileFunc_GetOptions${_FILEFUNC_S}_end
+
+	FileFunc_GetOptions${_FILEFUNC_S}_notfound:
+	SetErrors
+	StrCpy $0 ''
+
+	FileFunc_GetOptions${_FILEFUNC_S}_end:
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Exch $0
+
+!macroend
+
+!define GetOptions `!insertmacro GetOptionsCall`
+!define un.GetOptions `!insertmacro GetOptionsCall`
+
+!macro GetOptions
+!macroend
+
+!macro un.GetOptions
+!macroend
+
+!macro GetOptions_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+
+	!insertmacro GetOptionsBody ''
+
+	!verbose pop
+!macroend
+
+!define GetOptionsS `!insertmacro GetOptionsSCall`
+!define un.GetOptionsS `!insertmacro GetOptionsSCall`
+
+!macro GetOptionsS
+!macroend
+
+!macro un.GetOptionsS
+!macroend
+
+!macro GetOptionsS_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+
+	!insertmacro GetOptionsBody 'S'
+
+	!verbose pop
+!macroend
+
+!define GetRoot `!insertmacro GetRootCall`
+!define un.GetRoot `!insertmacro GetRootCall`
+
+!macro GetRoot
+!macroend
+
+!macro un.GetRoot
+!macroend
+
+!macro GetRoot_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	Exch $0
+	Push $1
+	Push $2
+	Push $3
+
+	StrCpy $1 $0 2
+	StrCmp $1 '\\' FileFunc_GetRoot_UNC
+	StrCpy $2 $1 1 1
+	StrCmp $2 ':' 0 FileFunc_GetRoot_empty
+	StrCpy $0 $1
+	goto FileFunc_GetRoot_end
+
+	FileFunc_GetRoot_UNC:
+	StrCpy $2 1
+	StrCpy $3 ''
+
+	FileFunc_GetRoot_loop:
+	IntOp $2 $2 + 1
+	StrCpy $1 $0 1 $2
+	StrCmp $1$3 '' FileFunc_GetRoot_empty
+	StrCmp $1 '' +5
+	StrCmp $1 '\' 0 FileFunc_GetRoot_loop
+	StrCmp $3 '1' +3
+	StrCpy $3 '1'
+	goto FileFunc_GetRoot_loop
+	StrCpy $0 $0 $2
+	StrCpy $2 $0 1 -1
+	StrCmp $2 '\' 0 FileFunc_GetRoot_end
+
+	FileFunc_GetRoot_empty:
+	StrCpy $0 ''
+
+	FileFunc_GetRoot_end:
+	Pop $3
+	Pop $2
+	Pop $1
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!define GetParent `!insertmacro GetParentCall`
+!define un.GetParent `!insertmacro GetParentCall`
+
+!macro GetParent
+!macroend
+
+!macro un.GetParent
+!macroend
+
+!macro GetParent_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	Exch $0
+	Push $1
+	Push $2
+
+	StrCpy $2 $0 1 -1
+	StrCmp $2 '\' 0 +3
+	StrCpy $0 $0 -1
+	goto -3
+
+	StrCpy $1 0
+	IntOp $1 $1 - 1
+	StrCpy $2 $0 1 $1
+	StrCmp $2 '\' +2
+	StrCmp $2 '' 0 -3
+	StrCpy $0 $0 $1
+
+	Pop $2
+	Pop $1
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!define GetFileName `!insertmacro GetFileNameCall`
+!define un.GetFileName `!insertmacro GetFileNameCall`
+
+!macro GetFileName
+!macroend
+
+!macro un.GetFileName
+!macroend
+
+!macro GetFileName_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	Exch $0
+	Push $1
+	Push $2
+
+	StrCpy $2 $0 1 -1
+	StrCmp $2 '\' 0 +3
+	StrCpy $0 $0 -1
+	goto -3
+
+	StrCpy $1 0
+	IntOp $1 $1 - 1
+	StrCpy $2 $0 1 $1
+	StrCmp $2 '' FileFunc_GetFileName_end
+	StrCmp $2 '\' 0 -3
+	IntOp $1 $1 + 1
+	StrCpy $0 $0 '' $1
+
+	FileFunc_GetFileName_end:
+	Pop $2
+	Pop $1
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!define GetBaseName `!insertmacro GetBaseNameCall`
+!define un.GetBaseName `!insertmacro GetBaseNameCall`
+
+!macro GetBaseName
+!macroend
+
+!macro un.GetBaseName
+!macroend
+
+!macro GetBaseName_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	Exch $0
+	Push $1
+	Push $2
+	Push $3
+
+	StrCpy $1 0
+	StrCpy $3 ''
+
+	FileFunc_GetBaseName_loop:
+	IntOp $1 $1 - 1
+	StrCpy $2 $0 1 $1
+	StrCmp $2 '' FileFunc_GetBaseName_trimpath
+	StrCmp $2 '\' FileFunc_GetBaseName_trimpath
+	StrCmp $3 'noext' FileFunc_GetBaseName_loop
+	StrCmp $2 '.' 0 FileFunc_GetBaseName_loop
+	StrCpy $0 $0 $1
+	StrCpy $3 'noext'
+	StrCpy $1 0
+	goto FileFunc_GetBaseName_loop
+
+	FileFunc_GetBaseName_trimpath:
+	StrCmp $1 -1 FileFunc_GetBaseName_empty
+	IntOp $1 $1 + 1
+	StrCpy $0 $0 '' $1
+	goto FileFunc_GetBaseName_end
+
+	FileFunc_GetBaseName_empty:
+	StrCpy $0 ''
+
+	FileFunc_GetBaseName_end:
+	Pop $3
+	Pop $2
+	Pop $1
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!define GetFileExt `!insertmacro GetFileExtCall`
+!define un.GetFileExt `!insertmacro GetFileExtCall`
+
+!macro GetFileExt
+!macroend
+
+!macro un.GetFileExt
+!macroend
+
+!macro GetFileExt_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	Exch $0
+	Push $1
+	Push $2
+
+	StrCpy $1 0
+
+	FileFunc_GetFileExt_loop:
+	IntOp $1 $1 - 1
+	StrCpy $2 $0 1 $1
+	StrCmp $2 '' FileFunc_GetFileExt_empty
+	StrCmp $2 '\' FileFunc_GetFileExt_empty
+	StrCmp $2 '.' 0 FileFunc_GetFileExt_loop
+
+	StrCmp $1 -1 FileFunc_GetFileExt_empty
+	IntOp $1 $1 + 1
+	StrCpy $0 $0 '' $1
+	goto FileFunc_GetFileExt_end
+
+	FileFunc_GetFileExt_empty:
+	StrCpy $0 ''
+
+	FileFunc_GetFileExt_end:
+	Pop $2
+	Pop $1
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!define BannerTrimPath `!insertmacro BannerTrimPathCall`
+!define un.BannerTrimPath `!insertmacro BannerTrimPathCall`
+
+!macro BannerTrimPath
+!macroend
+
+!macro un.BannerTrimPath
+!macroend
+
+!macro BannerTrimPath_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	Exch $1
+	Exch
+	Exch $0
+	Exch
+	Push $2
+	Push $3
+	Push $4
+
+	StrCpy $3 $1 1 -1
+	IntOp $1 $1 + 0
+	StrLen $2 $0
+	IntCmp $2 $1 FileFunc_BannerTrimPath_end FileFunc_BannerTrimPath_end
+	IntOp $1 $1 - 3
+	IntCmp $1 0 FileFunc_BannerTrimPath_empty FileFunc_BannerTrimPath_empty
+	StrCmp $3 'A' FileFunc_BannerTrimPath_A-trim
+	StrCmp $3 'B' FileFunc_BannerTrimPath_B-trim
+	StrCmp $3 'C' FileFunc_BannerTrimPath_C-trim
+	StrCmp $3 'D' FileFunc_BannerTrimPath_D-trim
+
+	FileFunc_BannerTrimPath_A-trim:
+	StrCpy $3 $0 1 1
+	StrCpy $2 0
+	StrCmp $3 ':' 0 +2
+	IntOp $2 $2 + 2
+
+	FileFunc_BannerTrimPath_loopleft:
+	IntOp $2 $2 + 1
+	StrCpy $3 $0 1 $2
+	StrCmp $2 $1 FileFunc_BannerTrimPath_C-trim
+	StrCmp $3 '\' 0 FileFunc_BannerTrimPath_loopleft
+	StrCpy $3 $0 $2
+	IntOp $2 $2 - $1
+	IntCmp $2 0 FileFunc_BannerTrimPath_B-trim 0 FileFunc_BannerTrimPath_B-trim
+
+	FileFunc_BannerTrimPath_loopright:
+	IntOp $2 $2 + 1
+	StrCpy $4 $0 1 $2
+	StrCmp $2 0 FileFunc_BannerTrimPath_B-trim
+	StrCmp $4 '\' 0 FileFunc_BannerTrimPath_loopright
+	StrCpy $4 $0 '' $2
+	StrCpy $0 '$3\...$4'
+	goto FileFunc_BannerTrimPath_end
+
+	FileFunc_BannerTrimPath_B-trim:
+	StrCpy $2 $1
+	IntOp $2 $2 - 1
+	StrCmp $2 -1 FileFunc_BannerTrimPath_C-trim
+	StrCpy $3 $0 1 $2
+	StrCmp $3 '\' 0 -3
+	StrCpy $0 $0 $2
+	StrCpy $0 '$0\...'
+	goto FileFunc_BannerTrimPath_end
+
+	FileFunc_BannerTrimPath_C-trim:
+	StrCpy $0 $0 $1
+	StrCpy $0 '$0...'
+	goto FileFunc_BannerTrimPath_end
+
+	FileFunc_BannerTrimPath_D-trim:
+	StrCpy $3 -1
+	IntOp $3 $3 - 1
+	StrCmp $3 -$2 FileFunc_BannerTrimPath_C-trim
+	StrCpy $4 $0 1 $3
+	StrCmp $4 '\' 0 -3
+	StrCpy $4 $0 '' $3
+	IntOp $3 $1 + $3
+	IntCmp $3 2 FileFunc_BannerTrimPath_C-trim FileFunc_BannerTrimPath_C-trim
+	StrCpy $0 $0 $3
+	StrCpy $0 '$0...$4'
+	goto FileFunc_BannerTrimPath_end
+
+	FileFunc_BannerTrimPath_empty:
+	StrCpy $0 ''
+
+	FileFunc_BannerTrimPath_end:
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!define DirState `!insertmacro DirStateCall`
+!define un.DirState `!insertmacro DirStateCall`
+
+!macro DirState
+!macroend
+
+!macro un.DirState
+!macroend
+
+!macro DirState_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	Exch $0
+	Push $1
+	ClearErrors
+
+	FindFirst $1 $0 '$0\*.*'
+	IfErrors 0 +3
+	StrCpy $0 -1
+	goto FileFunc_DirState_end
+	StrCmp $0 '.' 0 +4
+	FindNext $1 $0
+	StrCmp $0 '..' 0 +2
+	FindNext $1 $0
+	FindClose $1
+	IfErrors 0 +3
+	StrCpy $0 0
+	goto FileFunc_DirState_end
+	StrCpy $0 1
+
+	FileFunc_DirState_end:
+	Pop $1
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!define RefreshShellIcons `!insertmacro RefreshShellIconsCall`
+!define un.RefreshShellIcons `!insertmacro RefreshShellIconsCall`
+
+!macro RefreshShellIcons
+!macroend
+
+!macro un.RefreshShellIcons
+!macroend
+
+!macro RefreshShellIcons_
+	!verbose push
+	!verbose ${_FILEFUNC_VERBOSE}
+	
+	System::Call 'shell32::SHChangeNotify(i 0x08000000, i 0, i 0, i 0)'
+
+	!verbose pop
+!macroend
+
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Include/TextFunc.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/TextFunc.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/TextFunc.nsh	(revision 728)
@@ -0,0 +1,1214 @@
+/*
+_____________________________________________________________________________
+
+                       Text Functions Header v2.4
+_____________________________________________________________________________
+
+ 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
+
+ See documentation for more information about the following functions.
+
+ Usage in script:
+ 1. !include "TextFunc.nsh"
+ 2. [Section|Function]
+      ${TextFunction} "File" "..."  $var
+    [SectionEnd|FunctionEnd]
+
+
+ TextFunction=[LineFind|LineRead|FileReadFromEnd|LineSum|FileJoin|
+               TextCompare|TextCompareS|ConfigRead|ConfigReadS|
+               ConfigWrite|ConfigWriteS|FileRecode|TrimNewLines]
+
+_____________________________________________________________________________
+
+                       Thanks to:
+_____________________________________________________________________________
+
+LineRead
+	Afrow UK (Based on his idea of Function "ReadFileLine")
+LineSum
+	Afrow UK (Based on his idea of Function "LineCount")
+FileJoin
+	Afrow UK (Based on his idea of Function "JoinFiles")
+ConfigRead
+	vbgunz (His idea)
+ConfigWrite
+	vbgunz (His idea)
+TrimNewLines
+	sunjammer (Based on his Function "TrimNewLines")
+*/
+
+
+;_____________________________________________________________________________
+;
+;                                   Macros
+;_____________________________________________________________________________
+;
+; Change log window verbosity (default: 3=no script)
+;
+; Example:
+; !include "TextFunc.nsh"
+; !insertmacro LineFind
+; ${TEXTFUNC_VERBOSE} 4   # all verbosity
+; !insertmacro LineSum
+; ${TEXTFUNC_VERBOSE} 3   # no script
+
+!ifndef TEXTFUNC_INCLUDED
+!define TEXTFUNC_INCLUDED
+
+!include FileFunc.nsh
+!include Util.nsh
+
+!verbose push
+!verbose 3
+!ifndef _TEXTFUNC_VERBOSE
+	!define _TEXTFUNC_VERBOSE 3
+!endif
+!verbose ${_TEXTFUNC_VERBOSE}
+!define TEXTFUNC_VERBOSE `!insertmacro TEXTFUNC_VERBOSE`
+!verbose pop
+
+!macro TEXTFUNC_VERBOSE _VERBOSE
+	!verbose push
+	!verbose 3
+	!undef _TEXTFUNC_VERBOSE
+	!define _TEXTFUNC_VERBOSE ${_VERBOSE}
+	!verbose pop
+!macroend
+
+!macro LineFindCall _INPUT _OUTPUT _RANGE _FUNC
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+	Push $0
+	Push `${_INPUT}`
+	Push `${_OUTPUT}`
+	Push `${_RANGE}`
+	GetFunctionAddress $0 `${_FUNC}`
+	Push `$0`
+	${CallArtificialFunction} LineFind_
+	Pop $0
+	!verbose pop
+!macroend
+
+!macro LineReadCall _FILE _NUMBER _RESULT
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+	Push `${_FILE}`
+	Push `${_NUMBER}`
+	${CallArtificialFunction} LineRead_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro FileReadFromEndCall _FILE _FUNC
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+	Push $0
+	Push `${_FILE}`
+	GetFunctionAddress $0 `${_FUNC}`
+	Push `$0`
+	${CallArtificialFunction} FileReadFromEnd_
+	Pop $0
+	!verbose pop
+!macroend
+
+!macro LineSumCall _FILE _RESULT
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+	Push `${_FILE}`
+	${CallArtificialFunction} LineSum_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro FileJoinCall _FILE1 _FILE2 _FILE3
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+	Push `${_FILE1}`
+	Push `${_FILE2}`
+	Push `${_FILE3}`
+	${CallArtificialFunction} FileJoin_
+	!verbose pop
+!macroend
+
+!macro TextCompareCall _FILE1 _FILE2 _OPTION _FUNC
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+	Push $0
+	Push `${_FILE1}`
+	Push `${_FILE2}`
+	Push `${_OPTION}`
+	GetFunctionAddress $0 `${_FUNC}`
+	Push `$0`
+	${CallArtificialFunction} TextCompare_
+	Pop $0
+	!verbose pop
+!macroend
+
+!macro TextCompareSCall _FILE1 _FILE2 _OPTION _FUNC
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+	Push $0
+	Push `${_FILE1}`
+	Push `${_FILE2}`
+	Push `${_OPTION}`
+	GetFunctionAddress $0 `${_FUNC}`
+	Push `$0`
+	${CallArtificialFunction} TextCompareS_
+	Pop $0
+	!verbose pop
+!macroend
+
+!macro ConfigReadCall _FILE _ENTRY _RESULT
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+	Push `${_FILE}`
+	Push `${_ENTRY}`
+	${CallArtificialFunction} ConfigRead_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro ConfigReadSCall _FILE _ENTRY _RESULT
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+	Push `${_FILE}`
+	Push `${_ENTRY}`
+	${CallArtificialFunction} ConfigReadS_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro ConfigWriteCall _FILE _ENTRY _VALUE _RESULT
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+	Push `${_FILE}`
+	Push `${_ENTRY}`
+	Push `${_VALUE}`
+	${CallArtificialFunction} ConfigWrite_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro ConfigWriteSCall _FILE _ENTRY _VALUE _RESULT
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+	Push `${_FILE}`
+	Push `${_ENTRY}`
+	Push `${_VALUE}`
+	${CallArtificialFunction} ConfigWriteS_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro FileRecodeCall _FILE _FORMAT
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+	Push `${_FILE}`
+	Push `${_FORMAT}`
+	${CallArtificialFunction} FileRecode_
+	!verbose pop
+!macroend
+
+!macro TrimNewLinesCall _FILE _RESULT
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+	Push `${_FILE}`
+	${CallArtificialFunction} TrimNewLines_
+	Pop ${_RESULT}
+	!verbose pop
+!macroend
+
+!macro _TextFunc_TempFileForFile _FILE _RESULT
+	# XXX replace with GetParent
+	Push `${_FILE}`
+	Exch $0
+	Push $1
+	Push $2
+
+	StrCpy $2 $0 1 -1
+	StrCmp $2 '\' 0 +3
+	StrCpy $0 $0 -1
+	goto -3
+
+	StrCpy $1 0
+	IntOp $1 $1 - 1
+	StrCpy $2 $0 1 $1
+	StrCmp $2 '\' +2
+	StrCmp $2 '' 0 -3
+	StrCpy $0 $0 $1
+
+	Pop $2
+	Pop $1
+	Exch $0
+	Pop ${_RESULT}
+	# XXX
+	StrCmp ${_RESULT} "" 0 +2
+		StrCpy ${_RESULT} $EXEDIR
+	GetTempFileName ${_RESULT} ${_RESULT}
+	StrCmp ${_RESULT} "" 0 +2
+		GetTempFileName ${_RESULT}
+	ClearErrors
+!macroend
+
+!define LineFind `!insertmacro LineFindCall`
+!define un.LineFind `!insertmacro LineFindCall`
+
+!macro LineFind
+!macroend
+
+!macro un.LineFind
+!macroend
+
+!macro LineFind_
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+
+	Exch $3
+	Exch
+	Exch $2
+	Exch
+	Exch 2
+	Exch $1
+	Exch 2
+	Exch 3
+	Exch $0
+	Exch 3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+	Push $8
+	Push $9
+	Push $R4
+	Push $R5
+	Push $R6
+	Push $R7
+	Push $R8
+	Push $R9
+	ClearErrors
+
+	IfFileExists '$0' 0 TextFunc_LineFind_error
+	StrCmp $1 '/NUL' TextFunc_LineFind_begin
+	StrCpy $8 0
+	IntOp $8 $8 - 1
+	StrCpy $9 $1 1 $8
+	StrCmp $9 \ +2
+	StrCmp $9 '' +3 -3
+	StrCpy $9 $1 $8
+	IfFileExists '$9\*.*' 0 TextFunc_LineFind_error
+
+	TextFunc_LineFind_begin:
+	StrCpy $4 1
+	StrCpy $5 -1
+	StrCpy $6 0
+	StrCpy $7 0
+	StrCpy $R4 ''
+	StrCpy $R6 ''
+	StrCpy $R7 ''
+	StrCpy $R8 0
+
+	StrCpy $8 $2 1
+	StrCmp $8 '{' 0 TextFunc_LineFind_delspaces
+	StrCpy $2 $2 '' 1
+	StrCpy $8 $2 1 -1
+	StrCmp $8 '}' 0 TextFunc_LineFind_delspaces
+	StrCpy $2 $2 -1
+	StrCpy $R6 TextFunc_LineFind_cut
+
+	TextFunc_LineFind_delspaces:
+	StrCpy $8 $2 1
+	StrCmp $8 ' ' 0 +3
+	StrCpy $2 $2 '' 1
+	goto -3
+	StrCmp $2$7 '0' TextFunc_LineFind_file
+	StrCpy $4 ''
+	StrCpy $5 ''
+	StrCmp $2 '' TextFunc_LineFind_writechk
+
+	TextFunc_LineFind_range:
+	StrCpy $8 0
+	StrCpy $9 $2 1 $8
+	StrCmp $9 '' +5
+	StrCmp $9 ' ' +4
+	StrCmp $9 ':' +3
+	IntOp $8 $8 + 1
+	goto -5
+	StrCpy $5 $2 $8
+	IntOp $5 $5 + 0
+	IntOp $8 $8 + 1
+	StrCpy $2 $2 '' $8
+	StrCmp $4 '' 0 +2
+	StrCpy $4 $5
+	StrCmp $9 ':' TextFunc_LineFind_range
+
+	IntCmp $4 0 0 +2
+	IntCmp $5 -1 TextFunc_LineFind_goto 0 TextFunc_LineFind_growthcmp
+	StrCmp $R7 '' 0 TextFunc_LineFind_minus2plus
+	StrCpy $R7 0
+	FileOpen $8 $0 r
+	FileRead $8 $9
+	IfErrors +3
+	IntOp $R7 $R7 + 1
+	Goto -3
+	FileClose $8
+
+	TextFunc_LineFind_minus2plus:
+	IntCmp $4 0 +5 0 +5
+	IntOp $4 $R7 + $4
+	IntOp $4 $4 + 1
+	IntCmp $4 0 +2 0 +2
+	StrCpy $4 0
+	IntCmp $5 -1 TextFunc_LineFind_goto 0 TextFunc_LineFind_growthcmp
+	IntOp $5 $R7 + $5
+	IntOp $5 $5 + 1
+	TextFunc_LineFind_growthcmp:
+	IntCmp $4 $5 TextFunc_LineFind_goto TextFunc_LineFind_goto
+	StrCpy $5 $4
+	TextFunc_LineFind_goto:
+	goto $7
+
+	TextFunc_LineFind_file:
+	StrCmp $1 '/NUL' TextFunc_LineFind_notemp
+	!insertmacro _TextFunc_TempFileForFile $1 $R4
+	Push $R4
+	FileOpen $R4 $R4 w
+	TextFunc_LineFind_notemp:
+	FileOpen $R5 $0 r
+	IfErrors TextFunc_LineFind_preerror
+
+	TextFunc_LineFind_loop:
+	IntOp $R8 $R8 + 1
+	FileRead $R5 $R9
+	IfErrors TextFunc_LineFind_handleclose
+
+	TextFunc_LineFind_cmp:
+	StrCmp $2$4$5 '' TextFunc_LineFind_writechk
+	IntCmp $4 $R8 TextFunc_LineFind_call 0 TextFunc_LineFind_writechk
+	StrCmp $5 -1 TextFunc_LineFind_call
+	IntCmp $5 $R8 TextFunc_LineFind_call 0 TextFunc_LineFind_call
+
+	GetLabelAddress $7 TextFunc_LineFind_cmp
+	goto TextFunc_LineFind_delspaces
+
+	TextFunc_LineFind_call:
+	StrCpy $7 $R9
+	Push $0
+	Push $1
+	Push $2
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+	Push $R4
+	Push $R5
+	Push $R6
+	Push $R7
+	Push $R8
+	StrCpy $R6 '$4:$5'
+	StrCmp $R7 '' +3
+	IntOp $R7 $R8 - $R7
+	IntOp $R7 $R7 - 1
+	Call $3
+	Pop $9
+	Pop $R8
+	Pop $R7
+	Pop $R6
+	Pop $R5
+	Pop $R4
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Pop $0
+	IfErrors TextFunc_LineFind_preerror
+	StrCmp $9 'StopLineFind' 0 +3
+	IntOp $6 $6 + 1
+	goto TextFunc_LineFind_handleclose
+	StrCmp $1 '/NUL' TextFunc_LineFind_loop
+	StrCmp $9 'SkipWrite' 0 +3
+	IntOp $6 $6 + 1
+	goto TextFunc_LineFind_loop
+	StrCmp $7 $R9 TextFunc_LineFind_write
+	IntOp $6 $6 + 1
+	goto TextFunc_LineFind_write
+
+	TextFunc_LineFind_writechk:
+	StrCmp $1 '/NUL' TextFunc_LineFind_loop
+	StrCmp $R6 TextFunc_LineFind_cut 0 TextFunc_LineFind_write
+	IntOp $6 $6 + 1
+	goto TextFunc_LineFind_loop
+
+	TextFunc_LineFind_write:
+	FileWrite $R4 $R9
+	goto TextFunc_LineFind_loop
+
+	TextFunc_LineFind_preerror:
+	SetErrors
+
+	TextFunc_LineFind_handleclose:
+	StrCmp $1 '/NUL' +3
+	FileClose $R4
+	Pop $R4
+	FileClose $R5
+	IfErrors TextFunc_LineFind_error
+
+	StrCmp $1 '/NUL' TextFunc_LineFind_end
+	StrCmp $1 '' 0 +2
+	StrCpy $1 $0
+	StrCmp $6 0 0 TextFunc_LineFind_rename
+	FileOpen $7 $0 r
+	FileSeek $7 0 END $8
+	FileClose $7
+	FileOpen $7 $R4 r
+	FileSeek $7 0 END $9
+	FileClose $7
+	IntCmp $8 $9 0 TextFunc_LineFind_rename
+	Delete $R4
+	StrCmp $1 $0 TextFunc_LineFind_end
+	CopyFiles /SILENT $0 $1
+	goto TextFunc_LineFind_end
+
+	TextFunc_LineFind_rename:
+	Delete '$EXEDIR\$1'
+	Rename $R4 '$EXEDIR\$1'
+	IfErrors 0 TextFunc_LineFind_end
+	Delete $1
+	Rename $R4 $1
+	IfErrors 0 TextFunc_LineFind_end
+
+	TextFunc_LineFind_error:
+	SetErrors
+
+	TextFunc_LineFind_end:
+	Pop $R9
+	Pop $R8
+	Pop $R7
+	Pop $R6
+	Pop $R5
+	Pop $R4
+	Pop $9
+	Pop $8
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Pop $0
+
+	!verbose pop
+!macroend
+
+!define LineRead `!insertmacro LineReadCall`
+!define un.LineRead `!insertmacro LineReadCall`
+
+!macro LineRead
+!macroend
+
+!macro un.LineRead
+!macroend
+
+!macro LineRead_
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+
+	Exch $1
+	Exch
+	Exch $0
+	Exch
+	Push $2
+	Push $3
+	Push $4
+	ClearErrors
+
+	IfFileExists $0 0 TextFunc_LineRead_error
+	IntOp $1 $1 + 0
+	IntCmp $1 0 TextFunc_LineRead_error 0 TextFunc_LineRead_plus
+	StrCpy $4 0
+	FileOpen $2 $0 r
+	IfErrors TextFunc_LineRead_error
+	FileRead $2 $3
+	IfErrors +3
+	IntOp $4 $4 + 1
+	Goto -3
+	FileClose $2
+	IntOp $1 $4 + $1
+	IntOp $1 $1 + 1
+	IntCmp $1 0 TextFunc_LineRead_error TextFunc_LineRead_error
+
+	TextFunc_LineRead_plus:
+	FileOpen $2 $0 r
+	IfErrors TextFunc_LineRead_error
+	StrCpy $3 0
+	IntOp $3 $3 + 1
+	FileRead $2 $0
+	IfErrors +4
+	StrCmp $3 $1 0 -3
+	FileClose $2
+	goto TextFunc_LineRead_end
+	FileClose $2
+
+	TextFunc_LineRead_error:
+	SetErrors
+	StrCpy $0 ''
+
+	TextFunc_LineRead_end:
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!define FileReadFromEnd `!insertmacro FileReadFromEndCall`
+!define un.FileReadFromEnd `!insertmacro FileReadFromEndCall`
+
+!macro FileReadFromEnd
+!macroend
+
+!macro un.FileReadFromEnd
+!macroend
+
+!macro FileReadFromEnd_
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+
+	Exch $1
+	Exch
+	Exch $0
+	Exch
+	Push $7
+	Push $8
+	Push $9
+	ClearErrors
+
+	StrCpy $7 -1
+	StrCpy $8 0
+	IfFileExists $0 0 TextFunc_FileReadFromEnd_error
+	FileOpen $0 $0 r
+	IfErrors TextFunc_FileReadFromEnd_error
+	FileRead $0 $9
+	IfErrors +4
+	Push $9
+	IntOp $8 $8 + 1
+	goto -4
+	FileClose $0
+
+	TextFunc_FileReadFromEnd_nextline:
+	StrCmp $8 0 TextFunc_FileReadFromEnd_end
+	Pop $9
+	Push $1
+	Push $7
+	Push $8
+	Call $1
+	Pop $0
+	Pop $8
+	Pop $7
+	Pop $1
+	IntOp $7 $7 - 1
+	IntOp $8 $8 - 1
+	IfErrors TextFunc_FileReadFromEnd_error
+	StrCmp $0 'StopFileReadFromEnd' TextFunc_FileReadFromEnd_clearstack TextFunc_FileReadFromEnd_nextline
+
+	TextFunc_FileReadFromEnd_error:
+	SetErrors
+
+	TextFunc_FileReadFromEnd_clearstack:
+	StrCmp $8 0 TextFunc_FileReadFromEnd_end
+	Pop $9
+	IntOp $8 $8 - 1
+	goto TextFunc_FileReadFromEnd_clearstack
+
+	TextFunc_FileReadFromEnd_end:
+	Pop $9
+	Pop $8
+	Pop $7
+	Pop $1
+	Pop $0
+
+	!verbose pop
+!macroend
+
+!define LineSum `!insertmacro LineSumCall`
+!define un.LineSum `!insertmacro LineSumCall`
+
+!macro LineSum
+!macroend
+
+!macro un.LineSum
+!macroend
+
+!macro LineSum_
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+
+	Exch $0
+	Push $1
+	Push $2
+	ClearErrors
+
+	IfFileExists $0 0 TextFunc_LineSum_error
+	StrCpy $2 0
+	FileOpen $0 $0 r
+	IfErrors TextFunc_LineSum_error
+	FileRead $0 $1
+	IfErrors +3
+	IntOp $2 $2 + 1
+	Goto -3
+	FileClose $0
+	StrCpy $0 $2
+	goto TextFunc_LineSum_end
+
+	TextFunc_LineSum_error:
+	SetErrors
+	StrCpy $0 ''
+
+	TextFunc_LineSum_end:
+	Pop $2
+	Pop $1
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!define FileJoin `!insertmacro FileJoinCall`
+!define un.FileJoin `!insertmacro FileJoinCall`
+
+!macro FileJoin
+!macroend
+
+!macro un.FileJoin
+!macroend
+
+!macro FileJoin_
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+
+	Exch $2
+	Exch
+	Exch $1
+	Exch
+	Exch 2
+	Exch $0
+	Exch 2
+	Push $3
+	Push $4
+	Push $5
+	ClearErrors
+
+	IfFileExists $0 0 TextFunc_FileJoin_error
+	IfFileExists $1 0 TextFunc_FileJoin_error
+	StrCpy $3 0
+	IntOp $3 $3 - 1
+	StrCpy $4 $2 1 $3
+	StrCmp $4 \ +2
+	StrCmp $4 '' +3 -3
+	StrCpy $4 $2 $3
+	IfFileExists '$4\*.*' 0 TextFunc_FileJoin_error
+
+	StrCmp $2 $0 0 +2
+	StrCpy $2 ''
+	StrCmp $2 '' 0 +3
+	StrCpy $4 $0
+	Goto TextFunc_FileJoin_notemp
+	!insertmacro _TextFunc_TempFileForFile $2 $4
+	CopyFiles /SILENT $0 $4
+	TextFunc_FileJoin_notemp:
+	FileOpen $3 $4 a
+	IfErrors TextFunc_FileJoin_error
+	FileSeek $3 -1 END
+	FileRead $3 $5
+	StrCmp $5 '$\r' +3
+	StrCmp $5 '$\n' +2
+	FileWrite $3 '$\r$\n'
+
+	;FileWrite $3 '$\r$\n--Divider--$\r$\n'
+
+	FileOpen $0 $1 r
+	IfErrors TextFunc_FileJoin_error
+	FileRead $0 $5
+	IfErrors +3
+	FileWrite $3 $5
+	goto -3
+	FileClose $0
+	FileClose $3
+	StrCmp $2 '' TextFunc_FileJoin_end
+	Delete '$EXEDIR\$2'
+	Rename $4 '$EXEDIR\$2'
+	IfErrors 0 TextFunc_FileJoin_end
+	Delete $2
+	Rename $4 $2
+	IfErrors 0 TextFunc_FileJoin_end
+
+	TextFunc_FileJoin_error:
+	SetErrors
+
+	TextFunc_FileJoin_end:
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Pop $0
+
+	!verbose pop
+!macroend
+
+!macro TextCompareBody _TEXTFUNC_S
+	Exch $3
+	Exch
+	Exch $2
+	Exch
+	Exch 2
+	Exch $1
+	Exch 2
+	Exch 3
+	Exch $0
+	Exch 3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+	Push $8
+	Push $9
+	ClearErrors
+
+	IfFileExists $0 0 TextFunc_TextCompare${_TEXTFUNC_S}_error
+	IfFileExists $1 0 TextFunc_TextCompare${_TEXTFUNC_S}_error
+	StrCmp $2 'FastDiff' +5
+	StrCmp $2 'FastEqual' +4
+	StrCmp $2 'SlowDiff' +3
+	StrCmp $2 'SlowEqual' +2
+	goto TextFunc_TextCompare${_TEXTFUNC_S}_error
+
+	FileOpen $4 $0 r
+	IfErrors TextFunc_TextCompare${_TEXTFUNC_S}_error
+	FileOpen $5 $1 r
+	IfErrors TextFunc_TextCompare${_TEXTFUNC_S}_error
+	SetDetailsPrint textonly
+
+	StrCpy $6 0
+	StrCpy $8 0
+
+	TextFunc_TextCompare${_TEXTFUNC_S}_nextline:
+	StrCmp${_TEXTFUNC_S} $4 '' TextFunc_TextCompare${_TEXTFUNC_S}_fast
+	IntOp $8 $8 + 1
+	FileRead $4 $9
+	IfErrors 0 +4
+	FileClose $4
+	StrCpy $4 ''
+	StrCmp${_TEXTFUNC_S} $5 '' TextFunc_TextCompare${_TEXTFUNC_S}_end
+	StrCmp $2 'FastDiff' TextFunc_TextCompare${_TEXTFUNC_S}_fast
+	StrCmp $2 'FastEqual' TextFunc_TextCompare${_TEXTFUNC_S}_fast TextFunc_TextCompare${_TEXTFUNC_S}_slow
+
+	TextFunc_TextCompare${_TEXTFUNC_S}_fast:
+	StrCmp${_TEXTFUNC_S} $5 '' TextFunc_TextCompare${_TEXTFUNC_S}_call
+	IntOp $6 $6 + 1
+	FileRead $5 $7
+	IfErrors 0 +5
+	FileClose $5
+	StrCpy $5 ''
+	StrCmp${_TEXTFUNC_S} $4 '' TextFunc_TextCompare${_TEXTFUNC_S}_end
+	StrCmp $2 'FastDiff' TextFunc_TextCompare${_TEXTFUNC_S}_call TextFunc_TextCompare${_TEXTFUNC_S}_close
+	StrCmp $2 'FastDiff' 0 +2
+	StrCmp${_TEXTFUNC_S} $7 $9 TextFunc_TextCompare${_TEXTFUNC_S}_nextline TextFunc_TextCompare${_TEXTFUNC_S}_call
+	StrCmp${_TEXTFUNC_S} $7 $9 TextFunc_TextCompare${_TEXTFUNC_S}_call TextFunc_TextCompare${_TEXTFUNC_S}_nextline
+
+	TextFunc_TextCompare${_TEXTFUNC_S}_slow:
+	StrCmp${_TEXTFUNC_S} $4 '' TextFunc_TextCompare${_TEXTFUNC_S}_close
+	StrCpy $6 ''
+	DetailPrint '$8. $9'
+	FileSeek $5 0
+
+	TextFunc_TextCompare${_TEXTFUNC_S}_slownext:
+	FileRead $5 $7
+	IfErrors 0 +2
+	StrCmp $2 'SlowDiff' TextFunc_TextCompare${_TEXTFUNC_S}_call TextFunc_TextCompare${_TEXTFUNC_S}_nextline
+	StrCmp $2 'SlowDiff' 0 +2
+	StrCmp${_TEXTFUNC_S} $7 $9 TextFunc_TextCompare${_TEXTFUNC_S}_nextline TextFunc_TextCompare${_TEXTFUNC_S}_slownext
+	IntOp $6 $6 + 1
+	StrCmp${_TEXTFUNC_S} $7 $9 0 TextFunc_TextCompare${_TEXTFUNC_S}_slownext
+
+	TextFunc_TextCompare${_TEXTFUNC_S}_call:
+	Push $2
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	Push $7
+	Push $8
+	Push $9
+	Call $3
+	Pop $0
+	Pop $9
+	Pop $8
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	StrCmp $0 'StopTextCompare' 0 TextFunc_TextCompare${_TEXTFUNC_S}_nextline
+
+	TextFunc_TextCompare${_TEXTFUNC_S}_close:
+	FileClose $4
+	FileClose $5
+	goto TextFunc_TextCompare${_TEXTFUNC_S}_end
+
+	TextFunc_TextCompare${_TEXTFUNC_S}_error:
+	SetErrors
+
+	TextFunc_TextCompare${_TEXTFUNC_S}_end:
+	SetDetailsPrint both
+	Pop $9
+	Pop $8
+	Pop $7
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Pop $0
+!macroend
+
+!define TextCompare `!insertmacro TextCompareCall`
+!define un.TextCompare `!insertmacro TextCompareCall`
+
+!macro TextCompare
+!macroend
+
+!macro un.TextCompare
+!macroend
+
+!macro TextCompare_
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+
+	!insertmacro TextCompareBody ''
+
+	!verbose pop
+!macroend
+
+!define TextCompareS `!insertmacro TextCompareSCall`
+!define un.TextCompareS `!insertmacro TextCompareSCall`
+
+!macro TextCompareS
+!macroend
+
+!macro un.TextCompareS
+!macroend
+
+!macro TextCompareS_
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+
+	!insertmacro TextCompareBody 'S'
+
+	!verbose pop
+!macroend
+
+!macro ConfigReadBody _TEXTFUNC_S
+	Exch $1
+	Exch
+	Exch $0
+	Exch
+	Push $2
+	Push $3
+	Push $4
+	ClearErrors
+
+	FileOpen $2 $0 r
+	IfErrors TextFunc_ConfigRead${_TEXTFUNC_S}_error
+	StrLen $0 $1
+	StrCmp${_TEXTFUNC_S} $0 0 TextFunc_ConfigRead${_TEXTFUNC_S}_error
+
+	TextFunc_ConfigRead${_TEXTFUNC_S}_readnext:
+	FileRead $2 $3
+	IfErrors TextFunc_ConfigRead${_TEXTFUNC_S}_error
+	StrCpy $4 $3 $0
+	StrCmp${_TEXTFUNC_S} $4 $1 0 TextFunc_ConfigRead${_TEXTFUNC_S}_readnext
+	StrCpy $0 $3 '' $0
+	StrCpy $4 $0 1 -1
+	StrCmp${_TEXTFUNC_S} $4 '$\r' +2
+	StrCmp${_TEXTFUNC_S} $4 '$\n' 0 TextFunc_ConfigRead${_TEXTFUNC_S}_close
+	StrCpy $0 $0 -1
+	goto -4
+
+	TextFunc_ConfigRead${_TEXTFUNC_S}_error:
+	SetErrors
+	StrCpy $0 ''
+
+	TextFunc_ConfigRead${_TEXTFUNC_S}_close:
+	FileClose $2
+
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Exch $0
+!macroend
+
+!define ConfigRead `!insertmacro ConfigReadCall`
+!define un.ConfigRead `!insertmacro ConfigReadCall`
+
+!macro ConfigRead
+!macroend
+
+!macro un.ConfigRead
+!macroend
+
+!macro ConfigRead_
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+
+	!insertmacro ConfigReadBody ''
+
+	!verbose pop
+!macroend
+
+!define ConfigReadS `!insertmacro ConfigReadSCall`
+!define un.ConfigReadS `!insertmacro ConfigReadSCall`
+
+!macro ConfigReadS
+!macroend
+
+!macro un.ConfigReadS
+!macroend
+
+!macro ConfigReadS_
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+
+	!insertmacro ConfigReadBody 'S'
+
+	!verbose pop
+!macroend
+
+!macro ConfigWriteBody _TEXTFUNC_S
+	Exch $2
+	Exch
+	Exch $1
+	Exch
+	Exch 2
+	Exch $0
+	Exch 2
+	Push $3
+	Push $4
+	Push $5
+	Push $6
+	ClearErrors
+
+	IfFileExists $0 0 TextFunc_ConfigWrite${_TEXTFUNC_S}_error
+	FileOpen $3 $0 a
+	IfErrors TextFunc_ConfigWrite${_TEXTFUNC_S}_error
+
+	StrLen $0 $1
+	StrCmp${_TEXTFUNC_S} $0 0 0 TextFunc_ConfigWrite${_TEXTFUNC_S}_readnext
+	StrCpy $0 ''
+	goto TextFunc_ConfigWrite${_TEXTFUNC_S}_close
+
+	TextFunc_ConfigWrite${_TEXTFUNC_S}_readnext:
+	FileRead $3 $4
+	IfErrors TextFunc_ConfigWrite${_TEXTFUNC_S}_add
+	StrCpy $5 $4 $0
+	StrCmp${_TEXTFUNC_S} $5 $1 0 TextFunc_ConfigWrite${_TEXTFUNC_S}_readnext
+
+	StrCpy $5 0
+	IntOp $5 $5 - 1
+	StrCpy $6 $4 1 $5
+	StrCmp${_TEXTFUNC_S} $6 '$\r' -2
+	StrCmp${_TEXTFUNC_S} $6 '$\n' -3
+	StrCpy $6 $4
+	StrCmp${_TEXTFUNC_S} $5 -1 +3
+	IntOp $5 $5 + 1
+	StrCpy $6 $4 $5
+
+	StrCmp${_TEXTFUNC_S} $2 '' TextFunc_ConfigWrite${_TEXTFUNC_S}_change
+	StrCmp${_TEXTFUNC_S} $6 '$1$2' 0 TextFunc_ConfigWrite${_TEXTFUNC_S}_change
+	StrCpy $0 SAME
+	goto TextFunc_ConfigWrite${_TEXTFUNC_S}_close
+
+	TextFunc_ConfigWrite${_TEXTFUNC_S}_change:
+	FileSeek $3 0 CUR $5
+	StrLen $4 $4
+	IntOp $4 $5 - $4
+	FileSeek $3 0 END $6
+	IntOp $6 $6 - $5
+
+	System::Alloc $6
+	Pop $0
+	FileSeek $3 $5 SET
+	System::Call 'kernel32::ReadFile(i r3, i r0, i $6, t.,)'
+	FileSeek $3 $4 SET
+	StrCmp${_TEXTFUNC_S} $2 '' +2
+	FileWrite $3 '$1$2$\r$\n'
+	System::Call 'kernel32::WriteFile(i r3, i r0, i $6, t.,)'
+	System::Call 'kernel32::SetEndOfFile(i r3)'
+	System::Free $0
+	StrCmp${_TEXTFUNC_S} $2 '' +3
+	StrCpy $0 CHANGED
+	goto TextFunc_ConfigWrite${_TEXTFUNC_S}_close
+	StrCpy $0 DELETED
+	goto TextFunc_ConfigWrite${_TEXTFUNC_S}_close
+
+	TextFunc_ConfigWrite${_TEXTFUNC_S}_add:
+	StrCmp${_TEXTFUNC_S} $2 '' 0 +3
+	StrCpy $0 SAME
+	goto TextFunc_ConfigWrite${_TEXTFUNC_S}_close
+	FileSeek $3 -1 END
+	FileRead $3 $4
+	IfErrors +4
+	StrCmp${_TEXTFUNC_S} $4 '$\r' +3
+	StrCmp${_TEXTFUNC_S} $4 '$\n' +2
+	FileWrite $3 '$\r$\n'
+	FileWrite $3 '$1$2$\r$\n'
+	StrCpy $0 ADDED
+
+	TextFunc_ConfigWrite${_TEXTFUNC_S}_close:
+	FileClose $3
+	goto TextFunc_ConfigWrite${_TEXTFUNC_S}_end
+
+	TextFunc_ConfigWrite${_TEXTFUNC_S}_error:
+	SetErrors
+	StrCpy $0 ''
+
+	TextFunc_ConfigWrite${_TEXTFUNC_S}_end:
+	Pop $6
+	Pop $5
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Exch $0
+!macroend
+
+!define ConfigWrite `!insertmacro ConfigWriteCall`
+!define un.ConfigWrite `!insertmacro ConfigWriteCall`
+
+!macro ConfigWrite
+!macroend
+
+!macro un.ConfigWrite
+!macroend
+
+!macro ConfigWrite_
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+
+	!insertmacro ConfigWriteBody ''
+
+	!verbose pop
+!macroend
+
+!define ConfigWriteS `!insertmacro ConfigWriteSCall`
+!define un.ConfigWriteS `!insertmacro ConfigWriteSCall`
+
+!macro ConfigWriteS
+!macroend
+
+!macro un.ConfigWriteS
+!macroend
+
+!macro ConfigWriteS_
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+
+	!insertmacro ConfigWriteBody 'S'
+
+	!verbose pop
+!macroend
+
+!define FileRecode `!insertmacro FileRecodeCall`
+!define un.FileRecode `!insertmacro FileRecodeCall`
+
+!macro FileRecode
+!macroend
+
+!macro un.FileRecode
+!macroend
+
+!macro FileRecode_
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+
+	Exch $1
+	Exch
+	Exch $0
+	Exch
+	Push $2
+	Push $3
+	Push $4
+
+	IfFileExists $0 0 TextFunc_FileRecode_error
+	StrCmp $1 OemToChar +2
+	StrCmp $1 CharToOem 0 TextFunc_FileRecode_error
+
+	FileOpen $2 $0 a
+	FileSeek $2 0 END $3
+	System::Alloc $3
+	Pop $4
+	FileSeek $2 0 SET
+	System::Call 'kernel32::ReadFile(i r2, i r4, i $3, t.,)'
+	System::Call 'user32::$1Buff(i r4, i r4, i $3)'
+	FileSeek $2 0 SET
+	System::Call 'kernel32::WriteFile(i r2, i r4, i $3, t.,)'
+	System::Free $4
+	FileClose $2
+	goto TextFunc_FileRecode_end
+
+	TextFunc_FileRecode_error:
+	SetErrors
+
+	TextFunc_FileRecode_end:
+	Pop $4
+	Pop $3
+	Pop $2
+	Pop $1
+	Pop $0
+
+	!verbose pop
+!macroend
+
+!define TrimNewLines `!insertmacro TrimNewLinesCall`
+!define un.TrimNewLines `!insertmacro TrimNewLinesCall`
+
+!macro TrimNewLines
+!macroend
+
+!macro un.TrimNewLines
+!macroend
+
+!macro TrimNewLines_
+	!verbose push
+	!verbose ${_TEXTFUNC_VERBOSE}
+
+	Exch $0
+	Push $1
+	Push $2
+
+	StrCpy $1 0
+	IntOp $1 $1 - 1
+	StrCpy $2 $0 1 $1
+	StrCmp $2 '$\r' -2
+	StrCmp $2 '$\n' -3
+	StrCmp $1 -1 +3
+	IntOp $1 $1 + 1
+	StrCpy $0 $0 $1
+
+	Pop $2
+	Pop $1
+	Exch $0
+
+	!verbose pop
+!macroend
+
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Include/VB6RunTime.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/VB6RunTime.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/VB6RunTime.nsh	(revision 728)
@@ -0,0 +1,90 @@
+/*
+
+VB6RunTime.nsh
+
+Setup of Visual Basic 6.0 run-time files, including the Oleaut32.dll security update
+
+Copyright 2008-2015 Joost Verburg
+
+To obtain the run-time files, download and extract
+http://nsis.sourceforge.net/vb6runtime.zip
+
+Script code for installation:
+
+!insertmacro InstallVB6RunTime FOLDER ALREADY_INSTALLED
+
+in which FOLDER is the location of the run-time files and ALREADY_INSTALLED is the
+name of a variable that is empty when the application is installed for the first time
+and non-empty otherwise
+
+Script code for uninstallation:
+
+!insertmacro UnInstallVB6RunTime
+
+Remarks:
+
+* You may have to install additional files for such Visual Basic application to work,
+  such as OCX files for user interface controls.
+  
+* Installation of the run-time files requires Administrator or Power User privileges.
+  Use the Multi-User header file to verify whether these privileges are available.
+
+* Add a Modern UI finish page or another check (see IfRebootFlag in the NSIS Users
+  Manual) to allow the user to restart the computer when necessary.
+
+*/
+
+!ifndef VB6_INCLUDED
+!define VB6_INCLUDED
+!verbose push
+!verbose 3
+
+!include Library.nsh
+!include WinVer.nsh
+
+!macro VB6RunTimeInstall FOLDER ALREADY_INSTALLED
+
+  !insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_PROTECTED "${FOLDER}\msvbvm60.dll" "$SYSDIR\msvbvm60.dll" "$SYSDIR"
+  
+  ;The files below will only be installed on Win9x/NT4
+  
+  !insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_PROTECTED    "${FOLDER}\olepro32.dll" "$SYSDIR\olepro32.dll" "$SYSDIR"
+  !insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_PROTECTED    "${FOLDER}\comcat.dll"   "$SYSDIR\comcat.dll"   "$SYSDIR"
+  !insertmacro InstallLib DLL    "${ALREADY_INSTALLED}" REBOOT_PROTECTED    "${FOLDER}\asycfilt.dll" "$SYSDIR\asycfilt.dll" "$SYSDIR"
+  !insertmacro InstallLib TLB    "${ALREADY_INSTALLED}" REBOOT_PROTECTED    "${FOLDER}\stdole2.tlb"  "$SYSDIR\stdole2.tlb"  "$SYSDIR"
+  
+  Push $R0
+  
+  ${if} ${IsNT}
+    ${if} ${IsWinNT4}
+      ReadRegStr $R0 HKLM "System\CurrentControlSet\Control" "ProductOptions"
+      ${if} $R0 == "Terminal Server"
+        !insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_NOTPROTECTED "${FOLDER}\NT4TS\oleaut32.dll" "$SYSDIR\oleaut32.dll" "$SYSDIR"
+      ${else}
+        !insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_NOTPROTECTED "${FOLDER}\NT4\oleaut32.dll" "$SYSDIR\oleaut32.dll" "$SYSDIR"
+      ${endif}
+    ${endif}
+  ${else}
+    ;No Oleaut32.dll with the security update has been released for Windows 9x.
+    ;The NT4 version is used because NT4 and Win9x used to share the same 2.40 version
+    ;and version 2.40.4519.0 is reported to work fine on Win9x.
+    !insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_NOTPROTECTED "${FOLDER}\NT4\oleaut32.dll" "$SYSDIR\oleaut32.dll" "$SYSDIR"
+  ${endif}
+  
+  Pop $R0
+
+!macroend
+
+!macro VB6RunTimeUnInstall
+
+   !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\msvbvm60.dll"
+   !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\oleaut32.dll"
+   !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\olepro32.dll"
+   !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\comcat.dll"
+   !insertmacro UnInstallLib DLL    SHARED NOREMOVE "$SYSDIR\asycfilt.dll"
+   !insertmacro UnInstallLib TLB    SHARED NOREMOVE "$SYSDIR\stdole2.tlb"
+
+!macroend
+
+!verbose pop
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Include/Colors.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/Colors.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/Colors.nsh	(revision 728)
@@ -0,0 +1,75 @@
+!ifndef COLORS_NSH
+!define COLORS_NSH
+
+!verbose push
+!verbose 3
+
+# Squad
+# Rob Segal
+# Joel
+# Yathosho
+
+
+# Predefined HTML Hex colors
+!define WHITE "FFFFFF"
+!define BLACK "000000"
+!define YELLOW "FFFF00"
+!define RED "FF0000"
+!define GREEN "00FF00"
+!define BLUE "0000FF"
+!define MAGENTA "FF00FF"
+!define CYAN "00FFFF"
+
+# Function to convert red , green and blue integer values to HTML Hex format
+!define RGB '!insertmacro rgb2hex'
+
+# Function to convert red, green and blue integer values to Hexadecimal (0xRRGGBB) format
+!define HEX '!insertmacro rgb2hex2'
+
+# Function to get the r value from a RGB number
+!define GetRvalue '!insertmacro redvalue'
+
+# Function to get the g value from a RGB number
+!define GetGvalue '!insertmacro greenvalue'
+
+# Function to get the b value from a RGB number
+!define GetBvalue '!insertmacro bluevalue'
+
+# Function to get the r value from a Hex number
+!define GetRvalueX '!insertmacro bluevalue'
+
+# Function to get the g value from a Hex number
+!define GetGvalueX '!insertmacro greenvalue'
+
+# Function to get the r value from a HEX number
+!define GetBvalueX '!insertmacro redvalue'
+
+!macro rgb2hex output R G B
+IntFmt "${output}" "%02X" "${R}"
+IntFmt "${output}" "${output}%02X" "${G}"
+IntFmt "${output}" "${output}%02X" "${B}"
+!macroend
+
+!macro rgb2hex2 output R G B
+IntFmt "${output}" "%02X" "${B}"
+IntFmt "${output}" "${output}%02X" "${G}"
+IntFmt "${output}" "${output}%02X" "${R}"
+!macroend
+
+!macro redvalue output hexval
+StrCpy ${output} ${hexval} 2 0
+IntFmt "${output}" "%02i" "0x${output}"
+!macroend
+
+!macro greenvalue output hexval
+StrCpy ${output} ${hexval} 2 2
+IntFmt "${output}" "%02i" "0x${output}"
+!macroend
+
+!macro bluevalue output hexval
+StrCpy ${output} ${hexval} 2 4
+IntFmt "${output}" "%02i" "0x${output}"
+!macroend
+
+!verbose pop
+!endif
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Include/Memento.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/Memento.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/Memento.nsh	(revision 728)
@@ -0,0 +1,526 @@
+!verbose push
+!verbose 3
+
+!include LogicLib.nsh
+!include Sections.nsh
+
+!ifndef ___MEMENTO_NSH___
+!define ___MEMENTO_NSH___
+
+#####################################
+### Memento                       ###
+#####################################
+
+/*
+
+Memento is a set of macros that allow installers to remember user selection
+across separate runs of the installer. Currently, it can remember the state
+of sections and mark new sections as bold. In the future, it'll integrate
+InstallOptions and maybe even the Modern UI.
+
+A usage example can be found in `Examples\Memento.nsi`.
+
+*/
+
+#####################################
+### Usage Instructions            ###
+#####################################
+
+/*
+
+1. Declare usage of Memento by including Memento.nsh at the top of the script.
+
+      !include Memento.nsh
+
+2. Define MEMENTO_REGISTRY_ROOT and MEMENTO_REGISTRY_KEY with the a registry key
+   where sections' state should be saved.
+
+      !define MEMENTO_REGISTRY_ROOT HKLM
+      !define MEMENTO_REGISTRY_KEY \
+                Software\Microsoft\Windows\CurrentVersion\Uninstall\MyProgram
+
+3. Replace Section with ${MementoSection} and SectionEnd with ${MementoSectionEnd}
+   for sections that whose state should be remembered by Memento.
+
+   For sections that should be unselected by default, use ${MementoSection}'s
+   brother - ${MementoUnselectedSection}.
+
+   Sections that don't already have an identifier must be assigned one.
+
+   Section identifiers must stay the same across different versions of the
+   installer or their state will be forgotten.
+
+4. Use ${MementoSectionDone} after the last ${MementoSection}.
+
+5. Add a call to ${MementoSectionRestore} to .onInit to restore the state
+   of all sections from the registry.
+
+      Function .onInit
+
+        ${MementoSectionRestore}
+
+      FunctionEnd
+
+6. Add a call to ${MementoSectionSave} to .onInstSuccess to save the state
+   of all sections to the registry.
+
+      Function .onInstSuccess
+
+        ${MementoSectionSave}
+
+      FunctionEnd
+
+7. Tattoo the location of the chosen registry key on your arm.
+
+*/
+
+#####################################
+### User API                      ###
+#####################################
+
+;
+; ${MementoSection}
+;
+;   Defines a section whose state is remembered by Memento.
+;
+;   Usage is similar to Section.
+;
+;     ${MementoSection} "name" "some_id"
+;
+
+!define MementoSection "!insertmacro MementoSection"
+
+;
+; ${MementoSectionEnd}
+;
+;   Ends a section previously opened using ${MementoSection}.
+;
+;   Usage is similar to SectionEnd.
+;
+;     ${MementoSection} "name" "some_id"
+;        # some code...
+;     ${MementoSectionEnd}
+;
+
+;
+; ${MementoUnselectedSection}
+;
+;   Defines a section whose state is remembered by Memento and is
+;   unselected by default.
+;
+;   Usage is similar to Section with the /o switch.
+;
+;     ${MementoUnselectedSection} "name" "some_id"
+;
+
+!define MementoUnselectedSection "!insertmacro MementoUnselectedSection"
+
+;
+; ${MementoSectionEnd}
+;
+;   Ends a section previously opened using ${MementoSection}.
+;
+;   Usage is similar to SectionEnd.
+;
+;     ${MementoSection} "name" "some_id"
+;        # some code...
+;     ${MementoSectionEnd}
+;
+
+!define MementoSectionEnd "!insertmacro MementoSectionEnd"
+
+;
+; ${MementoSectionDone}
+;
+;   Used after all ${MementoSection} have been set.
+;
+;     ${MementoSection} "name1" "some_id1"
+;        # some code...
+;     ${MementoSectionEnd}
+;
+;     ${MementoSection} "name2" "some_id2"
+;        # some code...
+;     ${MementoSectionEnd}
+;
+;     ${MementoSection} "name3" "some_id3"
+;        # some code...
+;     ${MementoSectionEnd}
+;
+;     ${MementoSectionDone}
+;
+
+!define MementoSectionDone "!insertmacro MementoSectionDone"
+
+;
+; ${MementoSectionRestore}
+;
+;   Restores the state of all Memento sections from the registry.
+;
+;   Commonly used in .onInit.
+;
+;     Function .onInit
+;
+;       ${MementoSectionRestore}
+;
+;     FunctionEnd
+;
+
+!define MementoSectionRestore "!insertmacro MementoSectionRestore"
+
+;
+; ${MementoSectionSave}
+;
+;   Saves the state of all Memento sections to the registry.
+;
+;   Commonly used in .onInstSuccess.
+;
+;     Function .onInstSuccess
+;
+;       ${MementoSectionSave}
+;
+;     FunctionEnd
+;
+
+!define MementoSectionSave "!insertmacro MementoSectionSave"
+
+
+#####################################
+### Internal Defines              ###
+#####################################
+
+!define __MementoSectionIndex 1
+
+#####################################
+### Internal Macros               ###
+#####################################
+
+!macro __MementoCheckSettings
+
+  !ifndef MEMENTO_REGISTRY_ROOT | MEMENTO_REGISTRY_KEY
+
+    !error "MEMENTO_REGISTRY_ROOT and MEMENTO_REGISTRY_KEY must be defined before using any of Memento's macros"
+
+  !endif
+
+!macroend
+
+!macro __MementoSection flags name id
+
+  !insertmacro __MementoCheckSettings
+
+  !ifndef __MementoSectionIndex
+
+    !error "MementoSectionDone already used!"
+
+  !endif
+
+  !define __MementoSectionLastSectionId `${id}`
+
+  !verbose pop
+
+  Section ${flags} `${name}` `${id}`
+
+  !verbose push
+  !verbose 3
+
+!macroend
+
+#####################################
+### User Macros                   ###
+#####################################
+
+!macro MementoSection name id
+
+  !verbose push
+  !verbose 3
+
+  !insertmacro __MementoSection "" `${name}` `${id}`
+
+  !verbose pop
+
+!macroend
+
+!macro MementoUnselectedSection name id
+
+  !verbose push
+  !verbose 3
+
+  !insertmacro __MementoSection /o `${name}` `${id}`
+
+  !define __MementoSectionUnselected
+
+  !verbose pop
+
+!macroend
+
+!macro MementoSectionEnd
+
+  SectionEnd
+
+  !verbose push
+  !verbose 3
+
+  !insertmacro __MementoCheckSettings
+
+  !ifndef __MementoSectionIndex
+
+    !error "MementoSectionDone already used!"
+
+  !endif
+
+  !define /MATH __MementoSectionIndexNext \
+      ${__MementoSectionIndex} + 1
+
+  Function __MementoSectionMarkNew${__MementoSectionIndex}
+
+    ClearErrors
+    ReadRegDWORD $0 ${MEMENTO_REGISTRY_ROOT} `${MEMENTO_REGISTRY_KEY}` `MementoSection_${__MementoSectionLastSectionId}`
+
+    ${If} ${Errors}
+
+      !insertmacro SetSectionFlag `${${__MementoSectionLastSectionId}}` ${SF_BOLD}
+
+    ${EndIf}
+
+    GetFunctionAddress $0 __MementoSectionMarkNew${__MementoSectionIndexNext}
+    Goto $0
+
+  FunctionEnd
+
+  Function __MementoSectionRestoreStatus${__MementoSectionIndex}
+
+    ClearErrors
+    ReadRegDWORD $0 ${MEMENTO_REGISTRY_ROOT} `${MEMENTO_REGISTRY_KEY}` `MementoSection_${__MementoSectionLastSectionId}`
+
+    !ifndef __MementoSectionUnselected
+
+      ${If} ${Errors}
+      ${OrIf} $0 != 0
+
+        !insertmacro SelectSection `${${__MementoSectionLastSectionId}}`
+
+      ${Else}
+
+        !insertmacro UnselectSection `${${__MementoSectionLastSectionId}}`
+
+      ${EndIf}
+
+    !else
+
+      !undef __MementoSectionUnselected
+
+      ${If} ${Errors}
+      ${OrIf} $0 == 0
+
+        !insertmacro UnselectSection `${${__MementoSectionLastSectionId}}`
+
+      ${Else}
+
+        !insertmacro SelectSection `${${__MementoSectionLastSectionId}}`
+
+      ${EndIf}
+
+    !endif
+
+    GetFunctionAddress $0 __MementoSectionRestoreStatus${__MementoSectionIndexNext}
+    Goto $0
+
+  FunctionEnd
+
+  Function __MementoSectionSaveStatus${__MementoSectionIndex}
+
+    ${If} ${SectionIsSelected} `${${__MementoSectionLastSectionId}}`
+
+      WriteRegDWORD ${MEMENTO_REGISTRY_ROOT} `${MEMENTO_REGISTRY_KEY}` `MementoSection_${__MementoSectionLastSectionId}` 1
+
+    ${Else}
+
+      WriteRegDWORD ${MEMENTO_REGISTRY_ROOT} `${MEMENTO_REGISTRY_KEY}` `MementoSection_${__MementoSectionLastSectionId}` 0
+
+    ${EndIf}
+
+    GetFunctionAddress $0 __MementoSectionSaveStatus${__MementoSectionIndexNext}
+    Goto $0
+
+  FunctionEnd
+
+  !undef __MementoSectionIndex
+  !define __MementoSectionIndex ${__MementoSectionIndexNext}
+  !undef __MementoSectionIndexNext
+
+  !undef __MementoSectionLastSectionId
+
+  !verbose pop
+
+!macroend
+
+!macro MementoSectionDone
+
+  !verbose push
+  !verbose 3
+
+  !insertmacro __MementoCheckSettings
+
+  Function __MementoSectionMarkNew${__MementoSectionIndex}
+  FunctionEnd
+
+  Function __MementoSectionRestoreStatus${__MementoSectionIndex}
+  FunctionEnd
+
+  Function __MementoSectionSaveStatus${__MementoSectionIndex}
+  FunctionEnd
+
+  !undef __MementoSectionIndex
+
+  !verbose pop
+
+!macroend
+
+!macro MementoSectionRestore
+
+  !verbose push
+  !verbose 3
+
+  !insertmacro __MementoCheckSettings
+
+  Push $0
+  Push $1
+  Push $2
+  Push $3
+
+    # check for first usage
+
+    ClearErrors
+
+    ReadRegStr $0 ${MEMENTO_REGISTRY_ROOT} `${MEMENTO_REGISTRY_KEY}` MementoSectionUsed
+
+    ${If} ${Errors}
+
+      # use script defaults on first run
+      Goto done
+
+    ${EndIf}
+
+    # mark new components in bold
+    
+    Call __MementoSectionMarkNew1
+
+    # mark section groups in bold
+
+    StrCpy $0 0
+    StrCpy $1 ""
+    StrCpy $2 ""
+    StrCpy $3 ""
+
+    loop:
+
+      ClearErrors
+
+      ${If} ${SectionIsBold} $0
+
+        ${If} $1 != ""
+
+          !insertmacro SetSectionFlag $1 ${SF_BOLD}
+
+        ${EndIf}
+
+        ${If} $2 != ""
+
+          !insertmacro SetSectionFlag $2 ${SF_BOLD}
+
+        ${EndIf}
+
+        ${If} $3 != ""
+
+          !insertmacro SetSectionFlag $3 ${SF_BOLD}
+
+        ${EndIf}
+
+      ${ElseIf} ${Errors}
+
+        Goto loop_end
+
+      ${EndIf}
+
+      ${If} ${SectionIsSectionGroup} $0
+
+        ${If} $1 == ""
+
+          StrCpy $1 $0
+
+        ${ElseIf} $2 == ""
+
+          StrCpy $2 $0
+
+        ${ElseIf} $3 == ""
+
+          StrCpy $3 $0
+
+        ${EndIf}
+
+      ${EndIf}
+
+      ${If} ${SectionIsSectionGroupEnd} $0
+
+        ${If} $3 != ""
+
+          StrCpy $3 ""
+
+        ${ElseIf} $2 != ""
+
+          StrCpy $2 ""
+
+        ${ElseIf} $1 != ""
+
+          StrCpy $1 ""
+
+        ${EndIf}
+
+      ${EndIf}
+
+      IntOp $0 $0 + 1
+
+    Goto loop
+    loop_end:
+
+    # restore sections' status
+
+    Call __MementoSectionRestoreStatus1
+
+  # all done
+
+  done:
+
+  Pop $3
+  Pop $2
+  Pop $1
+  Pop $0
+
+  !verbose pop
+
+!macroend
+
+!macro MementoSectionSave
+
+  !verbose push
+  !verbose 3
+
+  !insertmacro __MementoCheckSettings
+
+  Push $0
+
+    WriteRegStr ${MEMENTO_REGISTRY_ROOT} `${MEMENTO_REGISTRY_KEY}` MementoSectionUsed ""
+  
+    Call __MementoSectionSaveStatus1
+
+  Pop $0
+
+  !verbose pop
+
+!macroend
+
+
+
+!endif # ___MEMENTO_NSH___
+
+!verbose pop
Index: tmp/trunk/org.txm.setups/nsis/Include/Library.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/Library.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/Library.nsh	(revision 728)
@@ -0,0 +1,870 @@
+#
+# Library.nsh
+#
+# A system for the installation and uninstallation of dynamic
+# link libraries (DLL) and type libraries (TLB). Using this
+# system you can handle the complete setup with one single
+# line of code:
+#
+#  * File copying
+#  * File copying on reboot
+#  * Version checks
+#  * Registration and unregistration
+#  * Registration and unregistration on reboot
+#  * Shared DLL counting
+#  * Windows File Protection checks
+#
+# For more information, read appendix B in the documentation.
+#
+
+!verbose push
+!verbose 3
+
+!ifndef LIB_INCLUDED
+
+!define LIB_INCLUDED
+
+!ifndef SHCNE_ASSOCCHANGED
+  !define SHCNE_ASSOCCHANGED 0x08000000
+!endif
+!ifndef SHCNF_IDLIST
+  !define SHCNF_IDLIST 0x0000
+!endif
+
+!define REGTOOL_VERSION v3
+!define REGTOOL_KEY NSIS.Library.RegTool.${REGTOOL_VERSION}
+
+!include LogicLib.nsh
+!include x64.nsh
+
+### GetParent macro, don't pass $1 or $2 as INTPUT or OUTPUT
+!macro __InstallLib_Helper_GetParent INPUT OUTPUT
+
+  # Copied from FileFunc.nsh
+
+  StrCpy ${OUTPUT} ${INPUT}
+
+  Push $1
+  Push $2
+
+  StrCpy $2 ${OUTPUT} 1 -1
+  StrCmp $2 '\' 0 +3
+  StrCpy ${OUTPUT} ${OUTPUT} -1
+  goto -3
+
+  StrCpy $1 0
+  IntOp $1 $1 - 1
+  StrCpy $2 ${OUTPUT} 1 $1
+  StrCmp $2 '\' +2
+  StrCmp $2 '' 0 -3
+  StrCpy ${OUTPUT} ${OUTPUT} $1
+
+  Pop $2
+  Pop $1
+
+!macroend
+
+### Initialize session id (GUID)
+!macro __InstallLib_Helper_InitSession
+
+  !ifndef __InstallLib_SessionGUID_Defined
+
+    !define __InstallLib_SessionGUID_Defined
+
+    Var /GLOBAL __INSTALLLLIB_SESSIONGUID
+
+  !endif
+
+  !define __InstallLib_Helper_InitSession_Label "Library_${__FILE__}${__LINE__}"
+
+  StrCmp $__INSTALLLLIB_SESSIONGUID '' 0 "${__InstallLib_Helper_InitSession_Label}"
+
+    System::Call 'ole32::CoCreateGuid(g .s)'
+    Pop $__INSTALLLLIB_SESSIONGUID
+
+  "${__InstallLib_Helper_InitSession_Label}:"
+
+  !undef __InstallLib_Helper_InitSession_Label
+
+!macroend
+
+### Add a RegTool entry to register after reboot
+!macro __InstallLib_Helper_AddRegToolEntry mode filename tempdir
+
+  Push $R0
+  Push $R1
+  Push $R2
+  Push $R3
+
+  ;------------------------
+  ;Copy the parameters
+
+  Push "${filename}"
+  Push "${tempdir}"
+
+  Pop $R2 ; temporary directory
+  Pop $R1 ; file name to register
+
+  ;------------------------
+  ;Initialize session id
+
+  !insertmacro __InstallLib_Helper_InitSession
+
+  ;------------------------
+  ;Advance counter
+
+  StrCpy $R0 0
+  ReadRegDWORD $R0 HKLM "Software\${REGTOOL_KEY}\$__INSTALLLLIB_SESSIONGUID" "count"
+  IntOp $R0 $R0 + 1
+  WriteRegDWORD HKLM "Software\${REGTOOL_KEY}\$__INSTALLLLIB_SESSIONGUID" "count" "$R0"
+
+  ;------------------------
+  ;Setup RegTool
+
+  ReadRegStr $R3 HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" "${REGTOOL_KEY}"
+  StrCpy $R3 $R3 -4 1
+  IfFileExists $R3 +3
+
+    File /oname=$R2\${REGTOOL_KEY}.$__INSTALLLLIB_SESSIONGUID.exe "${NSISDIR}\Bin\RegTool.bin"
+    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" \
+      "${REGTOOL_KEY}" '"$R2\${REGTOOL_KEY}.$__INSTALLLLIB_SESSIONGUID.exe" /S'
+
+  ;------------------------
+  ;Add RegTool entry
+
+  WriteRegStr HKLM "Software\${REGTOOL_KEY}\$__INSTALLLLIB_SESSIONGUID" "$R0.file" "$R1"
+  WriteRegStr HKLM "Software\${REGTOOL_KEY}\$__INSTALLLLIB_SESSIONGUID" "$R0.mode" "${mode}"
+
+  Pop $R3
+  Pop $R2
+  Pop $R1
+  Pop $R0
+
+!macroend
+
+### Get library version
+!macro __InstallLib_Helper_GetVersion TYPE FILE
+
+  !tempfile LIBRARY_TEMP_NSH
+
+  !ifdef NSIS_WIN32_MAKENSIS
+
+    !execute '"${NSISDIR}\Bin\LibraryLocal.exe" "${TYPE}" "${FILE}" "${LIBRARY_TEMP_NSH}"'
+
+  !else
+
+    !execute 'LibraryLocal "${TYPE}" "${FILE}" "${LIBRARY_TEMP_NSH}"'
+
+    !if ${TYPE} == 'T'
+
+      !warning "LibraryLocal currently supports TypeLibs version detection on Windows only"
+
+    !endif
+
+  !endif
+
+  !include "${LIBRARY_TEMP_NSH}"
+  !delfile "${LIBRARY_TEMP_NSH}"
+  !undef LIBRARY_TEMP_NSH
+
+!macroend
+
+### Install library
+!macro InstallLib libtype shared install localfile destfile tempbasedir
+
+  !verbose push
+  !verbose 3
+
+  Push $R0
+  Push $R1
+  Push $R2
+  Push $R3
+  Push $R4
+  Push $R5
+
+  ;------------------------
+  ;Define
+
+  !define INSTALLLIB_UNIQUE "${__FILE__}${__LINE__}"
+
+  !define INSTALLLIB_LIBTYPE_${libtype}
+  !define INSTALLLIB_LIBTYPE_SET INSTALLLIB_LIBTYPE_${libtype}
+  !define INSTALLLIB_SHARED_${shared}
+  !define INSTALLLIB_SHARED_SET INSTALLLIB_SHARED_${shared}
+  !define INSTALLLIB_INSTALL_${install}
+  !define INSTALLLIB_INSTALL_SET INSTALLLIB_INSTALL_${install}
+
+  ;------------------------
+  ;Validate
+
+  !ifndef INSTALLLIB_LIBTYPE_DLL & INSTALLLIB_LIBTYPE_REGDLL & INSTALLLIB_LIBTYPE_TLB & \
+    INSTALLLIB_LIBTYPE_REGDLLTLB & INSTALLLIB_LIBTYPE_REGEXE
+    !error "InstallLib: Incorrect setting for parameter: libtype"
+  !endif
+
+  !ifndef INSTALLLIB_INSTALL_REBOOT_PROTECTED & INSTALLLIB_INSTALL_REBOOT_NOTPROTECTED & \
+    INSTALLLIB_INSTALL_NOREBOOT_PROTECTED & INSTALLLIB_INSTALL_NOREBOOT_NOTPROTECTED
+    !error "InstallLib: Incorrect setting for parameter: install"
+  !endif
+
+  ;------------------------
+  ;x64 settings
+
+  !ifdef LIBRARY_X64
+
+    ${DisableX64FSRedirection}
+
+  !endif
+
+  ;------------------------
+  ;Copy the parameters used on run-time to a variable
+  ;This allows the usage of variables as parameter
+
+  StrCpy $R4 "${destfile}"
+  StrCpy $R5 "${tempbasedir}"
+
+  ;------------------------
+  ;Shared library count
+
+  !ifndef INSTALLLIB_SHARED_NOTSHARED
+
+    StrCmp ${shared} "" 0 "installlib.noshareddllincrease_${INSTALLLIB_UNIQUE}"
+
+      !ifdef LIBRARY_X64
+
+        SetRegView 64
+
+      !endif
+
+      ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R4
+      ClearErrors
+      IntOp $R0 $R0 + 1
+      WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R4 $R0
+
+      !ifdef LIBRARY_X64
+
+        SetRegView lastused
+
+      !endif
+
+    "installlib.noshareddllincrease_${INSTALLLIB_UNIQUE}:"
+
+  !endif
+
+  ;------------------------
+  ;Check Windows File Protection
+
+  !ifdef INSTALLLIB_INSTALL_REBOOT_PROTECTED | INSTALLLIB_INSTALL_NOREBOOT_PROTECTED
+
+    !define LIBRARY_DEFINE_DONE_LABEL
+
+    System::Call "sfc::SfcIsFileProtected(i 0, w R4) i.R0"
+
+      StrCmp $R0 "error" "installlib.notprotected_${INSTALLLIB_UNIQUE}"
+      StrCmp $R0 "0" "installlib.notprotected_${INSTALLLIB_UNIQUE}"
+
+    Goto "installlib.done_${INSTALLLIB_UNIQUE}"
+
+    "installlib.notprotected_${INSTALLLIB_UNIQUE}:"
+
+  !endif
+
+  ;------------------------
+  ;Check file
+
+  IfFileExists $R4 0 "installlib.copy_${INSTALLLIB_UNIQUE}"
+
+  ;------------------------
+  ;Get version information
+
+  !ifndef LIBRARY_IGNORE_VERSION
+
+    !insertmacro __InstallLib_Helper_GetVersion D "${LOCALFILE}"
+
+    !ifdef LIBRARY_VERSION_FILENOTFOUND
+      !error "InstallLib: The library ${LOCALFILE} could not be found."
+    !endif
+
+    !ifndef LIBRARY_VERSION_NONE
+
+      !define LIBRARY_DEFINE_UPGRADE_LABEL
+      !define LIBRARY_DEFINE_REGISTER_LABEL
+
+      StrCpy $R0 ${LIBRARY_VERSION_HIGH}
+      StrCpy $R1 ${LIBRARY_VERSION_LOW}
+
+      GetDLLVersion $R4 $R2 $R3
+
+      !undef LIBRARY_VERSION_HIGH
+      !undef LIBRARY_VERSION_LOW
+
+      !ifndef INSTALLLIB_LIBTYPE_TLB & INSTALLLIB_LIBTYPE_REGDLLTLB
+
+        IntCmpU $R0 $R2 0 "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}"
+        IntCmpU $R1 $R3 "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.register_${INSTALLLIB_UNIQUE}" \
+          "installlib.upgrade_${INSTALLLIB_UNIQUE}"
+
+      !else
+
+        !insertmacro __InstallLib_Helper_GetVersion T "${LOCALFILE}"
+
+        !ifdef LIBRARY_VERSION_FILENOTFOUND
+          !error "InstallLib: The library ${LOCALFILE} could not be found."
+        !endif
+
+        !ifndef LIBRARY_VERSION_NONE
+
+          IntCmpU $R0 $R2 0 "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}"
+          IntCmpU $R1 $R3 0 "installlib.register_${INSTALLLIB_UNIQUE}" \
+            "installlib.upgrade_${INSTALLLIB_UNIQUE}"
+
+        !else
+
+          IntCmpU $R0 $R2 0 "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}"
+          IntCmpU $R1 $R3 "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.register_${INSTALLLIB_UNIQUE}" \
+            "installlib.upgrade_${INSTALLLIB_UNIQUE}"
+
+        !endif
+
+      !endif
+
+    !else
+
+      !undef LIBRARY_VERSION_NONE
+
+      !ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB
+
+        !insertmacro __InstallLib_Helper_GetVersion T "${LOCALFILE}"
+
+      !endif
+
+    !endif
+
+    !ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB
+
+      !ifndef LIBRARY_VERSION_NONE
+
+        !ifndef LIBRARY_DEFINE_UPGRADE_LABEL
+
+          !define LIBRARY_DEFINE_UPGRADE_LABEL
+
+        !endif
+
+        !ifndef LIBRARY_DEFINE_REGISTER_LABEL
+
+          !define LIBRARY_DEFINE_REGISTER_LABEL
+
+        !endif
+
+        StrCpy $R0 ${LIBRARY_VERSION_HIGH}
+        StrCpy $R1 ${LIBRARY_VERSION_LOW}
+
+        TypeLib::GetLibVersion $R4
+        Pop $R3
+        Pop $R2
+
+        IntCmpU $R0 $R2 0 "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.upgrade_${INSTALLLIB_UNIQUE}"
+        IntCmpU $R1 $R3 "installlib.register_${INSTALLLIB_UNIQUE}" "installlib.register_${INSTALLLIB_UNIQUE}" \
+          "installlib.upgrade_${INSTALLLIB_UNIQUE}"
+
+        !undef LIBRARY_VERSION_HIGH
+        !undef LIBRARY_VERSION_LOW
+
+      !else
+
+        !undef LIBRARY_VERSION_NONE
+
+      !endif
+
+    !endif
+
+  !endif
+
+  ;------------------------
+  ;Upgrade
+
+  !ifdef LIBRARY_DEFINE_UPGRADE_LABEL
+
+    !undef LIBRARY_DEFINE_UPGRADE_LABEL
+
+    "installlib.upgrade_${INSTALLLIB_UNIQUE}:"
+
+  !endif
+
+  ;------------------------
+  ;Copy
+
+  !ifdef INSTALLLIB_INSTALL_NOREBOOT_PROTECTED | INSTALLLIB_INSTALL_NOREBOOT_NOTPROTECTED
+
+    "installlib.copy_${INSTALLLIB_UNIQUE}:"
+
+    StrCpy $R0 $R4
+    Call ":installlib.file_${INSTALLLIB_UNIQUE}"
+
+  !else
+
+    !ifndef LIBRARY_DEFINE_REGISTER_LABEL
+
+      !define LIBRARY_DEFINE_REGISTER_LABEL
+
+    !endif
+
+    !ifndef LIBRARY_DEFINE_DONE_LABEL
+
+      !define LIBRARY_DEFINE_DONE_LABEL
+
+    !endif
+
+    ClearErrors
+
+    StrCpy $R0 $R4
+    Call ":installlib.file_${INSTALLLIB_UNIQUE}"
+
+    IfErrors 0 "installlib.register_${INSTALLLIB_UNIQUE}"
+
+    SetOverwrite lastused
+
+    ;------------------------
+    ;Copy on reboot
+
+    GetTempFileName $R0 $R5
+    Call ":installlib.file_${INSTALLLIB_UNIQUE}"
+    Rename /REBOOTOK $R0 $R4
+
+    ;------------------------
+    ;Register on reboot
+
+    Call ":installlib.regonreboot_${INSTALLLIB_UNIQUE}"
+
+    Goto "installlib.done_${INSTALLLIB_UNIQUE}"
+
+    "installlib.copy_${INSTALLLIB_UNIQUE}:"
+      StrCpy $R0 $R4
+      Call ":installlib.file_${INSTALLLIB_UNIQUE}"
+
+  !endif
+
+  ;------------------------
+  ;Register
+
+  !ifdef LIBRARY_DEFINE_REGISTER_LABEL
+
+    !undef LIBRARY_DEFINE_REGISTER_LABEL
+
+    "installlib.register_${INSTALLLIB_UNIQUE}:"
+
+  !endif
+
+  !ifdef INSTALLLIB_LIBTYPE_REGDLL | INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB | INSTALLLIB_LIBTYPE_REGEXE
+
+    !ifdef INSTALLLIB_INSTALL_REBOOT_PROTECTED | INSTALLLIB_INSTALL_REBOOT_NOTPROTECTED
+
+      IfRebootFlag 0 "installlib.regnoreboot_${INSTALLLIB_UNIQUE}"
+
+        Call ":installlib.regonreboot_${INSTALLLIB_UNIQUE}"
+
+        Goto "installlib.registerfinish_${INSTALLLIB_UNIQUE}"
+
+      "installlib.regnoreboot_${INSTALLLIB_UNIQUE}:"
+
+    !endif
+
+    !ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB
+
+      TypeLib::Register $R4
+
+    !endif
+
+    !ifdef INSTALLLIB_LIBTYPE_REGDLL | INSTALLLIB_LIBTYPE_REGDLLTLB
+
+      !ifndef LIBRARY_X64
+
+        RegDll $R4
+
+      !else
+
+        ExecWait '"$SYSDIR\regsvr32.exe" /s "$R4"'
+
+      !endif
+
+    !endif
+
+    !ifdef INSTALLLIB_LIBTYPE_REGEXE
+
+      ExecWait '"$R4" /regserver'
+
+    !endif
+
+    !ifdef INSTALLLIB_INSTALL_REBOOT_PROTECTED | INSTALLLIB_INSTALL_REBOOT_NOTPROTECTED
+
+      "installlib.registerfinish_${INSTALLLIB_UNIQUE}:"
+
+    !endif
+
+  !endif
+
+  !ifdef LIBRARY_SHELL_EXTENSION
+
+    System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
+
+  !endif
+
+  !ifdef LIBRARY_COM
+
+    System::Call 'Ole32::CoFreeUnusedLibraries()'
+
+  !endif
+
+  ;------------------------
+  ;Done
+
+  !ifdef LIBRARY_DEFINE_DONE_LABEL
+
+    !undef LIBRARY_DEFINE_DONE_LABEL
+
+  "installlib.done_${INSTALLLIB_UNIQUE}:"
+
+  !endif
+
+  Pop $R5
+  Pop $R4
+  Pop $R3
+  Pop $R2
+  Pop $R1
+  Pop $R0
+
+  ;------------------------
+  ;End
+
+  Goto "installlib.end_${INSTALLLIB_UNIQUE}"
+
+  ;------------------------
+  ;Extract
+
+  !ifdef INSTALLLIB_INSTALL_REBOOT_PROTECTED | INSTALLLIB_INSTALL_REBOOT_NOTPROTECTED
+
+    SetOverwrite try
+
+  !else
+
+    SetOverwrite on
+
+  !endif
+
+  "installlib.file_${INSTALLLIB_UNIQUE}:"
+    SetFileAttributes $R0 FILE_ATTRIBUTE_NORMAL
+    ClearErrors
+    File /oname=$R0 "${LOCALFILE}"
+    Return
+
+  SetOverwrite lastused
+
+  ;------------------------
+  ;Register on reboot
+
+  !ifdef INSTALLLIB_INSTALL_REBOOT_PROTECTED | INSTALLLIB_INSTALL_REBOOT_NOTPROTECTED
+
+    "installlib.regonreboot_${INSTALLLIB_UNIQUE}:"
+
+      !ifdef INSTALLLIB_LIBTYPE_REGDLL | INSTALLLIB_LIBTYPE_REGDLLTLB
+        !ifndef LIBRARY_X64
+          !insertmacro __InstallLib_Helper_AddRegToolEntry 'D' "$R4" "$R5"
+        !else
+          !insertmacro __InstallLib_Helper_AddRegToolEntry 'DX' "$R4" "$R5"
+        !endif
+      !endif
+
+      !ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB
+        !insertmacro __InstallLib_Helper_AddRegToolEntry 'T' "$R4" "$R5"
+      !endif
+
+      !ifdef INSTALLLIB_LIBTYPE_REGEXE
+        !insertmacro __InstallLib_Helper_AddRegToolEntry 'E' "$R4" "$R5"
+      !endif
+
+      Return
+
+  !endif
+
+  ;------------------------
+  ;End label
+
+  "installlib.end_${INSTALLLIB_UNIQUE}:"
+
+  !ifdef LIBRARY_X64
+
+    ${EnableX64FSRedirection}
+
+  !endif
+
+  ;------------------------
+  ;Undefine
+
+  !undef INSTALLLIB_UNIQUE
+
+  !undef ${INSTALLLIB_LIBTYPE_SET}
+  !undef INSTALLLIB_LIBTYPE_SET
+  !undef ${INSTALLLIB_SHARED_SET}
+  !undef INSTALLLIB_SHARED_SET
+  !undef ${INSTALLLIB_INSTALL_SET}
+  !undef INSTALLLIB_INSTALL_SET
+
+  !verbose pop
+
+!macroend
+
+### Uninstall library
+!macro UnInstallLib libtype shared uninstall file
+
+  !verbose push
+  !verbose 3
+
+  Push $R0
+  Push $R1
+
+  ;------------------------
+  ;Define
+
+  !define UNINSTALLLIB_UNIQUE "${__FILE__}${__LINE__}"
+
+  !define UNINSTALLLIB_LIBTYPE_${libtype}
+  !define UNINSTALLLIB_LIBTYPE_SET UNINSTALLLIB_LIBTYPE_${libtype}
+  !define UNINSTALLLIB_SHARED_${shared}
+  !define UNINSTALLLIB_SHARED_SET UNINSTALLLIB_SHARED_${shared}
+  !define UNINSTALLLIB_UNINSTALL_${uninstall}
+  !define UNINSTALLLIB_UNINSTALL_SET UNINSTALLLIB_UNINSTALL_${uninstall}
+
+  ;------------------------
+  ;Validate
+
+  !ifndef UNINSTALLLIB_LIBTYPE_DLL & UNINSTALLLIB_LIBTYPE_REGDLL & UNINSTALLLIB_LIBTYPE_TLB & \
+    UNINSTALLLIB_LIBTYPE_REGDLLTLB & UNINSTALLLIB_LIBTYPE_REGEXE
+    !error "UnInstallLib: Incorrect setting for parameter: libtype"
+  !endif
+
+  !ifndef UNINSTALLLIB_SHARED_NOTSHARED & UNINSTALLLIB_SHARED_SHARED
+    !error "UnInstallLib: Incorrect setting for parameter: shared"
+  !endif
+
+  !ifndef UNINSTALLLIB_UNINSTALL_NOREMOVE & UNINSTALLLIB_UNINSTALL_REBOOT_PROTECTED & \
+    UNINSTALLLIB_UNINSTALL_REBOOT_NOTPROTECTED & UNINSTALLLIB_UNINSTALL_NOREBOOT_PROTECTED & \
+    UNINSTALLLIB_UNINSTALL_NOREBOOT_NOTPROTECTED
+    !error "UnInstallLib: Incorrect setting for parameter: uninstall"
+  !endif
+
+  ;------------------------
+  ;x64 settings
+
+  !ifdef LIBRARY_X64
+
+    ${DisableX64FSRedirection}
+
+  !endif
+
+  ;------------------------
+  ;Copy the parameters used on run-time to a variable
+  ;This allows the usage of variables as parameter
+
+  StrCpy $R1 "${file}"
+
+  ;------------------------
+  ;Shared library count
+
+  !ifdef UNINSTALLLIB_SHARED_SHARED
+
+    !define UNINSTALLLIB_DONE_LABEL
+
+    !ifdef LIBRARY_X64
+
+      SetRegView 64
+
+    !endif
+
+    ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1
+    StrCmp $R0 "" "uninstalllib.shareddlldone_${UNINSTALLLIB_UNIQUE}"
+
+    IntOp $R0 $R0 - 1
+    IntCmp $R0 0 "uninstalllib.shareddllremove_${UNINSTALLLIB_UNIQUE}" \
+      "uninstalllib.shareddllremove_${UNINSTALLLIB_UNIQUE}" "uninstalllib.shareddllinuse_${UNINSTALLLIB_UNIQUE}"
+
+    "uninstalllib.shareddllremove_${UNINSTALLLIB_UNIQUE}:"
+      DeleteRegValue HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1
+      !ifndef UNINSTALLLIB_SHARED_SHAREDNOREMOVE
+        Goto "uninstalllib.shareddlldone_${UNINSTALLLIB_UNIQUE}"
+      !endif
+
+    "uninstalllib.shareddllinuse_${UNINSTALLLIB_UNIQUE}:"
+      WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 $R0
+
+        !ifdef LIBRARY_X64
+
+          SetRegView lastused
+
+        !endif
+
+      Goto "uninstalllib.done_${UNINSTALLLIB_UNIQUE}"
+
+    "uninstalllib.shareddlldone_${UNINSTALLLIB_UNIQUE}:"
+
+    !ifdef LIBRARY_X64
+
+      SetRegView lastused
+
+    !endif
+
+  !endif
+
+  ;------------------------
+  ;Remove
+
+  !ifndef UNINSTALLLIB_UNINSTALL_NOREMOVE
+
+    ;------------------------
+    ;Check Windows File Protection
+
+    !ifdef UNINSTALLLIB_UNINSTALL_REBOOT_PROTECTED | UNINSTALLLIB_UNINSTALL_NOREBOOT_PROTECTED
+
+      !ifndef UNINSTALLLIB_DONE_LABEL
+
+        !define UNINSTALLLIB_DONE_LABEL
+
+      !endif
+
+      System::Call "sfc::SfcIsFileProtected(i 0, w $R1) i.R0"
+
+        StrCmp $R0 "error" "uninstalllib.notprotected_${UNINSTALLLIB_UNIQUE}"
+        StrCmp $R0 "0" "uninstalllib.notprotected_${UNINSTALLLIB_UNIQUE}"
+
+      Goto "uninstalllib.done_${UNINSTALLLIB_UNIQUE}"
+
+      "uninstalllib.notprotected_${UNINSTALLLIB_UNIQUE}:"
+
+    !endif
+
+    ;------------------------
+    ;Unregister
+
+    !ifdef UNINSTALLLIB_LIBTYPE_REGDLL | UNINSTALLLIB_LIBTYPE_REGDLLTLB
+
+      !ifndef LIBRARY_X64
+
+        UnRegDLL $R1
+
+      !else
+
+        ExecWait '"$SYSDIR\regsvr32.exe" /s /u "$R1"'
+
+      !endif
+
+    !endif
+
+    !ifdef UNINSTALLLIB_LIBTYPE_REGEXE
+
+      ExecWait '"$R1" /unregserver'
+
+    !endif
+
+    !ifdef UNINSTALLLIB_LIBTYPE_TLB | UNINSTALLLIB_LIBTYPE_REGDLLTLB
+
+      TypeLib::UnRegister $R1
+
+    !endif
+
+    !ifdef LIBRARY_SHELL_EXTENSION
+
+      System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
+
+    !endif
+
+    !ifdef LIBRARY_COM
+
+      System::Call 'Ole32::CoFreeUnusedLibraries()'
+
+    !endif
+
+    ;------------------------
+    ;Delete
+
+    Delete $R1
+
+    !ifdef UNINSTALLLIB_UNINSTALL_REBOOT_PROTECTED | UNINSTALLLIB_UNINSTALL_REBOOT_NOTPROTECTED
+
+      ${If} ${FileExists} $R1
+        # File is in use, can't just delete.
+        # Move file to another location before using Delete /REBOOTOK. This way, if
+        #  the user installs a new version of the DLL, it won't be deleted after
+        #  reboot. See bug #1097642 for more information on this.
+
+        # Try moving to $TEMP.
+        GetTempFileName $R0
+        Delete $R0
+        Rename $R1 $R0
+
+        ${If} ${FileExists} $R1
+          # Still here, delete temporary file, in case the file was copied
+          #  and not deleted. This happens when moving from network drives,
+          #  for example.
+          Delete $R0
+
+          # Try moving to directory containing the file.
+          !insertmacro __InstallLib_Helper_GetParent $R1 $R0
+          GetTempFileName $R0 $R0
+          Delete $R0
+          Rename $R1 $R0
+
+          ${If} ${FileExists} $R1
+            # Still here, delete temporary file.
+            Delete $R0
+
+            # Give up moving, simply Delete /REBOOTOK the file.
+            StrCpy $R0 $R1
+          ${EndIf}
+        ${EndIf}
+
+        # Delete the moved file.
+        Delete /REBOOTOK $R0
+      ${EndIf}
+
+    !endif
+
+  !endif
+
+  ;------------------------
+  ;Done
+
+  !ifdef UNINSTALLLIB_DONE_LABEL
+
+    !undef UNINSTALLLIB_DONE_LABEL
+
+    "uninstalllib.done_${UNINSTALLLIB_UNIQUE}:"
+
+  !endif
+
+  !ifdef LIBRARY_X64
+
+    ${EnableX64FSRedirection}
+
+  !endif
+
+  Pop $R1
+  Pop $R0
+
+  ;------------------------
+  ;Undefine
+
+  !undef UNINSTALLLIB_UNIQUE
+
+  !undef ${UNINSTALLLIB_LIBTYPE_SET}
+  !undef UNINSTALLLIB_LIBTYPE_SET
+  !undef ${UNINSTALLLIB_SHARED_SET}
+  !undef UNINSTALLLIB_SHARED_SET
+  !undef ${UNINSTALLLIB_UNINSTALL_SET}
+  !undef UNINSTALLLIB_UNINSTALL_SET
+
+  !verbose pop
+
+!macroend
+
+!endif
+
+!verbose pop
Index: tmp/trunk/org.txm.setups/nsis/Include/Win/WinError.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/Win/WinError.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/Win/WinError.nsh	(revision 728)
@@ -0,0 +1,64 @@
+!ifndef __WIN_WINERROR__INC
+!define __WIN_WINERROR__INC
+!verbose push
+!verbose 3
+!ifndef __WIN_NOINC_WINERROR
+
+#define NO_ERROR 0
+!define ERROR_SUCCESS                 0
+!define ERROR_INVALID_FUNCTION        1    
+!define ERROR_FILE_NOT_FOUND          2
+!define ERROR_PATH_NOT_FOUND          3
+!define ERROR_TOO_MANY_OPEN_FILES     4
+!define ERROR_ACCESS_DENIED           5
+!define ERROR_INVALID_HANDLE          6
+!define ERROR_ARENA_TRASHED           7
+!define ERROR_NOT_ENOUGH_MEMORY       8    
+!define ERROR_INVALID_BLOCK           9
+!define ERROR_BAD_ENVIRONMENT         10
+!define ERROR_BAD_FORMAT              11
+!define ERROR_INVALID_ACCESS          12
+!define ERROR_INVALID_DATA            13
+!define ERROR_OUTOFMEMORY             14
+!define ERROR_INVALID_DRIVE           15
+!define ERROR_CURRENT_DIRECTORY       16
+!define ERROR_NOT_SAME_DEVICE         17
+!define ERROR_NO_MORE_FILES           18
+!define ERROR_WRITE_PROTECT           19
+!define ERROR_BAD_UNIT                20
+!define ERROR_NOT_READY               21
+!define ERROR_BAD_COMMAND             22
+!define ERROR_CRC                     23
+!define ERROR_BAD_LENGTH              24
+!define ERROR_SEEK                    25
+!define ERROR_NOT_DOS_DISK            26
+!define ERROR_SECTOR_NOT_FOUND        27
+!define ERROR_OUT_OF_PAPER            28
+!define ERROR_WRITE_FAULT             29
+!define ERROR_READ_FAULT              30
+!define ERROR_GEN_FAILURE             31
+!define ERROR_SHARING_VIOLATION       32
+!define ERROR_LOCK_VIOLATION          33
+!define ERROR_WRONG_DISK              34
+!define ERROR_SHARING_BUFFER_EXCEEDED 36
+!define ERROR_HANDLE_EOF              38
+!define ERROR_HANDLE_DISK_FULL        39
+!define ERROR_NOT_SUPPORTED           50
+
+!define SEVERITY_SUCCESS 0
+!define SEVERITY_ERROR   1
+!define E_UNEXPECTED   0x8000FFFF
+!define E_NOTIMPL      0x80004001
+!define E_OUTOFMEMORY  0x8007000E
+!define E_INVALIDARG   0x80070057
+!define E_NOINTERFACE  0x80004002
+!define E_POINTER      0x80004003
+!define E_HANDLE       0x80070006
+!define E_ABORT        0x80004004
+!define E_FAIL         0x80004005
+!define E_ACCESSDENIED 0x80070005
+!define E_PENDING      0x8000000A
+
+!endif /* __WIN_NOINC_WINERROR */
+!verbose pop
+!endif /* __WIN_WINERROR__INC */
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Include/Win/WinDef.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/Win/WinDef.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/Win/WinDef.nsh	(revision 728)
@@ -0,0 +1,74 @@
+!ifndef __WIN_WINDEF__INC
+!define __WIN_WINDEF__INC
+!verbose push
+!verbose 3
+!ifndef __WIN_NOINC_WINDEF
+
+
+!ifndef MAX_PATH
+!define MAX_PATH 260
+!endif
+#define NULL 0
+
+
+!macro _Win_MINMAX _intcmp _j1 _j2 _outvar _a _b
+${_intcmp} "${_a}" "${_b}" ${_j1} ${_j1} ${_j2}
+StrCpy ${_outvar} "${_a}"
+goto +2
+StrCpy ${_outvar} "${_b}"
+!macroend
+!ifndef __WIN_MS_NOMINMAX & min & max & min_u & max_u
+!define min "!insertmacro _Win_MINMAX IntCmp +1 +3 "
+!define max "!insertmacro _Win_MINMAX IntCmp +3 +1 "
+!define min_u "!insertmacro _Win_MINMAX IntCmpU +1 +3 "
+!define max_u "!insertmacro _Win_MINMAX IntCmpU +3 +1 "
+!endif
+
+!macro _Win_LOBYTE _outvar _in
+IntOp ${_outvar} "${_in}" & 0xFF
+!macroend
+!define LOBYTE "!insertmacro _Win_LOBYTE "
+
+!macro _Win_HIBYTE _outvar _in
+IntOp ${_outvar} "${_in}" >> 8
+${LOBYTE} ${_outvar} ${_outvar}
+!macroend
+!define HIBYTE "!insertmacro _Win_HIBYTE "
+
+!macro _Win_LOWORD _outvar _in
+IntOp ${_outvar} "${_in}" & 0xFFFF
+!macroend
+!define LOWORD "!insertmacro _Win_LOWORD "
+
+!macro _Win_HIWORD _outvar _in
+IntOp ${outvar} "${_in}" >> 16 ;sign extended :(
+${LOWORD} ${_outvar} ${outvar} ;make sure we strip off the upper word
+!macroend
+!define HIWORD "!insertmacro _Win_HIWORD "
+
+!macro _Win_MAKEWORD _outvar _tmpvar _lo _hi
+${LOBYTE} ${_outvar} "${_hi}"
+${LOBYTE} ${_tmpvar} "${_lo}"
+IntOp ${_outvar} ${_outvar} << 8
+IntOp ${_outvar} ${_outvar} | ${_tmpvar}
+!macroend
+!define MAKEWORD "!insertmacro _Win_MAKEWORD "
+
+!macro _Win_MAKELONG32 _outvar _tmpvar _wlo _whi
+${LOWORD} ${_outvar} "${_wlo}"
+IntOp ${_tmpvar} "${_whi}" << 16
+IntOp ${_outvar} ${_outvar} | ${_tmpvar}
+!macroend
+!define MAKELONG "!insertmacro _Win_MAKELONG32 "
+!if "${__WIN_PTRSIZE}" <= 4
+!define MAKEWPARAM "${MAKELONG}"
+!define MAKELPARAM "${MAKELONG}"
+!define MAKELRESULT "${MAKELONG}"
+!else
+!error "Missing 64bit imp!"
+!endif
+
+
+!endif /* __WIN_NOINC_WINDEF */
+!verbose pop
+!endif /* __WIN_WINDEF__INC */
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Include/Win/WinUser.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/Win/WinUser.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/Win/WinUser.nsh	(revision 728)
@@ -0,0 +1,199 @@
+!ifndef __WIN_WINUSER__INC
+!define __WIN_WINUSER__INC
+!verbose push
+!verbose 3
+!ifndef __WIN_MS_NOUSER & __WIN_NOINC_WINUSER
+
+!ifndef __WIN_MS_NOVIRTUALKEYCODES
+!define VK_LBUTTON    0x01
+!define VK_RBUTTON    0x02
+!define VK_CANCEL     0x03
+!define VK_MBUTTON    0x04 /* NOT contiguous with L & RBUTTON */
+!define VK_XBUTTON1   0x05 /* NOT contiguous with L & RBUTTON */
+!define VK_XBUTTON2   0x06 /* NOT contiguous with L & RBUTTON */
+!define VK_BACK       0x08
+!define VK_TAB        0x09
+!define VK_CLEAR      0x0C
+!define VK_RETURN     0x0D
+!define VK_SHIFT      0x10
+!define VK_CONTROL    0x11
+!define VK_MENU       0x12
+!define VK_PAUSE      0x13
+!define VK_CAPITAL    0x14
+!define VK_ESCAPE     0x1B
+!define VK_CONVERT    0x1C
+!define VK_NONCONVERT 0x1D
+!define VK_ACCEPT     0x1E
+!define VK_MODECHANGE 0x1F
+!define VK_SPACE      0x20
+!define VK_PRIOR      0x21
+!define VK_NEXT       0x22
+!define VK_END        0x23
+!define VK_HOME       0x24
+!define VK_LEFT       0x25
+!define VK_UP         0x26
+!define VK_RIGHT      0x27
+!define VK_DOWN       0x28
+!define VK_SELECT     0x29
+!define VK_PRINT      0x2A
+!define VK_EXECUTE    0x2B
+!define VK_SNAPSHOT   0x2C
+!define VK_INSERT     0x2D
+!define VK_DELETE     0x2E
+!define VK_HELP       0x2F
+; VK_0 - VK_9 are the same as ASCII '0' - '9' (0x30 - 0x39)
+; VK_A - VK_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A)
+!define VK_LWIN           0x5B
+!define VK_RWIN           0x5C
+!define VK_APPS           0x5D
+!define VK_SLEEP          0x5F
+!define VK_NUMPAD0        0x60
+!define VK_NUMPAD1        0x61
+!define VK_NUMPAD2        0x62
+!define VK_NUMPAD3        0x63
+!define VK_NUMPAD4        0x64
+!define VK_NUMPAD5        0x65
+!define VK_NUMPAD6        0x66
+!define VK_NUMPAD7        0x67
+!define VK_NUMPAD8        0x68
+!define VK_NUMPAD9        0x69
+!define VK_MULTIPLY       0x6A
+!define VK_ADD            0x6B
+!define VK_SEPARATOR      0x6C
+!define VK_SUBTRACT       0x6D
+!define VK_DECIMAL        0x6E
+!define VK_DIVIDE         0x6F
+!define VK_F1             0x70
+!define VK_F2             0x71
+!define VK_F3             0x72
+!define VK_F4             0x73
+!define VK_F5             0x74
+!define VK_F6             0x75
+!define VK_F7             0x76
+!define VK_F8             0x77
+!define VK_F9             0x78
+!define VK_F10            0x79
+!define VK_F11            0x7A
+!define VK_F12            0x7B
+!define VK_NUMLOCK        0x90
+!define VK_SCROLL         0x91
+!define VK_OEM_NEC_EQUAL  0x92   ; '=' key on numpad
+!define VK_LSHIFT         0xA0
+!define VK_RSHIFT         0xA1
+!define VK_LCONTROL       0xA2
+!define VK_RCONTROL       0xA3
+!define VK_LMENU          0xA4
+!define VK_RMENU          0xA5
+!endif
+
+!ifndef __WIN_MS_NOWINOFFSETS
+/* in nsDialogs.nsh...
+!define GWL_STYLE           -16
+!define GWL_EXSTYLE         -20 */
+!define GWLP_WNDPROC        -4
+!define GWLP_HINSTANCE      -6
+!define GWLP_HWNDPARENT     -8
+!define GWLP_USERDATA       -21
+!define GWLP_ID             -12
+!define DWLP_MSGRESULT  0
+!define /math DWLP_DLGPROC    ${DWLP_MSGRESULT} + ${__WIN_PTRSIZE} ;DWLP_MSGRESULT + sizeof(LRESULT) 
+!define /math DWLP_USER       ${DWLP_DLGPROC} + ${__WIN_PTRSIZE} ;DWLP_DLGPROC + sizeof(DLGPROC)
+!endif
+
+!ifndef __WIN_MS_NONCMESSAGES
+!define HTERROR       -2
+!define HTTRANSPARENT -1
+!define HTNOWHERE     0
+!define HTCLIENT      1
+!define HTCAPTION     2
+!define HTSYSMENU     3
+!define HTGROWBOX     4
+!define HTSIZE        ${HTGROWBOX}
+!define HTMENU        5
+!define HTHSCROLL     6
+!define HTVSCROLL     7
+!define HTMINBUTTON   8
+!define HTMAXBUTTON   9
+!define HTLEFT        10
+!define HTRIGHT       11
+!define HTTOP         12
+!define HTTOPLEFT     13
+!define HTTOPRIGHT    14
+!define HTBOTTOM      15
+!define HTBOTTOMLEFT  16
+!define HTBOTTOMRIGHT 17
+!define HTBORDER      18
+!define HTREDUCE      ${HTMINBUTTON}
+!define HTZOOM        ${HTMAXBUTTON}
+!define HTSIZEFIRST   ${HTLEFT}
+!define HTSIZELAST    ${HTBOTTOMRIGHT}
+!define HTOBJECT      19
+!define HTCLOSE       20
+!define HTHELP        21
+!endif
+
+!ifndef __WIN_MS_NOSYSCOMMANDS
+!define SC_SIZE         0xF000
+!define SC_MOVE         0xF010
+!define SC_MINIMIZE     0xF020
+!define SC_MAXIMIZE     0xF030
+!define SC_NEXTWINDOW   0xF040
+!define SC_PREVWINDOW   0xF050
+!define SC_CLOSE        0xF060
+!define SC_VSCROLL      0xF070
+!define SC_HSCROLL      0xF080
+!define SC_MOUSEMENU    0xF090
+!define SC_KEYMENU      0xF100
+!define SC_ARRANGE      0xF110
+!define SC_RESTORE      0xF120
+!define SC_TASKLIST     0xF130
+!define SC_SCREENSAVE   0xF140
+!define SC_HOTKEY       0xF150
+!define SC_DEFAULT      0xF160
+!define SC_MONITORPOWER 0xF170
+!define SC_CONTEXTHELP  0xF180
+!define SC_SEPARATOR    0xF00F
+!endif
+
+!define IDC_ARROW       32512
+!define IDC_IBEAM       32513
+!define IDC_WAIT        32514
+!define IDC_CROSS       32515
+!define IDC_UPARROW     32516
+!define IDC_SIZENWSE    32642
+!define IDC_SIZENESW    32643
+!define IDC_SIZEWE      32644
+!define IDC_SIZENS      32645
+!define IDC_SIZEALL     32646
+!define IDC_NO          32648 
+!define IDC_HAND        32649
+!define IDC_APPSTARTING 32650 
+!define IDC_HELP        32651
+
+/* in nsDialogs.nsh...
+!define IMAGE_BITMAP 0
+!define IMAGE_ICON   1
+!define IMAGE_CURSOR 2*/
+
+/* in nsDialogs.nsh...
+!define LR_DEFAULTCOLOR     0x0000
+!define LR_MONOCHROME       0x0001
+!define LR_COLOR            0x0002
+!define LR_COPYRETURNORG    0x0004
+!define LR_COPYDELETEORG    0x0008
+!define LR_LOADFROMFILE     0x0010
+!define LR_LOADTRANSPARENT  0x0020
+!define LR_DEFAULTSIZE      0x0040
+!define LR_VGACOLOR         0x0080
+!define LR_LOADMAP3DCOLORS  0x1000
+!define LR_CREATEDIBSECTION 0x2000
+!define LR_COPYFROMRESOURCE 0x4000
+!define LR_SHARED           0x8000*/
+
+!define GA_PARENT    1
+!define GA_ROOT      2
+!define GA_ROOTOWNER 3
+
+!endif /* __WIN_MS_NOUSER & __WIN_NOINC_WINUSER */
+!verbose pop
+!endif /* __WIN_WINUSER__INC */
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Include/Win/WinNT.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/Win/WinNT.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/Win/WinNT.nsh	(revision 728)
@@ -0,0 +1,209 @@
+!ifndef __WIN_WINNT__INC
+!define __WIN_WINNT__INC
+!verbose push
+!verbose 3
+!ifndef __WIN_NOINC_WINNT
+
+
+#define MINCHAR  0x80        
+#define MAXCHAR  0x7f        
+!define MINSHORT 0x8000      
+!define MAXSHORT 0x7fff      
+!define MINLONG  0x80000000  
+!define MAXLONG  0x7fffffff  
+!define MAXBYTE  0xff        
+!define MAXWORD  0xffff      
+!define MAXDWORD 0xffffffff  
+
+!ifndef WIN32_NO_STATUS 
+!define STATUS_WAIT_0                    0x00000000
+!define STATUS_ABANDONED_WAIT_0          0x00000080
+!define STATUS_USER_APC                  0x000000C0
+!define STATUS_TIMEOUT                   0x00000102
+!define STATUS_PENDING                   0x00000103
+!define DBG_EXCEPTION_HANDLED            0x00010001
+!define DBG_CONTINUE                     0x00010002
+!define STATUS_SEGMENT_NOTIFICATION      0x40000005
+!define DBG_TERMINATE_THREAD             0x40010003
+!define DBG_TERMINATE_PROCESS            0x40010004
+!define DBG_CONTROL_C                    0x40010005
+!define DBG_CONTROL_BREAK                0x40010008
+!define DBG_COMMAND_EXCEPTION            0x40010009
+!define STATUS_GUARD_PAGE_VIOLATION      0x80000001
+!define STATUS_DATATYPE_MISALIGNMENT     0x80000002
+!define STATUS_BREAKPOINT                0x80000003
+!define STATUS_SINGLE_STEP               0x80000004
+!define DBG_EXCEPTION_NOT_HANDLED        0x80010001
+!define STATUS_ACCESS_VIOLATION          0xC0000005
+!define STATUS_IN_PAGE_ERROR             0xC0000006
+!define STATUS_INVALID_HANDLE            0xC0000008
+!define STATUS_NO_MEMORY                 0xC0000017
+!define STATUS_ILLEGAL_INSTRUCTION       0xC000001D
+!define STATUS_NONCONTINUABLE_EXCEPTION  0xC0000025
+!define STATUS_INVALID_DISPOSITION       0xC0000026
+!define STATUS_ARRAY_BOUNDS_EXCEEDED     0xC000008C
+!define STATUS_FLOAT_DENORMAL_OPERAND    0xC000008D
+!define STATUS_FLOAT_DIVIDE_BY_ZERO      0xC000008E
+!define STATUS_FLOAT_INEXACT_RESULT      0xC000008F
+!define STATUS_FLOAT_INVALID_OPERATION   0xC0000090
+!define STATUS_FLOAT_OVERFLOW            0xC0000091
+!define STATUS_FLOAT_STACK_CHECK         0xC0000092
+!define STATUS_FLOAT_UNDERFLOW           0xC0000093
+!define STATUS_INTEGER_DIVIDE_BY_ZERO    0xC0000094
+!define STATUS_INTEGER_OVERFLOW          0xC0000095
+!define STATUS_PRIVILEGED_INSTRUCTION    0xC0000096
+!define STATUS_STACK_OVERFLOW            0xC00000FD
+!define STATUS_CONTROL_C_EXIT            0xC000013A
+!define STATUS_FLOAT_MULTIPLE_FAULTS     0xC00002B4
+!define STATUS_FLOAT_MULTIPLE_TRAPS      0xC00002B5
+!define STATUS_REG_NAT_CONSUMPTION       0xC00002C9
+!define STATUS_SXS_EARLY_DEACTIVATION    0xC015000F
+!define STATUS_SXS_INVALID_DEACTIVATION  0xC0150010
+!endif /*WIN32_NO_STATUS*/
+
+#define MAXIMUM_WAIT_OBJECTS 64  
+
+!define DELETE                   0x00010000
+!define READ_CONTROL             0x00020000
+!define WRITE_DAC                0x00040000
+!define WRITE_OWNER              0x00080000
+!define SYNCHRONIZE              0x00100000
+!define STANDARD_RIGHTS_REQUIRED 0x000F0000
+!define STANDARD_RIGHTS_READ     ${READ_CONTROL}
+!define STANDARD_RIGHTS_WRITE    ${READ_CONTROL}
+!define STANDARD_RIGHTS_EXECUTE  ${READ_CONTROL}
+!define STANDARD_RIGHTS_ALL      0x001F0000
+!define SPECIFIC_RIGHTS_ALL      0x0000FFFF
+!define ACCESS_SYSTEM_SECURITY   0x01000000
+!define MAXIMUM_ALLOWED          0x02000000
+!define GENERIC_READ             0x80000000
+!define GENERIC_WRITE            0x40000000
+!define GENERIC_EXECUTE          0x20000000
+!define GENERIC_ALL              0x10000000
+
+!define SE_PRIVILEGE_ENABLED_BY_DEFAULT 0x00000001
+!define SE_PRIVILEGE_ENABLED            0x00000002
+!define SE_PRIVILEGE_REMOVED            0x00000004
+!define SE_PRIVILEGE_USED_FOR_ACCESS    0x80000000
+
+!define SE_CREATE_TOKEN_NAME        "SeCreateTokenPrivilege"
+!define SE_ASSIGNPRIMARYTOKEN_NAME  "SeAssignPrimaryTokenPrivilege"
+!define SE_LOCK_MEMORY_NAME         "SeLockMemoryPrivilege"
+!define SE_INCREASE_QUOTA_NAME      "SeIncreaseQuotaPrivilege"
+!define SE_UNSOLICITED_INPUT_NAME   "SeUnsolicitedInputPrivilege"
+!define SE_MACHINE_ACCOUNT_NAME     "SeMachineAccountPrivilege"
+!define SE_TCB_NAME                 "SeTcbPrivilege"
+!define SE_SECURITY_NAME            "SeSecurityPrivilege"
+!define SE_TAKE_OWNERSHIP_NAME      "SeTakeOwnershipPrivilege"
+!define SE_LOAD_DRIVER_NAME         "SeLoadDriverPrivilege"
+!define SE_SYSTEM_PROFILE_NAME      "SeSystemProfilePrivilege"
+!define SE_SYSTEMTIME_NAME          "SeSystemtimePrivilege"
+!define SE_PROF_SINGLE_PROCESS_NAME "SeProfileSingleProcessPrivilege"
+!define SE_INC_BASE_PRIORITY_NAME   "SeIncreaseBasePriorityPrivilege"
+!define SE_CREATE_PAGEFILE_NAME     "SeCreatePagefilePrivilege"
+!define SE_CREATE_PERMANENT_NAME    "SeCreatePermanentPrivilege"
+!define SE_BACKUP_NAME              "SeBackupPrivilege"
+!define SE_RESTORE_NAME             "SeRestorePrivilege"
+!define SE_SHUTDOWN_NAME            "SeShutdownPrivilege"
+!define SE_DEBUG_NAME               "SeDebugPrivilege"
+!define SE_AUDIT_NAME               "SeAuditPrivilege"
+!define SE_SYSTEM_ENVIRONMENT_NAME  "SeSystemEnvironmentPrivilege"
+!define SE_CHANGE_NOTIFY_NAME       "SeChangeNotifyPrivilege"
+!define SE_REMOTE_SHUTDOWN_NAME     "SeRemoteShutdownPrivilege"
+!define SE_UNDOCK_NAME              "SeUndockPrivilege"
+!define SE_SYNC_AGENT_NAME          "SeSyncAgentPrivilege"
+!define SE_ENABLE_DELEGATION_NAME   "SeEnableDelegationPrivilege"
+!define SE_MANAGE_VOLUME_NAME       "SeManageVolumePrivilege"
+!define SE_IMPERSONATE_NAME         "SeImpersonatePrivilege"
+!define SE_CREATE_GLOBAL_NAME       "SeCreateGlobalPrivilege"
+
+!define TOKEN_ASSIGN_PRIMARY    0x0001
+!define TOKEN_DUPLICATE         0x0002
+!define TOKEN_IMPERSONATE       0x0004
+!define TOKEN_QUERY             0x0008
+!define TOKEN_QUERY_SOURCE      0x0010
+!define TOKEN_ADJUST_PRIVILEGES 0x0020
+!define TOKEN_ADJUST_GROUPS     0x0040
+!define TOKEN_ADJUST_DEFAULT    0x0080
+!define TOKEN_ADJUST_SESSIONID  0x0100
+!define TOKEN_ALL_ACCESS_P     0xF00FF
+!define /math TOKEN_ALL_ACCESS  ${TOKEN_ALL_ACCESS_P} | ${TOKEN_ADJUST_SESSIONID}
+!define /math TOKEN_READ        ${STANDARD_RIGHTS_READ} | ${TOKEN_QUERY}
+!define TOKEN_WRITE      0x200E0 ;(STANDARD_RIGHTS_WRITE|TOKEN_ADJUST_PRIVILEGES|TOKEN_ADJUST_GROUPS|TOKEN_ADJUST_DEFAULT)
+!define TOKEN_EXECUTE    ${STANDARD_RIGHTS_EXECUTE}
+
+!define PROCESS_TERMINATE         0x0001  
+!define PROCESS_CREATE_THREAD     0x0002  
+!define PROCESS_SET_SESSIONID     0x0004  
+!define PROCESS_VM_OPERATION      0x0008  
+!define PROCESS_VM_READ           0x0010  
+!define PROCESS_VM_WRITE          0x0020  
+!define PROCESS_DUP_HANDLE        0x0040  
+!define PROCESS_CREATE_PROCESS    0x0080  
+!define PROCESS_SET_QUOTA         0x0100  
+!define PROCESS_SET_INFORMATION   0x0200  
+!define PROCESS_QUERY_INFORMATION 0x0400  
+!define PROCESS_SUSPEND_RESUME    0x0800  
+!define PROCESS_ALL_ACCESS      0x1F0FFF ;(STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFF)
+!define THREAD_TERMINATE               0x0001  
+!define THREAD_SUSPEND_RESUME          0x0002  
+!define THREAD_GET_CONTEXT             0x0008  
+!define THREAD_SET_CONTEXT             0x0010  
+!define THREAD_SET_INFORMATION         0x0020  
+!define THREAD_QUERY_INFORMATION       0x0040  
+!define THREAD_SET_THREAD_TOKEN        0x0080
+!define THREAD_IMPERSONATE             0x0100
+!define THREAD_DIRECT_IMPERSONATION    0x0200
+!define THREAD_ALL_ACCESS            0x1F03FF ;(STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3FF)
+!define JOB_OBJECT_ASSIGN_PROCESS           0x0001
+!define JOB_OBJECT_SET_ATTRIBUTES           0x0002
+!define JOB_OBJECT_QUERY                    0x0004
+!define JOB_OBJECT_TERMINATE                0x0008
+!define JOB_OBJECT_SET_SECURITY_ATTRIBUTES  0x0010
+!define JOB_OBJECT_ALL_ACCESS             0x1F001F ;(STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1F )
+!define EVENT_MODIFY_STATE      0x0002  
+!define EVENT_ALL_ACCESS 0x1F0003 ;(STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3) 
+!define MUTANT_QUERY_STATE      0x0001
+!define MUTANT_ALL_ACCESS 0x1F0001 ;(STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|MUTANT_QUERY_STATE)
+
+!define FILE_SHARE_READ   0x00000001  
+!define FILE_SHARE_WRITE  0x00000002  
+!define FILE_SHARE_DELETE 0x00000004  
+!define FILE_ATTRIBUTE_READONLY             0x00000001  
+!define FILE_ATTRIBUTE_HIDDEN               0x00000002  
+!define FILE_ATTRIBUTE_SYSTEM               0x00000004  
+!define FILE_ATTRIBUTE_DIRECTORY            0x00000010  
+!define FILE_ATTRIBUTE_ARCHIVE              0x00000020  
+!define FILE_ATTRIBUTE_DEVICE               0x00000040  
+!define FILE_ATTRIBUTE_NORMAL               0x00000080  
+!define FILE_ATTRIBUTE_TEMPORARY            0x00000100  
+!define FILE_ATTRIBUTE_SPARSE_FILE          0x00000200  
+!define FILE_ATTRIBUTE_REPARSE_POINT        0x00000400  
+!define FILE_ATTRIBUTE_COMPRESSED           0x00000800  
+!define FILE_ATTRIBUTE_OFFLINE              0x00001000  
+!define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED  0x00002000  
+!define FILE_ATTRIBUTE_ENCRYPTED            0x00004000  
+
+!define DUPLICATE_CLOSE_SOURCE 0x00000001  
+!define DUPLICATE_SAME_ACCESS  0x00000002  
+
+!define VER_PLATFORM_WIN32s             0
+!define VER_PLATFORM_WIN32_WINDOWS      1
+!define VER_PLATFORM_WIN32_NT           2
+
+!ifndef REG_SZ & NSIS_WINDOWS__NO_REGTYPES
+!define REG_NONE                 0
+!define REG_SZ                   1
+!define REG_EXPAND_SZ            2
+!define REG_BINARY               3
+!define REG_DWORD                4
+!define REG_DWORD_LITTLE_ENDIAN  4
+!define REG_DWORD_BIG_ENDIAN     5
+!define REG_LINK                 6
+!define REG_MULTI_SZ             7
+!endif
+
+
+!endif /* __WIN_NOINC_WINNT */
+!verbose pop
+!endif /* __WIN_WINNT__INC */
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Include/WinCore.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/WinCore.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/WinCore.nsh	(revision 728)
@@ -0,0 +1,214 @@
+/*
+
+WinCore.nsh & Win\*.nsh - Collection of common windows defines
+
+!define __WIN_NOINC_xxx to exclude a windows header file
+!define __WIN_MS_xxx to exclude specific things (The original #ifdef xxx checks can be found in the official Microsoft headers)
+
+*/
+
+!ifndef __WIN_WINDOWS__INC
+!define __WIN_WINDOWS__INC
+!verbose push
+!verbose 3
+
+
+!define __WIN_PTRSIZE 4 ;will we ever see a 64 bit version?
+
+
+!include Win\WinDef.nsh
+!include Win\WinError.nsh
+!include Win\WinNT.nsh
+!include Win\WinUser.nsh
+
+!ifndef __WIN_MS_NOWINMESSAGES
+!include WinMessages.nsh
+!endif
+
+
+
+
+
+/**************************************************
+WinBase.h
+**************************************************/
+!ifndef __WIN_NOINC_WINBASE
+!define INVALID_HANDLE_VALUE -1
+!define INVALID_FILE_SIZE 0xFFFFFFFF
+!define INVALID_SET_FILE_POINTER -1
+!define INVALID_FILE_ATTRIBUTES -1
+
+!define WAIT_FAILED 0xFFFFFFFF
+!define WAIT_OBJECT_0       0 ;((STATUS_WAIT_0 ) + 0 )
+
+!define WAIT_ABANDONED         0x80 ;((STATUS_ABANDONED_WAIT_0 ) + 0 )
+!define WAIT_ABANDONED_0       0x80 ;((STATUS_ABANDONED_WAIT_0 ) + 0 )
+
+!define DRIVE_UNKNOWN     0
+!define DRIVE_NO_ROOT_DIR 1
+!define DRIVE_REMOVABLE   2
+!define DRIVE_FIXED       3
+!define DRIVE_REMOTE      4
+!define DRIVE_CDROM       5
+!define DRIVE_RAMDISK     6
+
+!define FILE_TYPE_UNKNOWN   0x0000
+!define FILE_TYPE_DISK      0x0001
+!define FILE_TYPE_CHAR      0x0002
+!define FILE_TYPE_PIPE      0x0003
+!define FILE_TYPE_REMOTE    0x8000
+
+!define STD_INPUT_HANDLE   -10
+!define STD_OUTPUT_HANDLE  -11
+!define STD_ERROR_HANDLE   -12
+
+#define IGNORE              0       ; Ignore signal
+!define INFINITE            0xFFFFFFFF  ; Infinite timeout
+
+!endif /* __WIN_NOINC_WINBASE */
+
+
+
+
+
+/**************************************************
+WinGDI.h
+**************************************************/
+!ifndef __WIN_MS_NOGDI & __WIN_NOINC_WINGDI
+!define HORZRES       8 
+!define VERTRES       10
+!define BITSPIXEL     12
+!define LOGPIXELSX    88
+!define LOGPIXELSY    90
+!define COLORRES     108
+!define VREFRESH     116
+!define DESKTOPVERTRES 117
+!define DESKTOPHORZRES 118
+!endif /* __WIN_MS_NOGDI & __WIN_NOINC_WINGDI */
+
+
+
+
+
+/**************************************************
+WinReg.h
+**************************************************/
+!ifndef __WIN_NOINC_WINREG
+!ifndef __WIN_NOHKEY & HKEY_CLASSES_ROOT & HKEY_CURRENT_USER & HKEY_LOCAL_MACHINE & HKEY_USERS
+!define HKEY_CLASSES_ROOT        0x80000000
+!define HKEY_CURRENT_USER        0x80000001
+!define HKEY_LOCAL_MACHINE       0x80000002
+!define HKEY_USERS               0x80000003
+!define HKEY_PERFORMANCE_DATA    0x80000004
+!define HKEY_PERFORMANCE_TEXT    0x80000050
+!define HKEY_PERFORMANCE_NLSTEXT 0x80000060
+!define HKEY_CURRENT_CONFIG      0x80000005
+!define HKEY_DYN_DATA            0x80000006
+!ifndef __WIN_NOSHORTHKEY & HKCR & HKCU & HKLM
+!define HKCR ${HKEY_CLASSES_ROOT}
+!define HKCU ${HKEY_CURRENT_USER}
+!define HKLM ${HKEY_LOCAL_MACHINE}
+!endif
+!endif
+!endif /* __WIN_NOINC_WINREG */
+
+
+
+
+
+/**************************************************
+WindowsX.h
+**************************************************/
+!ifndef __WIN_NOINC_WINDOWSX
+!ifndef GET_X_LPARAM & GET_Y_LPARAM
+!macro _Win_GET_X_LPARAM _outvar _in
+IntOp ${_outvar} "${_in}" << 16   ;We can't just use LOWORD, we need to keep the sign,
+IntOp ${_outvar} ${_outvar} >> 16 ;so we let NSIS sign extend for us
+!macroend
+!define GET_X_LPARAM "!insertmacro _Win_GET_X_LPARAM "
+!macro _Win_GET_Y_LPARAM _outvar _in
+IntOp ${_outvar} "${_in}" >> 16
+!macroend
+!define GET_Y_LPARAM "!insertmacro _Win_GET_Y_LPARAM "
+!endif
+!endif /* __WIN_NOINC_WINDOWSX */
+
+
+
+
+
+/**************************************************
+ShlObj.h
+**************************************************/
+!ifndef __WIN_NOINC_SHLOBJ
+!ifndef __WIN_NOSHELLFOLDERCSIDL
+!define CSIDL_DESKTOP                 0x0000
+!define CSIDL_INTERNET                0x0001 ;Internet Explorer (icon on desktop)
+!define CSIDL_PROGRAMS                0x0002 ;Start Menu\Programs
+!define CSIDL_CONTROLS                0x0003 ;My Computer\Control Panel
+!define CSIDL_PRINTERS                0x0004 ;My Computer\Printers
+!define CSIDL_PERSONAL                0x0005 ;My Documents
+!define CSIDL_FAVORITES               0x0006 ;<user name>\Favorites
+!define CSIDL_STARTUP                 0x0007 ;Start Menu\Programs\Startup
+!define CSIDL_RECENT                  0x0008 ;<user name>\Recent
+!define CSIDL_SENDTO                  0x0009 ;<user name>\SendTo
+!define CSIDL_BITBUCKET               0x000a ;<desktop>\Recycle Bin
+!define CSIDL_STARTMENU               0x000b ;<user name>\Start Menu
+!define CSIDL_MYDOCUMENTS             0x000c ;logical "My Documents" desktop icon
+!define CSIDL_MYMUSIC                 0x000d ;"My Music" folder
+!define CSIDL_MYVIDEO                 0x000e ;"My Videos" folder
+!define CSIDL_DESKTOPDIRECTORY        0x0010 ;<user name>\Desktop
+!define CSIDL_DRIVES                  0x0011 ;My Computer
+!define CSIDL_NETWORK                 0x0012 ;Network Neighborhood
+!define CSIDL_NETHOOD                 0x0013 ;<user name>\nethood
+!define CSIDL_FONTS                   0x0014 ;windows\fonts
+!define CSIDL_TEMPLATES               0x0015
+!define CSIDL_COMMON_STARTMENU        0x0016 ;All Users\Start Menu
+!define CSIDL_COMMON_PROGRAMS         0x0017 ;All Users\Start Menu\Programs
+!define CSIDL_COMMON_STARTUP          0x0018 ;All Users\Startup
+!define CSIDL_COMMON_DESKTOPDIRECTORY 0x0019 ;All Users\Desktop
+!define CSIDL_APPDATA                 0x001a ;<user name>\Application Data
+!define CSIDL_PRINTHOOD               0x001b ;<user name>\PrintHood
+!define CSIDL_LOCAL_APPDATA           0x001c ;<user name>\Local Settings\Applicaiton Data (non roaming)
+!define CSIDL_ALTSTARTUP              0x001d ;non localized startup
+!define CSIDL_COMMON_ALTSTARTUP       0x001e ;non localized common startup
+!define CSIDL_COMMON_FAVORITES        0x001f
+!define CSIDL_INTERNET_CACHE          0x0020
+!define CSIDL_COOKIES                 0x0021
+!define CSIDL_HISTORY                 0x0022
+!define CSIDL_COMMON_APPDATA          0x0023 ;All Users\Application Data
+!define CSIDL_WINDOWS                 0x0024 ;GetWindowsDirectory
+!define CSIDL_SYSTEM                  0x0025 ;GetSystemDirectory
+!define CSIDL_PROGRAM_FILES           0x0026 ;C:\Program Files
+!define CSIDL_MYPICTURES              0x0027
+!define CSIDL_PROFILE                 0x0028 ;USERPROFILE
+!define CSIDL_SYSTEMX86               0x0029 ;x86 system directory on RISC
+!define CSIDL_PROGRAM_FILESX86        0x002a ;x86 C:\Program Files on RISC
+!define CSIDL_PROGRAM_FILES_COMMON    0x002b ;C:\Program Files\Common
+!define CSIDL_PROGRAM_FILES_COMMONX86 0x002c ;x86 Program Files\Common on RISC
+!define CSIDL_COMMON_TEMPLATES        0x002d ;All Users\Templates
+!define CSIDL_COMMON_DOCUMENTS        0x002e ;All Users\Documents
+!define CSIDL_COMMON_ADMINTOOLS       0x002f ;All Users\Start Menu\Programs\Administrative Tools
+!define CSIDL_ADMINTOOLS              0x0030 ;<user name>\Start Menu\Programs\Administrative Tools
+!define CSIDL_CONNECTIONS             0x0031 ;Network and Dial-up Connections
+!define CSIDL_COMMON_MUSIC            0x0035 ;All Users\My Music
+!define CSIDL_COMMON_PICTURES         0x0036 ;All Users\My Pictures
+!define CSIDL_COMMON_VIDEO            0x0037 ;All Users\My Video
+!define CSIDL_RESOURCES               0x0038 ;Resource Direcotry
+!define CSIDL_RESOURCES_LOCALIZED     0x0039 ;Localized Resource Direcotry
+!define CSIDL_COMMON_OEM_LINKS        0x003a ;Links to All Users OEM specific apps
+!define CSIDL_CDBURN_AREA             0x003b ;USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning
+!define CSIDL_COMPUTERSNEARME         0x003d ;Computers Near Me (computered from Workgroup membership)
+!define CSIDL_FLAG_CREATE             0x8000 ;combine with CSIDL_ value to force folder creation in SHGetFolderPath()
+!define CSIDL_FLAG_DONT_VERIFY        0x4000 ;combine with CSIDL_ value to return an unverified folder path
+!define CSIDL_FLAG_NO_ALIAS           0x1000 ;combine with CSIDL_ value to insure non-alias versions of the pidl
+!define CSIDL_FLAG_PER_USER_INIT      0x0800 ;combine with CSIDL_ value to indicate per-user init (eg. upgrade)
+!define CSIDL_FLAG_MASK               0xFF00
+!endif /* __WIN_NOSHELLFOLDERCSIDL */
+!endif /* __WIN_NOINC_SHLOBJ */
+
+
+
+
+!verbose pop
+!endif /* __WIN_WINDOWS__INC */
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Include/WinVer.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/WinVer.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/WinVer.nsh	(revision 728)
@@ -0,0 +1,488 @@
+; ---------------------
+;      WinVer.nsh
+; ---------------------
+;
+; LogicLib extensions for handling Windows versions and service packs.
+;
+; IsNT checks if the installer is running on Windows NT family (NT4, 2000, XP, etc.)
+;
+;   ${If} ${IsNT}
+;     DetailPrint "Running on NT. Installing Unicode enabled application."
+;   ${Else}
+;     DetailPrint "Not running on NT. Installing ANSI application."
+;   ${EndIf}
+;
+; IsServer checks if the installer is running on a server version of Windows (NT4, 2003, 2008, etc.)
+;
+; AtLeastWin<version> checks if the installer is running on Windows version at least as specified.
+; IsWin<version> checks if the installer is running on Windows version exactly as specified.
+; AtMostWin<version> checks if the installer is running on Windows version at most as specified.
+;
+; <version> can be replaced with the following values:
+;
+;   95
+;   98
+;   ME
+;
+;   NT4
+;   2000
+;   XP
+;   2003
+;   Vista
+;   2008
+;   7
+;   2008R2
+;   8
+;   2012
+;
+; AtLeastServicePack checks if the installer is running on Windows service pack version at least as specified.
+; IsServicePack checks if the installer is running on Windows service pack version exactly as specified.
+; AtMostServicePack checks if the installer is running on Windows service version pack at most as specified.
+;
+; Usage examples:
+;
+;   ${If} ${IsNT}
+;   DetailPrint "Running on NT family."
+;   DetailPrint "Surely not running on 95, 98 or ME."
+;   ${AndIf} ${AtLeastWinNT4}
+;     DetailPrint "Running on NT4 or better. Could even be 2003."
+;   ${EndIf}
+;
+;   ${If} ${AtLeastWinXP}
+;     DetailPrint "Running on XP or better."
+;   ${EndIf}
+;
+;   ${If} ${IsWin2000}
+;     DetailPrint "Running on 2000."
+;   ${EndIf}
+;
+;   ${If} ${IsWin2000}
+;   ${AndIf} ${AtLeastServicePack} 3
+;   ${OrIf} ${AtLeastWinXP}
+;     DetailPrint "Running Win2000 SP3 or above"
+;   ${EndIf}
+;
+;   ${If} ${AtMostWinXP}
+;     DetailPrint "Running on XP or older. Surely not running on Vista. Maybe 98, or even 95."
+;   ${EndIf}
+;
+; Warning:
+;
+;   Windows 95 and NT both use the same version number. To avoid getting NT4 misidentified
+;   as Windows 95 and vice-versa or 98 as a version higher than NT4, always use IsNT to
+;   check if running on the NT family.
+;
+;     ${If} ${AtLeastWin95}
+;     ${And} ${AtMostWinME}
+;       DetailPrint "Running 95, 98 or ME."
+;       DetailPrint "Actually, maybe it's NT4?"
+;       ${If} ${IsNT}
+;         DetailPrint "Yes, it's NT4! oops..."
+;       ${Else}
+;         DetailPrint "Nope, not NT4. phew..."
+;       ${EndIf}
+;     ${EndIf}
+;
+;
+; Other useful extensions are:
+;
+;    * IsWin2003R2
+;    * IsStarterEdition
+;    * OSHasMediaCenter
+;    * OSHasTabletSupport
+;
+
+!verbose push
+!verbose 3
+
+!ifndef ___WINVER__NSH___
+!define ___WINVER__NSH___
+
+!include LogicLib.nsh
+!include Util.nsh
+
+# masks for our variables
+
+!define _WINVER_VERXBIT  0x00000001
+!define _WINVER_MASKVMAJ 0x7F000000
+!define _WINVER_MASKVMIN 0x00FF0000
+
+!define _WINVER_NTBIT    0x80000000
+!define _WINVER_NTMASK   0x7FFFFFFF
+!define _WINVER_NTSRVBIT 0x40000000
+!define _WINVER_MASKVBLD 0x0000FFFF
+!define _WINVER_MASKSP   0x000F0000
+
+# possible variable values for different versions
+
+!define WINVER_95_NT     0x04000000 ;4.00.0950
+!define WINVER_95        0x04000000 ;4.00.0950
+!define WINVER_98_NT     0x040a0000 ;4.10.1998
+!define WINVER_98        0x040a0000 ;4.10.1998
+;define WINVER_98SE      0x040a0000 ;4.10.2222
+!define WINVER_ME_NT     0x045a0000 ;4.90.3000
+!define WINVER_ME        0x045a0000 ;4.90.3000
+;define WINVER_NT3d51               ;3.51.1057
+!define WINVER_NT4_NT    0x84000000 ;4.00.1381
+!define WINVER_NT4       0x04000000 ;4.00.1381
+!define WINVER_2000_NT   0x85000000 ;5.00.2195
+!define WINVER_2000      0x05000000 ;5.00.2195
+!define WINVER_XP_NT     0x85010000 ;5.01.2600
+!define WINVER_XP        0x05010000 ;5.01.2600
+;define WINVER_XP64                 ;5.02.3790
+!define WINVER_2003_NT   0x85020000 ;5.02.3790
+!define WINVER_2003      0x05020000 ;5.02.3790
+!define WINVER_VISTA_NT  0x86000000 ;6.00.6000
+!define WINVER_VISTA     0x06000000 ;6.00.6000
+!define WINVER_2008_NT   0x86000001 ;6.00.6001
+!define WINVER_2008      0x06000001 ;6.00.6001
+!define WINVER_7_NT      0x86010000 ;6.01.7600
+!define WINVER_7         0x06010000 ;6.01.7600
+!define WINVER_2008R2_NT 0x86010001 ;6.01.7600
+!define WINVER_2008R2    0x06010001 ;6.01.7600
+!define WINVER_8_NT      0x86020000 ;6.02.9200
+!define WINVER_8         0x06020000 ;6.02.9200
+!define WINVER_2012_NT   0x86020001 ;6.02.9200
+!define WINVER_2012      0x06020001 ;6.02.9200
+
+
+# use this to make all nt > 9x
+
+!ifdef WINVER_NT4_OVER_W95
+  !define __WINVERTMP ${WINVER_NT4}
+  !undef WINVER_NT4
+  !define /math WINVER_NT4 ${__WINVERTMP} | ${_WINVER_VERXBIT}
+  !undef __WINVERTMP
+!endif
+
+# some definitions from header files
+
+!define OSVERSIONINFOA_SIZE   148
+!define OSVERSIONINFOEXA_SIZE 156
+!define VER_PLATFORM_WIN32_NT 2
+!define VER_NT_WORKSTATION    1
+
+!define SM_TABLETPC    86
+!define SM_MEDIACENTER 87
+!define SM_STARTER     88
+!define SM_SERVERR2    89
+
+# variable declaration
+
+!macro __WinVer_DeclareVars
+
+  !ifndef __WINVER_VARS_DECLARED
+
+    !define __WINVER_VARS_DECLARED
+
+    Var /GLOBAL __WINVERV
+    Var /GLOBAL __WINVERSP
+
+  !endif
+
+!macroend
+
+# lazy initialization macro
+
+!ifmacrondef __WinVer_Call_GetVersionEx
+
+  !macro __WinVer_Call_GetVersionEx STRUCT_SIZE
+
+    System::Call '*$0(i ${STRUCT_SIZE})'
+    System::Call kernel32::GetVersionEx(ir0)i.r3
+
+  !macroend
+
+!endif
+
+!macro __WinVer_InitVars
+  # variables
+  !insertmacro __WinVer_DeclareVars
+
+  # only calculate version once
+  StrCmp $__WINVERV "" _winver_noveryet
+    Return
+  _winver_noveryet:
+
+  # push used registers on the stack
+  Push $0
+  Push $1 ;maj
+  Push $2 ;min
+  Push $3 ;bld
+  Push $R0 ;temp
+
+  # allocate memory
+  System::Alloc ${OSVERSIONINFOEXA_SIZE}
+  Pop $0
+
+  # use OSVERSIONINFOEX
+  !insertmacro __WinVer_Call_GetVersionEx ${OSVERSIONINFOEXA_SIZE}
+
+  IntCmp $3 0 "" _winver_ex _winver_ex
+    # OSVERSIONINFOEX not allowed (Win9x or NT4 w/SP < 6), use OSVERSIONINFO
+    !insertmacro __WinVer_Call_GetVersionEx ${OSVERSIONINFOA_SIZE}
+  _winver_ex:
+
+  # get results from struct
+  System::Call '*$0(i.s,i.r1,i.r2,i.r3,i.s,&t128.s,&i2.s,&i2,&i2,&i1.s,&i1)'
+
+  # free struct
+  System::Free $0
+
+  # win9x has major and minor info in high word of dwBuildNumber - remove it
+  IntOp $3 $3 & 0xFFFF
+
+  # get dwOSVersionInfoSize
+  Pop $R0
+
+  # get dwPlatformId
+  Pop $0
+
+  # NT?
+  IntCmp $0 ${VER_PLATFORM_WIN32_NT} "" _winver_notnt _winver_notnt
+    IntOp $__WINVERSP $__WINVERSP | ${_WINVER_NTBIT}
+    IntOp $__WINVERV  $__WINVERV  | ${_WINVER_NTBIT}
+  _winver_notnt:
+
+  # get service pack information
+  IntCmp $0 ${VER_PLATFORM_WIN32_NT} _winver_nt "" _winver_nt  # win9x
+
+    # get szCSDVersion
+    Pop $0
+
+    # copy second char
+    StrCpy $0 $0 1 1
+
+    # discard invalid wServicePackMajor and wProductType
+    Pop $R0
+    Pop $R0
+
+    # switch
+    StrCmp $0 'A' "" +3
+      StrCpy $0 1
+      Goto _winver_sp_done
+    StrCmp $0 'B' "" +3
+      StrCpy $0 2
+      Goto _winver_sp_done
+    StrCmp $0 'C' "" +3
+      StrCpy $0 3
+      Goto _winver_sp_done
+    StrCpy $0 0
+    Goto _winver_sp_done
+
+  _winver_nt: # nt
+
+    IntCmp $R0 ${OSVERSIONINFOEXA_SIZE} "" _winver_sp_noex _winver_sp_noex
+
+      # discard szCSDVersion
+      Pop $0
+
+      # get wProductType
+      Exch
+      Pop $0
+
+      # is server?
+      IntCmp $0 ${VER_NT_WORKSTATION} _winver_noserver _winver_noserver ""
+        IntOp $__WINVERSP $__WINVERSP | ${_WINVER_NTSRVBIT}
+      _winver_noserver:
+
+      # get wServicePackMajor
+      Pop $0
+
+      # done with sp
+      Goto _winver_sp_done
+
+    _winver_sp_noex: # OSVERSIONINFO, not OSVERSIONINFOEX
+
+      ####  TODO
+      ## For IsServer to support < NT4SP6, we need to check the registry
+      ## here to see if we are a server and/or DC
+
+      # get szCSDVersion
+      Pop $0
+
+      # discard invalid wServicePackMajor and wProductType
+      Pop $R0
+      Pop $R0
+
+      # get service pack number from text
+      StrCpy $R0 $0 13
+      StrCmp $R0 "Service Pack " "" +3
+        StrCpy $0 $0 "" 13 # cut "Service Pack "
+        Goto +2
+        StrCpy $0 0 # no service pack
+
+!ifdef WINVER_NT4_OVER_W95
+      IntOp $__WINVERV $__WINVERV | ${_WINVER_VERXBIT}
+!endif
+
+  _winver_sp_done:
+
+  # store service pack
+  IntOp $0 $0 << 16
+  IntOp $__WINVERSP $__WINVERSP | $0
+
+  ### now for the version
+
+  # is server?
+  IntOp $0 $__WINVERSP & ${_WINVER_NTSRVBIT}
+
+  # windows xp x64?
+  IntCmp $0 0 "" _winver_not_xp_x64 _winver_not_xp_x64 # not server
+  IntCmp $1 5 "" _winver_not_xp_x64 _winver_not_xp_x64 # maj 5
+  IntCmp $2 2 "" _winver_not_xp_x64 _winver_not_xp_x64 # min 2
+    # change XP x64 from 5.2 to 5.1 so it's still XP
+    StrCpy $2 1
+  _winver_not_xp_x64:
+
+  # server 2008?
+  IntCmp $0 0 _winver_not_ntserver # server
+  IntCmp 6 $1 "" "" _winver_not_ntserver # maj 6
+    # extra bit so Server 2008 comes after Vista SP1 that has the same minor version, same for Win7 vs 2008R2
+    IntOp $__WINVERV $__WINVERV | ${_WINVER_VERXBIT}
+  _winver_not_ntserver:
+
+  # pack version
+  IntOp $1 $1 << 24 # VerMajor
+  IntOp $__WINVERV $__WINVERV | $1
+  IntOp $0 $2 << 16
+  IntOp $__WINVERV $__WINVERV | $0 # VerMinor
+  IntOp $__WINVERSP $__WINVERSP | $3 # VerBuild
+
+  # restore registers
+  Pop $R0
+  Pop $3
+  Pop $2
+  Pop $1
+  Pop $0
+
+!macroend
+
+# version comparison LogicLib macros
+
+!macro _WinVerAtLeast _a _b _t _f
+  !insertmacro _LOGICLIB_TEMP
+  ${CallArtificialFunction} __WinVer_InitVars
+  IntOp $_LOGICLIB_TEMP $__WINVERV & ${_WINVER_NTMASK}
+  !insertmacro _>= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}`
+!macroend
+!macro _WinVerIs _a _b _t _f
+  ${CallArtificialFunction} __WinVer_InitVars
+  !insertmacro _= $__WINVERV `${_b}` `${_t}` `${_f}`
+!macroend
+!macro _WinVerAtMost _a _b _t _f
+  !insertmacro _LOGICLIB_TEMP
+  ${CallArtificialFunction} __WinVer_InitVars
+  IntOp $_LOGICLIB_TEMP $__WINVERV & ${_WINVER_NTMASK}
+  !insertmacro _<= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}`
+!macroend
+
+!macro __WinVer_DefineOSTest Test OS Suffix
+  !define ${Test}Win${OS} `"" WinVer${Test} ${WINVER_${OS}${Suffix}}`
+!macroend
+
+!macro __WinVer_DefineOSTests Test Suffix
+  !insertmacro __WinVer_DefineOSTest ${Test} 95     '${Suffix}'
+  !insertmacro __WinVer_DefineOSTest ${Test} 98     '${Suffix}'
+  !insertmacro __WinVer_DefineOSTest ${Test} ME     '${Suffix}'
+  !insertmacro __WinVer_DefineOSTest ${Test} NT4    '${Suffix}'
+  !insertmacro __WinVer_DefineOSTest ${Test} 2000   '${Suffix}'
+  !insertmacro __WinVer_DefineOSTest ${Test} XP     '${Suffix}'
+  !insertmacro __WinVer_DefineOSTest ${Test} 2003   '${Suffix}'
+  !insertmacro __WinVer_DefineOSTest ${Test} VISTA  '${Suffix}'
+  !insertmacro __WinVer_DefineOSTest ${Test} 2008   '${Suffix}'
+  !insertmacro __WinVer_DefineOSTest ${Test} 7      '${Suffix}'
+  !insertmacro __WinVer_DefineOSTest ${Test} 2008R2 '${Suffix}'
+  !insertmacro __WinVer_DefineOSTest ${Test} 8      '${Suffix}'
+  !insertmacro __WinVer_DefineOSTest ${Test} 2012   '${Suffix}'
+!macroend
+
+!insertmacro __WinVer_DefineOSTests AtLeast ""
+!insertmacro __WinVer_DefineOSTests Is _NT
+!insertmacro __WinVer_DefineOSTests AtMost ""
+
+# version feature LogicLib macros
+
+!macro _IsNT _a _b _t _f
+  !insertmacro _LOGICLIB_TEMP
+  ${CallArtificialFunction} __WinVer_InitVars
+  IntOp $_LOGICLIB_TEMP $__WINVERSP & ${_WINVER_NTBIT}
+  !insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`
+!macroend
+!define IsNT `"" IsNT ""`
+
+!macro _IsServerOS _a _b _t _f
+  !insertmacro _LOGICLIB_TEMP
+  ${CallArtificialFunction} __WinVer_InitVars
+  IntOp $_LOGICLIB_TEMP $__WINVERSP & ${_WINVER_NTSRVBIT}
+  !insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`
+!macroend
+!define IsServerOS `"" IsServerOS ""`
+
+# service pack macros
+
+!macro _WinVer_GetServicePackLevel OUTVAR
+  ${CallArtificialFunction} __WinVer_InitVars
+  IntOp ${OUTVAR} $__WINVERSP & ${_WINVER_MASKSP}
+  IntOp ${OUTVAR} ${OUTVAR} >> 16
+!macroend
+!define WinVerGetServicePackLevel '!insertmacro _WinVer_GetServicePackLevel '
+
+!macro _AtLeastServicePack _a _b _t _f
+  !insertmacro _LOGICLIB_TEMP
+  ${WinVerGetServicePackLevel} $_LOGICLIB_TEMP
+  !insertmacro _>= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}`
+!macroend
+!define AtLeastServicePack `"" AtLeastServicePack`
+
+!macro _AtMostServicePack _a _b _t _f
+  !insertmacro _LOGICLIB_TEMP
+  ${WinVerGetServicePackLevel} $_LOGICLIB_TEMP
+  !insertmacro _<= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}`
+!macroend
+!define AtMostServicePack `"" AtMostServicePack`
+
+!macro _IsServicePack _a _b _t _f
+  !insertmacro _LOGICLIB_TEMP
+  ${WinVerGetServicePackLevel} $_LOGICLIB_TEMP
+  !insertmacro _= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}`
+!macroend
+!define IsServicePack `"" IsServicePack`
+
+# special feature LogicLib macros
+
+!macro _WinVer_SysMetricCheck m _b _t _f
+  !insertmacro _LOGICLIB_TEMP
+  System::Call user32::GetSystemMetrics(i${m})i.s
+  pop $_LOGICLIB_TEMP
+  !insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`
+!macroend
+
+!define IsWin2003R2        `${SM_SERVERR2}    WinVer_SysMetricCheck ""`
+!define IsStarterEdition   `${SM_STARTER}     WinVer_SysMetricCheck ""`
+!define OSHasMediaCenter   `${SM_MEDIACENTER} WinVer_SysMetricCheck ""`
+!define OSHasTabletSupport `${SM_TABLETPC}    WinVer_SysMetricCheck ""`
+
+# version retrieval macros
+
+!macro __WinVer_GetVer var rshift mask outvar
+  ${CallArtificialFunction} __WinVer_InitVars
+  !if "${mask}" != ""
+    IntOp ${outvar} ${var} & ${mask}
+    !if "${rshift}" != ""
+      IntOp ${outvar} ${outvar} >> ${rshift}
+    !endif
+  !else
+    IntOp ${outvar} ${var} >> ${rshift}
+  !endif
+!macroend
+
+!define WinVerGetMajor '!insertmacro __WinVer_GetVer $__WINVERV  24 ${_WINVER_MASKVMAJ}'
+!define WinVerGetMinor '!insertmacro __WinVer_GetVer $__WINVERV  16 ${_WINVER_MASKVMIN}'
+!define WinVerGetBuild '!insertmacro __WinVer_GetVer $__WINVERSP "" ${_WINVER_MASKVBLD}'
+
+# done
+
+!endif # !___WINVER__NSH___
+
+!verbose pop
Index: tmp/trunk/org.txm.setups/nsis/Include/VPatchLib.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/VPatchLib.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/VPatchLib.nsh	(revision 728)
@@ -0,0 +1,47 @@
+; PatchLib v3.0
+; =============
+;
+; Library with macro for use with VPatch (DLL version) in NSIS 2.0.5+
+; Created by Koen van de Sande
+
+!include LogicLib.nsh
+
+!macro VPatchFile PATCHDATA SOURCEFILE TEMPFILE
+
+  Push $1
+  Push $2
+  Push $3
+  Push $4
+
+  Push ${SOURCEFILE}
+  Push ${TEMPFILE}
+
+  Pop $2 # temp file
+  Pop $3 # source file
+
+  InitPluginsDir
+  GetTempFileName $1 $PLUGINSDIR
+  File /oname=$1 ${PATCHDATA}
+
+  vpatch::vpatchfile $1 $3 $2
+  Pop $4
+  DetailPrint $4
+
+  StrCpy $4 $4 2
+  ${Unless} $4 == "OK"
+    SetErrors
+  ${EndIf}
+
+  ${If} ${FileExists} $2
+    Delete $3
+    Rename /REBOOTOK $2 $3
+  ${EndIf}
+
+  Delete $1
+
+  Pop $4
+  Pop $3
+  Pop $2
+  Pop $1
+
+!macroend
Index: tmp/trunk/org.txm.setups/nsis/Include/MUI2.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/MUI2.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/MUI2.nsh	(revision 728)
@@ -0,0 +1 @@
+!include "${NSISDIR}\Contrib\Modern UI 2\MUI2.nsh"
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Include/Util.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/Util.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/Util.nsh	(revision 728)
@@ -0,0 +1,56 @@
+; ---------------------
+;       Util.nsh
+; ---------------------
+;
+; Voodoo macros to make end-user usage easier. This may be documented someday.
+
+!verbose push
+!verbose 3
+
+!ifndef ___UTIL__NSH___
+!define ___UTIL__NSH___
+
+# see WinVer.nsh and *Func.nsh for usage examples
+!macro CallArtificialFunction NAME
+  !ifndef __UNINSTALL__
+    !define CallArtificialFunction_TYPE inst
+  !else
+    !define CallArtificialFunction_TYPE uninst
+  !endif
+  Call :.${NAME}${CallArtificialFunction_TYPE}
+  !ifndef ${NAME}${CallArtificialFunction_TYPE}_DEFINED
+    Goto ${NAME}${CallArtificialFunction_TYPE}_DONE
+    !define ${NAME}${CallArtificialFunction_TYPE}_DEFINED
+    .${NAME}${CallArtificialFunction_TYPE}:
+      !insertmacro ${NAME}
+    Return
+    ${NAME}${CallArtificialFunction_TYPE}_DONE:
+  !endif
+  !undef CallArtificialFunction_TYPE
+!macroend
+!define CallArtificialFunction `!insertmacro CallArtificialFunction`
+
+# for usage of artificial functions inside artificial functions
+# macro recursion is prohibited
+!macro CallArtificialFunction2 NAME
+  !ifndef __UNINSTALL__
+    !define CallArtificialFunction2_TYPE inst
+  !else
+    !define CallArtificialFunction2_TYPE uninst
+  !endif
+  Call :.${NAME}${CallArtificialFunction2_TYPE}
+  !ifndef ${NAME}${CallArtificialFunction2_TYPE}_DEFINED
+    Goto ${NAME}${CallArtificialFunction2_TYPE}_DONE
+    !define ${NAME}${CallArtificialFunction2_TYPE}_DEFINED
+    .${NAME}${CallArtificialFunction2_TYPE}:
+      !insertmacro ${NAME}
+    Return
+    ${NAME}${CallArtificialFunction2_TYPE}_DONE:
+  !endif
+  !undef CallArtificialFunction2_TYPE
+!macroend
+!define CallArtificialFunction2 `!insertmacro CallArtificialFunction2`
+
+!endif # !___UTIL__NSH___
+
+!verbose pop
Index: tmp/trunk/org.txm.setups/nsis/Include/x64.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/x64.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/x64.nsh	(revision 728)
@@ -0,0 +1,54 @@
+; ---------------------
+;       x64.nsh
+; ---------------------
+;
+; A few simple macros to handle installations on x64 machines.
+;
+; RunningX64 checks if the installer is running on x64.
+;
+;   ${If} ${RunningX64}
+;     MessageBox MB_OK "running on x64"
+;   ${EndIf}
+;
+; DisableX64FSRedirection disables file system redirection.
+; EnableX64FSRedirection enables file system redirection.
+;
+;   SetOutPath $SYSDIR
+;   ${DisableX64FSRedirection}
+;   File some.dll # extracts to C:\Windows\System32
+;   ${EnableX64FSRedirection}
+;   File some.dll # extracts to C:\Windows\SysWOW64
+;
+
+!ifndef ___X64__NSH___
+!define ___X64__NSH___
+
+!include LogicLib.nsh
+
+!macro _RunningX64 _a _b _t _f
+  !insertmacro _LOGICLIB_TEMP
+  System::Call kernel32::GetCurrentProcess()i.s
+  System::Call kernel32::IsWow64Process(is,*i.s)
+  Pop $_LOGICLIB_TEMP
+  !insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`
+!macroend
+
+!define RunningX64 `"" RunningX64 ""`
+
+!macro DisableX64FSRedirection
+
+  System::Call kernel32::Wow64EnableWow64FsRedirection(i0)
+
+!macroend
+
+!define DisableX64FSRedirection "!insertmacro DisableX64FSRedirection"
+
+!macro EnableX64FSRedirection
+
+  System::Call kernel32::Wow64EnableWow64FsRedirection(i1)
+
+!macroend
+
+!define EnableX64FSRedirection "!insertmacro EnableX64FSRedirection"
+
+!endif # !___X64__NSH___
Index: tmp/trunk/org.txm.setups/nsis/Include/LangFile.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Include/LangFile.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Include/LangFile.nsh	(revision 728)
@@ -0,0 +1,133 @@
+/*
+
+LangFile.nsh
+
+Header file to create langauge files that can be
+included with a single command.
+
+Copyright 2008-2015 Joost Verburg
+
+* Either LANGFILE_INCLUDE or LANGFILE_INCLUDE_WITHDEFAULT
+  can be called from the script to include a language
+  file.
+
+  - LANGFILE_INCLUDE takes the language file name as parameter.
+  - LANGFILE_INCLUDE_WITHDEFAULT takes as additional second
+    parameter the default language file to load missing strings
+    from.
+
+* A language file start with:
+  !insertmacro LANGFILE_EXT "English"
+  using the same name as the standard NSIS language file.
+
+* Language strings in the language file have the format:
+  ${LangFileString} LANGSTRING_NAME "Text"
+
+*/
+
+!ifndef LANGFILE_INCLUDED
+!define LANGFILE_INCLUDED
+
+!macro LANGFILE_INCLUDE FILENAME
+
+  ;Called from script: include a langauge file
+
+  !ifdef LangFileString
+    !undef LangFileString
+  !endif
+
+  !define LangFileString "!insertmacro LANGFILE_SETSTRING"
+
+  !define LANGFILE_SETNAMES
+  !include "${FILENAME}"
+  !undef LANGFILE_SETNAMES
+
+  ;Create language strings
+
+  !undef LangFileString
+  !define LangFileString "!insertmacro LANGFILE_LANGSTRING"
+  !include "${FILENAME}"
+
+!macroend
+
+!macro LANGFILE_INCLUDE_WITHDEFAULT FILENAME FILENAME_DEFAULT
+
+  ;Called from script: include a langauge file
+  ;Obtains missing strings from a default file
+
+  !ifdef LangFileString
+    !undef LangFileString
+  !endif
+
+  !define LangFileString "!insertmacro LANGFILE_SETSTRING"
+
+  !define LANGFILE_SETNAMES
+  !include "${FILENAME}"
+  !undef LANGFILE_SETNAMES
+
+  ;Include default language for missing strings
+  !include "${FILENAME_DEFAULT}"
+  
+  ;Create language strings
+  !undef LangFileString
+  !define LangFileString "!insertmacro LANGFILE_LANGSTRING"
+  !include "${FILENAME_DEFAULT}"
+
+!macroend
+
+!macro LANGFILE IDNAME NAME
+
+  ;Start of standard NSIS language file
+
+  !ifdef LANGFILE_SETNAMES
+
+    !ifdef LANGFILE_IDNAME
+      !undef LANGFILE_IDNAME
+    !endif
+
+    !define LANGFILE_IDNAME "${IDNAME}"
+
+    !ifndef "LANGFILE_${IDNAME}_NAME"
+      !define "LANGFILE_${IDNAME}_NAME" "${NAME}"
+    !endif
+
+  !endif
+
+!macroend
+
+!macro LANGFILE_EXT IDNAME
+
+  ;Start of installer language file
+  
+  !ifdef LANGFILE_SETNAMES
+
+    !ifdef LANGFILE_IDNAME
+      !undef LANGFILE_IDNAME
+    !endif
+
+    !define LANGFILE_IDNAME "${IDNAME}"
+
+  !endif
+
+!macroend
+
+!macro LANGFILE_SETSTRING NAME VALUE
+
+  ;Set define with translated string
+
+  !ifndef ${NAME}
+    !define "${NAME}" "${VALUE}"
+  !endif
+
+!macroend
+
+!macro LANGFILE_LANGSTRING NAME DUMMY
+
+  ;Create a language string from a define and undefine
+
+  LangString "${NAME}" "${LANG_${LANGFILE_IDNAME}}" "${${NAME}}"
+  !undef "${NAME}"
+
+!macroend
+
+!endif
Index: tmp/trunk/org.txm.setups/nsis/Menu/images/site.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Menu/images/site.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Menu/images/line.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Menu/images/line.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Menu/images/header.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Menu/images/header.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Menu/index.html
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Menu/index.html	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Menu/index.html	(revision 728)
@@ -0,0 +1,63 @@
+<html>
+<body link="#0C6E97">
+    <div>
+        <img src="images/header.gif" width="598" height="45"></div>
+    <table border="0">
+        <tr>
+            <td width="20">
+            </td>
+            <td width="190" valign="top">
+                <p>
+                    <font size="+1" color="#333333"><b>Compiler</b></font><br>
+                    <a href="EX:makensisw.exe">Compile NSI scripts</a><br>
+                    <a href="EX:Bin\zip2exe.exe">Installer based on ZIP file</a><br>
+                    <br>
+                    <br>
+                    <br>
+                </p>
+                <p>
+                    <font size="+1" color="#333333"><b>Developer Center</b></font><br>
+                    Many more examples, tutorials, plug-ins and NSIS-releted software are available
+                    at the on-line <a href="EX:http://nsis.sourceforge.net/Developer_Center">Developer Center</a>.
+                </p>
+				</td>
+			<td width="150" valign="top">
+				<p>
+					<font size="+1" color="#333333"><b>Documentation</b></font><br>
+					<a href="EX:NSIS.chm">NSIS Users Manual</a><br>
+					<a href="EX:Examples">Example scripts</a><br>
+					<a href="EX:Docs\Modern UI 2\Readme.html">Modern UI 2</a><br>
+					<a href="EX:Docs\MultiUser\Readme.html">Multi-User Header File</a><br>
+					<a href="EX:Docs\StrFunc\StrFunc.txt">StrFunc Header File</a></p>
+				<p>
+					<font size="+1" color="#333333"><b>On-line help</b></font><br>
+					<a href="EX:http://forums.winamp.com/forumdisplay.php?s=&forumid=65">Forum</a><br>
+					<a href="EX:http://nsis.sourceforge.net/FAQ">FAQ</a><br>
+					<a href="EX:irc://irc.landoleet.org/nsis">IRC Channel</a><br>
+					<a href="EX:http://sourceforge.net/tracker/?group_id=22049&atid=373085">Bug Tracker</a><br>
+			</td>
+			<td valign="top">
+				<p>
+					<font size="+1" color="#333333"><b>Plug-ins</b></font><br>
+					<a href="EX:Docs\AdvSplash\advsplash.txt">AdvSplash</a> - splash with fade in/out<br>
+					<a href="EX:Docs\Banner\Readme.txt">Banner</a> - banner with custom text<br>
+					<a href="EX:Docs\BgImage\BgImage.txt">BgImage</a> - background image<br>
+					<a href="EX:Docs\Dialer\Dialer.txt">Dialer</a> - internet connection<br>
+					<a href="EX:Docs\Math\Math.txt">Math</a> - math operations<br>
+					<a href="EX:Docs\nsDialogs\Readme.html">nsDialogs</a> - custom wizard pages<br>
+					<a href="EX:Docs\nsExec\nsExec.txt">nsExec</a> - launch command line tools<br>
+					<a href="EX:Docs\NSISdl\Readme.txt">NSISdl</a> - download files<br>
+					<a href="EX:Docs\Splash\splash.txt">Splash</a> - splash screen<br>
+					<a href="EX:Docs\StartMenu\Readme.txt">StartMenu</a> - Start Menu folder selection<br>
+					<a href="EX:Docs\System\System.html">System</a> - Windows API calls<br>
+					<a href="EX:Docs\VPatch\Readme.html">VPatch</a> - update existing files</p>
+			</td>
+        </tr>
+    </table>
+    <p>
+        <img src="images/line.gif" width="598" height="3"></p>
+    <div align="right">
+        <a href="EX:http://nsis.sourceforge.net/">
+            <img src="images/site.gif" width="200" height="25"></a></div>
+</body>
+</html>

Property changes on: tmp/trunk/org.txm.setups/nsis/Menu/index.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Unicode/Plugins/AccessControl.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Unicode/Plugins/AccessControl.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Bin/RegTool.bin
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Bin/RegTool.bin
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Bin/zip2exe.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Bin/zip2exe.exe
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Bin/MakeLangId.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Bin/MakeLangId.exe
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Bin/GenPat.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Bin/GenPat.exe
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Bin/LibraryLocal.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Bin/LibraryLocal.exe
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/COPYING
===================================================================
--- tmp/trunk/org.txm.setups/nsis/COPYING	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/COPYING	(revision 728)
@@ -0,0 +1,144 @@
+COPYRIGHT
+---------
+
+Copyright (C) 1995-2015 Contributors
+
+More detailed copyright information can be found in the individual source code files.
+
+APPLICABLE LICENSES
+-------------------
+
+* All NSIS source code, plug-ins, documentation, examples, header files and graphics, with the exception of the compression modules and where otherwise noted, are licensed under the zlib/libpng license.
+
+* The zlib compression module for NSIS is licensed under the zlib/libpng license.
+
+* The bzip2 compression module for NSIS is licensed under the bzip2 license.
+
+* The LZMA compression module for NSIS is licensed under the Common Public License version 1.0.
+
+ZLIB/LIBPNG LICENSE
+-------------------
+
+This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+
+      1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+
+      2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+
+      3. This notice may not be removed or altered from any source distribution.
+
+BZIP2 LICENSE
+-------------
+
+This program, "bzip2" and associated library "libbzip2", are copyright (C) 1996-2000 Julian R Seward. All rights reserved.
+
+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. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+
+      3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+
+      4. 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.
+
+Julian Seward, Cambridge, UK.
+
+jseward@acm.org
+
+COMMON PUBLIC LICENSE VERSION 1.0
+---------------------------------
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+      a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+      b) in the case of each subsequent Contributor:
+
+      i) changes to the Program, and
+
+      ii) additions to the Program;
+
+      where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. 
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+      a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+
+      b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. 
+
+      c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+
+      d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. 
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+      a) it complies with the terms and conditions of this Agreement; and
+
+      b) its license agreement:
+
+      i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; 
+
+      ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; 
+
+      iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+
+      iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. 
+
+When the Program is made available in source code form:
+
+      a) it must be made available under this Agreement; and 
+
+      b) a copy of this Agreement must be included with each copy of the Program. 
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. 
+
+SPECIAL EXCEPTION FOR LZMA COMPRESSION MODULE
+---------------------------------------------
+
+Igor Pavlov and Amir Szekely, the authors of the LZMA compression module for NSIS, expressly permit you to statically or dynamically link your code (or bind by name) to the files from the LZMA compression module for NSIS without subjecting your linked code to the terms of the Common Public license version 1.0. Any modifications or additions to files from the LZMA compression module for NSIS, however, are subject to the terms of the Common Public License version 1.0.
Index: tmp/trunk/org.txm.setups/nsis/Docs/InstallOptions/Changelog.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/InstallOptions/Changelog.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/InstallOptions/Changelog.txt	(revision 728)
@@ -0,0 +1,144 @@
+DLL version 2.47 (4/27/2007)
+* Line breaks support in Link control
+* Added HLine and VLine controls
+
+DLL version 2.46 (3/31/2007)
+* Use installer's name for message boxes
+
+DLL version 2.45 (1/23/2007)
+* Added FOCUS flag for setting focus to a control other than the first
+
+DLL version 2.44 (10/11/2005)
+* Added HWND and HWND2 entries to the INI file to avoid messy calculations of the correct control id
+
+DLL version 2.43 (10/4/2005)
+* Fixed alteration of the working directory by FileRequest
+* Added WS_EX_LEFTSCROLLBAR in RTL mode
+
+DLL version 2.42 (1/21/2005)
+* Added TRANSPARENT flag for BITMAP fields (funded by Chris Morgan)
+
+DLL version 2.41 (8/5/2004)
+* Bitmaps are now automatically centered
+* Fixed a bug which prevented enabling the next button from the leave function of InstallOptions pages
+* Fixed a rare freeze
+
+DLL version 2.4 (1/4/2004)
+* Initial focus is set in "initDialog" making it possible to override it from NSIS prior to calling "show"
+* When initial focus is to a Text field InstallOptions now follows standard Windows behaviour by having the text selected
+* Label and other static fields no longer have State= written to the INI file when leaving the dialog
+* NOTIFY flag can now be used with Link fields (State should be omitted in this case)
+* Likewise, State can now be used with Button fields (behaves the same as with Link fields)
+* NOTIFY flag can also now be used with ListBox and DropList fields to have NSIS notified when the selection changes
+* Meaning of RIGHT flag is now reversed in right-to-left language mode
+* HSCROLL and VSCROLL flags are no longer restricted to Text fields
+* Various Link field fixes
+
+DLL version 2.3 (12/4/2003)
+* Added new control type "Button"
+* Added new flag "NOTIFY"
+* Added new flag "NOWORDWRAP" for multi-line text boxes
+* Reduced size down to 12K
+* Better RTL support
+
+DLL version 2.2 (6/10/2003)
+* Added New control type LINK
+* \r\n converts to newline in Multiline edit box
+* Support for multiline edit box
+* Better tab order in DirRequest and FileRequest
+* Added READONLY option to text box
+* Minor fixes
+
+DLL version 2.1 (3/15/2003)
+* \r\n converts to newline in both label Text and ValidateText
+* New browse dialog style (modern)
+* Word wrapping for check boxes and radio buttons
+* No ugly border for edit fields under XP
+* Scroll bar for list boxes
+* Works with SetStaticBkColor
+* DISABLED dir and file request fields now disable the browse button too
+* No more STATE value for labels
+* Minor fixes
+
+DLL version 2.0 (1/4/2003)
+* Supports custom font and DPI settings (by Joost Verburg)
+* INI files should contain dialog units now, no pixels (by Joost Verburg)
+* RESIZETOFIT flag for Bitmap control (by Amir Szekely)
+* New documentation (by Joost Verburg)
+* New GROUP/NOTABSTOP/DISABLED flags
+
+DLL version 1.7 beta (11/2/2002)
+* Added initDialog and show DLL functions
+
+DLL version 1.6 beta (9/30/2002)
+* CancelConfirmIcon becomes CancelConfirmFlags and can now take the other common MessageBox flags
+
+DLL version 1.5 beta (9/26/2002)
+* Made close [x] button behave like Cancel (thanks brainsucker)
+
+DLL version 1.4 beta (9/4/2002)
+* Added Icon and Bitmap controls (by Amir Szekely)
+
+DLL version 1.3 beta (8/15/2002)
+* Added CancelShow (by ORTIM)
+* Added pixel transformation for widgets (by ORTIM)
+
+DLL version 1.2 beta (7/31/2002)
+* Added CancelEnabled (by ORTIM)
+* Added CancelConfirmCaption and CancelConfirmIcon (by Amir Szekely)
+
+DLL version 1.1 beta (7/22/2002)
+* Font is now taken from the main NSIS window (by Amir Szekely)
+
+DLL version 1.0 beta (12/16/2001)
+* Moved to DLL, no longer need parentwnd ini writing
+* Tons of changes - no longer fully compatible (see source for a big list)
+* removed support for silent installers (it seems the old version would bring up it's own dialog)
+
+version 1.4 (11/18/2001)
+* Added Listbox controls.
+* Added MULTISELECT flag.
+* Made the HWND list for the parent window controls dynamically allocated. This prevents a crash if NSIS ever gets more than 150 controls on it's main window.
+* The TEXT property of DirRequest control can be used to specify an initial directory. The current directory is automatically selected when clicking the browse button of the DirRequest control.
+* Added ROOT property to DirRequest which can be used to set the root directory (mostly due to felfert)
+* Edit controls will now auto scroll (thanks felfert)
+* Fixed a problem where the window wouldn't draw properly on some systems (thanks felfert)
+
+version 1.3 (11/03/2001)
+* Got rid of the call to RedrawWindow() because it's no longer needed with the WS_CLIPCHILDREN flag for NSIS.
+* Removed a few hardcoded limits of buffer sizes
+* Added Checkbox and RadioButton controls
+* Added RIGHT and CHECKED flags
+
+version 1.2.2 (10/30/2001)
+* Additional size reductions. Further reduced the size down to 8k.
+* The text parameter to a combobox can now be used to specify the initial value
+* Changed from InvalidateRect() to RedrawWindow() to force a redraw after a browse dialog
+* On startup, set the flags of the NSIS window to include WS_CLIPCHILDREN. Otherwise, our controls don't get drawn right.
+
+version 1.2.1 (10/28/2001)
+* Bug fix. ControlID for the caption and the OK button were reused by the first two controls. (Thanks Schultz)
+
+version 1.2j (10/28/2001)
+* 8.5kb from 44kb. heh. (by Justin Frankel)
+
+version 1.2 (10/28/2001)
+* Still 44k
+* Added the "FileRequest" and "DirRequest" control types (thanks Schultz)
+* Added "MinLen", "MaxLen", and "ValidateText" properties to fields
+* Added "Flags" as a way to specify additional parameters for controls
+* Few more changes to the documentation
+* Cleaned the code in a few places...still trying to make it smaller
+
+version 1.1 (10/27/2001)
+* Added the "Title" option (thanks Alex)
+* Moved the OK button so it is in the same location as the buttons on the main NSIS window (thanks Alex)
+* Pressing "ENTER" will now automatically select the OK button (thanks Alex)
+* Slightly improved the documentation
+
+version 1.01 (10/25/2001)
+* Fixed the SetFocus loop so it exits after the first control like it was supposed to
+* Added the license to the documentation
+
+version 1.0 (10/25/2001)
+* Barely qualifies as a distribution

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/InstallOptions/Changelog.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/InstallOptions/Readme.html
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/InstallOptions/Readme.html	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/InstallOptions/Readme.html	(revision 728)
@@ -0,0 +1,907 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <title>InstallOptions 2</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
+    <style type="text/css">
+        /*<![CDATA[*/body
+        {
+            padding: 10px;
+            background-color: #F0F0F0;
+            font-family: Verdana, Arial, Helvetica, sans-serif;
+            font-size: 13px;
+            font-weight: normal;
+            text-align: left;
+        }
+        p, li
+        {
+            font-size: 13px;
+        }
+        .center
+        {
+            text-align: center;
+        }
+        table
+        {
+            margin: auto;
+            font-size: 13px;
+            background-color: #FFFFFF;
+        }
+        .maintable
+        {
+            border: 2px solid #376EAB;
+        }
+        .parameter
+        {
+            font-weight: bold;
+            color: #6586AC;
+        }
+        h1
+        {
+            font-size: 30px;
+            color: #333333;
+            font-weight: normal;
+            text-align: center;
+            margin-top: 20px;
+        }
+        h2
+        {
+            font-size: 20px;
+            color: #7A7272;
+            font-weight: normal;
+        }
+        h3
+        {
+            font-size: 17px;
+            font-weight: bold;
+            color: #303030;
+        }
+        pre
+        {
+            font-size: 13px;
+        }
+        div
+        {
+            margin: 20px;
+        }
+        a:link, a:visited, a:active
+        {
+            color: #294F75;
+            text-decoration: none;
+        }
+        a:hover
+        {
+            color: #182634;
+            text-decoration: underline;
+        }
+        .subtable
+        {
+            border: 0px;
+            margin-left: 20px;
+            margin-right: 20px;
+        }
+        .lefttable
+        {
+            background-color: #CCCCCC;
+            vertical-align: top;
+        }
+        .righttable
+        {
+            background-color: #EEEEEE;
+            vertical-align: top;
+        }
+        /*]]>*/</style>
+</head>
+<body>
+    <table width="750" class="maintable" cellspacing="0" cellpadding="0" align="center">
+        <tr>
+            <td>
+                <h1>
+                    InstallOptions 2</h1>
+                <div>
+                    <p>
+                        The InstallOptions plug-in is deprecated. For new scripts, it is recommended to
+                        use the new nsDialogs plug-in instead.</p>
+                </div>
+                <div>
+                    <h2>
+                        Introduction</h2>
+                    <div>
+                        <p>
+                            InstallOptions is an NSIS plugin which allows you to create custom pages for NSIS
+                            installers, to prompt the user for extra information.</p>
+                        <p>
+                            The dialogs created by InstallOptions are based on INI files which define the controls
+                            on the dialog and their properties. These INI files can be modified from the script
+                            to adjust the dialogs on runtime.</p>
+                        <p>
+                            The format of INI files is described in a <a href="http://en.wikipedia.org/wiki/Ini_file">
+                                Wikipedia article</a>.</p>
+                    </div>
+                    <h2>
+                        INI file structure</h2>
+                    <div>
+                        <p>
+                            The INI file has one required section. This section includes the number of controls
+                            to be created as well as general window attributes. The INI file also includes a
+                            variable number of Field sections which are used to create the controls to be displayed.</p>
+                        <p>
+                            The required section is named &quot;<em>Settings</em>&quot;. It can contain the
+                            following values:</p>
+                        <table class="subtable">
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>NumFields</strong></td>
+                                <td class="lefttable">
+                                    <em>(required)</em></td>
+                                <td class="righttable">
+                                    The number of control elements to be displayed on the dialog window.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>Title</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    If specified, gives the text to set the titlebar to. Otherwise, the titlebar text
+                                    is not changed.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>CancelEnabled</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    If specified, overrides NSIS settings and enables or disables the cancel button.
+                                    If set to 1, the cancel button will be enabled. If set to 0, the cancel button will
+                                    be disabled.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>CancelShow</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    If specified, overrides NSIS settings and shows or hides the cancel button If set
+                                    to 1, the cancel button will be shown. If set to 0, the cancel button will be hidden.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>BackEnabled</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    If specified, overrides NSIS settings and enables or disables the back button. If
+                                    set to 1, the back button will be enabled. If set to 0, the back button will be
+                                    disabled.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>CancelButtonText</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    Overrides the text for the cancel button. If not specified, the cancel button text
+                                    will not be changed.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>NextButtonText</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    Overrides the text for the next button. If not specified, the next button text will
+                                    not be changed.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>BackButtonText</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    Overrides the text for the back button. If not specified, the back button text will
+                                    not be changed.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>Rect</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    Overrides the default rect ID to run over. This will make IO resize itself according
+                                    to a different rect than NSIS's dialogs rect.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>RTL</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    If 1 is specified the dialog will be mirrored and all texts will be aligned to the
+                                    right. The INSTALLOPTIONS_EXTRACT macros automatically set this field to the right
+                                    value for the current installer language as given by the NSIS string $(^RTL).</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>State</strong></td>
+                                <td class="lefttable">
+                                    <em>(output)</em></td>
+                                <td class="righttable">
+                                    This is not something you have to supply yourself but is set by InstallOptions,
+                                    before calling your custom page validation function, to the field number of the
+                                    custom Button control (or other control having the Notify flag) the user pressed,
+                                    if any.</td>
+                            </tr>
+                        </table>
+                        <p>
+                            Each field section has the heading &quot;Field #&quot; where # must be sequential
+                            numbers from 1 to NumFields. Each Field section can contain the following values:</p>
+                        <table class="subtable">
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>Type</strong></td>
+                                <td class="lefttable">
+                                    <em>(required)</em></td>
+                                <td class="righttable">
+                                    Type of control to be created. Valid values are &quot;<em>Label</em>&quot;, &quot;<em>Text</em>&quot;,
+                                    &quot;<em>Password</em>&quot;, &quot;<em>Combobox</em>&quot;, &quot;<em>DropList</em>&quot;,
+                                    &quot;<em>Listbox</em>&quot;, &quot;<em>CheckBox</em>&quot;, &quot;<em>RadioButton</em>&quot;,
+                                    &quot;<em>FileRequest</em>&quot;, &quot;<em>DirRequest</em>&quot; &quot;<em>Icon</em>&quot;,
+                                    &quot;<em>Bitmap</em>&quot;, &quot;<em>GroupBox</em>&quot;, &quot;<em>HLine</em>&quot;,
+                                    &quot;<em>VLine</em>&quot;, &quot;<em>Link</em>&quot; or &quot;<em>Button</em>&quot;.<br />
+                                    <br />
+                                    A &quot;<em>Label</em>&quot; is used to display static text. (i.e. a caption for
+                                    a textbox)<br />
+                                    A &quot;<em>Text</em>&quot; and &quot;<em>Password</em>&quot; accept text input
+                                    from the user. &quot;<em>Password</em>&quot; masks the input with * characters.<br />
+                                    A &quot;<em>Combobox</em>&quot; allows the user to type text not in the popup list,
+                                    a &quot;<em>Droplist</em>&quot; only allows selection of items in the list.<br />
+                                    A &quot;<em>Listbox</em>&quot; shows multiple items and can optionally allow the
+                                    user to select more than one item.<br />
+                                    A &quot;<em>CheckBox</em>&quot; control displays a check box with label.<br />
+                                    A &quot;<em>RadioButton</em>&quot; control displays a radio button with label.<br />
+                                    A &quot;<em>FileRequest</em>&quot; control displays a textbox and a browse button.
+                                    Clicking the browse button will display a file requester where the user can browse
+                                    for a file.<br />
+                                    A &quot;<em>DirRequest</em>&quot; control displays a textbox and a browse button.
+                                    Clicking the browse button will display a directory requester where the user can
+                                    browse for a directory.<br />
+                                    An &quot;<em>Icon</em>&quot; control displays an icon. Use no Text to use the installer
+                                    icon.<br />
+                                    A &quot;<em>Bitmap</em>&quot; control displays a bitmap.<br />
+                                    A &quot;<em>GroupBox</em>&quot; control displays a frame to group controls.<br />
+                                    A &quot;<em>HLine</em>&quot; control displays a horizontal line to separate controls.<br />
+                                    A &quot;<em>VLine</em>&quot; control displays a vertical line to separate controls.<br />
+                                    A &quot;<em>Link</em>&quot; control displays a static hot text. When the user clicks
+                                    the control the contents of <strong>State</strong> (e.g. http://...) will be executed
+                                    using ShellExecute. Alternatively <strong>State</strong> can be omitted and the
+                                    <em>NOTIFY</em> flag used to have your NSIS script called. See the &quot;<em>NOTIFY</em>&quot;
+                                    flag below for more information.<br />
+                                    A &quot;<em>Button</em>&quot; control displays a push button that can be used in
+                                    the same way as the &quot;<em>Link</em>&quot; control above.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>Text</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    Specifies the caption of a label, checkbox, or radio button control. For DirRequest
+                                    control this specifies the title of the browse dialog. For icon and bitmaps control
+                                    this specifies the path to the image.<br />
+                                    <br />
+                                    <strong>Note:</strong> For labels, \r\n will be converted to a newline. To use a
+                                    back-slash in your text you have to escape it using another back-slash - \\. Described
+                                    <a href="#escaping">below</a> are NSIS functions for converting text to/from this
+                                    format.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>State</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    Specifies the state of the control. This is updated when the user closes the window,
+                                    so you can read from it from NSIS. For edit texts and dir and file request boxes,
+                                    this is the string that is specified. For radio button and check boxes, this can
+                                    be '0' or '1' (for unchecked or checked). For list boxes, combo boxes and drop lists
+                                    this is the selected items separated by pipes ('|'). For Links and Buttons this
+                                    can specify something to be executed or opened (using ShellExecute).<br />
+                                    <br />
+                                    <strong>Note:</strong> For Text fields with the MULTILINE flag, \r\n will be converted
+                                    to a newline. To use a back-slash in your text you have to escape it using another
+                                    back-slash - \\. Described <a href="#escaping">below</a> are NSIS functions for
+                                    converting text to/from this format.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>ListItems</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    A list of items to display in a combobox, droplist, or listbox.<br />
+                                    This is a single line of text with each item separated by a pipe character '|'</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>MaxLen</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    Causes validation on the selected control to limit the maximum length of text.<br />
+                                    If the user specifies more text than this, a message box will appear when they click
+                                    &quot;OK&quot; and the dialog will not be dismissed.<br />
+                                    You should not use this on a &quot;<em>combobox</em>&quot; since the user can not
+                                    control what is selected.<br />
+                                    This should be set to a maximum of 260 for &quot;<em>FileRequest</em>&quot; and
+                                    &quot;<em>DirRequest</em>&quot; controls.<br />
+                                    Ignored on &quot;<em>Label</em>&quot; controls.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>MinLen</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    Causes validation on the selected control to force the user to enter a minimum amount
+                                    of text.<br />
+                                    If the user specifies less text than this, a message box will appear when they click
+                                    &quot;OK&quot; and the dialog will not be dismissed.<br />
+                                    Unlike MaxLen, this is useful for &quot;<em>Combobox</em>&quot; controls. By setting
+                                    this to a value of &quot;1&quot; the program will force the user to select an item.<br />
+                                    Ignored on &quot;<em>Label</em>&quot; controls.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>ValidateText</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    If the field fails the test for &quot;<em>MinLen</em>&quot; or &quot;<em>MaxLen</em>&quot;,
+                                    a messagebox will be displayed with this text.<br />
+                                    <br />
+                                    <strong>Note:</strong> \r\n will be converted to a newline, two back-slashes will
+                                    be converted to one - \\. Described <a href="#escaping">below</a> are NSIS functions
+                                    for converting text to/from this format.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>Left<br />
+                                        Right<br />
+                                        Top<br />
+                                        Bottom</strong></td>
+                                <td class="lefttable">
+                                    <em>(required)</em></td>
+                                <td class="righttable">
+                                    The position on the dialog where this control appears. All sizes should be set in
+                                    dialog units. To get the right dimensions for your controls, design your dialog
+                                    using a resource editor and copy the dimensions to the INI file.<br />
+                                    <br />
+                                    <strong>Note:</strong> You can specify negative coordinates to specify the distance
+                                    from the right or bottom edge.<br />
+                                    <br />
+                                    <strong>Note (2):</strong> For combobox or droplist, the &quot;<em>bottom</em>&quot;
+                                    value is not used in the same way.<br />
+                                    In this case, the bottom value is the maximum size of the window when the pop-up
+                                    list is being displayed. All other times, the combobox is automatically sized to
+                                    be one element tall. If you have trouble where you can not see the combobox drop-down,
+                                    then check the bottom value and ensure it is large enough. A rough guide for the
+                                    height required is the number of items in the list multiplied by 8, plus 20.<br />
+                                    <br />
+                                    <strong>Note (3):</strong> FileRequest and DirRequest controls will allocate 15
+                                    dialog units to the browse button. Make this control wide enough the contents of
+                                    the textbox can be seen.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>Filter</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    Specifies the filter to be used in the &quot;<em>FileRequest</em>&quot; control.<br />
+                                    This is constructed by putting pairs of entries together, each item separated by
+                                    a | character.<br />
+                                    The first value in each pair is the text to display for the filter.<br />
+                                    The second value is the pattern to use to match files.<br />
+                                    For example, you might specify:<br />
+                                    Filter=Text Files|*.txt|Programs|*.exe;*.com|All Files|*.*<br />
+                                    If not specified, then the filter defaults to All Files|*.*<br />
+                                    <br />
+                                    <strong>Note:</strong> you should not put any extra spaces around the | characters.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>Root</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    Used by <strong>DirRequest</strong> controls to specify the root directory of the
+                                    search. By default, this allows the user to browse any directory on the computer.
+                                    This will limit the search to a particular directory on the system.</td>
+                            </tr>
+                            <tr>
+                                <td class="lefttable">
+                                    <strong>Flags</strong></td>
+                                <td class="lefttable">
+                                    <em>(optional)</em></td>
+                                <td class="righttable">
+                                    This specifies additional flags for the display of different controls. Each value
+                                    should be separated by a | character, and you should be careful not to put any spaces
+                                    around the | character.<br />
+                                    <table class="righttable">
+                                        <tr>
+                                            <td class="righttable">
+                                                <strong>Value</strong></td>
+                                            <td class="righttable">
+                                                <strong>Meaning</strong></td>
+                                        </tr>
+                                        <tr>
+                                            <td class="righttable">
+                                                REQ_SAVE</td>
+                                            <td class="righttable">
+                                                This causes &quot;<em>FileRequest</em>&quot; controls to display a Save As dialog.
+                                                If not specified, an Open dialog is used.</td>
+                                        </tr>
+                                        <tr>
+                                            <td class="righttable">
+                                                FILE_MUST_EXIST</td>
+                                            <td class="righttable">
+                                                Used by &quot;<em>FileRequest</em>&quot; to determine if the selected file must
+                                                exist.<br />
+                                                This only applies if an &quot;Open&quot; dialog is being displayed.<br />
+                                                This currently does not force the file to exist other than through the browse button.</td>
+                                        </tr>
+                                        <tr>
+                                            <td class="righttable">
+                                                FILE_EXPLORER</td>
+                                            <td class="righttable">
+                                                Used by &quot;<em>FileRequest</em>&quot;, enables new file request look (recommended)</td>
+                                        </tr>
+                                        <tr>
+                                            <td class="righttable">
+                                                FILE_HIDEREADONLY</td>
+                                            <td class="righttable">
+                                                Used by &quot;<em>FileRequest</em>&quot;, hides &quot;open read only&quot; checkbox
+                                                in open dialog.</td>
+                                        </tr>
+                                        <tr>
+                                            <td class="righttable">
+                                                WARN_IF_EXIST</td>
+                                            <td class="righttable">
+                                                Used by &quot;<em>FileRequest</em>&quot; to display a warning message if the selected
+                                                file already exists.<br />
+                                                The warning message is only displayed for files selected with the browse button.</td>
+                                        </tr>
+                                        <tr>
+                                            <td class="righttable">
+                                                PATH_MUST_EXIST</td>
+                                            <td class="righttable">
+                                                Used by &quot;<em>FileRequest</em>&quot; to force the path to exist. Prevents the
+                                                user from typing a non-existent path into the browse dialog window.<br />
+                                                This only validates path's selected with the browse button.</td>
+                                        </tr>
+                                        <tr>
+                                            <td class="righttable">
+                                                PROMPT_CREATE</td>
+                                            <td class="righttable">
+                                                Used by &quot;<em>FileRequest</em>&quot; to display a warning if the selected file
+                                                does not exist. However, it still allows the user to select the file.<br />
+                                                This only displays the warning for files selected with the browse button.<br />
+                                                Doesn't work along with REQ_SAVE.</td>
+                                        </tr>
+                                        <tr>
+                                            <td class="righttable">
+                                                RIGHT</td>
+                                            <td class="righttable">
+                                                Used by &quot;<em>Checkbox</em>&quot; and &quot;<em>Radiobutton</em>&quot; controls
+                                                to specify you want the checkbox to the right of the text instead of the left as
+                                                is the default.</td>
+                                        </tr>
+                                        <tr>
+                                            <td class="righttable">
+                                                MULTISELECT</td>
+                                            <td class="righttable">
+                                                Used by &quot;<em>Listbox</em>&quot; controls. Turns string selection on or off
+                                                each time the user clicks or double-clicks a string in the list box. The user can
+                                                select any number of strings. If this flag and EXTENDEDSELCT are not specified,
+                                                only one item can be selected from the list.</td>
+                                        </tr>
+                                        <tr>
+                                            <td class="righttable">
+                                                EXTENDEDSELCT</td>
+                                            <td class="righttable">
+                                                Used by &quot;<em>Listbox</em>&quot; controls. Allows multiple items to be selected
+                                                by using the SHIFT key and the mouse or special key combinations. If this flag and
+                                                MULTISELECT are not specified, only one item can be selected from the list.</td>
+                                        </tr>
+                                        <tr>
+                                            <td class="righttable">
+                                                RESIZETOFIT</td>
+                                            <td class="righttable">
+                                                This causes &quot;<em>Bitmap</em>&quot; controls to resize the image to the size
+                                                of the control. Also useful to support custom DPI settings. Without this, the image
+                                                will be centered within the specified area.</td>
+                                        </tr>
+                                        <td class="righttable">
+                                            TRANSPARENT</td>
+                                        <td class="righttable">
+                                            Used by &quot;<em>Bitmap</em>&quot; controls. Hides every pixel with the same color
+                                            as of the top left pixel. This allows to see-through to controls behind it. This
+                                            flag doesn't work well with a combination of the RESIZETOFIT flag and bitmaps with
+                                            more than 256 colors.</td>
+                            </tr>
+                            <tr>
+                                <td class="righttable">
+                                    GROUP</td>
+                                <td class="righttable">
+                                    Add this flag to the first control of a group of controls to group them. Grouping
+                                    controls allows you to create multiple groups of radio button and makes keyboard
+                                    navigation using arrow keys easier.</td>
+                            </tr>
+                            <tr>
+                                <td class="righttable">
+                                    FOCUS</td>
+                                <td class="righttable">
+                                    Sets focus on the specified control, instead of the first focusable control. If
+                                    more than one field is specified with this flag, only the first one will receive
+                                    focus.</td>
+                            </tr>
+                            <tr>
+                                <td class="righttable">
+                                    NOTABSTOP</td>
+                                <td class="righttable">
+                                    Do not stop on the control when the user pressed the Tab key. Add NOTABSTOP to all
+                                    controls of a group except the first one to allow navigation between groups with
+                                    the Tab key.</td>
+                            </tr>
+                            <tr>
+                                <td class="righttable">
+                                    DISABLED</td>
+                                <td class="righttable">
+                                    Causes a control to be disabled.</td>
+                            </tr>
+                            <tr>
+                                <td class="righttable">
+                                    ONLY_NUMBERS</td>
+                                <td class="righttable">
+                                    Used by &quot;<em>Text</em>&quot; controls. Forces the user to enter only numbers
+                                    into the edit box.</td>
+                            </tr>
+                            <tr>
+                                <td class="righttable">
+                                    MULTILINE</td>
+                                <td class="righttable">
+                                    Used by &quot;<em>Text</em>&quot; controls. Causes the control to accept multiple-lines.</td>
+                            </tr>
+                            <tr>
+                                <td class="righttable">
+                                    WANTRETURN</td>
+                                <td class="righttable">
+                                    Used by &quot;<em>Text</em>&quot; controls with multiple-line. Specifies that a
+                                    carriage return be inserted when the user presses the ENTER key while entering text
+                                    into the text box.</td>
+                            </tr>
+                            <tr>
+                                <td class="righttable">
+                                    NOWORDWRAP</td>
+                                <td class="righttable">
+                                    Used by &quot;<em>Text</em>&quot; controls with multiple-line. Disables the word-wrap
+                                    that occurs when long lines are entered. Long lines instead scroll off to the side.
+                                    Specifying the HSCROLL flag also has this effect.</td>
+                            </tr>
+                            <tr>
+                                <td class="righttable">
+                                    HSCROLL</td>
+                                <td class="righttable">
+                                    Show a horizontal scrollbar. When used by &quot;<em>Text</em>&quot; controls with
+                                    multiple-lines this also disables word-wrap.</td>
+                            </tr>
+                            <tr>
+                                <td class="righttable">
+                                    VSCROLL</td>
+                                <td class="righttable">
+                                    Show a vertical scrollbar.</td>
+                            </tr>
+                            <tr>
+                                <td class="righttable">
+                                    READONLY</td>
+                                <td class="righttable">
+                                    Used by &quot;<em>Text</em>&quot; controls. Prevents the user from entering or editing
+                                    text in the edit control, but allow the user to select and copy the text.</td>
+                            </tr>
+                            <tr>
+                                <td class="righttable">
+                                    NOTIFY</td>
+                                <td class="righttable">
+                                    Used by &quot;<em>Button</em>&quot;, &quot;<em>Link</em>&quot;, &quot;<em>CheckBox</em>&quot;,
+                                    &quot;<em>RadioButton</em>&quot;, &quot;<em>ListBox</em>&quot; and &quot;<em>DropList</em>&quot;
+                                    controls. Causes InstallOptions to call your NSIS custom page validation/leave function
+                                    whenever the control's selection changes. Your validation/leave function can read
+                                    the &quot;<em>State</em>&quot; value from the &quot;<em>Settings</em>&quot; section
+                                    to determine which control caused the notification, if any, and perform some appropriate
+                                    action followed by an Abort instruction (to tell NSIS to return to the page). The
+                                    Examples\InstallOptions folder contains an example script showing how this might
+                                    be used.</td>
+                            </tr>
+                        </table>
+            </td>
+        </tr>
+        <tr>
+            <td class="lefttable">
+                <strong>TxtColor</strong></td>
+            <td class="lefttable">
+                <em>(optional)</em></td>
+            <td class="righttable">
+                Used by <strong>Link</strong> controls to specify the foreground color of the text.
+                Format: 0xBBGGRR (hexadecimal).</td>
+        </tr>
+        <tr>
+            <td class="lefttable">
+                <strong>HWND<br>
+                    HWND2</strong></td>
+            <td class="lefttable">
+                <em>(output)</em></td>
+            <td class="righttable">
+                After initDialog returns, this will contain the HWND of the control created by this
+                field. It can be used instead of FindWindow and GetDlgItem. HWND2 contains the HWND
+                of an additional control, such as the browse button.</td>
+        </tr>
+    </table>
+    </div>
+    <h2>
+        Header file</h2>
+    <div>
+        <p>
+            The InstallOptions header files provides macros and functions to easily create custom
+            dialogs. You can include it on the top of your script as follows:
+            <pre>
+!include InstallOptions.nsh
+</pre>
+    </div>
+    <h2>
+        Creating dialogs</h2>
+    <div>
+        <h3>
+            Extracting the INI file</h3>
+        <div>
+            <p>
+                First, you have to extract your InstallOptions INI files in the .onInit function
+                (or un.onInit for the uninstaller) using the INSTALLOPTIONS_EXTRACT macro. The files
+                will be extracted to a temporary folder (the NSIS plug-ins folder) that is automatically
+                created.</p>
+            <pre>
+Function .onInit
+  !insertmacro INSTALLOPTIONS_EXTRACT &quot;ioFile.ini&quot;
+FunctionEnd
+</pre>
+            <p>
+                If the INI file is located in another directory, use INSTALLOPTIONS_EXTRACT_AS.
+                The second parameter is the filename in the temporary folder, which is the filename
+                that should be used as input for the other macros.</p>
+            <pre>
+Function .onInit
+  !insertmacro INSTALLOPTIONS_EXTRACT_AS &quot;..\ioFile.ini&quot; &quot;ioFile.ini&quot;
+FunctionEnd
+</pre>
+        </div>
+        <h3>
+            Displaying the dialog</h3>
+        <div>
+            <p>
+                You can call InstallOptions in a page function defined with the Page or UninstPage
+                command. Check the NSIS documentation (Scripting Reference -&gt; Pages) for information
+                about the page system.</p>
+            <pre>
+Page custom CustomPageFunction</pre>
+            <p>
+                To display the dialog, use the INSTALLOPTIONS_DISPLAY macro:<pre>
+Function CustomPageFunction ;Function name defined with Page command
+  !insertmacro INSTALLOPTIONS_DISPLAY &quot;ioFile.ini&quot;
+FunctionEnd
+</pre>
+        </div>
+    </div>
+    <h2>
+        User input</h2>
+    <div>
+        <p>
+            To get the input of the user, read the State value of a Field using the INSTALLOPTIONS_READ
+            macro:</p>
+        <pre>
+!insertmacro INSTALLOPTIONS_READ $VAR &quot;ioFile.ini&quot; &quot;Field #&quot; &quot;Name&quot;
+</pre>
+    </div>
+    <h2>
+        Writing to INI files</h2>
+    <div>
+        <p>
+            The INSTALLOPTIONS_WRITE macro allows you to write values to the INI file to change
+            texts or control settings on runtime:
+            <pre>
+!insertmacro INSTALLOPTIONS_WRITE &quot;ioFile.ini&quot; &quot;Field #&quot; &quot;Name&quot; &quot;Value&quot;
+</pre>
+    </div>
+    <h2>
+        Escaped values</h2>
+    <div>
+        <p>
+            Some InstallOptions values are escaped (in a similar manner to &quot;C&quot; strings)
+            to allow characters to be used that are not normally valid in INI file values. The
+            affected values are:</p>
+        <ul>
+            <li>The ValidateText field</li>
+            <li>The Text value of Label fields</li>
+            <li>The State value of Text fields that have the MULTILINE flag</li>
+        </ul>
+        <p>
+            The escape character is the back-slash character (&quot;\&quot;) and the available
+            escape sequences are:</p>
+        <table class="subtable">
+            <tr>
+                <td class="lefttable">
+                    &quot;\\&quot;</td>
+                <td class="righttable">
+                    Back-slash</td>
+            </tr>
+            <tr>
+                <td class="lefttable">
+                    &quot;\r&quot;</td>
+                <td class="righttable">
+                    Carriage return (ASCII 13)</td>
+            </tr>
+            <tr>
+                <td class="lefttable">
+                    &quot;\n&quot;</td>
+                <td class="righttable">
+                    Line feed (ASCII 10)</td>
+            </tr>
+            <tr>
+                <td class="lefttable">
+                    &quot;\t&quot;</td>
+                <td class="righttable">
+                    Tab (ASCII 9)</td>
+            </tr>
+        </table>
+        <p>
+            The INSTALLOPTIONS_READ_CONVERT and INSTALLOPTIONS_WRITE_CONVERT macros automatically
+            convert these characters in installer code. In uninstaller code, use INSTALLOPTIONS_READ_UNCONVERT
+            and INSTALLOPTIONS_WRITE_UNCONVERT.</p>
+        <p>
+            To use these macros in your script, the conversion functions need to be included:</p>
+        <pre>
+;For INSTALLOPTIONS_READ_CONVERT
+  !insertmacro INSTALLOPTIONS_FUNCTION_READ_CONVERT
+;For INSTALLOPTIONS_WRITE_CONVERT
+  !insertmacro INSTALLOPTIONS_FUNCTION_WRITE_CONVERT
+;For INSTALLOPTIONS_READ_UNCONVERT
+  !insertmacro INSTALLOPTIONS_UNFUNCTION_READ_CONVERT
+;For INSTALLOPTIONS_WRITE_UNCONVERT
+  !insertmacro INSTALLOPTIONS_UNFUNCTION_WRITE_CONVERT
+</pre>
+    </div>
+    <h2>
+        Input validation</h2>
+    <div>
+        <p>
+            To validate the user input (for example, to check whether the user has filled in
+            a textbox) use the leave function of the Page command and Abort when the validation
+            has failed:</p>
+        <pre>
+Function ValidateCustom
+
+  !insertmacro INSTALLOPTIONS_READ $R0 "test.ini" "Field 1" "State"
+  StrCmp $R0 "" 0 +3
+    MessageBox MB_ICONEXCLAMATION|MB_OK "Please enter your name."
+    Abort
+
+FunctionEnd
+</pre>
+    </div>
+    <h2>
+        Return value</h2>
+    <div>
+        After a dialog is created (using display or show), a return value is available:</p>
+        <ul>
+            <li>success - The user has pressed the Next button</li>
+            <li>back - The user has pressed the Back button</li>
+            <li>cancel - The user has pressed the Cancel button</li>
+            <li>error - An error has occurred, the dialog cannot be displayed.</li>
+        </ul>
+        <p>
+            You only have to check this value if you need something really special, such as
+            doing something when the user pressed the Back button.</p>
+        <p>
+            If you need the return value, use the INSTALLOPTIONS_DISPLAY_RETURN or INSTALLOPTIONS_SHOW_RETURN
+            macro. The return value will be added to the stack, so you can use the Pop command
+            to get it.</p>
+    </div>
+    <h2>
+        Reserve files</h2>
+    <div>
+        <p>
+            When using solid compression, it's important that files which are being extracted
+            in user interface functions are located before other files in the data block. Otherwise
+            there may be a delay before a page can be displayed.</p>
+        <p>
+            To ensure that this is the case, add ReserveFile commands for InstallOptions and
+            the INI files before all sections and functions:</p>
+        <pre>
+ReserveFile &quot;test.ini&quot;
+ReserveFile &quot;${NSISDIR}\Plugins\InstallOptions.dll&quot;
+</pre>
+    </div>
+    <h2>
+        Fonts and colors</h2>
+    <div>
+        <p>
+            To customize fonts or colors on InstallOptions dialogs, the INSTALLOPTIONS_INITDIALOG
+            and INSTALLOPTIONS_SHOW macro can be used.</p>
+        <p>
+            INSTALLOPTIONS_INITDIALOG creates the dialog in memory, but does not show it. After
+            inserting this macro, you can set the fonts and colors, and then insert INSTALLOPTIONS_SHOW
+            to show the dialog.</p>
+        <p>
+            The INSTALLOPTIONS_INITDIALOG macro also pushes the HWND of the custom dialog to
+            the stack. Control HWND's are available for each control in the HWND entry of the
+            corresponding field in the INI file.</p>
+        <p>
+            Example of using a custom font:</p>
+        <pre>
+Var HWND
+Var DLGITEM
+Var FONT
+
+Function FunctionName ;FunctionName defined with Page command
+
+  !insertmacro INSTALLOPTIONS_INITDIALOG &quot;ioFile.ini&quot;
+  Pop $HWND ;HWND of dialog
+    
+  !insertmacro INSTALLOPTIONS_READ $DLGITEM &quot;ioFile.ini&quot; &quot;Field 1&quot; &quot;HWND&quot;
+    
+  ;$DLGITEM contains the HWND of the first field
+  CreateFont $FONT &quot;Tahoma&quot; 10 700 
+  SendMessage $DLGITEM ${WM_SETFONT} $FONT 0
+        
+  !insertmacro INSTALLOPTIONS_SHOW
+
+FunctionEnd
+</pre>
+    </div>
+    <h2>
+        Credits</h2>
+    <div>
+        <p>
+            Original version by Michael Bishop<br />
+            DLL version by Nullsoft, Inc.<br />
+            DLL version 2 by Amir Szekely, ORTIM, Joost Verburg<br />
+            New documentation by Joost Verburg</p>
+    </div>
+    <h2>
+        License</h2>
+    <div>
+        <pre>
+Original version Copyright &copy; 2001 Michael Bishop
+DLL version 1 Copyright &copy; 2001-2002 Nullsoft, Inc., ORTIM
+DLL version 2 Copyright &copy; 2003-2015 Amir Szekely, Joost Verburg, Dave Laundon
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute
+it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented;
+   you must not claim that you wrote the original software.
+   If you use this software in a product, an acknowledgment in the
+   product documentation would be appreciated but is not required.
+2. Altered versions must be plainly marked as such,
+   and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any distribution.
+</pre>
+    </div>
+    </div> </td> </tr> </table>
+</body>
+</html>

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/InstallOptions/Readme.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/License.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/License.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/License.txt	(revision 728)
@@ -0,0 +1,10 @@
+Copyright 2002-2015 Joost Verburg
+
+This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
+   If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any distribution.

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/License.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/Readme.html
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/Readme.html	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/Readme.html	(revision 728)
@@ -0,0 +1,1154 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <title>NSIS Modern User Interface - Documentation</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
+    <style type="text/css">
+        /*<![CDATA[*/body
+        {
+            padding: 10px;
+            background-color: #F0F0F0;
+            font-size: 13px;
+            font-family: Verdana, Arial, Helvetica, sans-serif;
+            font-weight: normal;
+            text-align: justify;
+        }
+        p, li
+        {
+            font-size: 13px;
+        }
+        table
+        {
+            margin: auto;
+            background-color: #FFFFFF;
+        }
+        .maintable
+        {
+            border: 2px solid #376EAB;
+        }
+        .parameter
+        {
+            font-weight: bold;
+            color: #6586AC;
+        }
+        h1
+        {
+            font-size: 20px;
+            color: #7A7272;
+            font-weight: normal;
+        }
+        h2
+        {
+            font-size: 17px;
+            font-weight: bold;
+            color: #303030;
+        }
+        h3
+        {
+            font-size: 14px;
+            font-weight: bold;
+            color: #2B5885;
+        }
+        pre
+        {
+            font-size: 13px;
+        }
+        div
+        {
+            margin: 20px;
+        }
+        div.settings
+        {
+            margin-right: 0;
+        }
+        a:link, a:visited, a:active
+        {
+            color: #294F75;
+            text-decoration: none;
+        }
+        a:hover
+        {
+            color: #182634;
+            text-decoration: underline;
+        }
+        .trigger
+        {
+            cursor: pointer;
+            cursor: hand;
+            height: 14px;
+        }
+        .toggle
+        {
+            display: none;
+        }
+        .options
+        {
+            text-align: center;
+            cursor: pointer;
+            cursor: hand;
+            color: #294F75;
+        }
+        /*]]>*/</style>
+
+    <script type="text/javascript">
+//<![CDATA[
+
+   var image_open = new Image();
+   image_open.src = "images/open.gif";
+   var image_closed = new Image();
+   image_closed.src = "images/closed.gif";
+   
+   function toggle(image, section) {
+   
+      if(document.all) {
+        if(document.all[section].style.display == "block") {
+           document.all[section].style.display = "none";
+           document.all[image].src = image_closed.src;
+        }
+        else
+        {              
+           document.all[section].style.display = "block";
+           document.all[image].src = image_open.src;
+        }
+      }
+      else
+      {
+      if(document.getElementById(section).style.display == "block") {
+         document.getElementById(section).style.display = "none";
+         document.getElementById(image).src = image_closed.src;
+         }
+      else
+         {              
+         document.getElementById(section).style.display = "block";
+         document.getElementById(image).src = image_open.src;
+         }
+      }
+   
+   }
+
+   function expandall() {
+
+     var divNodeList = document.getElementsByTagName('div'); 
+     for (i = 0; i < divNodeList.length; i++) { 
+        if(divNodeList[i].id) {
+           divNodeList[i].style.display = "block";
+           document.getElementById('trigger_' + divNodeList[i].id.substr(7)).src = "images/open.gif";
+        }
+     }
+     
+   }
+
+   function collapseall() {
+
+     var divNodeList = document.getElementsByTagName('div'); 
+     for (i = 0; i < divNodeList.length; i++) { 
+        if(divNodeList[i].id) {
+           divNodeList[i].style.display = "none";
+           document.getElementById('trigger_' + divNodeList[i].id.substr(7)).src = "images/closed.gif";
+        }
+     }
+
+   }
+
+//]]>
+    </script>
+
+</head>
+<body>
+    <table width="750" class="maintable" cellspacing="0" cellpadding="0" align="center">
+        <tr>
+            <td>
+                <img src="images/header.gif" width="750" height="80" alt="" />
+                <p class="options">
+                    <a onclick="expandall()">[Expand all]</a>&nbsp; &nbsp;<a onclick="collapseall()">[Collapse
+                        all]</a></p>
+                <div>
+                    <h1>
+                        Introduction</h1>
+                    <div>
+                        <p>
+                            The Modern UI provides a user interface for NSIS installers with a modern wizard
+                            style, similar to the wizards of recent Windows versions. It is based on the basic
+                            user interface that is provided by the NSIS compiler itself and extends it with
+                            more interface features and pages.</p>
+                        <p>
+                            All standard NSIS pages (such as the pages to select components and the installation
+                            folder) are supported as well as a number of additional pages. The welcome page
+                            allows you to provide an introduction to the installation process, while the finish
+                            page provides a way to let the user decide what steps should be performed after
+                            the setup wizard is closed (for example, whether the application should be started
+                            immediately). A finish page can also be used to ask for a system restart is necessary.</p>
+                        <h3>
+                            <img class="trigger" alt="Open/Close section" id="trigger_scr" src="images/closed.gif"
+                                onclick="toggle('trigger_scr', 'toggle_scr');" />
+                            Screenshots</h3>
+                        <div class="toggle" id="toggle_scr">
+                            <p>
+                                <img src="images/screen1.png" width="503" height="393" alt="" /></p>
+                            <p>
+                                <img src="images/screen2.png" width="503" height="393" alt="" /></p>
+                        </div>
+                    </div>
+                    <h1>
+                        Script header</h1>
+                    <div>
+                        <p>
+                            The settings for the Modern UI should be inserted in the header of the script file.
+                            It&#39;s important to follow the same order as the items below.&nbsp;For example,
+                            interface settings should be defined before you insert pages, because the pages
+                            depend on the interface configuration. It may be useful to look at the <a href="#examples">
+                                example scripts</a> too see how this is done in actual script files.</p>
+                        <p>
+                            Parameters are given in this format: <span class="parameter">required (option1 | option2)
+                                [optional]</span></p>
+                        <h2>
+                            1. Header file</h2>
+                        <div>
+                            <p>
+                                First of all, add this line to the top of script to include the Modern UI:</p>
+                            <pre>
+!include &quot;MUI.nsh&quot;
+</pre>
+                        </div>
+                        <h2>
+                            2. Interface configuration</h2>
+                        <div>
+                            <p>
+                                Then, you may want to use interface settings to change the look and feel of the
+                                installer. These settings apply to all pages.<p>
+                                    The interface settings provided by the NSIS compiler itself (such as LicenseText,
+                                    Icon, CheckBitmap, InstallColors) should not be used in Modern UI scripts. The Modern
+                                    UI provides equalivent or extended versions of these settings.<p>
+                                        Examples:</p>
+                                    <pre>
+!define MUI_COMPONENTSPAGE_SMALLDESC ;No value
+!define MUI_UI &quot;myUI.exe&quot; ;Value
+!define MUI_INSTFILESPAGE_COLORS &quot;FFFFFF 000000&quot; ;Two colors
+</pre>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_in" src="images/closed.gif"
+                                            onclick="toggle('trigger_in', 'toggle_in');" />
+                                        Interface settings</h3>
+                                    <div class="toggle" id="toggle_in">
+                                        <h3>
+                                            <img class="trigger" alt="Open/Close section" id="trigger_ingen" src="images/closed.gif"
+                                                onclick="toggle('trigger_ingen', 'toggle_ingen');" />
+                                            Page header</h3>
+                                        <div class="toggle" id="toggle_ingen">
+                                            <p>
+                                                <strong>MUI_ICON</strong> <span class="parameter">icon_file</span><br />
+                                                The icon for the installer.<br />
+                                                <em>Default: ${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico</em></p>
+                                            <p>
+                                                <strong>MUI_UNICON</strong> <span class="parameter">icon_file</span><br />
+                                                The icon for the uninstaller.<br />
+                                                <em>Default: ${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico</em></p>
+                                            <p>
+                                                <strong>MUI_HEADERIMAGE</strong><br />
+                                                Display an image on the header of the page.</p>
+                                            <div class="settings">
+                                                <p>
+                                                    <strong>MUI_HEADERIMAGE_BITMAP</strong> <span class="parameter">bmp_file</span><br />
+                                                    Bitmap image to display on the header of installers pages (recommended size: 150x57
+                                                    pixels).<br />
+                                                    <em>Default: ${NSISDIR}\Contrib\Graphics\Header\nsis.bmp</em></p>
+                                                <div class="settings">
+                                                    <p>
+                                                        <strong>MUI_HEADERIMAGE_BITMAP_NOSTRETCH</strong><br />
+                                                        Do not stretch the installer header bitmap to fit the size of the field. Use this
+                                                        option only if you have an image that does not use the whole space. If you have
+                                                        a full size bitmap that fits exactly, you should not use this option because the
+                                                        size of the field will be different if the user has a custom DPI setting.</p>
+                                                    <p>
+                                                        <strong>MUI_HEADERIMAGE_BITMAP_RTL</strong> <span class="parameter">bmp_file</span><br />
+                                                        Bitmap image to display on the header of installers pages when using a RTL language
+                                                        (recommended size: 150x57 pixels).<br />
+                                                        <em>Default: Non-RTL bitmap</em></p>
+                                                    <div class="settings">
+                                                        <p>
+                                                            <strong>MUI_HEADERIMAGE_BITMAP_RTL_NOSTRETCH</strong><br />
+                                                            Do not stretch the installer header bitmap when using a RTL language to fit the
+                                                            size of the field. Use this option only if you have an image that does not use the
+                                                            whole space. If you have a full size bitmap that fits exactly, you should not use
+                                                            this option because the size of the field will be different if the user has a custom
+                                                            DPI setting.</p>
+                                                    </div>
+                                                </div>
+                                                <p>
+                                                    <strong>MUI_HEADERIMAGE_UNBITMAP</strong> <span class="parameter">bmp_file</span><br />
+                                                    Bitmap image to display on the header of uninstaller pages (recommended size: 150x57
+                                                    pixels).<br />
+                                                    <em>Default: Installer header bitmap</em></p>
+                                                <div class="settings">
+                                                    <p>
+                                                        <strong>MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH</strong><br />
+                                                        Do not stretch the uninstaller header bitmap to fit the size of the field. Use this
+                                                        option only if you have an image that does not use the whole space. If you have
+                                                        a full size bitmap that fits exactly, you should not use this option because the
+                                                        size of the field will be different if the user has a custom DPI setting.</p>
+                                                    <p>
+                                                        <strong>MUI_HEADERIMAGE_UNBITMAP_RTL</strong> <span class="parameter">bmp_file</span><br />
+                                                        Bitmap image to display on the header of uninstallers pages when using a RTL language
+                                                        (recommended size: 150x57 pixels).<br />
+                                                        <em>Default: Installer RTL header bitmap</em></p>
+                                                    <div class="settings">
+                                                        <p>
+                                                            <strong>MUI_HEADERIMAGE_UNBITMAP_RTL_NOSTRETCH</strong><br />
+                                                            Do not stretch the uninstaller header bitmap when using a RTL language to fit the
+                                                            size of the field. Use this option only if you have an image that does not use the
+                                                            whole space. If you have a full size bitmap that fits exactly, you should not use
+                                                            this option because the size of the field will be different if the user has a custom
+                                                            DPI setting.</p>
+                                                    </div>
+                                                </div>
+                                                <p>
+                                                    <strong>MUI_HEADERIMAGE_RIGHT</strong><br />
+                                                    Display the header image on the right side instead of the left side (when using
+                                                    a RTL language it will be displayed on the left side instead of the right side).</p>
+                                            </div>
+                                            <p>
+                                                <strong>MUI_BGCOLOR</strong> <span class="parameter">(color: RRGGBBR hexadecimal)</span><br />
+                                                Background color for the header, the Welcome page and the Finish page.<br />
+                                                <em>Default: FFFFFF</em></p>
+                                            <p>
+                                                <strong>MUI_HEADER_TRANSPARENT_TEXT</strong><br />
+                                                Set a transparent background for the header's label controls. Useful for custom
+                                                user interfaces that set a bigger header image.</p>
+                                        </div>
+                                        <h3>
+                                            <img class="trigger" alt="Open/Close section" id="trigger_inres" src="images/closed.gif"
+                                                onclick="toggle('trigger_inres', 'toggle_inres');" />
+                                            Interface resources</h3>
+                                        <div class="toggle" id="toggle_inres">
+                                            <p>
+                                                <strong>MUI_UI</strong> <span class="parameter">ui_file</span><br />
+                                                The interface file with the dialog resources. Change this if you have made your
+                                                own customized UI.<br />
+                                                <em>Default: ${NSISDIR}\Contrib\UIs\modern.exe</em></p>
+                                            <p>
+                                                <strong>MUI_UI_HEADERIMAGE</strong> <span class="parameter">ui_file</span><br />
+                                                The interface files with the dialog resource IDD_INST that contains a bitmap control
+                                                and space for the header bitmap.<br />
+                                                <em>Default: ${NSISDIR}\Contrib\UIs\modern_headerbmp.exe</em></p>
+                                            <p>
+                                                <strong>MUI_UI_HEADERIMAGE_RIGHT</strong> <span class="parameter">ui_file</span><br />
+                                                The interface files with the dialog resource IDD_INST that contains a bitmap control
+                                                and space for the header bitmap on the right side.<br />
+                                                <em>Default: ${NSISDIR}\Contrib\UIs\modern_headerbmpr.exe</em></p>
+                                            <p>
+                                                <strong>MUI_UI_COMPONENTSPAGE_SMALLDESC</strong> <span class="parameter">ui_file</span><br />
+                                                The interface files with a customized dialog resource IDD_SELCOM with a small description
+                                                area.<br />
+                                                <em>Default: ${NSISDIR}\Contrib\UIs\modern_smalldesc.exe</em></p>
+                                            <p>
+                                                <strong>MUI_UI_COMPONENTSPAGE_NODESC</strong> <span class="parameter">ui_file</span><br />
+                                                The interface files with a customized dialog resource IDD_SELCOM without a description
+                                                area.<br />
+                                                <em>Default: ${NSISDIR}\Contrib\UIs\modern_nodesc.exe</em></p>
+                                        </div>
+                                        <h3>
+                                            <img class="trigger" alt="Open/Close section" id="trigger_inwf" src="images/closed.gif"
+                                                onclick="toggle('trigger_inwf', 'toggle_inwf');" />
+                                            Installer welcome/finish page</h3>
+                                        <div class="toggle" id="toggle_inwf">
+                                            <p>
+                                                <strong>MUI_WELCOMEFINISHPAGE_BITMAP</strong> <span class="parameter">bmp_file</span><br />
+                                                Bitmap for the Welcome page and the Finish page (recommended size: 164x314 pixels).<br />
+                                                <em>Default: ${NSISDIR}\Contrib\Graphics\Wizard\win.bmp</em></p>
+                                            <div class="settings">
+                                                <p>
+                                                    <strong>MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH</strong><br />
+                                                    Do not stretch the bitmap for the Welcome and Finish page to fit the size of the
+                                                    field. Use this option only if you have an image that does not use the whole space.
+                                                    If you have a full size bitmap that fits exactly, you should not use this option
+                                                    because the size of the field will be different if the user has a custom DPI setting.</p>
+                                            </div>
+                                            <p>
+                                                <strong>MUI_WELCOMEFINISHPAGE_INI</strong> <span class="parameter">ini_file</span><br />
+                                                InstallOptions INI file for the Welcome page and the Finish page.<br />
+                                                <em>Default: ${NSISDIR}\Contrib\Modern UI\ioSpecial.ini</em></p>
+                                        </div>
+                                        <h3>
+                                            <img class="trigger" alt="Open/Close section" id="trigger_inuwf" src="images/closed.gif"
+                                                onclick="toggle('trigger_inuwf', 'toggle_inuwf');" />
+                                            Uninstaller welcome/finish page</h3>
+                                        <div class="toggle" id="toggle_inuwf">
+                                            <p>
+                                                <strong>MUI_UNWELCOMEFINISHPAGE_BITMAP</strong> <span class="parameter">bmp_file</span><br />
+                                                Bitmap for the Welcome page and the Finish page (recommended size: 164x314 pixels).<br />
+                                                <em>Default: ${NSISDIR}\Contrib\Graphics\Wizard\win.bmp</em></p>
+                                            <div class="settings">
+                                                <p>
+                                                    <strong>MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH</strong><br />
+                                                    Do not stretch the bitmap for the Welcome and Finish page to fit the size of the
+                                                    field. Use this option only if you have an image that does not use the whole space.
+                                                    If you have a full size bitmap that fits exactly, you should not use this option
+                                                    because the size of the field will be different if the user has a custom DPI setting.</p>
+                                            </div>
+                                            <p>
+                                                <strong>MUI_UNWELCOMEFINISHPAGE_INI</strong> <span class="parameter">ini_file</span><br />
+                                                InstallOptions INI file for the uninstaller Welcome page and the Finish page.<br />
+                                                <em>Default: ${NSISDIR}\Contrib\Modern UI\ioSpecial.ini</em></p>
+                                        </div>
+                                        <h3>
+                                            <img class="trigger" alt="Open/Close section" id="trigger_inl" src="images/closed.gif"
+                                                onclick="toggle('trigger_inl', 'toggle_inl');" />
+                                            License page</h3>
+                                        <div class="toggle" id="toggle_inl">
+                                            <p>
+                                                <strong>MUI_LICENSEPAGE_BGCOLOR</strong> <span class="parameter">(/windows | /grey |
+                                                    (color: RRGGBB hexadecimal))</span><br />
+                                                The background color for the license textbox. Use /windows for the Windows text
+                                                background color (usually white). Use the /grey for the window background color
+                                                (usually grey).<br />
+                                                <em>Default: /windows</em></p>
+                                        </div>
+                                        <h3>
+                                            <img class="trigger" alt="Open/Close section" id="trigger_inc" src="images/closed.gif"
+                                                onclick="toggle('trigger_inc', 'toggle_inc');" />
+                                            Components page</h3>
+                                        <div class="toggle" id="toggle_inc">
+                                            <p>
+                                                <strong>MUI_COMPONENTSPAGE_CHECKBITMAP</strong> <span class="parameter">bitmap_file</span><br />
+                                                The bitmap with images for the checks of the component select treeview.<br />
+                                                <em>Default: ${NSISDIR}\Contrib\Graphics\Checks\modern.bmp</em></p>
+                                            <p>
+                                                <strong>MUI_COMPONENTSPAGE_SMALLDESC</strong><br />
+                                                A small description area on the bottom of the page. Use this layout if you have
+                                                a lot of sections and don't need large descriptions.</p>
+                                            <p>
+                                                <strong>MUI_COMPONENTSPAGE_NODESC</strong><br />
+                                                No description area.</p>
+                                        </div>
+                                        <h3>
+                                            <img class="trigger" alt="Open/Close section" id="trigger_ind" src="images/closed.gif"
+                                                onclick="toggle('trigger_ind', 'toggle_ind');" />
+                                            Directory page</h3>
+                                        <div class="toggle" id="toggle_ind">
+                                            <p>
+                                                <strong>MUI_DIRECTORYPAGE_BGCOLOR</strong> <span class="parameter">(color: RRGGBB hexadecimal)</span><br />
+                                                The background color for the directory textbox.</p>
+                                        </div>
+                                        <h3>
+                                            <img class="trigger" alt="Open/Close section" id="trigger_ins" src="images/closed.gif"
+                                                onclick="toggle('trigger_ins', 'toggle_ins');" />
+                                            Start Menu folder page</h3>
+                                        <div class="toggle" id="toggle_ins">
+                                            <p>
+                                                <strong>MUI_STARTMENUPAGE_BGCOLOR</strong> <span class="parameter">(color: RRGGBB hexadecimal)</span><br />
+                                                The background color for the startmenu directory list and textbox.</p>
+                                        </div>
+                                        <h3>
+                                            <img class="trigger" alt="Open/Close section" id="trigger_ini" src="images/closed.gif"
+                                                onclick="toggle('trigger_ini', 'toggle_ini');" />
+                                            Installation page</h3>
+                                        <div class="toggle" id="toggle_ini">
+                                            <p>
+                                                <strong>MUI_INSTFILESPAGE_COLORS</strong> <span class="parameter">(/windows | &quot;(foreground
+                                                    color: RRGGBB hexadecimal) (background color: RRGGBB hexadecimal)&quot;)</span><br />
+                                                The colors of the details screen. Use /windows for the default Windows colors.<br />
+                                                <em>Default: /windows</em></p>
+                                            <p>
+                                                <strong>MUI_INSTFILESPAGE_PROGRESSBAR</strong> <span class="parameter">(&quot;&quot;
+                                                    | colored | smooth)</span><br />
+                                                The style of the progress bar. Colored makes it use the MUI_INSTALLCOLORS.<br />
+                                                <em>Default: smooth</em></p>
+                                        </div>
+                                        <h3>
+                                            <img class="trigger" alt="Open/Close section" id="trigger_inf" src="images/closed.gif"
+                                                onclick="toggle('trigger_inf', 'toggle_inf');" />
+                                            Installer finish page</h3>
+                                        <div class="toggle" id="toggle_inf">
+                                            <p>
+                                                <strong>MUI_FINISHPAGE_NOAUTOCLOSE</strong><br />
+                                                Do not automatically jump to the finish page, to allow the user to check the install
+                                                log.</p>
+                                        </div>
+                                        <h3>
+                                            <img class="trigger" alt="Open/Close section" id="trigger_uinf" src="images/closed.gif"
+                                                onclick="toggle('trigger_uinf', 'toggle_uinf');" />
+                                            Uninstaller finish page</h3>
+                                        <div class="toggle" id="toggle_uinf">
+                                            <p>
+                                                <strong>MUI_UNFINISHPAGE_NOAUTOCLOSE</strong><br />
+                                                Do not automatically jump to the finish page, to allow the user to check the uninstall
+                                                log.</p>
+                                        </div>
+                                        <h3>
+                                            <img class="trigger" alt="Open/Close section" id="trigger_inaw" src="images/closed.gif"
+                                                onclick="toggle('trigger_inaw', 'toggle_inaw');" />
+                                            Abort warning</h3>
+                                        <div class="toggle" id="toggle_inaw">
+                                            <p>
+                                                <strong>MUI_ABORTWARNING</strong><br />
+                                                Show a message box with a warning when the user wants to close the installer.</p>
+                                            <div class="settings">
+                                                <p>
+                                                    <strong>MUI_ABORTWARNING_TEXT</strong> <span class="parameter">text</span><br />
+                                                    Text to display on the abort warning message box.</p>
+                                                <p>
+                                                    <strong>MUI_ABORTWARNING_CANCEL_DEFAULT</strong><br />
+                                                    Set the Cancel button as the default button on the message box.</p>
+                                            </div>
+                                        </div>
+                                        <h3>
+                                            <img class="trigger" alt="Open/Close section" id="trigger_inuaw" src="images/closed.gif"
+                                                onclick="toggle('trigger_inuaw', 'toggle_inuaw');" />
+                                            Uninstaller abort warning</h3>
+                                        <div class="toggle" id="toggle_inuaw">
+                                            <p>
+                                                <strong>MUI_UNABORTWARNING</strong><br />
+                                                Show a message box with a warning when the user wants to close the uninstaller.</p>
+                                            <div class="settings">
+                                                <p>
+                                                    <strong>MUI_UNABORTWARNING_TEXT</strong> <span class="parameter">text</span><br />
+                                                    Text to display on the abort warning message box.</p>
+                                                <p>
+                                                    <strong>MUI_UNABORTWARNING_CANCEL_DEFAULT</strong><br />
+                                                    Set the Cancel button as the default button on the message box.</p>
+                                            </div>
+                                        </div>
+                                    </div>
+                        </div>
+                        <h2>
+                            3. Pages</h2>
+                        <div>
+                            <p>
+                                Insert the following macros to set the pages you want to use. The pages will appear
+                                in the order in which you insert them in the script. You can also insert custom
+                                Page commands between the macros to add custom pages.</p>
+                            <p>
+                                You can add multiple pages of certain types (for example, if you want the user to
+                                specify multiple folders).</p>
+                            <p>
+                                Examples:</p>
+                            <pre>
+!insertmacro MUI_PAGE_LICENSE &quot;License.rtf&quot;
+!insertmacro MUI_PAGE_COMPONENTS
+
+Var StartMenuFolder
+!insertmacro MUI_PAGE_STARTMENU &quot;Application&quot; $StartMenuFolder
+</pre>
+                            <p>
+                                You will need the page ID for the Start Menu folder page when using the Start Menu
+                                folder macros. The folder will be stored in the specified variable.</p>
+                            <p>
+                                <strong>Installer pages</strong><br />
+                                MUI_PAGE_WELCOME<br />
+                                MUI_PAGE_LICENSE <span class="parameter">textfile</span><br />
+                                MUI_PAGE_COMPONENTS<br />
+                                MUI_PAGE_DIRECTORY<br />
+                                MUI_PAGE_STARTMENU <span class="parameter">pageid variable</span><br />
+                                MUI_PAGE_INSTFILES<br />
+                                MUI_PAGE_FINISH</p>
+                            <p>
+                                <strong>Uninstaller pages</strong><br />
+                                MUI_UNPAGE_WELCOME<br />
+                                MUI_UNPAGE_CONFIRM<br />
+                                MUI_UNPAGE_LICENSE <span class="parameter">textfile</span><br />
+                                MUI_UNPAGE_COMPONENTS<br />
+                                MUI_UNPAGE_DIRECTORY<br />
+                                MUI_UNPAGE_INSTFILES<br />
+                                MUI_UNPAGE_FINISH</p>
+                            <h3>
+                                <img class="trigger" alt="Open/Close section" id="trigger_pg" src="images/closed.gif"
+                                    onclick="toggle('trigger_pg', 'toggle_pg');" />
+                                Page settings</h3>
+                            <div class="toggle" id="toggle_pg">
+                                <p>
+                                    Page settings apply to a single page and should be set before inserting a page macro.
+                                    The same settings can be used for installer and uninstaller pages. You have to repeat
+                                    the setting if you want it to apply to multiple pages. Example:</p>
+                                <pre>
+;Add a directory page to let the user specify a plug-ins folder
+;Store the folder in $PluginsFolder
+
+Var PLUGINS_FOLDER
+!define MUI_DIRECTORYPAGE_VARIABLE $PluginsFolder
+!insertmacro MUI_PAGE_DIRECTORY
+</pre>
+                                <p>
+                                    <p>
+                                        All standard texts in the user interface are loaded from language files, which are
+                                        available for all languages supported by NSIS. So you only need to define these
+                                        texts if you want to change the default.</p>
+                                    <p>
+                                        If the parameter is a text that should be different for each language, define a
+                                        language string using LangString and use $(LangStringName) as value. For a license
+                                        text in multiple languages, LicenseLangString can be used. Refer the NSIS Users
+                                        Manual for more information about installers with multiple languages.</p>
+                                    <p>
+                                        In all text settings, the doublequote character (&quot;) should be escaped in the
+                                        following form: $\&quot;</p>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_pgg" src="images/closed.gif"
+                                            onclick="toggle('trigger_pgg', 'toggle_pgg');" />
+                                        General page settings</h3>
+                                    <div class="toggle" id="toggle_pgg">
+                                        <p>
+                                            <strong>MUI_PAGE_HEADER_TEXT</strong> <span class="parameter">text</span><br />
+                                            Text to display on the header of the page.</p>
+                                        <p>
+                                            <strong>MUI_PAGE_HEADER_SUBTEXT</strong> <span class="parameter">text</span><br />
+                                            Subtext to display on the header of the page.</p>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_pgw" src="images/closed.gif"
+                                            onclick="toggle('trigger_pgw', 'toggle_pgw');" />
+                                        Welcome page settings</h3>
+                                    <div class="toggle" id="toggle_pgw">
+                                        <p>
+                                            To add a newline to any of these texts, use \r\n instead of $\r$\n.</p>
+                                        <p>
+                                            <strong>MUI_WELCOMEPAGE_TITLE</strong> <span class="parameter">title</span><br />
+                                            Title to display on the top of the page.</p>
+                                        <p>
+                                            <strong>MUI_WELCOMEPAGE_TITLE_3LINES</strong><br />
+                                            Extra space for the title area.</p>
+                                        <p>
+                                            <strong>MUI_WELCOMEPAGE_TEXT</strong> <span class="parameter">text</span><br />
+                                            Text to display on the page.</p>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_pgl" src="images/closed.gif"
+                                            onclick="toggle('trigger_pgl', 'toggle_pgl');" />
+                                        License page settings</h3>
+                                    <div class="toggle" id="toggle_pgl">
+                                        <p>
+                                            <strong>MUI_LICENSEPAGE_TEXT_TOP</strong> <span class="parameter">text</span><br />
+                                            Text to display on the top of the page.</p>
+                                        <p>
+                                            <strong>MUI_LICENSEPAGE_TEXT_BOTTOM</strong> <span class="parameter">text</span><br />
+                                            Text to display on the bottom of the page.</p>
+                                        <p>
+                                            <strong>MUI_LICENSEPAGE_BUTTON</strong> <span class="parameter">button_text</span><br />
+                                            Text to display on the 'I Agree' button.</p>
+                                        <p>
+                                            <strong>MUI_LICENSEPAGE_CHECKBOX</strong><br />
+                                            Display a checkbox the user has to check to agree with the license terms.</p>
+                                        <div class="settings">
+                                            <p>
+                                                <strong>MUI_LICENSEPAGE_CHECKBOX_TEXT</strong> <span class="parameter">text</span><br />
+                                                Text to display next to the checkbox to agree with the license terms.</p>
+                                        </div>
+                                        <p>
+                                            <strong>MUI_LICENSEPAGE_RADIOBUTTONS</strong><br />
+                                            Display two radio buttons to allow the user to choose between accepting the license
+                                            terms or not.</p>
+                                        <div class="settings">
+                                            <p>
+                                                <strong>MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT</strong> <span class="parameter">text</span><br />
+                                                Text to display next to the checkbox to accept the license terms.</p>
+                                            <p>
+                                                <strong>MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE</strong> <span class="parameter">text</span><br />
+                                                Text to display next to the checkbox to decline the license terms.</p>
+                                        </div>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_pgc" src="images/closed.gif"
+                                            onclick="toggle('trigger_pgc', 'toggle_pgc');" />
+                                        Components page settings</h3>
+                                    <div class="toggle" id="toggle_pgc">
+                                        <p>
+                                            <strong>MUI_COMPONENTSPAGE_TEXT_TOP</strong> <span class="parameter">text</span><br />
+                                            Text to display on the top of the page.</p>
+                                        <p>
+                                            <strong>MUI_COMPONENTSPAGE_TEXT_COMPLIST</strong> <span class="parameter">text</span><br />
+                                            Text to display on next to the components list.</p>
+                                        <p>
+                                            <strong>MUI_COMPONENTSPAGE_TEXT_INSTTYPE</strong> <span class="parameter">text</span><br />
+                                            Text to display on next to the installation type combo box.</p>
+                                        <p>
+                                            <strong>MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE</strong> <span class="parameter">text</span><br />
+                                            Text to display on the of the top of the description box.</p>
+                                        <p>
+                                            <strong>MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO</strong> <span class="parameter">text</span><br />
+                                            Text to display inside the description box when no section is selected.</p>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_pgd" src="images/closed.gif"
+                                            onclick="toggle('trigger_pgd', 'toggle_pgd');" />
+                                        Directory page settings</h3>
+                                    <div class="toggle" id="toggle_pgd">
+                                        <p>
+                                            <strong>MUI_DIRECTORYPAGE_TEXT_TOP</strong> <span class="parameter">text</span><br />
+                                            Text to display on top of the page.</p>
+                                        <p>
+                                            <strong>MUI_DIRECTORYPAGE_TEXT_DESTINATION</strong> <span class="parameter">text</span><br />
+                                            Text to display on the destination folder frame.</p>
+                                        <p>
+                                            <strong>MUI_DIRECTORYPAGE_VARIABLE</strong> <span class="parameter">variable</span><br />
+                                            Variable in which to store the selected folder.<br />
+                                            <em>Default: $INSTDIR</em></p>
+                                        <p>
+                                            <strong>MUI_DIRECTORYPAGE_VERIFYONLEAVE</strong><br />
+                                            Does not disable the Next button when a folder is invalid but allows you to use
+                                            GetInstDirError in the leave function to handle an invalid folder.</p>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_pgs" src="images/closed.gif"
+                                            onclick="toggle('trigger_pgs', 'toggle_pgs');" />
+                                        Start Menu folder page settings</h3>
+                                    <div class="toggle" id="toggle_pgs">
+                                        <p>
+                                            <strong>MUI_STARTMENUPAGE_TEXT_TOP</strong> <span class="parameter">text</span><br />
+                                            Text to display on the top of the page.</p>
+                                        <p>
+                                            <strong>MUI_STARTMENUPAGE_TEXT_CHECKBOX</strong> <span class="parameter">text</span><br />
+                                            Text to display next to the checkbox to disable the Start Menu folder creation.</p>
+                                        <p>
+                                            <strong>MUI_STARTMENUPAGE_DEFAULTFOLDER</strong> <span class="parameter">folder</span><br />
+                                            The default Start Menu Folder.</p>
+                                        <p>
+                                            <strong>MUI_STARTMENUPAGE_NODISABLE</strong><br />
+                                            Do not display the checkbox to disable the creation of Start Menu shortcuts.</p>
+                                        <p>
+                                            <strong>MUI_STARTMENUPAGE_REGISTRY_ROOT</strong> <span class="parameter">root</span><br />
+                                            <strong>MUI_STARTMENUPAGE_REGISTRY_KEY</strong> <span class="parameter">key</span><br />
+                                            <strong>MUI_STARTMENUPAGE_REGISTRY_VALUENAME</strong> <span class="parameter">value_name</span><br />
+                                            The registry key to store the Start Menu folder. The page will use it to remember
+                                            the users preference. You should also use for the uninstaller to remove the Start
+                                            Menu folders. Don't forget to remove this key during uninstallation.</p>
+                                        <p>
+                                            For the uninstaller, use the MUI_STARTMENU_GETFOLDER macro to get the Start Menu
+                                            folder:</p>
+                                        <pre>
+!insertmacro MUI_STARTMENU_GETFOLDER page_id $R0
+  Delete &quot;$SMPROGRAMS\$R0\Your Shortcut.lnk&quot;
+</pre>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_pgi" src="images/closed.gif"
+                                            onclick="toggle('trigger_pgi', 'toggle_pgi');" />
+                                        Installation page settings</h3>
+                                    <div class="toggle" id="toggle_pgi">
+                                        <p>
+                                            <strong>MUI_INSTFILESPAGE_FINISHHEADER_TEXT</strong> <span class="parameter">text</span><br />
+                                            Text to display on the header of the installation page when the installation has
+                                            been completed (won't be displayed when using a Finish page without MUI_(UN)FINISHPAGE_NOAUTOCLOSE).</p>
+                                        <p>
+                                            <strong>MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT</strong> <span class="parameter">text</span><br />
+                                            Subtext to display on the header of the installation page when the installation
+                                            has been completed (won't be displayed when using a Finish page without MUI_(UN)FINISHPAGE_NOAUTOCLOSE).</p>
+                                        <p>
+                                            <strong>MUI_INSTFILESPAGE_ABORTHEADER_TEXT</strong> <span class="parameter">text</span><br />
+                                            Text to display on the header of the installation page when the installation has
+                                            been aborted.</p>
+                                        <p>
+                                            <strong>MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT</strong> <span class="parameter">text</span><br />
+                                            Subext to display on the header of the installation page when the installation has
+                                            been aborted.</p>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_pgf" src="images/closed.gif"
+                                            onclick="toggle('trigger_pgf', 'toggle_pgf');" />
+                                        Finish page settings</h3>
+                                    <div class="toggle" id="toggle_pgf">
+                                        <p>
+                                            To add a newline to any of these texts, use \r\n instead of $\r$\n.</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_TITLE</strong> <span class="parameter">title</span><br />
+                                            Title to display on the top of the page.</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_TITLE_3LINES</strong><br />
+                                            Extra space for the title area.</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_TEXT</strong> <span class="parameter">text</span><br />
+                                            Text to display on the page.</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_TEXT_LARGE</strong><br />
+                                            Extra space for the text area (if using checkboxes).</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_BUTTON</strong> <span class="parameter">text</span><br />
+                                            Text to display on the Finish button.</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_CANCEL_ENABLED</strong><br />
+                                            Enable the Cancel button so the user can skip any options displayed on the finish
+                                            page.</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_TEXT_REBOOT</strong> <span class="parameter">text</span><br />
+                                            Text to display on the finish page when asking for a system reboot.</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_TEXT_REBOOTNOW</strong> <span class="parameter">text</span><br />
+                                            Text to display next to the 'Reboot now' option button.</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_TEXT_REBOOTLATER</strong> <span class="parameter">text</span><br />
+                                            Text to display next to the 'Reboot later' option button.</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_REBOOTLATER_DEFAULT</strong><br />
+                                            Sets the 'Reboot later' option as the default option.</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_RUN</strong> <span class="parameter">exe_file</span><br />
+                                            Application which the user can select to run using a checkbox. You don't need to
+                                            put quotes around the filename when it contains spaces.</p>
+                                        <div class="settings">
+                                            <p>
+                                                <strong>MUI_FINISHPAGE_RUN_TEXT</strong> <span class="parameter">text</span><br />
+                                                Texts to display next to the 'Run program' checkbox.</p>
+                                            <p>
+                                                <strong>MUI_FINISHPAGE_RUN_PARAMETERS</strong> <span class="parameter">parameters</span><br />
+                                                Parameters for the application to run. Don't forget to escape double quotes in the
+                                                value (use $\&quot;).</p>
+                                            <p>
+                                                <strong>MUI_FINISHPAGE_RUN_NOTCHECKED</strong><br />
+                                                Do not check the 'Run program' checkbox by default</p>
+                                            <p>
+                                                <strong>MUI_FINISHPAGE_RUN_FUNCTION</strong> <span class="parameter">function</span><br />
+                                                Call a function instead of executing an application (define MUI_FINISHPAGE_RUN without
+                                                parameters). You can use the function to execute multiple applications or you can
+                                                change the checkbox name and use it for other things.</p>
+                                        </div>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_SHOWREADME</strong> <span class="parameter">file/url</span><br />
+                                            File or website which the user can select to view using a checkbox. You don't need
+                                            to put quotes around the filename when it contains spaces.</p>
+                                        <div class="settings">
+                                            <p>
+                                                <strong>MUI_FINISHPAGE_SHOWREADME_TEXT</strong> <span class="parameter">text</span><br />
+                                                Texts to display next to the 'Show Readme' checkbox.</p>
+                                            <p>
+                                                <strong>MUI_FINISHPAGE_SHOWREADME_NOTCHECKED</strong><br />
+                                                Do not check the 'Show Readme' checkbox by default</p>
+                                            <p>
+                                                <strong>MUI_FINISHPAGE_SHOWREADME_FUNCTION</strong> <span class="parameter">function</span><br />
+                                                Call a function instead of showing a file (define MUI_FINISHPAGE_SHOWREADME without
+                                                parameters). You can use the function to show multiple files or you can change the
+                                                checkbox name and use it for other things.</p>
+                                        </div>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_LINK</strong> <span class="parameter">link_text</span><br />
+                                            Text for a link on the which the user can click to view a website or file.</p>
+                                        <div class="settings">
+                                            <p>
+                                                <strong>MUI_FINISHPAGE_LINK_LOCATION</strong> <span class="parameter">file/url</span><br />
+                                                Website or file which the user can select to view using the link. You don't need
+                                                to put quotes around the filename when it contains spaces.</p>
+                                            <p>
+                                                <strong>MUI_FINISHPAGE_LINK_COLOR</strong> <span class="parameter">(color: RRGGBB hexadecimal)</span><br />
+                                                Text color for the link on the Finish page.<br />
+                                                <em>Default: 000080</em></p>
+                                        </div>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_NOREBOOTSUPPORT</strong><br />
+                                            Disables support for the page that allows the user to reboot the system. Define
+                                            this option to save some space if you are not using the /REBOOTOK flag or SetRebootFlag.</p>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_pgu" src="images/closed.gif"
+                                            onclick="toggle('trigger_pgu', 'toggle_pgu');" />
+                                        Uninstall confirm page settings</h3>
+                                    <div class="toggle" id="toggle_pgu">
+                                        <p>
+                                            <strong>MUI_UNCONFIRMPAGE_TEXT_TOP</strong> <span class="parameter">text</span><br />
+                                            Text to display on the top of the page.</p>
+                                        <p>
+                                            <strong>MUI_UNCONFIRMPAGE_TEXT_LOCATION</strong> <span class="parameter">text</span><br />
+                                            Text to display next to the uninstall location text box.</p>
+                                    </div>
+                            </div>
+                        </div>
+                        <h2>
+                            4. Language files</h2>
+                        <div>
+                            <p>
+                                Insert the Modern UI language files for the languages to want to include.</p>
+                            <pre>
+!insertmacro MUI_LANGUAGE &quot;English&quot;
+</pre>
+                            <p>
+                                The standard NSIS language files are loaded automatically, there is no need to use
+                                LoadLanguageFile.</p>
+                        </div>
+                        <h2>
+                            5. Reserve files</h2>
+                        <div>
+                            <p>
+                                If you are using solid compression, files that are required before the actual installation
+                                should be stored first in the data block, because this will make your installer
+                                start faster. Include reserve file commands for such files before your sections
+                                and functions:</p>
+                            <pre>
+ReserveFile &quot;ioFile.ini&quot; ;Your own InstallOptions INI files
+!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions plug-in
+!insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog
+</pre>
+                        </div>
+                    </div>
+                    <h1>
+                        Script code for pages</h1>
+                    <div>
+                        <p>
+                            Some pages allow you to show additional information or can be used to get user input.
+                            Here you can find the script code to use these features.</p>
+                        <h2>
+                            Components page descriptions</h2>
+                        <div>
+                            <p>
+                                The Modern UI components page has a text box in which a description can be shown
+                                when the user hovers the mouse over a component. If you don't want to use these
+                                descriptions, insert the MUI_COMPONENTSPAGE_NODESC interface setting.</p>
+                            <p>
+                                To set a description for a section, an additional parameter needs to be added to
+                                Section commmand with a unique identifier for the section. This name can later be
+                                used to set the description for this section.</p>
+                            <pre>
+Section &quot;Section Name 1&quot; Section1
+   ...
+SectionEnd
+</pre>
+                            <p>
+                                After the sections, use these macros to set the descriptions:</p>
+                            <pre>
+LangString DESC_Section1 ${LANG_ENGLISH} &quot;Description of section 1.&quot;
+LangString DESC_Section2 ${LANG_ENGLISH} &quot;Description of section 2.&quot;
+
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+  !insertmacro MUI_DESCRIPTION_TEXT ${Section1} $(DESC_Section1)
+  !insertmacro MUI_DESCRIPTION_TEXT ${Section2} $(DESC_Section2)
+!insertmacro MUI_FUNCTION_DESCRIPTION_END
+</pre>
+                            <p>
+                                For the uninstaller, use the MUI_UNFUNCTION_DESCRIPTION_BEGIN and MUI_UNFUNCTION_DESCRIPTION_END
+                                macros.</p>
+                        </div>
+                        <h2>
+                            Start Menu folder</h2>
+                        <div>
+                            <p>
+                                Put the code to write the shortcuts (using CreateShortcut) between the MUI_STARTMENU_WRITE_BEGIN
+                                and MUI_STARTMENU_WRITE_END macros:</p>
+                            <pre>
+!insertmacro MUI_STARTMENU_WRITE_BEGIN pageid
+  ...create shortcuts...
+!insertmacro MUI_STARTMENU_WRITE_END
+</pre>
+                            <p>
+                                The page ID should be the ID of the page on which the user has selected the folder
+                                for the shortcuts you want to write.</p>
+                            <p>
+                                The variable which contains the folder and the page ID are set as parameters of
+                                the page macro.</p>
+                        </div>
+                    </div>
+                    <h1>
+                        Language selection dialog</h1>
+                    <div>
+                        <p>
+                            If you want the installer to display a language selection dialog (see the the <a
+                                href="../../Examples/Modern%20UI/MultiLanguage.nsi">MultiLanguage.nsi</a> example),
+                            insert the MUI_LANGDLL_DISPLAY macro in the .onInit function:</p>
+                        <pre>
+Function .onInit
+
+  !insertmacro MUI_LANGDLL_DISPLAY
+
+FunctionEnd
+</pre>
+                        <p>
+                            This macro can also be used in the un.onInit function.</p>
+                        <h3>
+                            <img class="trigger" alt="Open/Close section" id="trigger_lss" src="images/closed.gif"
+                                onclick="toggle('trigger_lss', 'toggle_lss');" />
+                            Settings for registry storage of selected language</h3>
+                        <div class="toggle" id="toggle_lss">
+                            <p>
+                                To remember the user's preference, you can define a registry key. These defines
+                                should be set before inserting the installation page macro.</p>
+                            <p>
+                                <strong>MUI_LANGDLL_REGISTRY_ROOT</strong> <span class="parameter">root</span><br />
+                                <strong>MUI_LANGDLL_REGISTRY_KEY</strong> <span class="parameter">key</span><br />
+                                <strong>MUI_LANGDLL_REGISTRY_VALUENAME</strong> <span class="parameter">value_name</span><br />
+                                The registry key to store the language. The users preference will be remembered.
+                                You can also use it for the uninstaller to display the right language. Don't forget
+                                to remove this key in the uninstaller.</p>
+                            <p>
+                                For the uninstaller, insert the MUI_UNGETLANGUAGE macro in un.onInit to get the
+                                stored language preference:</p>
+                            <pre>
+Function un.onInit
+
+  !insertmacro MUI_UNGETLANGUAGE
+
+FunctionEnd
+</pre>
+                        </div>
+                        <h3>
+                            <img class="trigger" alt="Open/Close section" id="trigger_lsin" src="images/closed.gif"
+                                onclick="toggle('trigger_lsin', 'toggle_lsin');" />
+                            Interface settings for selection dialog</h3>
+                        <div class="toggle" id="toggle_lsin">
+                            <p>
+                                To customize the language selection dialog interface, use these defines before inserting
+                                the MUI_LANGDLL_DISPLAY macro.</p>
+                            <p>
+                                <strong>MUI_LANGDLL_WINDOWTITLE</strong> <span class="parameter">text</span><br />
+                                The window title of the language selection dialog.</p>
+                            <p>
+                                <strong>MUI_LANGDLL_INFO</strong> <span class="parameter">text</span><br />
+                                The text to display on the language selection dialog.</p>
+                            <p>
+                                <strong>MUI_LANGDLL_ALWAYSSHOW</strong><br />
+                                Always show the language selection dialog, even if a language has been stored in
+                                the registry. The language stored in the registry will be selected by default.</p>
+                            <p>
+                                <strong>MUI_LANGDLL_ALLLANGUAGES</strong><br />
+                                Always show all available languages and don't filter according to their codepage.</p>
+                        </div>
+                    </div>
+                    <h1>
+                        Custom pages</h1>
+                    <div>
+                        <p>
+                            If you want add your custom pages to your installer, you can insert your own page
+                            commands between the page macros. The <a href="../InstallOptions/Readme.html">InstallOptions
+                                documentation</a> provides information about creating custom pages using InstallOptions.</p>
+                        <pre>
+!insertmacro MUI_PAGE_WELCOME
+Page custom FunctionName ;Custom page
+!insertmacro MUI_PAGE_COMPONENTS
+ 
+;Uninstaller
+!insertmacro MUI_UNPAGE_CONFIRM
+UninstPage custom un.FunctionName ;Custom page
+!insertmacro MUI_UNPAGE_INSTFILES
+</pre>
+                        <p>
+                            Use the MUI_HEADER_TEXT macro to set the text on the page header in a page function:</p>
+                        <pre>
+LangString PAGE_TITLE ${LANG_ENGLISH} &quot;Title&quot;
+LangString PAGE_SUBTITLE ${LANG_ENGLISH} &quot;Subtitle&quot;
+
+Function CustomPageFunction
+  !insertmacro MUI_HEADER_TEXT $(PAGE_TITLE) $(PAGE_SUBTITLE)
+  !insertmacro MUI_INSTALLOPTIONS_DISPLAY &quot;ioFile.ini&quot;
+FuctionEnd
+</pre>
+                    </div>
+                    <h1>
+                        Custom functions</h1>
+                    <div>
+                        <p>
+                            Interface functions provided by NSIS, like the .onGUIInit function and the page
+                            functions are automatically included by the Modern UI and filled with code to support
+                            new interface features. If you want to add additional code to these function, create
+                            a function with the custom script code in the script use the Modern UI functions
+                            call them.</p>
+                        <p>
+                            Example:</p>
+                        <pre class="text">
+!define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit
+
+Function myGUIInit
+  ...your own code...
+FunctionEnd
+</pre>
+                        <h3>
+                            <img class="trigger" alt="Open/Close section" id="trigger_cfg" src="images/closed.gif"
+                                onclick="toggle('trigger_cfg', 'toggle_cfg');" />
+                            General Custom Functions</h3>
+                        <div class="toggle" id="toggle_cfg">
+                            <p>
+                                These defines should be set before inserting the language macros.</p>
+                            <p>
+                                <strong>MUI_CUSTOMFUNCTION_GUIINIT</strong> <span class="parameter">function</span><br />
+                                <strong>MUI_CUSTOMFUNCTION_UNGUIINIT</strong> <span class="parameter">function</span><br />
+                                <strong>MUI_CUSTOMFUNCTION_ABORT</strong> <span class="parameter">function</span><br />
+                                <strong>MUI_CUSTOMFUNCTION_UNABORT</strong> <span class="parameter">function</span><br />
+                                <strong>MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION</strong> <span class="parameter">function</span><br />
+                                <strong>MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION</strong> <span class="parameter">function</span></p>
+							<p>
+                                Mouse over functions are only available when the description macros
+								(MUI_FUNCTION_DESCRIPTION_BEGIN) are used. When component page descriptions are not
+								used, regular .onMouseOverSection and un.onMouseOverSection must be used.</p>
+                        </div>
+                        <h3>
+                            <img class="trigger" alt="Open/Close section" id="trigger_cfpg" src="images/closed.gif"
+                                onclick="toggle('trigger_cfpg', 'toggle_cfpg');" />
+                            Page Custom Functions</h3>
+                        <div class="toggle" id="toggle_cfpg">
+                            <p>
+                                These defines should be set before inserting a page macro.</p>
+                            <p>
+                                <strong>MUI_PAGE_CUSTOMFUNCTION_PRE</strong> <span class="parameter">function</span><br />
+                                <strong>MUI_PAGE_CUSTOMFUNCTION_SHOW</strong> <span class="parameter">function</span><br />
+                                <strong>MUI_PAGE_CUSTOMFUNCTION_LEAVE</strong> <span class="parameter">function</span></p>
+                            <p>
+                                <strong>Notes:</strong></p>
+                            <ul>
+                                <li>In the Pre function of the Welcome page and the Finish page, you can write to the
+                                    InstallOptions INI file of the page (ioSpecial.ini)</li>
+                                <li>In the Show function of the Welcome, Finish and StartMenu pages, $MUI_HWND contains
+                                    the HWND of the inner dialog</li>
+                            </ul>
+                        </div>
+                        <h3>
+                            <img class="trigger" alt="Open/Close section" id="trigger_cfwf" src="images/closed.gif"
+                                onclick="toggle('trigger_cfwf', 'toggle_cfwf');" />
+                            Welcome/Finish Page Custom Functions</h3>
+                        <div class="toggle" id="toggle_cfwf">
+                            <p>
+                                This define should be inserted before a single Welcome or Finish page.</p>
+                            <p>
+                                <strong>MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT</strong> <span class="parameter">function</span></p>
+                            <p>
+                                This Init function is called before the InstallOptions INI file for the page is
+                                written, so you can use it to initialize any variables used in the page settings.</p>
+                        </div>
+                    </div>
+                    <h1>
+                        <a name="examples" id="examples">Example scripts</a></h1>
+                    <div>
+                        <p>
+                            Basic: <a href="../../Examples/Modern%20UI/Basic.nsi">Basic.nsi</a><br />
+                            Welcome/Finish page: <a href="../../Examples/Modern%20UI/WelcomeFinish.nsi">WelcomeFinish.nsi</a><br />
+                            Multiple languages: <a href="../../Examples/Modern%20UI/MultiLanguage.nsi">MultiLanguage.nsi</a><br />
+                            Header image: <a href="../../Examples/Modern%20UI/HeaderBitmap.nsi">HeaderBitmap.nsi</a><br />
+                            Custom pages: <a href="../../Examples/Modern%20UI/InstallOptions.nsi">InstallOptions.nsi</a><br />
+                            Start Menu Folder page: <a href="../../Examples/Modern%20UI/StartMenu.nsi">StartMenu.nsi</a></p>
+                    </div>
+                    <h1>
+                        Credits</h1>
+                    <div>
+                        <p>
+                            Written by Joost Verburg.<br />
+                            Icons designed by Nikos Adamamas, aka adni18.<br />
+                            Thanks to Amir Szekely, aka KiCHiK, for his work on NSIS to make this possible.</p>
+                    </div>
+                    <h1>
+                        License</h1>
+                    <div>
+                        <p>
+                            The zlib/libpng license applies to the Modern UI.</p>
+                        <h3>
+                            <img class="trigger" alt="Open/Close section" id="trigger_lic" src="images/closed.gif"
+                                onclick="toggle('trigger_lic', 'toggle_lic');" />
+                            License Terms</h3>
+                        <div class="toggle" id="toggle_lic">
+                            <pre>
+Copyright &copy; 2002-2015 Joost Verburg
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute
+it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; 
+   you must not claim that you wrote the original software.
+   If you use this software in a product, an acknowledgment in the
+   product documentation would be appreciated but is not required.
+2. Altered versions must be plainly marked as such,
+   and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any distribution.
+</pre>
+                        </div>
+                    </div>
+                </div>
+            </td>
+        </tr>
+    </table>
+</body>
+</html>

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/Readme.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/Changelog.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/Changelog.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/Changelog.txt	(revision 728)
@@ -0,0 +1,263 @@
+NSIS Modern User Interface
+Version History
+
+1.8 - August 9, 2007
+* Uses the new language files
+* Updated documentation
+* Although MUI_DIRECTORYPAGE_BGCOLOR and MUI_STARTMENUPAGE_BGCOLOR are documented as interface
+  setttings that apply to every directory page or Start Menu folder page, they were actually
+  implemented as page specific settings. They have been changed to interface settings.
+* MUI_LANGDLL_DISPLAY now also reads a previously saved language from the registry if the
+  installation is silent.
+* InstallOptions macros have been moved to a separate header file (InstallOptions.nsh).
+  The MUI_INSTALLOPTIONS_* macros are still provided for backwards compatibility and insert the
+  equalivent INSTALLOPTIONS_* macros.
+* Added MUI_CUSTOMFUNCTION_MOUSEOVERSECTION
+
+1.78 - June 8, 2007
+* Added MUI_STARTMENUPAGE_BGCOLOR
+* Added MUI_DIRECTORYPAGE_BGCOLOR
+* Added MUI_LANGDLL_ALLLANGUAGES
+
+1.77 - April 27, 2007
+* Added MUI_FINISHPAGE_CANCEL_ENABLED
+* Added MUI_FINISHPAGE_REBOOTLATER_DEFAULT
+* Block unsupported languages in the language selection dialog
+* Cancel button no longer enabled by default on the finish page
+* Reduced flicker caused by MUI_HEADER_TRANSPARENT_TEXT
+
+1.76 - September 23, 2006
+* Added MUI_ABORTWARNING_CANCEL_DEFAULT
+
+1.75 - April 1, 2006
+* Added show function for the start menu page
+* Added MUI_HEADER_TRANSPARENT_TEXT for transparent header texts
+
+1.74 - September 4, 2005
+* Fixed compile error when checkboxes are used on multiple finish page pages
+
+1.73 - August 6, 2005
+* The checkboxes to run an application or show a Readme file can now also be used on an uninstaller
+  finish pages or multiple finish pages
+
+1.72 - November 27, 2004
+* Fixed state of Finish page Cancel button when both an installer and uninstaller page is included
+
+1.71 - October 14, 2004
+* The selected language is only stored in the registry when installation was successful
+
+1.70 - February 6, 2004
+* Improved documentation
+* New Init custom function for Welcome and Finish page
+
+1.69 - January 7, 2004
+* All uninstaller pages work without installer pages
+* Fixed top text on uninstaller license page
+
+1.68 - November 24, 2003
+* New settings for extra space for title and text on Welcome and Finish page.
+* Improved handling of verbose settings. Define MUI_VERBOSE the set the Modern UI verbose level (1-4).
+* Language file string for uninstaller reboot information
+* Setting for folder validation in leave function
+* Fixed finish page text settings for multiple pages
+
+1.67 - November 18, 2003
+* Support for uninstaller Welcome pages and Finish pages
+* Improved and changed text settings
+* ID for Start Menu Folder pages, easier to use multiple pages
+* Renamed a few settings
+* Default header image
+* Support for uninstaller abort warning
+* Setting for 3 line text on Welcome and Finish page
+  (NOTE: New settings have been introduced in version 1.68)
+* Langauge file backwards compatibility: English for missing strings
+* Support for different uninstaller header image
+* Language selection dialog not displayed if installer is silent
+* Cancel button on Finish page when there are options
+* Full RTL support
+
+1.66 - October 7, 2003
+* New system for page settings and custom pages
+* Support for uninstaller components page
+* Support for multiple pages of the same type
+* New position for interface settings
+* Changed macro and setting names
+* Updated langauge system, new language files and settings
+* Removed MUI_BRANDINGTEXT. You can use the standard BrandingText instruction.
+* Removed MUI_PRODUCT and MUI VERSION. You can use the standard Name instruction.
+
+1.65 - July 16, 2003
+* New page configuration system, no different system for installers with custom pages
+* Default windows color for the license text background
+* Example script updates (new format, user variables)
+* Improved registry storage for Start Menu folder
+* ReserveFile macro for StartMenu plug-in
+* Option to always show the language selection dialog (even if a language has been stored in the registry)
+* Checkboxes on Finish page can be used to call a function
+* Support for custom leave functions for Start Menu Folder, Welcome and Finish pages
+* Support for a link on the Finish page
+* New macro to get Start Menu folder in uninstaller
+* Options to disable bitmap stretching
+* Components page description box info text: always displayed
+  when mouse is outside box, disabled style
+
+1.64 - April 27, 2003
+* Support for license page with checkbox or radiobuttons to let the user accept the agreement or not
+* Macros for finish headers don't have to be inserted anymore
+* Language preference stored when installation has completed, no problems anymore when the users selects the wrong language
+* Header text for aborted installation
+* New macros: get language for uninstaller, delete shortcuts
+* Language specific fonts
+* Welcome/Finish page INI files can be modified in pre functions
+* More texts can be customized
+
+1.63 - March 9, 2003
+* Support for a bitmap in the wizard header
+* New defines to change the components page interface
+* MUI_SYSTEM inserted automatically
+* Single macro for language selection dialog
+* Removed page description in window title
+* Easier to customize resource files
+* New system for custom functions
+* Start Menu folder registry key automatically written
+* New InstallOptions macros that do not remove the return value from the stack
+* Support for custom pages before the finish page
+* Renamed Start Menu page defines
+* 'Do not create shortcuts' checkbox can be removed
+* 'MS Shell Dlg' font for header title
+* RTL support
+* Documentation updates
+* Minor fixes
+
+1.62 - February 2, 2003
+* New language strings for Finish page
+* Possibility to let a Modern UI Function call your own function
+* No problems anymore when using both 'Run program' and 'Show Readme' on the Finish page
+* Default state of checkboxes on the finish page can be changed
+* Welcome / Finish page compatible with custom DPI settings
+* Converted Install Options INI files to use dialog units
+* More ReserveFile macros
+  (NOTE: Some of these macros have been removed in later versions)
+* Background color can be changed with a define
+* Support for multilingual branding texts
+* Start Menu / Finish page window titles also work when using custom page commands
+* Language files should be inserted after inserting the MUI_SYSTEM macro
+  (NOTE: The MUI_SYSTEM macro has been removed in version 1.63)
+* Define MUI_MANUALVERBOSE if you don't want the Modern UI to change the verbose settings during compilation
+  (NOTE: This setting has been changed in version 1.68)
+    
+1.61 - December 5, 2002
+* modern3.exe UI without description area
+  (NOTE: This setting has been changed in version 1.63)
+* Added define to show uninstall confirm page
+* Added language string for finish page title and continue to uninstall
+* Define for parameters for the application to run on the finish page
+* Minor fixes
+
+1.6 - November 18, 2002
+* Welcome / Finish page
+* Automatic ask for reboot on finish page
+* Create no shortcut option on the Start Menu Folder selection page
+* Customizing GUIInit functions easier
+* Minor font / UI changes
+
+1.5 - November 11, 2002
+* New language file format
+* Language strings can be changed in the script without editing languagefiles
+* Start Menu Folder selection page
+* 'Click Next to continue' and 'Click Install to start the installation' texts automatically change to the page order
+* Install Options macros updated. MUI_INSTALLOPTIONS_DISPLAY is the standard macro now.
+  Use MUI_INSTALLOPTIONS_INITDIALOG and MUI_INSTALLOPTIONS_SHOW if you want to customize dialog controls.
+* No more writing window titles & abort warnings to Install Options INI Files
+* Compatible with updated paging system
+* Renamed macros and defines
+* Minor fixes
+
+1.4 - November 4, 2002
+* Uses new NSIS Page command
+* Macro System updates (smaller)
+* Macro System a lot easier
+* Modern UI Language Files load NLF language files
+* Renamed macros and defines
+
+1.3 - October 27, 2002
+* Easier macro system for basic scripts
+* New MultiLanguage system using Modern UI Language Files
+* New directory structure (header/language files in Contrib\Modern UI)
+* Small bugfixes & typo corrections
+* SetPage function should be set using defines
+* Different NextPage/PrevPage/FinishHeader macros for install/uninstall
+  (NOTE: These macros have been removed in version 1.4)
+* Interface settings can be definend (for example, MUI_ICON), no parameters for MUI_INTERFACE anymore
+* New Install Options macros to read/write IO INI file value
+
+1.21 - September 30, 2002
+* Temp vars set in Modern UI header
+* Currentpage & Install Options vars should be set using
+  parameters of the MUI_INTERFACE and * MUI_INSTALLOPTIONS macros
+  (NOTE: The MUI_INTERFACE macro has been removed in version 1.3)
+* MultiLanguage.nsi uses the new language strings
+
+1.2 - September 22, 2002
+  (NOTE: All macros mentioned here have been removed in version 1.4)
+  
+* Lots of macro system updates & fixes
+* InstallOptions support in macro system
+* Added Modern UI + InstallOptions example (InstallOptions.nsi)
+* MUI_NEXTPAGE_OUTER integrated in MUI_NEXTPAGE
+* No hard-coded function names anymore (you should give
+  MUI_PREVPAGE a parameter with the set page function name
+  (for example, MUI_PREVPAGE SetPage)
+* Examples use ReserveFile for faster startup
+
+1.19 - Semtember 19, 2002
+* Renamed some macros
+* Custom code can be used between page start/stop macros
+  (NOTE: These macros have been removed in version 1.4)
+
+1.18 - Semtember 13, 2002
+* Uses the new Sendmessage string option
+
+1.17 - Semtember 10, 2002
+* Win9x font weight bug fixed (font of title in white rect)
+
+1.16 - Semtember 6, 2002
+* Change text 'Scroll down' on license page to 'Press Page Down',
+  because the RichEdit control has focus by default now
+
+1.15 - Semtember 4, 2002
+* Multilanguage example: changed LangDialog to LangDLL::LangDialog (using the DLL name is now required)
+  (NOTE: A new macro for the language selection dialog has been introduced in version 1.63)
+
+1.14 - Semtember 3, 2002
+* Small grammar fix (thanks eccles)
+* UI files updated by Justin for better RichEdit usage
+
+1.13 - Semtember 2, 2002
+* Added 16 color icons 
+
+1.12 - August 30, 2002
+* Verifying installer & Unpacking data dialog has no titlebar anymore
+
+1.11 - August 29, 2002
+* Finish header for uninstaller can also be set using MUI_FINISHHEADER
+  (NOTE: The MUI_FINISHHEADER macro has been removed in version 1.64)
+
+1.1 - August 29, 2002
+  (NOTE: All settings mentioned here do not exist anymore)
+
+* Header file with macros, it's now very easy to use the UI in your scripts
+* Added the modern2.exe UI, with an other location of the Description frame, for installers with a lot of subsections (thanks rainwater)
+* Updated example scripts
+* Added Multilanguage.nsi example (Multilanguage & LangDLL)
+* Fixed background color issue with some custom XP themes
+* Removed WS_VISIBLE from black rect for inner dialog (fixes display issues)
+* Changed size of description area
+* Example script: Added instructions for the user on the Description frame
+* Auto sizing branding text
+* Used modern.bmp for the checks (thanks rainwater)
+* Using the new NSIS version, descriptions work using the keyboard and you can give descriptions to subsections
+* Correct font size using High-DPI fonts
+
+1.0 - August 26, 2002
+* Initial release
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/Changelog.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/images/header.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/images/header.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/images/closed.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/images/closed.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/images/screen1.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/images/screen1.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/images/screen2.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/images/screen2.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/images/open.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI/images/open.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Docs/StartMenu/Readme.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/StartMenu/Readme.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/StartMenu/Readme.txt	(revision 728)
@@ -0,0 +1,47 @@
+StartMenu.dll shows a custom page that lets the user select a start menu program 
+folder to put shortcuts in.
+
+To show the dialog use the Select function. This function has one required parameter 
+which is the program group default name, and some more optional switches:
+  /autoadd - automatically adds the program name to the selected folder
+  /noicon - doesn't show the icon in the top left corner
+  /text [please select...] - sets the top text to something else than
+                             "Select the Start Menu folder in which..."
+  /lastused [folder] - sets the edit box to a specific value folder.
+                       Use this to make this plug-in remember the last
+                       folder selected by the user
+  /checknoshortcuts text - Shows a check box with the text "text". If
+                           the user checks this box, the return value
+                           will have > as its first character and you
+                           should not create the program group.
+  /rtl - sets the direction of every control on the selection dialog
+         to RTL. This means every text shown on the page will be
+	 justified to the right.
+
+The order of the switches doesn't matter but the required parameter must come after
+all of them. Every switch after the required parameter will be ignored and left
+on the stack.
+
+The function pushes "success", "cancel" or an error to the stack. If there was no
+error and the user didn't press on cancel it will push the selected folder name
+after "success". If the user checked the no shortcuts checkbox the result will be
+prefixed with '>'. The function does not push the full path but only the selected
+sub-folder. It's up to you to decide if to put it in the current user or all
+users start menu.
+
+To set properties of the controls on the page, such as colors and fonts use Init
+and Show instead of Select. Init will push the HWND of the page on the stack,
+or an error string. For example:
+
+StartMenu::Init "Test"
+Pop $0
+IntCmp $0 0 failed
+GetDlgItem $0 $0 1003
+SetCtlColors $0 "" FF0000
+StartMenu::Show
+# continue as with Select here
+failed:
+
+Look at Example.nsi for a full example (without Init and Select).
+
+Created by Amir Szekely (aka KiCHiK)
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/StartMenu/Readme.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/nsDialogs/Readme.html
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/nsDialogs/Readme.html	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/nsDialogs/Readme.html	(revision 728)
@@ -0,0 +1,924 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>nsDialogs</title>
+<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
+<style type="text/css">
+b
+{
+	color: red;
+}
+code
+{
+	margin-left: 20px;
+	padding: 7px;
+	background-color: rgb(240,240,240);
+}
+</style>
+</head>
+<body>
+
+<h1>NSIS nsDialogs Plug-in</h1>
+<p><i>Next generation of user interface design</i></p>
+
+<h2>Table of Contents</h2>
+
+<ul>
+<li><a href="#intro">Introduction</a></li>
+<li>
+<a href="#step">Step-by-Step Tutorial</a>
+<ul>
+<li><a href="#step-basic">Basic Script</a></li>
+<li><a href="#step-page">Custom Page</a></li>
+<li><a href="#step-create">Creating Page</a></li>
+<li><a href="#step-show">Showing Page</a></li>
+<li><a href="#step-add">Adding Controls</a></li>
+<li><a href="#step-state">Control State</a></li>
+<li><a href="#step-notify">Real-time Notification</a></li>
+<li><a href="#step-memory">Memory</a></li>
+</ul>
+</li>
+<li>
+<a href="#ref">Function Reference</a>
+<ul>
+<li><a href="#ref-create">Create</a></li>
+<li><a href="#ref-createcontrol">CreateControl</a></li>
+<li><a href="#ref-show">Show</a></li>
+<li><a href="#ref-selectfiledialog">SelectFileDialog</a></li>
+<li><a href="#ref-selectfolderdialog">SelectFolderDialog</a></li>
+<li><a href="#ref-setrtl">SetRTL</a></li>
+<li><a href="#ref-getuserdata">GetUserData</a></li>
+<li><a href="#ref-setuserdata">SetUserData</a></li>
+<li><a href="#ref-onback">OnBack</a></li>
+<li><a href="#ref-onchange">OnChange</a></li>
+<li><a href="#ref-onclick">OnClick</a></li>
+<li><a href="#ref-onnotify">OnNotify</a></li>
+<li><a href="#ref-createtimer">CreateTimer</a></li>
+<li><a href="#ref-killtimer">KillTimer</a></li>
+</ul>
+</li>
+<li>
+<a href="#mref">Macro Reference</a>
+<ul>
+<li><a href="#mref-create">NSD_Create*</a></li>
+<li><a href="#mref-onback">NSD_OnBack</a></li>
+<li><a href="#mref-onchange">NSD_OnChange</a></li>
+<li><a href="#mref-onclick">NSD_OnClick</a></li>
+<li><a href="#mref-onnotify">NSD_OnNotify</a></li>
+<li><a href="#mref-createtimer">NSD_CreateTimer</a></li>
+<li><a href="#mref-killtimer">NSD_KillTimer</a></li>
+<li><a href="#mref-addstyle">NSD_AddStyle</a></li>
+<li><a href="#mref-addexstyle">NSD_AddExStyle</a></li>
+<li><a href="#mref-gettext">NSD_GetText</a></li>
+<li><a href="#mref-settext">NSD_SetText</a></li>
+<li><a href="#mref-settextlimit">NSD_SetTextLimit</a></li>
+<li><a href="#mref-getstate">NSD_GetState</a></li>
+<li><a href="#mref-setstate">NSD_SetState</a></li>
+<li><a href="#mref-check">NSD_Check</a></li>
+<li><a href="#mref-uncheck">NSD_Uncheck</a></li>
+<li><a href="#mref-cbaddstring">NSD_CB_AddString</a></li>
+<li><a href="#mref-cbselectstring">NSD_CB_SelectString</a></li>
+<li><a href="#mref-lbaddstring">NSD_LB_AddString</a></li>
+<li><a href="#mref-lbdelstring">NSD_LB_DelString</a></li>
+<li><a href="#mref-lbclear">NSD_LB_Clear</a></li>
+<li><a href="#mref-lbgetcount">NSD_LB_GetCount</a></li>
+<li><a href="#mref-lbselectstring">NSD_LB_SelectString</a></li>
+<li><a href="#mref-lbgetselection">NSD_LB_GetSelection</a></li>
+<li><a href="#mref-setfocus">NSD_SetFocus</a></li>
+<li><a href="#mref-setimage">NSD_SetImage</a></li>
+<li><a href="#mref-setsimage">NSD_SetStretchedImage</a></li>
+<li><a href="#mref-seticon">NSD_SetIcon</a></li>
+<li><a href="#mref-seticonfrominstaller">NSD_SetIconFromInstaller</a></li>
+<li><a href="#mref-clearimage">NSD_ClearImage</a></li>
+<li><a href="#mref-clearicon">NSD_ClearIcon</a></li>
+<li><a href="#mref-freeimage">NSD_FreeImage</a></li>
+<li><a href="#mref-freeicon">NSD_FreeIcon</a></li>
+</ul>
+</li>
+<li><a href="#faq">FAQ</a></li>
+</ul>
+
+<h2><a name="intro"></a>Introduction</h2>
+
+<p>nsDialogs allows creation of custom pages in the installer. On top of the built-in pages, nsDialogs can create pages with any type of controls in any order and arrangement. It can create everything from a simple page with one label to form which reacts to user's actions. <a href="../Modern UI 2/Readme.html">Modern UI 2</a>, for example, uses nsDialogs to create the welcome and finish pages.</p>
+
+<p>nsDialogs is a new NSIS plug-in, introduced in version 2.29 as a replacement for <a href="../InstallOptions/Readme.html">InstallOptions</a>. nsDialogs doesn't use INI files, so it's way faster than InstallOptions. Integration with the script is tighter and more natural - creating controls is done using plug-in functions and notification is done by directly calling a function in the script. Unlike InstallOptions, there isn't a predefined set of available control type and by providing a lower level access to Windows API, every type of control can be created and pages can be more customizable.</p>
+
+<p>The same thing that makes nsDialogs more flexible can also make it more complicated for users with no knowledge of Win32 API. This is solved by creating a library of predefined functions, defined in script, that allow creation and handling of controls. This way, novices get easy access to the flexibility, while advanced users still get access to the core functionality by modifying the library or simply avoid using it.</p>
+
+<h2><a name="step"></a>Step-by-Step Tutorial</h2>
+
+<h3><a name="step-basic"></a>Basic Script</h3>
+
+<p>Before using nsDialogs, lets first create a basic script as our skeleton.</p>
+
+<blockquote><pre>Name nsDialogs
+OutFile nsDialogs.exe
+
+XPStyle on
+
+Page instfiles
+
+Section
+
+	DetailPrint "hello world"
+
+SectionEnd</pre></blockquote>
+
+<h3><a name="step-page"></a>Custom Page</h3>
+
+<p>Next, we'll add a custom page where we can use nsDialogs. nsDialogs cannot be used in sections or any other function but a custom page's function.</p>
+
+<blockquote><pre>Name nsDialogs
+OutFile nsDialogs.exe
+
+XPStyle on
+
+<b>Page custom nsDialogsPage</b>
+Page instfiles
+
+<b>Function nsDialogsPage
+FunctionEnd</b>
+
+Section
+
+	DetailPrint "hello world"
+
+SectionEnd</pre></blockquote>
+
+<h3><a name="step-create"></a>Creating Page</h3>
+
+<p>Now that the foundations are laid, it's time to use nsDialogs. The first call must always be to nsDialogs::Create. It will create a new dialog in the page and return its <i>HWND</i> on the stack. The result must be popped from the stack to prevent stack corruption. If the result is <i>error</i>, the dialog couldn't be created.</p>
+
+<p>nsDialogs::Create accepts one parameter. It has a very specific function, but to keep things simple for this tutorial, it must always be 1018.</p>
+
+<p><i>HWND</i> is a number that uniquely identifies the dialog and can be used with SendMessage, SetCtlColors and Win32 API.</p>
+
+<blockquote><pre><b>!include LogicLib.nsh</b>
+
+Name nsDialogs
+OutFile nsDialogs.exe
+
+XPStyle on
+
+<b>Var Dialog</b>
+
+Page custom nsDialogsPage
+Page instfiles
+
+Function nsDialogsPage
+<b>
+	nsDialogs::Create 1018
+	Pop $Dialog
+
+	${If} $Dialog == error
+		Abort
+	${EndIf}
+</b>
+FunctionEnd
+
+Section
+
+	DetailPrint "hello world"
+
+SectionEnd</pre></blockquote>
+
+<h3><a name="step-show"></a>Showing Page</h3>
+
+<p>Now that the page is created, it's time to show it. This is done with nsDialogs::Show. This function will not return until the user clicks Next, Back or Cancel.</p>
+
+<blockquote><pre>!include LogicLib.nsh
+
+Name nsDialogs
+OutFile nsDialogs.exe
+
+XPStyle on
+
+Var Dialog
+
+Page custom nsDialogsPage
+Page instfiles
+
+Function nsDialogsPage
+	nsDialogs::Create 1018
+	Pop $Dialog
+
+	${If} $Dialog == error
+		Abort
+	${EndIf}
+<b>
+	nsDialogs::Show
+</b>
+FunctionEnd
+
+Section
+
+	DetailPrint "hello world"
+
+SectionEnd</pre></blockquote>
+
+<h3><a name="step-add"></a>Adding Controls</h3>
+
+<p>Compiling the last script and running it results in an empty page which is not very useful. So now we'll add some controls to it to. To do so, we'll use <a href="#mref-create">${NSD_Create*}</a> macros from nsDialogs.nsh. Each of those macros takes 5 parameters - x, y, width, height and text. Each macro also returns one value on the stack, which is the new control's HWND. Like the dialogs HWND, it must be popped from the stack and saved.</p>
+
+<p>Each of the measurements that the macros take can use one of three unit types - pixels, dialog units or percentage of the dialog's size. It can also be negative to indicate it should be measured from the end. To use dialog units, the measurement must be suffixed with the letter <i>u</i>. To use percentage, the measurement must be suffixed with the percentage sign - <i>%</i>. Any other suffix, or no suffix, means pixels.</p>
+
+<p>Dialog units allow creation of dialogs that scale well when different fonts or DPI is used. Its size in pixels is determined on runtime based on the font and the DPI. For example, standard pages in the classic NSIS user interface are 266 dialog units wide and 130 dialog units high. Pages in Modern UI are 300 dialogs units wide and 140 dialog units high. In different resolutions, using different fonts or DPI settings, the dialogs will always have the same size in dialog units, but different size in pixels.</p>
+
+<blockquote><pre><b>!include nsDialogs.nsh</b>
+!include LogicLib.nsh
+
+Name nsDialogs
+OutFile nsDialogs.exe
+
+XPStyle on
+
+Var Dialog
+<b>Var Label
+Var Text</b>
+
+Page custom nsDialogsPage
+Page instfiles
+
+Function nsDialogsPage
+
+	nsDialogs::Create 1018
+	Pop $Dialog
+
+	${If} $Dialog == error
+		Abort
+	${EndIf}
+<b>
+	${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
+	Pop $Label
+
+	${NSD_CreateText} 0 13u 100% -13u "Type something here..."
+	Pop $Text
+</b>
+	nsDialogs::Show
+
+FunctionEnd
+
+Section
+
+	DetailPrint "hello world"
+
+SectionEnd</pre></blockquote>
+
+<p>Available control types that can be created with <a href="#mref-create">${NSD_Create*}</a> are:</p>
+
+<ul>
+<li>HLine</li>
+<li>VLine</li>
+<li>Label</li>
+<li>Icon</li>
+<li>Bitmap</li>
+<li>BrowseButton</li>
+<li>Link</li>
+<li>Button</li>
+<li>GroupBox</li>
+<li>CheckBox</li>
+<li>RadioButton</li>
+<li>Text</li>
+<li>Password</li>
+<li>Number</li>
+<li>FileRequest</li>
+<li>DirRequest</li>
+<li>ComboBox</li>
+<li>DropList</li>
+<li>ListBox</li>
+<li>ProgressBar</li>
+</ul>
+
+<h3><a name="step-state"></a>Control State</h3>
+
+<p>Now that we have some controls that the user can interact with, it's time to see what the user actually does with them. For that, we'll first add a <i>leave callback</i> function to our page. In that function, we'll query the state of the text control we've created and display it to the user. To do so, we'll use the <a href="#mref-gettext">${NSD_GetText}</a> macro. Use the <a href="#mref-getstate">${NSD_GetState}</a> macro for RadioButton and CheckBox controls.</p>
+
+<p>Note that not all controls support <a href="#mref-gettext">${NSD_GetText}</a> and some require special handling with specific messages defined in WinMessages.nsh. For example, the ListBox control requires usage of <i>LB_GETCURSEL</i> and <i>LB_GETTEXT</i>. With time, the library of macros in nsDialogs.nsh will fill with more and more macros that'll handle more cases like this.</p>
+
+<blockquote><pre>!include nsDialogs.nsh
+!include LogicLib.nsh
+
+Name nsDialogs
+OutFile nsDialogs.exe
+
+XPStyle on
+
+Var Dialog
+Var Label
+Var Text
+
+Page custom nsDialogsPage <b>nsDialogsPageLeave</b>
+Page instfiles
+
+Function nsDialogsPage
+
+	nsDialogs::Create 1018
+	Pop $Dialog
+
+	${If} $Dialog == error
+		Abort
+	${EndIf}
+
+	${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
+	Pop $Label
+
+	${NSD_CreateText} 0 13u 100% -13u "Type something here..."
+	Pop $Text
+
+	nsDialogs::Show
+
+FunctionEnd
+
+<b>Function nsDialogsPageLeave
+
+	${NSD_GetText} $Text $0
+	MessageBox MB_OK "You typed:$\n$\n$0"
+
+FunctionEnd</b>
+
+Section
+
+	DetailPrint "hello world"
+
+SectionEnd</pre></blockquote>
+
+<h3><a name="step-notify"></a>Real-time Notification</h3>
+
+<p>One of the more exciting new features of nsDialogs is callback function notification of changes to the dialog. nsDialogs can call a function defined in a script in response to a user action such as changing of a text field or click of a button. To make nsDialogs notify us of events, we'll use <a href="#mref-onclick">${NSD_OnClick}</a> and <a href="#mref-onchange">${NSD_OnChange}</a>. Not every control supports both of the events. For example, there is nothing to notify about label changes, only clicks.</p>
+
+<p>When the callback function is called, the control's HWND will be waiting on the stack and must be popped to prevent stack corruption. In this simple example, this is not so useful. But in case of a bigger script where several controls are associated with the same callback function, the HWND can shed some light on which control originated the event.</p>
+
+<p>The new example will respond to the user type <i>hello</i> in the text box.</p>
+
+<blockquote><pre>!include nsDialogs.nsh
+!include LogicLib.nsh
+
+Name nsDialogs
+OutFile nsDialogs.exe
+
+XPStyle on
+
+Var Dialog
+Var Label
+Var Text
+
+Page custom nsDialogsPage nsDialogsPageLeave
+Page instfiles
+
+Function nsDialogsPage
+
+	nsDialogs::Create 1018
+	Pop $Dialog
+
+	${If} $Dialog == error
+		Abort
+	${EndIf}
+
+	${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
+	Pop $Label
+
+	${NSD_CreateText} 0 13u 100% -13u "Type something here..."
+	Pop $Text
+	<b>${NSD_OnChange} $Text nsDialogsPageTextChange</b>
+
+	nsDialogs::Show
+
+FunctionEnd
+
+Function nsDialogsPageLeave
+
+	${NSD_GetText} $Text $0
+	MessageBox MB_OK "You typed:$\n$\n$0"
+
+FunctionEnd
+
+<b>Function nsDialogsPageTextChange
+
+	Pop $1 # $1 == $ Text
+
+	${NSD_GetText} $Text $0
+
+	${If} $0 == "hello"
+
+		MessageBox MB_OK "right back at ya!"
+
+	${EndIf}
+
+FunctionEnd</b>
+
+Section
+
+	DetailPrint "hello world"
+
+SectionEnd</pre></blockquote>
+
+<h3><a name="step-memory"></a>Memory</h3>
+
+<p>So far we have a page that has some basic input controls. But what happens when the user goes to the next page and comes back? With the current code, the user's input will not be remembered. To remember, we'll use the already present leave callback function to store the user's choice in variables and pass these values when creating the controls the next time. For a better example, we'll also add a checkbox to the page and use <a href="#mref-getstate">${NSD_GetState}</a> and <a href="#mref-setstate">${NSD_SetState}</a> to get and set its state.</p>
+
+<p>For clarity, we'll remove some of the notifications from the previous step.</p>
+
+<blockquote><pre>!include nsDialogs.nsh
+!include LogicLib.nsh
+
+Name nsDialogs
+OutFile nsDialogs.exe
+
+XPStyle on
+
+Var Dialog
+Var Label
+Var Text
+<b>Var Text_State
+Var Checkbox
+Var Checkbox_State</b>
+
+Page custom nsDialogsPage nsDialogsPageLeave
+<b>Page license</b>
+Page instfiles
+
+<b>Function .onInit
+
+	StrCpy $Text_State "Type something here..."
+
+FunctionEnd</b>
+
+Function nsDialogsPage
+
+	nsDialogs::Create 1018
+	Pop $Dialog
+
+	${If} $Dialog == error
+		Abort
+	${EndIf}
+
+	${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
+	Pop $Label
+
+	${NSD_CreateText} 0 13u 100% <b>12u $Text_State</b>
+	Pop $Text
+
+	<b>${NSD_CreateCheckbox} 0 30u 100% 10u "&amp;Something"
+	Pop $Checkbox
+
+	${If} $Checkbox_State == ${BST_CHECKED}
+		${NSD_Check} $Checkbox
+	${EndIf}
+
+	# alternative for the above ${If}:
+	#${NSD_SetState} $Checkbox_State</b>
+
+	nsDialogs::Show
+
+FunctionEnd
+
+Function nsDialogsPageLeave
+
+	${NSD_GetText} $Text <b>$Text_State</b>
+	<b>${NSD_GetState} $Checkbox $Checkbox_State</b>
+
+FunctionEnd
+
+Section
+
+	DetailPrint "hello world"
+
+SectionEnd</pre></blockquote>
+
+<h2><a name="ref"></a>Function Reference</h2>
+
+<h3><a name="ref-create"></a>Create</h3>
+
+<p><code>nsDialogs::Create <i>rect</i></code></p>
+
+<p>Creates a new dialog. <i>rect</i> specific the identifier of the control whose location will be mimiced. This should usually be 1018, which is control mimiced for creation of built-in pages. The Modern UI also has control 1040 for the welcome and the finish page.</p>
+
+<p>Returns the new dialog's HWND on the stack or <i>error</i>.</p>
+
+<h3><a name="ref-createcontrol"></a>CreateControl</h3>
+
+<p><code>nsDialogs::CreateControl <i>class</i> <i>style</i> <i>extended_style</i> <i>x</i> <i>y</i> <i>width</i> <i>height</i> <i>text</i></code></p>
+
+<p>Create a new control in the current dialog. A dialog must exist for this to work, so nsDialogs::Create must be called prior to this function.</p>
+
+<p>Returns the new dialog's HWND on the stack or <i>error</i>.</p>
+
+<h3><a name="ref-show"></a>Show</h3>
+
+<p><code>nsDialogs::Show</code></p>
+
+<p>Displays the page. Call this once finished with nsDialogs::Create, nsDialogs::CreateControl and the rest.</p>
+
+<p>Returns nothing.</p>
+
+<h3><a name="ref-selectfiledialog"></a>SelectFileDialog</h3>
+
+<p><code>nsDialogs::SelectFileDialog <i>mode</i> <i>initial_selection</i> <i>filter</i></code></p>
+
+<p>Displays a file selection dialog to the user. If <i>mode</i> is set to <i>save</i>, displays a file save dialog. If <i>mode</i> is set to <i>open</i>, displays a file open dialog. <i>filter</i> is a list of available file filters separated by pipes. If an empty string is passed, the default is used - <i>All Files|*.*</i>.</p>
+
+<p><i>initial_selection</i> can be used to provide the user with a default file to look for and/or a default folder to look in. If <i>initial_selection</i> is empty no default filename will be provided for the user and the dialog will start in the current working directory. If <i>initial_selection</i> specifies just a filename, for example "test.exe", the dialog will be set up to look for a file called test.exe in the current working directory. If <i>initial_selection</i> specifies just a directory, for example "C:\Program Files", the dialog starts in the provided directory with no file name provided. If <i>initial_selection</i> specifies a directory and a filename, for example "C:\Windows\System32\calc.exe", the dialog will be set up to look for a file called calc.exe in the directory C:\Windows\System32.</p>
+
+<p>Returns the selected file on the stack or an empty string if the user canceled the operation.</p>
+
+<h3><a name="ref-selectfolderdialog"></a>SelectFolderDialog</h3>
+
+<p><code>nsDialogs::SelectFolderDialog <i>title</i> <i>initial_selection</i></code></p>
+
+<p>Displays a directory selection dialog to the user.</p>
+
+<p>Returns the selected directory on the stack or "error" in case the user canceled the operation or an error occured.</p>
+
+<h3><a name="ref-setrtl"></a>SetRTL</h3>
+
+<p><code>nsDialogs::SetRTL <i>rtl_setting</i></code></p>
+
+<p>Sets right-to-left mode on or off. If <i>rtl_setting</i> is 0, it's set to off. If <i>rtl_setting</i> is 1, it's set to on. This function must be called before any calls to nsDialogs::CreateControl.</p>
+
+<p>Returns nothing.</p>
+
+<h3><a name="ref-getuserdata"></a>GetUserData</h3>
+
+<p><code>nsDialogs::GetUserData <i>control_HWND</i></code></p>
+
+<p>Returns user data associated with the control on the stack.  Use nsDialogs::SetUserData to set this data.</p>
+
+<h3><a name="ref-setuserdata"></a>SetUserData</h3>
+
+<p><code>nsDialogs::SetUserData <i>control_HWND</i> <i>data</i></code></p>
+
+<p>Associates <i>data</i> with the control. Use nsDialogs::GetUserData to get this data.</p>
+
+<p>Returns nothing.</p>
+
+<h3><a name="ref-onback"></a>OnBack</h3>
+
+<p><code>nsDialogs::OnBack <i>function_address</i></code></p>
+
+<p>Sets the callback function for the Back button. This function will be called when the user clicks the back button. Call Abort in this function to prevent the user from going back to the last page.</p>
+
+<p>Use GetFunctionAddress to get the address of the desired callback function.</p>
+
+<p>Returns nothing.</p>
+
+<h3><a name="ref-onchange"></a>OnChange</h3>
+
+<p><code>nsDialogs::OnChange <i>control_HWND</i> <i>function_address</i></code></p>
+
+<p>Sets a change notification callback function for the given control. Whenever the control changes, the function will be called and the control's HWND will be waiting on its stack.</p>
+
+<p>Use GetFunctionAddress to get the address of the desired callback function.</p>
+
+<p>Returns nothing.</p>
+
+<h3><a name="ref-onclick"></a>OnClick</h3>
+
+<p><code>nsDialogs::OnClick <i>control_HWND</i> <i>function_address</i></code></p>
+
+<p>Sets a click notification callback function for the given control. Whenever the control is clicked, the function will be called and the control's HWND will be waiting on its stack.</p>
+
+<p>Use GetFunctionAddress to get the address of the desired callback function.</p>
+
+<p>Returns nothing.</p>
+
+<h3><a name="ref-onnotify"></a>OnNotify</h3>
+
+<p><code>nsDialogs::OnNotify <i>control_HWND</i> <i>function_address</i></code></p>
+
+<p>Sets a notification callback function for the given control. Whenever the control receives the WM_NOTIFY message, the function will be called and the control's HWND, notification code and a pointer to the MNHDR structure will be waiting on its stack.</p>
+
+<p>Use GetFunctionAddress to get the address of the desired callback function.</p>
+
+<p>Returns nothing.</p>
+
+<h3><a name="ref-createtimer"></a>CreateTimer</h3>
+
+<p><code>nsDialogs::CreateTimer <i>function_address</i> <i>timer_interval</i></code></p>
+
+<p>Sets a timer that'd call the callback function for the given control every in a constant interval. Interval times are specified in milliseconds.</p>
+
+<p>Use GetFunctionAddress to get the address of the desired callback function.</p>
+
+<p>Returns nothing.</p>
+
+<h3><a name="ref-killtimer"></a>KillTimer</h3>
+
+<p><code>nsDialogs::KillTimer <i>function_address</i></code></p>
+
+<p>Kills a previously set timer.</p>
+
+<p>Use GetFunctionAddress to get the address of the desired callback function.</p>
+
+<p>Returns nothing.</p>
+
+<h2><a name="mref"></a>Macro Reference</h2>
+
+<p>nsDialogs.nsh contains a lot of macros that can make nsDialogs usage a lot easier. Below is a description of each of those macros including purpose, syntax, input and output.</p>
+
+<h3><a name="mref-create"></a>NSD_Create*</h3>
+
+<p><code>${NSD_Create*} <i>x</i> <i>y</i> <i>width</i> <i>height</i> <i>text</i></code></p>
+
+<p>Create a new control in the current dialog. A dialog must exist for this to work, so nsDialogs::Create must be called prior to this function.</p>
+
+<p>Available variants:</p>
+
+<ul>
+<li>${NSD_CreateHLine}</li>
+<li>${NSD_CreateVLine}</li>
+<li>${NSD_CreateLabel}</li>
+<li>${NSD_CreateIcon}</li>
+<li>${NSD_CreateBitmap}</li>
+<li>${NSD_CreateBrowseButton}</li>
+<li>${NSD_CreateLink}</li>
+<li>${NSD_CreateButton}</li>
+<li>${NSD_CreateGroupBox}</li>
+<li>${NSD_CreateCheckBox}</li>
+<li>${NSD_CreateRadioButton}</li>
+<li>${NSD_CreateText}</li>
+<li>${NSD_CreatePassword}</li>
+<li>${NSD_CreateNumber}</li>
+<li>${NSD_CreateFileRequest}</li>
+<li>${NSD_CreateDirRequest}</li>
+<li>${NSD_CreateComboBox}</li>
+<li>${NSD_CreateDropList}</li>
+<li>${NSD_CreateListBox}</li>
+<li>${NSD_CreateProgressBar}</li>
+</ul>
+
+<p>Returns the new dialog's HWND on the stack or error.</p>
+
+<h3><a name="mref-onback"></a>NSD_OnBack</h3>
+
+<p><code>${NSD_OnBack} <i>function_address</i></code></p>
+
+<p>See <a href="#ref-onback">OnBack</a> for more details.</p>
+
+<p></p>
+
+<h3><a name="mref-onchange"></a>NSD_OnChange</h3>
+
+<p><code>${NSD_OnChange} <i>control_HWND</i> <i>function_address</i></code></p>
+
+<p>See <a href="#ref-onchange">OnChange</a> for more details.</p>
+
+<p>See <a href="#step-notify">Real-time Notification</a> for usage example.</p>
+
+<h3><a name="mref-onclick"></a>NSD_OnClick</h3>
+
+<p><code>${NSD_OnClick} <i>control_HWND</i> <i>function_address</i></code></p>
+
+<p>See <a href="#ref-onclick">OnClick</a> for more details.</p>
+
+<h3><a name="mref-onnotify"></a>NSD_OnNotify</h3>
+
+<p><code>${NSD_OnNotify} <i>control_HWND</i> <i>function_address</i></code></p>
+
+<p>See <a href="#ref-onnotify">OnNotify</a> for more details.</p>
+
+<h3><a name="mref-createtimer"></a>NSD_CreateTimer</h3>
+
+<p><code>${NSD_CreateTimer} <i>function_address</i> <i>timer_interval</i></code></p>
+
+<p>See <a href="#ref-createtimer">CreateTimer</a> for more details.</p>
+
+<h3><a name="mref-killtimer"></a>NSD_KillTimer</h3>
+
+<p><code>${NSD_KillTimer} <i>function_address</i></code></p>
+
+<p>See <a href="#ref-killtimer">KillTimer</a> for more details.</p>
+
+<h3><a name="mref-addstyle"></a>NSD_AddStyle</h3>
+
+<p><code>${NSD_AddStyle} <i>control_HWND</i> <i>style</i></code></p>
+
+<p>Adds one or more window style to a control. Multiple styles should be separated with pipes `|'.</p>
+
+<p>See MSDN for style description.</p>
+
+<h3><a name="mref-addexstyle"></a>NSD_AddExStyle</h3>
+
+<p><code>${NSD_AddExStyle} <i>control_HWND</i> <i>style</i></code></p>
+
+<p>Adds one or more extended window style to a control. Multiple styles should be separated with pipes `|'.</p>
+
+<p>See MSDN for style description.</p>
+
+<h3><a name="mref-gettext"></a>NSD_GetText</h3>
+
+<p><code>${NSD_GetText} <i>control_HWND</i> <i>output_variable</i></code></p>
+
+<p>Retrieves the text of a control and stores it into <i>output_variable</i>. Especially useful for textual controls.</p>
+
+<p>See <a href="#step-state">Control State</a> for usage example.</p>
+
+<h3><a name="mref-settext"></a>NSD_SetText</h3>
+
+<p><code>${NSD_SetText} <i>control_HWND</i> <i>text</i></code></p>
+
+<p>Sets the text of a control.</p>
+
+<h3><a name="mref-settextlimit"></a>NSD_SetTextLimit</h3>
+
+<p><code>${NSD_SetTextLimit} <i>control_HWND</i> <i>limit</i></code></p>
+
+<p>Sets input size limit for a text control.</p>
+
+<h3><a name="mref-getstate"></a>NSD_GetState</h3>
+
+<p><code>${NSD_GetState} <i>control_HWND</i> <i>output_variable</i></code></p>
+
+<p>Retrieves the state of a check box or a radio button control. Possible outputs are ${BST_CHECKED} and ${BST_UNCHECKED}.</p>
+
+<p>See <a href="#step-memory">Memory</a> for usage example.</p>
+
+<h3><a name="mref-setstate"></a>NSD_SetState</h3>
+
+<p><code>${NSD_SetState} <i>control_HWND</i> <i>state</i></code></p>
+
+<p>Sets the state of a check box or a radio button control. Possible values for <i>state</i> are ${BST_CHECKED} and ${BST_UNCHECKED}.</p>
+
+<p>See <a href="#step-memory">Memory</a> for usage example.</p>
+
+<h3><a name="mref-check"></a>NSD_Check</h3>
+
+<p><code>${NSD_Check} <i>control_HWND</i></code></p>
+
+<p>Checks a check box or a radio button control. Same as calling ${NSD_SetState} with ${BST_CHECKED}.</p>
+
+<h3><a name="mref-uncheck"></a>NSD_Uncheck</h3>
+
+<p><code>${NSD_Uncheck} <i>control_HWND</i></code></p>
+
+<p>Unchecks a check box or a radio button control. Same as calling ${NSD_SetState} with ${BST_UNCHECKED}.</p>
+
+<p>See <a href="#step-memory">Memory</a> for usage example.</p>
+
+<h3><a name="mref-cbaddstring"></a>NSD_CB_AddString</h3>
+
+<p><code>${NSD_CB_AddString} <i>combo_HWND</i> <i>string</i></code></p>
+
+<p>Adds a string to a combo box.</p>
+
+<h3><a name="mref-cbselectstring"></a>NSD_CB_SelectString</h3>
+
+<p><code>${NSD_CB_SelectString} <i>combo_HWND</i> <i>string</i></code></p>
+
+<p>Selects a string in a combo box.</p>
+
+<h3><a name="mref-lbaddstring"></a>NSD_LB_AddString</h3>
+
+<p><code>${NSD_LB_AddString} <i>listbox_HWND</i> <i>string</i></code></p>
+
+<p>Adds a string to a list box.</p>
+
+<h3><a name="mref-lbdelstring"></a>NSD_LB_DelString</h3>
+
+<p><code>${NSD_LB_DelString} <i>listbox_HWND</i> <i>string</i></code></p>
+
+<p>Deletes a string from a list box.</p>
+
+<h3><a name="mref-lbcleqar">NSD_LB_Clear</a></h3>
+
+<p><code>${NSD_LB_Clear} <i>listbox_HWND</i></code></p>
+
+<p>Deletes all strings from a list box.</p>
+
+<h3><a name="mref-lbgetcount">NSD_LB_GetCount</a></h3>
+
+<p><code>${NSD_LB_GetCount} <i>listbox_HWND</i> <i>output_variable</i></code></p>
+
+<p>Retrieves the number of strings from a list box.</p>
+
+<h3><a name="mref-lbselectstring"></a>NSD_LB_SelectString</h3>
+
+<p><code>${NSD_LB_SelectString} <i>listbox_HWND</i> <i>string</i></code></p>
+
+<p>Selects a string in a list box.</p>
+
+<h3><a name="mref-lbgetselection">NSD_LB_GetSelection</a></h3>
+
+<p><code>${NSD_LB_GetSelection} <i>listbox_HWND</i> <i>output_variable</i></code></p>
+
+<p>Retrieves the selected stringed from a list box. Returns an empty string if no string is selected.</p>
+
+<h3><a name="mref-setfocus"></a>NSD_SetFocus</h3>
+
+<p><code>${NSD_SetFocus} <i>control_HWND</i></code></p>
+
+<p>Sets focus to a control.</p>
+
+<h3><a name="mref-setimage"></a>NSD_SetImage</h3>
+
+<p><code>${NSD_SetImage} <i>control_HWND</i> <i>image_path</i> <i>output_variable</i></code></p>
+
+<p>Loads a bitmap from <i>image_path</i> and displays it on <i>control_HWND</i> created by <a href="#mref-create">${NSD_CreateBitmap}</a>. The image handle is stored in <i>output_variable</i> and should be freed using <a href="#mref-freeimage">${NSD_FreeImage}</a> once no longer necessary.</p>
+
+<p>The image must be extracted to the user's computer prior to calling this macro. A good place to extract images is $PLUGINSDIR.</p>
+
+<blockquote><pre>!include nsDialogs.nsh
+
+Name nsDialogs
+OutFile nsDialogs.exe
+
+XPStyle on
+
+Page custom nsDialogsImage
+Page instfiles
+
+Var Dialog
+Var Image
+Var ImageHandle
+
+Function .onInit
+
+	InitPluginsDir
+	File /oname=$PLUGINSDIR\image.bmp "${NSISDIR}\Contrib\Graphics\Header\nsis-r.bmp"
+
+FunctionEnd
+
+Function nsDialogsImage
+
+	nsDialogs::Create 1018
+	Pop $Dialog
+
+	${If} $Dialog == error
+		Abort
+	${EndIf}
+
+	${NSD_CreateBitmap} 0 0 100% 100% ""
+	Pop $Image
+	${NSD_SetImage} $Image $PLUGINSDIR\image.bmp $ImageHandle
+
+	nsDialogs::Show
+
+	${NSD_FreeImage} $ImageHandle
+
+FunctionEnd
+
+Section
+SectionEnd</pre></blockquote>
+
+<h3><a name="mref-setsimage"></a>NSD_SetStretchedImage</h3>
+
+<p><code>${NSD_SetStretchedImage} <i>control_HWND</i> <i>image_path</i> <i>output_variable</i></code></p>
+
+<p>Loads and displays a bitmap just like <a href="#mref-setimage">${NSD_SetImage}</a>, but stretched the image to fit the control.</p>
+
+<h3><a name="mref-seticon"></a>NSD_SetIcon</h3>
+
+<p><code>${NSD_SetIcon} <i>control_HWND</i> <i>image_path</i> <i>output_variable</i></code></p>
+
+<p>Same as <a href="#mref-setimage">${NSD_SetImage}</a>, but used for loading and setting an icon in a control created by <a href="#mref-create">${NSD_CreateIcon}</a>. The image handle is stored in <i>output_variable</i> and should be freed using <a href="#mref-freeicon">${NSD_FreeIcon}</a> once no longer necessary.</p>
+
+<h3><a name="mref-seticonfrominstaller"></a>NSD_SetIconFromInstaller</h3>
+
+<p><code>${NSD_SetIconFromInstaller} <i>control_HWND</i> <i>output_variable</i></code></p>
+
+<p>Loads the icon used in the isntaller and displays it on <i>control_HWND</i> created by <a href="#mref-create">${NSD_CreateIcon}</a>. The image handle is stored in <i>output_variable</i> and should be freed using <a href="#mref-freeicon">${NSD_FreeIcon}</a> once no longer necessary.</p>
+
+<h3><a name="mref-clearimage"></a>NSD_ClearImage</h3>
+
+<p><code>${NSD_ClearImage} <i>control_HWND</i></code></p>
+
+<p>Clears an image from a control.</p>
+
+<h3><a name="mref-clearicon"></a>NSD_ClearIcon</h3>
+
+<p><code>${NSD_ClearIcon} <i>control_HWND</i></code></p>
+
+<p>Clears an icon from a control.</p>
+
+<h3><a name="mref-freeimage"></a>NSD_FreeImage</h3>
+
+<p><code>${NSD_FreeImage} <i>image_handle</i></code></p>
+
+<p>Frees an image handle previously loaded with <a href="#mref-setimage">${NSD_SetImage}</a> or <a href="#mref-setsimage">${NSD_SetStretchedImage}</a>.</p>
+
+<h3><a name="mref-freeicon"></a>NSD_FreeIcon</h3>
+
+<p><code>${NSD_FreeIcon} <i>icon_handle</i></code></p>
+
+<p>Frees an icon handle previously loaded with <a href="#mref-seticon">${NSD_SetIcon}</a> or <a href="#mref-seticonfrominstaller">${NSD_SetIconFromInstaller}</a>.</p>
+
+
+<h2><a name="faq"></a>FAQ</h2>
+
+<div>
+
+<ul>
+
+<li>
+<b>Q:</b> Can nsDialogs handle InstallOptions INI files?
+<blockquote>
+<p><b>A:</b> nsDialogs.nsh contains a function called <i>CreateDialogFromINI</i> that can create nsDialogs' dialog from an INI file. It can handle every type of control InstallOptions supports, but doesn't handle the flags or notification yet. <i>Examples\nsDialogs\InstallOptions.nsi</i> shows a usage example of this function.</p><p>In the future there'll also be a function that creates the script itself.
+</blockquote>
+</li>
+
+</ul>
+
+</div>
+
+</body>
+</html>

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/nsDialogs/Readme.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/StrFunc/StrFunc.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/StrFunc/StrFunc.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/StrFunc/StrFunc.txt	(revision 728)
@@ -0,0 +1,707 @@
+String Functions Header File Readme
+-----------------------------------
+
+String Functions Header File contains a set of good string manipulation
+functions in a much simpler way to include and call in NSIS scripts.
+
+How to use
+----------
+
+  Basic Syntax
+  ------------
+
+  Parameters are specified in this format:
+  required (required) (option1 | option2) [optional or add. options]
+  [option1 | option2]
+
+  The stars in command titles (*****) are the function usefulness in my
+  opinion. The more starts, the more useful it is. 5 stars (*****) is the
+  most useful.
+
+  Any time when is mentioned "Default is" means that you can use the value
+  mentioned or keep it blank, the result is the same.
+
+  If you want a certain value (e.g. a text) to be language-specific, set a
+  language string (using LangString) and define $(STRINGNAME) as value.
+
+  If you want to add ` to a string, you should always escape it using $\`
+  because the header file macro functions use ` to separate parameters.
+
+  1. Include Header file
+  ----------------------
+
+    !include "StrFunc.nsh"
+
+    StrFunc.nsh has to be inside Include directory, so you don't have to
+    specify a path.
+
+    You have to put this command before any command used in this header file.
+
+  2. Defines
+  ----------
+
+    This header file contains defines that automate the life of some who
+    fear a lot of changes sometimes imposed in this header file, or who have
+    applications that put it to work at maximum capacity. Before you try
+    these, take a look at the information below:
+
+      - Every item on a define value is separated by a "|", and every subitem
+        (items in an item) is separated by " ".
+
+      - Use ${StrTok} $var "${DefineName}" "|" "$counter" "0" to get every
+        item inside the define. For subitems, use ${StrTok} $var2 "$var" " "
+        "$counter2" "0" after getting the value for a desired item.
+
+      - ${StrFunc_List} is automatically made by the header file. The rest
+        is manually added to the header.
+
+    2.1 Defines List:
+    -----------------
+
+    StrFunc_List - Lists all function names currently available on StrFunc
+                   header file.
+
+    *_List       - Lists all parameter names currently available for "*"
+                   function. (* = function name - i.e. StrTok_List).
+
+    *_TypeList   - Lists the types of all parameters on "*" function.
+                   (* = function name - i.e. StrTok_List). Possible types
+                   for each parameter:
+
+                   - Output - Needs a variable to output a function result.
+
+                   - Text   - Needs text or number to be input.
+
+                   - Mixed  - Needs text, number or option to be inputed.
+                              Each subitem following the "Mixed" word is an
+                              option. The first option is ever the default
+                              one. Two following spaces "  " means that
+                              that subitem is empty.
+
+                   - Option - Needs an option to be inputed. Each subitem
+                              following the "Option" word is an option.
+                              The first option is ever the default one. Two
+                              following spaces "  " means that that subitem
+                              is empty.
+
+  3. Commands
+  -----------
+
+  Some commands have special specifications to work. Consult command's
+  documentation on "3.3 Commands" section.
+
+    3.1 How To Use Commands In Install Sections and Functions
+    ---------------------------------------------------------
+
+    Every command used in install sections and functions have to be called
+    first before and out of any sections and functions, and without
+    parameters.
+
+    Example:
+    --------
+
+    ${StrStr}
+    
+    3.2 How To Use Commands In Uninstall Sections and Functions
+    -----------------------------------------------------------
+
+    Commands with Uninstall Sections and Functions support have "Un" before
+    the words inside curly brackets "{}".
+
+    Example:
+    --------
+    
+    ${UnStrStr}
+
+    A complete example with both Install and Uninstall Commands:
+    ------------------------------------------------------------
+
+
+    !include "StrFunc.nsh"
+
+    ${StrStr} # Supportable for Install Sections and Functions
+
+    ${UnStrStr} # Supportable for Uninstall Sections and Functions
+
+    Section
+
+      ${StrStr} $0 "OK! Now what?" "wh"
+
+    SectionEnd
+
+    Section Uninstall
+
+      ${UnStrStr} $0 "OK! Now what?" "wh"
+
+    SectionEnd
+
+    3.3 Commands
+    ------------
+
+    =========================================================================
+    **                                                             ${StrCase}
+    -------------------------------------------------------------------------
+    ResultVar String Type(|L|U|T|S|<>)
+    =========================================================================
+    Converts "String" to "Type" Case. Uses LogicLib.
+
+    Parameters:
+
+      ResultVar
+      Destination where result is returned.
+
+      String
+      String to convert to "Type" case.
+      
+      Type
+      Type of string case to convert to:
+
+        - "" = Original Case (same as "String")
+        - L = Lower Case (this is just an example. a very simple one.)
+        - U = Upper Case (THIS IS JUST AN EXAMPLE. A VERY SIMPLE ONE.)
+        - T = Title Case (This Is Just An Example. A Very Simple One.)
+        - S = Sentence Case (This is just an example. A very simple one.)
+        - <> = Switch Case (This is just an example. A very simple one.)
+        
+      Default value is "" (Original Case).
+
+    Result Value -> ResultVar:
+
+      "String" in "Type" case.
+
+    Example:
+
+      ${StrCase} $0 '"Você" is "You" in English.' "U"
+                    [__(_)__()___()__()__(____)_]
+
+      $0 = '"VOCÊ" IS "YOU" IN ENGLISH.'
+
+    =========================================================================
+    *                                                               ${StrClb}
+    -------------------------------------------------------------------------
+    ResultVar String Action(|>|<|<>)
+    =========================================================================
+    Makes an action with the clipboard depending on value of parameter
+    "Action". Uses LogicLib.
+
+    Parameters:
+
+      String
+      If "Action" = ">" or "<>" - String to put on the clipboard.
+
+      Action
+      Can be one of the following values:
+
+        - "" = Cleans the clipboard.
+        - ">" = Set string to clipboard.
+        - "<" = Get string from clipboard.
+        - "<>" = Swap string with clipboard's.
+
+    Result Value -> ResultVar:
+
+      If "Action" = "<" or "<>" - String found on the clipboard.
+
+    =========================================================================
+    ***                                                        ${StrIOToNSIS}
+    -------------------------------------------------------------------------
+    ResultVar String
+    =========================================================================
+    Convert "String" from Install Options plugin to be supported by NSIS.
+    Escape, back-slash, carriage return, line feed and tab characters are
+    converted.
+
+    Parameters:
+
+      ResultVar
+      Destination where result is returned.
+
+      String
+      String to convert to be supportable for NSIS.
+
+    Result Value -> ResultVar:
+
+      "String" supportable for NSIS.
+
+    Example:
+
+      ${StrIOToNSIS} $0 "\r\n\t\\This is just an example\\"
+                        [()()()()_______________________()]
+
+      $0 = "$\r$\n$\t\This is just an example\"
+
+    =========================================================================
+    *                                                               ${StrLoc}
+    -------------------------------------------------------------------------
+    ResultVar String StrToSearchFor CounterDirection(>|<)
+    =========================================================================
+    Searches for "StrToSearchFor" in "String" and returns its location,
+    according to "CounterDirection".
+
+    Parameters:
+
+      ResultVar
+      Destination where result is returned.
+
+      String
+      String where to search "StrToSearchFor".
+
+      StrToSearchFor
+      String to search in "String".
+
+      CounterDirection(>|<)
+      Direction where the counter increases to. Default is ">".
+      (> = increases from left to right, < = increases from right to left)
+
+    Result Value -> ResultVar:
+
+      Where "StrToSearchFor" is, according to "OffsetDirection".
+
+    Example: 
+
+      ${StrLoc} $0 "This is just an example" "just" "<"
+                            (__)<<<<<<<<<<<
+
+      $0 = "11"
+
+    =========================================================================
+    ***                                                        ${StrNSISToIO}
+    -------------------------------------------------------------------------
+    ResultVar String
+    =========================================================================
+    Converts "String" from NSIS to be supported by Install Options plugin.
+    Escape, back-slash, carriage return, line feed and tab characters are
+    converted.
+
+    Parameters:
+
+      ResultVar
+      Destination where result is returned.
+
+      String
+      String to convert to be supportable for Install Options plugin.
+
+    Result Value -> ResultVar:
+
+      "String" supportable for Install Options plugin.
+
+    Example:
+
+      ${StrNSISToIO} $0 "$\r$\n$\t\This is just an example\"
+                        [(_)(_)(_)^_______________________^]
+
+      $0 = "\r\n\t\\This is just an example\\"
+
+    =========================================================================
+    *****                                                           ${StrRep}
+    -------------------------------------------------------------------------
+    ResultVar String StrToReplace ReplacementString
+    =========================================================================
+    Searches for all "StrToReplace" in "String" replacing those with
+    "ReplacementString".
+
+    Parameters:
+
+      ResultVar
+      Destination where result is returned.
+
+      String
+      String where to search "StrToReplace".
+
+      StrToReplaceFor
+      String to search in "String".
+
+      StringToBeReplacedWith
+      String to replace "StringToReplace" when it is found in "String".
+
+    Result Value -> ResultVar:
+
+      "String" with all occurrences of "StringToReplace" replaced with
+      "ReplacementString".
+
+    Example: 
+
+      ${StrRep} $0 "This is just an example" "an" "one"
+                    [____________()_______]
+
+      $0 = "This is just one example"
+
+    =========================================================================
+    ***                                                            ${StrSort}
+    -------------------------------------------------------------------------
+    ResultVar String LeftStr CenterStr RightStr IncludeLeftStr(1|0)
+    IncludeCenterStr(1|0) IncludeRightStr(1|0)
+    =========================================================================
+    Searches for "CenterStr" in "String", and returns only the value
+    between "LeftStr" and "RightStr", including or not the "CenterStr" using
+    "IncludeCenterStr" and/or the "LeftStr" using "IncludeLeftStr" and
+    "RightStr" using "IncludeRightStr".
+
+    Parameters:
+
+      ResultVar
+      Destination where result is returned.
+
+      String
+      String where to search "CenterStr".
+
+      LeftStr
+      The first occurrence of "LeftStr" on the left of "CenterStr".
+      If it is an empty value, or was not found, will return
+      everything on the left of "CenterStr".
+
+      CenterStr
+      String to search in "String".
+
+      RightStr
+      The first occurrence of "RightStr" on the right of "CenterStr".
+      If it is an empty value, or was not found, will return
+      everything on the right of "CenterStr".
+
+      IncludeLeftStr(1|0)
+      Include or not the "LeftStr" in the result value. Default is 1
+      (True). (1 = True, 0 = False)
+
+      IncludeCenterStr(1|0)
+      Include or not the "CenterStr" in the result value. Default is 1
+      (True). (1 = True, 0 = False)
+
+      IncludeRightStr(1|0)
+      Include or not the "RightStr" in the result value. Default is 1
+      (True). (1 = True, 0 = False)
+
+    Result Value -> ResultVar:
+
+      String between "LeftStr" and "RightStr" of a found "CenterStr"
+      including or not the "LeftStr" and "RightStr" if
+      "IncludeLeftRightStr" is 1 and/or the "CenterStr" if
+      "IncludeCenterStr" is 1.
+
+    Example: 
+
+      ${StrSort} $0 "This is just an example" " just" "" "ple" "0" "0" "0"
+                    [_______(___)_______]( )
+                              C           R
+
+      $0 = "This is an exam"
+
+    =========================================================================
+    *****                                                           ${StrStr}
+    -------------------------------------------------------------------------
+    ResultVar String StrToSearchFor
+    =========================================================================
+    Searches for "StrToSearchFor" in "String".
+
+    Parameters:
+
+      ResultVar
+      Destination where result is returned.
+
+      String
+      String where to search "StrToSearchFor".
+
+      StrToSearchFor
+      String to search in "String".
+
+    Result Value -> ResultVar:
+
+      "StrToSearchFor" + the string after where "StrToSearchFor" was found in
+      "String".
+
+    Example: 
+
+      ${StrStr} $0 "This is just an example" "just"
+                   >>>>>>>>>{_)____________]
+
+      $0 = "just an example"
+
+    =========================================================================
+    *****                                                        ${StrStrAdv}
+    -------------------------------------------------------------------------
+    ResultVar String StrToSearchFor SearchDirection(>|<)
+    ResultStrDirection(>|<) DisplayStrToSearch(1|0) Loops CaseSensitive(0|1)
+    =========================================================================
+    Searches for "StrToSearchFor" in "String" in the direction specified by
+    "SearchDirection" and looping "Loops" times.
+
+    Parameters:
+
+      ResultVar
+      Destination where result is returned.
+
+      String
+      String where to search "StrToSearchFor".
+
+      StrToSearchFor
+      String to search in "String".
+
+      SearchDirection (>|<)
+      Where do you want to direct the search. Default is ">" (to right).
+      (< = To left, > = To right)
+
+      ResultStrDirection (>|<)
+      Where the result string will be based on in relation of
+      "StrToSearchFor"
+      position. Default is ">" (to right). (< = To left, > = To right)
+
+      DisplayStrToSearch (1|0)
+      Display "StrToSearchFor" in the result. Default is "1" (True).
+      (1 = True, 0 = False)
+
+      Loops
+      Number of times the code will search "StrToSearchFor" in "String" not
+      including the original execution. Default is "0" (1 code execution).
+
+      CaseSensitive(0|1)
+      If "1" the search will be case-sensitive (differentiates between cases).
+      If "0" it is case-insensitive (does not differentiate between cases).
+      Default is "0" (Case-Insensitive).
+
+
+    Result Value -> ResultVar:
+
+      "StrToSearchFor" if "DisplayStrToSearch" is 1 + the result string after
+      or before "StrToSearchFor", depending on "ResultStrDirection".
+
+    Result with Errors:
+
+      When "StrToSearchFor" was not found, will return an empty string.
+
+      When you put nothing in "StrToSearchFor", will return "String" and set
+      error flag.
+
+      When you put nothing in "String", will return an empty string and set
+      error flag.
+
+    Example: 
+
+      ${StrStrAdv} $0 "This IS really just an example" "IS " ">" ">" "0" "0" "1"
+                       >>>>>( )[____________________]                       
+
+
+      $0 = "really just an example"
+
+    =========================================================================
+    ****                                                            ${StrTok}
+    -------------------------------------------------------------------------
+    ResultVar String Separators ResultPart[L] SkipEmptyParts(1|0)
+    =========================================================================
+    Returns the part "ResultPart" between two "Separators" inside
+    "String".
+
+    Parameters:
+
+      ResultVar
+      Destination where result is returned.
+
+      String
+      String where to search for "Separators".
+
+      Separators
+      Characters to find on "String".
+
+      ResultPart[L]
+      The part want to be found on "StrToTokenize" between two "Separators".
+      Can be any number, starting at 0, and "L" that is the last part.
+      Default is L (Last part).
+
+      SkipEmptyParts(1|0)
+      Skips empty string parts between two "Separators". Default is 1 (True).
+      (1 = True, 0 = False)
+
+    Result Value -> ResultVar:
+
+      "String" part number "Part" between two "Separators".
+
+    Examples: 
+
+      1) ${StrTok} $0 "This is, or is not, just an example" " ," "4" "1"
+                       (  ) ()  () () [_]  (  ) () (     )
+                       0    1   2  3  4    5    6  7 
+         $0 = "not"
+
+      2) ${StrTok} $0 "This is, or is not, just an example" " ," "4" "0"
+                       (  ) () ^() [] ( ) ^(  ) () (     )
+                       0    1  23  4  5   67    8  9
+         $0 = "is"
+
+    =========================================================================
+    *                                                      ${StrTrimNewLines}
+    -------------------------------------------------------------------------
+    ResultVar String
+    =========================================================================
+    Deletes unnecessary new lines at end of "String".
+
+    Parameters:
+
+      ResultVar
+      Destination where result is returned.
+
+      String
+      String where to search unnecessary new lines at end of "String".
+
+    Result Value -> ResultVar:
+
+      "String" with unnecessary end new lines removed.
+
+    Example:
+
+      ${StrTrimNewLines} $0 "$\r$\nThis is just an example$\r$\n$\r$\n"
+                            [_____________________________(_)(_)(_)(_)]
+
+      $0 = "$\r$\nThis is just an example"
+
+Functions included and not included
+--------------------------------------------------
+
+11 functions have been included
+  They are not available on Archive
+  They are on LogicLib format
+
+15 functions have not been included
+  12 were not included because of better functions
+    6 were not included because of AdvStrTok (called here as StrTok)
+      First String Part Function
+      Save on Variables Function
+      Sort Strings (1, 2 and 3) Functions
+      StrTok Function
+    2 were not included because of StrCase
+      StrLower Function
+      StrUpper Function
+    2 were not included because of StrClb
+      StrClbSet Function
+      StrClbGet Function
+    1 was not included because of NSISToIO and IOToNSIS
+      Convert / to // in Paths Function
+    1 was not included because of original String Replace Function (called
+      here as StrRep)
+      Another String Replace Function
+  2 were not included because they aren't useful anymore
+    Slash <-> Backslash Converter Function
+    Trim Function
+  1 was not included because of bugs
+    Number to String Converter Function
+
+Version History
+---------------
+
+1.09 - 10/22/2004
+
+- Fixed stack problems involving: StrCase, StrRep, StrSort, StrTok.
+- Fixed StrClb: When "Action" = "<>", handle was wrongly outputed as
+  text.
+- Fixed StrSort, StrStrAdv documentation examples.
+- Fixed StrIOToNSIS, StrLoc, StrNSISToIO, StrRep, StrStr: sometimes
+  didn't find "StrToSearch" at all.
+
+1.08 - 10/12/2004
+
+- Converted all the functions to LogicLib.
+- StrSort: Totally remade and it can break old scripts. See
+  documentation for details.
+- StrTok: "ResultPart" has to start from 0 and it can break old scripts.
+  See documentation for details.
+- Added defines: StrFunc_List, *_List and *_TypeList.
+- Fixed StrStrAdv: Variables $R0-$R3 couldn't be used on scripts before
+  calling.
+- StrRep: Cut down some variables.
+- Arranged correctly the order of StrSort on the documentation.
+
+1.07 - 09/21/2004
+
+- Removed ${UnStrFunc} command. Now you can just include uninstall
+  functions commands like ${UnStrStr} to be supported by uninstall functions
+  and sections.
+- Added case-sensitive comparation option for StrStrAdv.
+- StrCase now uses System.dll which makes case conversions effective with
+all latin letters (i.e. ê).
+- Added switch case and original case for StrCase.
+- StrClbSet and StrClbGet removed, added StrClb.
+- Made compact the most usual operations inside the header file. File size
+reduced.
+
+1.06 - 03/26/2004
+
+- StrNumToStr removed due to complex number handling on some languages.
+- Fixed the bug where the old string was attached to string returned by
+  StrCase when $R5 variable was used.
+
+1.05 - 03/17/2004
+
+- Fixed a bug with StrCase, Title Case wasn't working as should be.
+- Fixed a bug with StrStrAdv, previous fix created another bug, string not
+  returned correctly when using backwards search with "DisplayStrToSearch" as
+  "0".
+
+1.04 - 03/07/2004
+
+- Added new StrCase, removed StrLower and StrUpper.
+- Organized by name commands inside header and readme files.
+
+1.03 - 02/12/2004
+
+- Added commands support for uninstall sections and functions.
+- Fixed variables switch in "StrLoc" and "StrTok" after using these.
+
+1.02 - 02/07/2004
+
+- Fixed StrLoc.
+- Fixed Documentation about StrLoc. "Direction" is really "OffsetDirection".
+- Added my new AdvStrSort, and removed the old one.
+
+1.01 - 02/05/2004
+
+- Fixed Documentation about StrSort and StrTok.
+- Fixed StrTok default value for the string part. Now it's "L".
+- Fixed StrStrAdv fixed wrong search when had a combination of same
+  substrings one after another in a string.
+- Fixed StrLoc: when a string isn't found, don't return any value at all.
+
+1.00 - 02/01/2004
+
+- Added documentation.
+- Renamed header file to "StrFunc.nsh".
+- Added 1 function, StrLoc.
+- Modified StrStrAdv, removed some lines.
+- Fixed StrTok, 2 simple numbers made it loop everytime.
+- Fixed some small issues on the header file.
+
+0.02 - 01/24/2004
+
+- Completed StrFunc.nsh file. Need some tests and the readme.
+
+0.01 - 01/22/2004
+
+- First version to test ideas...
+
+Credits
+-------
+
+  Made by Diego Pedroso (aka deguix).
+
+Functions Credits
+-----------------
+
+- All functions are made by Diego Pedroso on LogicLib format. They
+  are based on functions by Amir Szekely, Dave Laundon, Hendri
+  Adriaens, Nik Medved, Joost Verburg, Stuart Welch, Ximon Eighteen,
+  "bigmac666" and "bluenet". "bluenet"'s version of StrIOToNSIS and
+  StrNSISToIO on LogicLib format were included.
+
+License
+-------
+
+This header file is provided 'as-is', without any express or implied
+warranty. In no event will the author be held liable for any damages
+arising from the use of this header file.
+
+Permission is granted to anyone to use this header file for any purpose,
+including commercial applications, and to alter it and redistribute
+it freely, subject to the following restrictions:
+
+1. The origin of this header file must not be misrepresented;
+   you must not claim that you wrote the original header file.
+   If you use this header file in a product, an acknowledgment in the
+   product documentation would be appreciated but is not required.
+2. Altered versions must be plainly marked as such,
+   and must not be misrepresented as being the original header file.
+3. This notice may not be removed or altered from any distribution.
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/StrFunc/StrFunc.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/System/System.html
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/System/System.html	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/System/System.html	(revision 728)
@@ -0,0 +1,790 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<title>NSIS System Plug-in</title>
+<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
+</head>
+<body>
+<h1>NSIS System Plug-in</h1>
+<p><i>&copy; brainsucker (Nik Medved), 2002</i></p>
+
+<h2>Table of Contents</h2>
+
+<ul>
+<li><a href="#intro">Introduction</a></li>
+<li>
+<a href="#funcs">Available Functions</a>
+<ul>
+<li><a href="#memfuncs">Memory Related Functions</a></li>
+<li><a href="#callfuncs">Calling Functions</a></li>
+<li><a href="#64bitfuncs">64-bit Functions</a></li>
+</ul>
+</li>
+<li><a href="#faq">FAQ</a></li>
+</ul>
+
+<h2><a name="intro"></a>Introduction</h2>
+
+<p>The System plug-in gives developers the ability to call any exported function from any DLL. For example, you can use it to call <a href="http://msdn.microsoft.com/library/en-us/fileio/base/getlogicaldrivestrings.asp">GetLogicalDriveStrings</a> to get a list of available drives on the user's computer.</p>
+
+<p>The System plug-in also allows the developer to allocate, free and copy memory; interact with COM objects and perform mathematical operations on 64-bit integers.</p>
+
+<p>Programming knowledge is highly recommended for good understanding of the System plug-in.</p>
+
+<p>The most useful System plug-in functions (Call, Get and Debug) are not available when compiling with GCC. To work around this, either download a MSVC-compiled version or write your own plugin that calls the functions you need.</p>
+
+<h4>Usage Examples From The Wiki</h4>
+
+<ul>
+<li><a href="http://nsis.sourceforge.net/wiki/Get_Local_Time">Get local time</a></li>
+<li><a href="http://nsis.sourceforge.net/wiki/Registering_a_Palm_Com_Conduit">Register conduits with Palm HotSync</a></li>
+<li><a href="http://nsis.sourceforge.net/wiki/Determining_free_memory_using_the_System_plugin">Get free memory</a></li>
+<li><a href="http://nsis.sourceforge.net/wiki/REG_MULTI_SZ_Reader">Read REG_MULTI_SZ</a></li>
+<li><a href="http://nsis.sourceforge.net/wiki/Get_Disk_Volume_Serial_Number">Get disk serial number</a></li>
+<li><i><a href="http://nsis.sourceforge.net/Special:Search?search=System%3A%3ACall">Search all...</a></i></li>
+</ul>
+
+<h2><a name="funcs"></a>Available Functions</h2>
+
+<h3><a name="memfuncs"></a>Memory Related Functions</h3>
+
+<div>
+<ul>
+
+<li>
+<b>Alloc</b> <i>SIZE</i>
+<blockquote>
+<p>Allocates <i>SIZE</i> bytes and returns a memory address on the stack.</p>
+<h4>Usage Example</h4>
+<blockquote><pre>
+System::<b>Alloc</b> 64
+Pop $0
+DetailPrint "64 bytes allocated at $0"
+System::Free $0
+</pre></blockquote>
+</blockquote>
+</li>
+
+<li>
+<b>Copy</b> [/<i>SIZE</i>] <i>DESTINATION</i> <i>SOURCE</i>
+<blockquote>
+<p>Copies <i>SIZE</i> bytes from <i>SOURCE</i> to <i>DESTINATION</i>. If <i>SIZE</i> is not specified, <i>SOURCE</i>'s size will queried using GlobalSize. This means that if you don't allocate <i>SOURCE</i> using System::Alloc, System::Call or GlobalAlloc, you must specify <i>SIZE</i>. If <i>DESTINATION</i> is zero it will be allocated and its address will be pushed on the stack.</p>
+<h4>Usage example</h4>
+<blockquote><pre>
+# allocate a buffer and put 'test string' and an int in it
+System::Call "*(&amp;t1024 'test string', i 5) i .s"
+Pop $0
+# copy to an automatically created buffer
+System::<b>Copy</b> 0 $0
+Pop $1
+# get string and int in $1 buffer
+System::Call "*$1(&amp;t1024 .r2, i .r3)"
+# free buffer
+System::Free $1
+# print result
+DetailPrint $2
+DetailPrint $3
+# copy to our own buffer
+System::Alloc 1028
+Pop $1
+System::<b>Copy</b> $1 $0
+# get string and int in $1 buffer
+System::Call "*$1(&amp;t1024 .r2, i .r3)"
+# free
+System::Free $0
+System::Free $1
+# print result
+DetailPrint $2
+DetailPrint $3
+</pre></blockquote>
+</blockquote>
+
+</li>
+
+<li>
+<b>Free</b> <i>ADDRESS</i>
+<blockquote>
+<p>Frees <i>ADDRESS</i>.</p>
+<h4>Usage Example</h4>
+<blockquote><pre>
+System::Alloc 64
+Pop $0
+DetailPrint "64 bytes allocated at $0"
+System::<b>Free</b> $0
+</pre></blockquote>
+</blockquote>
+</li>
+
+<li>
+<b>Store</b> "<i>OPERATION</i> [<i>OPERATION</i> [<i>OPERATION</i> ...]]"
+<blockquote>
+<p>Performs stack operations. An operation can be pushing or popping a single register from the NSIS stack or pushing or popping all of the registers ($0-$9 and $R0-$R9) from System's private stack. Operations can be separated by any character.</p>
+<h4>Available Operations</h4>
+<ul>
+<li>To push $<i>#</i>, use p<i>#</i>, where <i>#</i> is a digit from 0 to 9.</li>
+<li>To pop $<i>#</i>, use r<i>#</i>, where <i>#</i> is a digit from 0 to 9.</li>
+<li>To push $R<i>#</i>, use P<i>#</i>, where <i>#</i> is a digit from 0 to 9.</li>
+<li>To pop $R<i>#</i>, use R<i>#</i>, where <i>#</i> is a digit from 0 to 9.</li>
+<li>To push $0-$9 and $R0-$R9 to System's private stack, use s or S.</li>
+<li>To pop $0-$9 and $R0-$R9 from System's private stack, use l or L.</li>
+</ul>
+<h4>Usage Examples</h4>
+<blockquote><pre>
+StrCpy $0 "test"
+System::<b>Store</b> "p0"
+Pop $1
+DetailPrint "$0 = $1"
+</pre></blockquote>
+<blockquote><pre>
+StrCpy $2 "test"
+System::<b>Store</b> "p2 R2"
+DetailPrint "$2 = $R2"
+</pre></blockquote>
+<blockquote><pre>
+StrCpy $3 "test"
+System::<b>Store</b> "s"
+StrCpy $3 "another test"
+System::<b>Store</b> "l"
+DetailPrint $3
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Store</b> "r4" "test"
+DetailPrint $4
+</pre></blockquote>
+</blockquote>
+</li>
+</ul>
+
+</div>
+
+<h3><a name="callfuncs"></a>Calling Functions</h3>
+
+<div>
+
+<ul>
+<li><b>Call</b> <i>PROC</i> [( <i>PARAMS</i> ) [<i>RETURN</i> [? <i>OPTIONS</i>]]]</li>
+<li><b>Get</b> <i>PROC</i> [( <i>PARAMS</i> ) [<i>RETURN</i> [? <i>OPTIONS</i>]]]
+<blockquote>
+<p>Call and get both share a common syntax. As the names suggest, Call calls and Get gets. What does it call or get? It depends on <i>PROC</i>'s value.</p>
+
+<p><i>PARAMS</i> is a list of parameters and what do to with them. You can pass data in the parameters and you can also get data from them. The parameters list is separated by commas. Each parameter is combined of three values: <i>type</i>, <i>source</i> and <i>destination</i>. <i>Type</i> can be an integer, a string, etc. <i>Source</i>, which is the source of the parameter value, can be a NSIS register ($0, $1, $INSTDIR), the NSIS stack, a concrete value (5, "test", etc.) or nothing (null). <i>Destination</i>, which is the destination of the parameter value after the call returns, can be a NSIS register, the NSIS stack or nothing which means no output is required. Either one of <i>source</i> or <i>destination</i> can also be a dot (`.') if it is not needed.</p>
+
+<p><i>RETURN</i> is like a single parameter definition, but <i>source</i> is only used when creating callback functions. Normally <i>source</i> is a dot.</p>
+
+<p><i>OPTIONS</i> is a list of options which control the way System plug-in behaves. Each option can be turned off by prefixing with an exclamation mark. For example: <b>?!e</b>.</p>
+
+<p><i>PARAMS</i>, <i>RETURN</i> and <i>OPTIONS</i> can be repeated many times in one Get/Call line. When repeating, a lot can be omitted, and only what you wish to change can be used. <i>Type</i>, <i>source</i> and/or <i>destination</i> can be omitted for each parameter, even the return value. Options can be added or removed. This allows you to define function prototypes and save on some typing. The <a href="#repeat">last two examples</a> show this.</p>
+
+<p><i>PROC</i> can also be repeated but must be prefixed with a hash sign (`#').</p>
+
+<h4>Possible <i>PROC</i> Values and Meanings</h4>
+
+<blockquote>
+<table>
+<tr>
+<th>Value</th>
+<th>Meaning</th>
+<th>Example</th>
+</tr>
+<tr>
+<th><i>DLL</i>::<i>FUNC</i></th>
+<td><i>FUNC</i> exported from <i>DLL</i></td>
+<td><a href="#func">user32::MessageBox</a></td>
+</tr>
+<tr>
+<th>::<i>ADDR</i></th>
+<td>Function located at <i>ADDR</i></td>
+<td><a href="#funcaddr">see below</a></td>
+</tr>
+<tr>
+<th>*<i>ADDR</i></th>
+<td>Structure located at <i>ADDR</i></td>
+<td><a href="#structaddr">see below</a></td>
+</tr>
+<tr>
+<th>*</th>
+<td>New structure</td>
+<td><a href="#newstruct">see below</a></td>
+</tr>
+<tr>
+<th><i>IPTR</i>-><i>IDX</i></th>
+<td>Member indexed <i>IDX</i> from<br/>interface pointed by <i>IPTR</i></td>
+<td><a href="#com">see below</a></td>
+</tr>
+<tr>
+<th>&lt;nothing&gt;</th>
+<td>New callback function</td>
+<td><a href="#callback">see below</a></td>
+</tr>
+<tr>
+<th><i>PROC</i></th>
+<td><i>PROC</i> returned by Get</td>
+<td><a href="#get">see below</a></td>
+</tr>
+</table>
+</blockquote>
+
+<h4>Available Parameter Types</h4>
+
+<blockquote>
+<table>
+<tr>
+<th>Type</th>
+<th>Meaning</th>
+</tr>
+<tr>
+<th>v</th>
+<td>void (generally for return)</td>
+<td></td>
+</tr>
+<tr>
+<th>p</th>
+<td>pointer (and other pointer sized types like handles and HWNDs)</td>
+</tr>
+<tr>
+<th>i</th>
+<td>int (includes char, byte, short and so on)</td>
+</tr>
+<tr>
+<th>l</th>
+<td>large integer, int64</td>
+</tr>
+<tr>
+<th>m</th>
+<td>ANSI text, string. (FYI: 'm' for multibyte string or 'w' flipped over.)</td>
+</tr>
+<tr>
+<th>t</th>
+<td>text, string (pointer to first character). <i>Like TCHAR*, it is a Unicode string in Unicode NSIS.</i></td>
+</tr>
+<tr>
+<th>w</th>
+<td>WCHAR text, Unicode string</td>
+</tr>
+<tr>
+<th>g</th>
+<td>GUID</td>
+</tr>
+<tr>
+<th>k</th>
+<td>callback</td>
+</tr>
+<tr>
+<th>&amp;v<i>N</i></th>
+<td><i>N</i> bytes padding (structures only)</td>
+</tr>
+<tr>
+<th>&amp;i<i>N</i></th>
+<td>integer of <i>N</i> bytes (structures only)</td>
+</tr>
+<tr>
+<th>&amp;l</th>
+<td>structure size (structures only)</td>
+</tr>
+<tr>
+<th>&amp;t<i>N</i></th>
+<td><i>N</i> bytes of text (structures only)</td>
+</tr>
+<tr>
+<th>&amp;w<i>N</i></th>
+<td><i>N</i> bytes of Unicode text (structures only)</td>
+</tr>
+<tr>
+<th>&amp;g<i>N</i></th>
+<td><i>N</i> bytes of GUID (structures only)</td>
+</tr>
+</table>
+<p>Additionally, each type can be prefixed with an asterisk to denote a pointer. When using an asterisk, the System plug-in still expects the value of the parameter, rather than the pointer's address. To pass a direct address, use `i' with no asterisk. A <a href="#pointer">usage example</a> is available. <a href="#memfuncs">Alloc</a> returns addresses and its return value should therefore be used with `i', without an asterisk.</p>
+</blockquote>
+
+<h4>Available Sources and Destinations</h4>
+
+<blockquote>
+<table>
+<tr>
+<th>Type</th>
+<th>Meaning</th>
+</tr>
+<tr>
+<th>.</th>
+<td>ignored</td>
+<td></td>
+</tr>
+<tr>
+<th><i>number</i></th>
+<td>concrete hex, decimal or octal integer value. several integers can be or'ed using the pipe symbol (`|')</td>
+</tr>
+<tr>
+<th>'<i>string</i>'<br/>"<i>string</i>"<br/>`<i>string</i>`</th>
+<td>concrete string value</td>
+</tr>
+<tr>
+<th><i>r0</i> through <i>r9</i></th>
+<td>$0 through $9 respectively</td>
+</tr>
+<tr>
+<th><i>r10</i> through <i>r19</i><br/><i>R0</i> through <i>R9</i></th>
+<td>$R0 through $R9 respectively</td>
+</tr>
+<tr>
+<th>c</th>
+<td>$CMDLINE</td>
+</tr>
+<tr>
+<th>d</th>
+<td>$INSTDIR</td>
+</tr>
+<tr>
+<th>o</th>
+<td>$OUTDIR</td>
+</tr>
+<tr>
+<th>e</th>
+<td>$EXEDIR</td>
+</tr>
+<tr>
+<th>a</th>
+<td>$LANGUAGE</td>
+</tr>
+<tr>
+<th>s</th>
+<td>NSIS stack</td>
+</tr>
+<tr>
+<th>n</th>
+<td>null for source, no output required for destination</td>
+</tr>
+</table>
+</blockquote>
+
+<h4>Callbacks</h4>
+
+<blockquote>
+<p>Callback functions are simply functions which are passed to a function and called back by it. They are frequently used to pass a possibly large set of data item by item. For example, <a href="http://msdn.microsoft.com/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/Windows/WindowReference/WindowFunctions/EnumChildWindows.asp">EnumChildWindows</a> uses a <a href="http://msdn.microsoft.com/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/Windows/WindowReference/WindowFunctions/EnumChildProc.asp">callback function</a>. As NSIS functions are not quite regular functions, the System plug-in provides its own mechanism to support callback functions. It allows you to create callback functions and notifies you each time a callback function was called.</p>
+
+<p>Creation of callback functions is done using <a href="#callfuncs">Get</a> and the callback creation syntax. As you will not call the callbacks yourself, the source of the parameters should be omitted using a dot. When the callback is called, the destination of the parameters will be filled with the values passed on to the callback. The value the callback will return is set by the source of the return "parameter". The destination of the return "parameter" should always be set as that's where System will notify you the callback was called.</p>
+
+<blockquote><pre>System::Get "(i .r0, i .r1) iss"</pre></blockquote>
+
+<p>To pass a callback to a function, use the k type.</p>
+
+<blockquote><pre>System::Get "(i .r0, i .r1) isR0"
+Pop $0
+System::Call "dll::UseCallback(k r0)"</pre></blockquote>
+
+<p>Each time the callback is called, the string callback#, where # is the number of the callback, will be placed in the destination of the return "parameter". The number of the first callback created is 1, the second's is 2, the third's is 3 and so on. As System is single threaded, a callback can only be called while calling another function. For example, EnumChildWindows's callback can only be called when EnumChildWindows is being called. You should therefore check for callback# after each function call that might call your callback.</p>
+
+<blockquote><pre>System::Get "(i .r0, i .r1) isR0"
+Pop $0
+System::Call "dll::UseCallback(k r0)"
+StrCmp $R0 "callback1" 0 +2
+DetailPrint "UseCallback passed ($0, $1) to the callback"
+</pre></blockquote>
+
+<p>After you've processed the callback call, you should use <a href="#callfuncs">Call</a>, passing it the value returned by <a href="#callfuncs">Get</a> - the callback. This tells System to return from the callback. Destination of the return "parameter" must be cleared prior to calling a function, to avoid false detection of a callback call. If you've specified a source for the return "parameter" when the callback was created, you should fill that source with the appropriate return value. Callbacks are not automatically freed, don't forget to free it after you've finished using it.</p>
+
+<blockquote><pre>System::Get "(i .r0, i .r1) isR0"
+Pop $0
+System::Call "dll::UseCallback(k r0)"
+loop:
+	StrCmp $R0 "callback1" 0 done
+	DetailPrint "UseCallback passed ($0, $1) to the callback"
+	Push 1 # return value of the callback
+	StrCpy $R0 "" # clear $R0 in case there are no more callback calls
+	System::Call $0 # tell system to return from the callback
+	Goto loop
+done:
+System::Free $0
+</pre></blockquote>
+
+<p>A complete working <a href="#callback">example</a> is available in the usage examples section.</p>
+
+</blockquote>
+
+<h4>Notes</h4>
+
+<blockquote>
+<ul>
+<li>To find out the index of a member in a COM interface, you need to search for the definition of this COM interface in the header files that come with Visual C/C++ or the Platform SDK. Remember the index is zero based.</li>
+<li>If a function can't be found, an `A' will be appended to its name and it will be looked up again. This is done because a lot of Windows API functions have two versions, one for ANSI strings and one for Unicode strings. The ANSI version of the function is marked with `A' and the Unicode version is marked with `W'. For example: lstrcpyA and lstrcpyW.</li>
+</ul>
+</blockquote>
+
+<h4>Available Options</h4>
+
+<blockquote>
+<table>
+<tr>
+<th>Option</th>
+<th>Meaning</th>
+</tr>
+<tr>
+<th>c</th>
+<td>cdecl calling convention (the stack restored by caller). By default stdcall calling convention is used (the stack restored by callee).</td>
+<td></td>
+</tr>
+<tr>
+<th>r</th>
+<td>Always return (for GET means you should pop result and proc, for CALL means you should pop result (at least)). By default result is returned for errors only (for GET you will pop either error result or right proc, and for CALL you will get either your return or result at defined return place).</td>
+</tr>
+<tr>
+<th>n</th>
+<td>No redefine. Whenever this proc will be used it will never be redefined either by GET or CALL. This options is never inherited to children.</td>
+</tr>
+<tr>
+<th>s</th>
+<td>Use general Stack. Whenever the first callback defined the system starts using the temporary stacks for function calls.</td>
+</tr>
+<tr>
+<th>e</th>
+<td>Call GetLastError() after procedure end and push result on stack.</td>
+</tr>
+<tr>
+<th>u</th>
+<td>Unload DLL after call (using FreeLibrary, so you'll be able to delete it for example).</td>
+</tr>
+</table>
+</blockquote>
+
+<h4>Usage Examples</h4>
+
+<blockquote><pre>
+<a name="func"></a>System::<b>Call</b> "user32::MessageBox(i $HWNDPARENT, t 'NSIS System Plug-in', t 'Test', i 0)"
+</pre></blockquote>
+<blockquote><pre>
+<a name="funcaddr"></a>System::<b>Call</b> "kernel32::GetModuleHandle(t 'user32.dll') i .s"
+System::<b>Call</b> "kernel32::GetProcAddress(i s, t 'MessageBoxA') i .r0"
+System::<b>Call</b> "::$0(i $HWNDPARENT, t 'GetProcAddress test', t 'NSIS System Plug-in', i 0)"
+</pre></blockquote>
+<blockquote><pre>
+<a name="get"></a>System::<b>Get</b> "user32::MessageBox(i $HWNDPARENT, t 'This is a default text', t 'Default', i 0)"
+Pop $0
+System::<b>Call</b> "$0"
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Get</b> "user32::MessageBox(i $HWNDPARENT, t 'This is a default text', \
+	t 'Default', i 0x1|0x10)"
+Pop $0
+System::<b>Call</b> "$0(, 'This is a System::Get test', 'NSIS System Plug-in',)"
+</pre></blockquote>
+<blockquote><pre>
+<a name="pointer"></a>System::<b>Call</b> "advapi32::GetUserName(t .r0, *i ${NSIS_MAX_STRLEN} r1) i.r2"
+DetailPrint "User name - $0"
+DetailPrint "String length - $1"
+DetailPrint "Return value - $2"
+</pre></blockquote>
+<blockquote><pre>
+<a name="structaddr"></a>System::Alloc 4
+Pop $0
+System::<b>Call</b> "*$0(i 5)"
+System::<b>Call</b> "*$0(i .r1)"
+DetailPrint $1
+</pre></blockquote>
+<blockquote><pre>
+<a name="newstruct"></a>System::<b>Call</b> "*(i 5) i .r0"
+System::<b>Call</b> "*$0(i .r1)"
+DetailPrint $1
+</pre></blockquote>
+<blockquote><pre>
+<a name="com"></a># defines
+!define CLSCTX_INPROC_SERVER 1
+!define CLSID_ActiveDesktop {75048700-EF1F-11D0-9888-006097DEACF9}
+!define IID_IActiveDesktop {F490EB00-1240-11D1-9888-006097DEACF9}
+# create IActiveDesktop interface
+System::<b>Call</b> "ole32::CoCreateInstance( \
+	g '${CLSID_ActiveDesktop}', i 0, \
+	i ${CLSCTX_INPROC_SERVER}, \
+	g '${IID_IActiveDesktop}', *i .r0) i.r1"
+StrCmp $1 0 0 end
+# call IActiveDesktop->GetWallpaper
+System::<b>Call</b> "$0->4(w .r2, i ${NSIS_MAX_STRLEN}, i 0)"
+# call IActiveDesktop->Release
+System::<b>Call</b> "$0->2()"
+# print result
+DetailPrint $2
+end:
+</pre></blockquote>
+<blockquote><pre>
+InitPluginsDir
+SetOutPath $PLUGINSDIR
+File MyDLL.dll
+System::<b>Call</b> "MyDLL::MyFunc(i 5) ? u"
+Delete $PLUGINSDIR\MyDLL.dll
+</pre></blockquote>
+<blockquote><pre>
+<a name="callback"></a>System::<b>Get</b> "(i.r1, i) iss"
+Pop $R0
+System::<b>Call</b> "user32::EnumChildWindows(i $HWNDPARENT, k R0, i) i.s"
+loop:
+	Pop $0
+	StrCmp $0 "callback1" 0 done
+	System::<b>Call</b> "user32::GetWindowText(ir1,t.r2,i${NSIS_MAX_STRLEN})"
+	System::<b>Call</b> "user32::GetClassName(ir1,t.r3,i${NSIS_MAX_STRLEN})"
+	IntFmt $1 "0x%X" $1
+	DetailPrint "$1 - [$3] $2"
+	Push 1 # callback's return value
+	System::<b>Call</b> "$R0"
+	Goto loop
+done:
+System::Free $R0
+</pre></blockquote>
+<blockquote><pre>
+<a name="repeat"></a>!define MB "user32::MessageBox(i$HWNDPARENT,t,t'NSIS System Plug-in',i0)"
+System::<b>Call</b> "${MB}(,'my message',,)"
+System::<b>Call</b> "${MB}(,'another message',,) i.r0"
+MessageBox MB_OK "last call returned $0"
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Call</b> "user32::SendMessage(i $HWNDPARENT, t 'test', t 'test', i 0) i.s ? \
+	e (,t'test replacement',,) i.r0 ? !e #user32::MessageBox"
+DetailPrint $0
+ClearErrors
+Pop $0
+IfErrors good
+MessageBox MB_OK "this message box will never be reached"
+good:
+</pre></blockquote>
+</blockquote>
+</li>
+</ul>
+
+</div>
+
+<h3><a name="64bitfuncs"></a>64-bit Functions</h3>
+
+<div>
+
+<ul>
+
+<li>
+<b>Int64Op</b> <i>ARG1</i> <i>OP</i> [<i>ARG2</i>]
+<blockquote>
+<p>Performs <i>OP</i> on <i>ARG1</i> and optionally <i>ARG2</i> and returns the result on the stack. Both <i>ARG1</i> and <i>ARG2</i> are 64-bit integers. This means they can range between -2^63 and 2^63 - 1.</p>
+<h4>Available Operations</h4>
+<ul>
+<li>Addition -- <b>+</b></li>
+<li>Subtraction -- <b>-</b></li>
+<li>Multiplication -- <b>*</b></li>
+<li>Division -- <b>/</b></li>
+<li>Modulo -- <b>%</b></li>
+<li>Shift right -- <b>&gt;&gt;</b></li>
+<li>Shift left -- <b>&lt;&lt;</b></li>
+<li>Bitwise or -- <b>|</b></li>
+<li>Bitwise and -- <b>&amp;</b></li>
+<li>Bitwise xor -- <b>^</b></li>
+<li>Logical or -- <b>||</b></li>
+<li>Logical and -- <b>&amp;&amp;</b></li>
+<li>Less than -- <b>&lt;</b></li>
+<li>Equals -- <b>=</b></li>
+<li>Greater than -- <b>&gt;</b></li>
+<li>Bitwise not (one argument) -- <b>~</b></li>
+<li>Logical not (one argument) -- <b>!</b></li>
+</ul>
+
+<h4>Usage Examples</h4>
+
+<blockquote><pre>
+System::<b>Int64Op</b> 5 + 5
+Pop $0
+DetailPrint "5 + 5 = $0" # 10
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Int64Op</b> 64 - 25
+Pop $0
+DetailPrint "64 - 25 = $0" # 39
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Int64Op</b> 526355 * 1565487
+Pop $0
+DetailPrint "526355 * 1565487 = $0" # 824001909885
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Int64Op</b> 5498449498849818 / 3
+Pop $0
+DetailPrint "5498449498849818 / 3 = $0" # 1832816499616606
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Int64Op</b> 0x89498A198E4566C % 157
+Pop $0
+DetailPrint "0x89498A198E4566C % 157 = $0" # 118
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Int64Op</b> 1 &lt;&lt; 62
+Pop $0
+DetailPrint "1 &lt;&lt; 62 = $0" # 4611686018427387904
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Int64Op</b> 0x4000000000000000 &gt;&gt; 62
+Pop $0
+DetailPrint "0x4000000000000000 &gt;&gt; 62 = $0" # 1
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Int64Op</b> 0xF0F0F0F | 0xF0F0FFF
+Pop $0
+# IntFmt is 32-bit, this is just for the example
+IntFmt $0 "0x%X" $0
+DetailPrint "0xF0F0F0F | 0xF0F0FFF = $0" # 0xF0F0FFF
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Int64Op</b> 0x12345678 &amp; 0xF0F0F0F0
+Pop $0
+# IntFmt is 32-bit, this is just for the example
+IntFmt $0 "0x%X" $0
+DetailPrint "0x12345678 &amp; 0xF0F0F0F0 = $0" # 0x10305070
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Int64Op</b> 1 ^ 0
+Pop $0
+DetailPrint "1 ^ 0 = $0" # 1
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Int64Op</b> 1 || 0
+Pop $0
+DetailPrint "1 || 0 = $0" # 1
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Int64Op</b> 1 &amp;&amp; 0
+Pop $0
+DetailPrint "1 &amp;&amp; 0 = $0" # 0
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Int64Op</b> 9302157012375 &lt; 570197509190760
+Pop $0
+DetailPrint "9302157012375 &lt; 570197509190760 = $0" # 1
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Int64Op</b> 5168 &gt; 89873
+Pop $0
+DetailPrint "5168 &gt; 89873 = $0" # 0
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Int64Op</b> 189189 = 189189
+Pop $0
+DetailPrint "189189 = 189189 = $0" # 1
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Int64Op</b> 156545668489 ~
+Pop $0
+DetailPrint "1 ~ = $0" # -156545668490
+</pre></blockquote>
+<blockquote><pre>
+System::<b>Int64Op</b> 1 !
+Pop $0
+DetailPrint "1 ! = $0" # 0
+</pre></blockquote>
+</blockquote>
+</li>
+
+</ul>
+
+</div>
+
+<h2><a name="faq"></a>FAQ</h2>
+
+<div>
+
+<ul>
+
+<li>
+<b>Q:</b> How can I pass structs to functions?
+<blockquote>
+<p><b>A:</b> First of all, you must allocate the struct. This can be done in two ways. You can either use <a href="#memfuncs">Alloc</a> or <a href="#callfuncs">Call</a> with the special struct allocation syntax. Next, if you need to pass data in the struct, you must fill it with data. Then you call the function with a pointer to the struct. Finally, if you want to read data from the struct which might have been written by the called function, you must use <a href="#callfuncs">Call</a> with the struct handling syntax. After all is done, it's important to remember to free the struct.</p>
+
+<h4>Allocation</h4>
+
+<blockquote><p>To allocate the struct using <a href="#memfuncs">Alloc</a>, you must know the size of the struct in bytes. Therefore, it would normally be easier to use <a href="#callfuncs">Call</a>. In this case it's easy to see the required size is 16 bytes, but other cases might not be that trivial. In both cases, the struct address will be located on the top of the stack and should be retrieved using Pop.</p>
+
+<blockquote><pre>
+System::Alloc 16
+</pre></blockquote>
+
+<blockquote><pre>
+System::Call "*(i, i, i, t)i.s"
+</pre></blockquote>
+
+</blockquote>
+
+<h4>Setting Data</h4>
+
+<blockquote><p>Setting data can be done using <a href="#callfuncs">Call</a>. It can be done in the allocation stage, or in another stage using the struct handling syntax.</p>
+
+<blockquote><pre>
+System::Call "*(i 5, i 2, i 513, t 'test')i.s"
+</pre></blockquote>
+
+<blockquote><pre>
+# assuming the struct's memory address is kept in $0
+System::Call "*$0(i 5, i 2, i 513, t 'test')"
+</pre></blockquote>
+
+</blockquote>
+
+<h4>Passing to the Function</h4>
+
+<blockquote><p>As all allocation methods return an address, the type of the passed data should be an integer, an address in memory.</p>
+
+<blockquote><pre>
+# assuming the struct's memory address is kept in $0
+System::Call "dll::func(i r0)"
+</pre></blockquote>
+
+</blockquote>
+
+<h4>Reading Data</h4>
+
+<blockquote><p>Reading data from the struct can be done using the same syntax as setting it. The only difference is that the destination part of the parameter will be set and the source part will be omitted using a dot.</p>
+
+<blockquote><pre>
+# assuming the struct's memory address is kept in $0
+System::Call "*$0(i .r0, i .r1, i .r2, t .r3)"
+DetailPrint "first int = $0"
+DetailPrint "second int = $1"
+DetailPrint "third int = $2"
+DetailPrint "string = $3"
+</pre></blockquote>
+
+</blockquote>
+
+<h4>Freeing Memory</h4>
+
+<blockquote><p>Memory is freed using <a href="#memfuncs">Free</a>.</p>
+
+<blockquote><pre>
+# assuming the struct's memory address is kept in $0
+System::Free $0
+</pre></blockquote>
+
+</blockquote>
+
+<h4>A Complete Example</h4>
+
+<blockquote><pre>
+# allocate
+System::Alloc 32
+Pop $1
+# call
+System::Call "Kernel32::GlobalMemoryStatus(i r1)"
+# get
+System::Call "*$1(i.r2, i.r3, i.r4, i.r5, i.r6, i.r7, i.r8, i.r9)"
+# free
+System::Free $1
+# print
+DetailPrint "Structure size: $2 bytes"
+DetailPrint "Memory load: $3%"
+DetailPrint "Total physical memory: $4 bytes"
+DetailPrint "Free physical memory: $5 bytes"
+DetailPrint "Total page file: $6 bytes"
+DetailPrint "Free page file: $7 bytes"
+DetailPrint "Total virtual: $8 bytes"
+DetailPrint "Free virtual: $9 bytes"
+</pre></blockquote>
+
+</blockquote>
+</li>
+
+</ul>
+
+</div>
+
+</body>
+</html>

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/System/System.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/System/WhatsNew.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/System/WhatsNew.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/System/WhatsNew.txt	(revision 728)
@@ -0,0 +1,46 @@
+release 2.
+1. Syntax, with inline input
+2. Int64 full support (conversion/operations/comparison)
+3. Structures support
+4. Callbacks support, including multilevel callbacks
+5. Some useful routines (Alloc, Free, Copy)
+6. CDecl and StdCall calling conventions
+
+release 3, 22 march 2003.
+1. Custom Message Boxes (with icons etc) -> bug in case of GetModuleHandle and
+call to FreeLibrary (sysfunc.nsh)
+2. GetFileSysTime -> No SystemTimeToTzSpecificLocalTime at win9x bug, 
+changed to use FileTimeToLocalFileTime (sysfunc.nsh)
+3. Incorrect automatic structure size (&l) bug, value actually never filled
+into the structure (strange -> winxp takes no care of the structure size 
+members, such as cbSize, and win98 does...) (system.c)
+4. Changed Secondary Stack Allocation behavior - now we just leave 65kb of the
+stack NSIS give to us to the NSIS itself, and use the other part as the stack
+for our calls. (system.c)
+5. Secondary Stack Optimization - in case of no more pending callback procs -
+"free" the secondary stack pointer. (system.c)
+6. PlaySound("", 0, 0) plays the default windows sound at win9x, so changed to
+PlaySound(NULL, 0, 0) for effective sound stopping after splash (sysfunc.nsh).
+
+release 4, 3 september 2003.
+1. Division by zero fatal error at Int64Op killed.
+2. bool type removed (use int instead).
+3. GUID (g) and LPWSTR (w) types added.
+4. Memory cleanup after using t (string), g (guid) and w (unicode string) added.
+5. Automatic A-letter at proc name discovery.
+6. COM optimized: new proc specification "x->y", where x is interface ptr, and
+y is vtable member index. For such procs Interface pointer passed as first arg
+automatically.
+
+release 5, 11 september 2003.
+1. u flag - unload dll after procedure call.
+2. some changes to asm to turn on Whole Program Optimization.
+3. Dll shrunk by 1 kb.
+
+bug-fix-release, 4.06.2004
+1. System::Copy /SIZE fixed (Kichik).
+2. System::Copy with destination auto-allocation now pushes destination
+address on stack.
+3. Callbacks fixed (Kichik's kick is awesome).
+4. Bug with proc call parts redefinition, # for example (pointed by Kichik).
+5. Bug with memory protection during callback processing (Kichik).
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/System/WhatsNew.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/AdvSplash/advsplash.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/AdvSplash/advsplash.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/AdvSplash/advsplash.txt	(revision 728)
@@ -0,0 +1,53 @@
+AdvSplash.dll - small (5.5k), simple plugin that lets you throw 
+up a splash screen in NSIS installers with cool fading effects (win2k/xp)
+and transparency.
+
+To use:
+
+Create a .BMP file of your splash screen.
+(optional) Create a .WAV file to play while your splash screen shows.
+
+Add the following lines to your .NSI file:
+
+Function .onInit
+  SetOutPath $TEMP
+  File /oname=spltmp.bmp "my_splash.bmp"
+
+; optional
+; File /oname=spltmp.wav "my_splashshit.wav"
+
+  advsplash::show 1000 600 400 -1 $TEMP\spltmp
+
+  Pop $0 ; $0 has '1' if the user closed the splash screen early,
+         ; '0' if everything closed normally, and '-1' if some error occurred.
+
+  Delete $TEMP\spltmp.bmp
+;  Delete $TEMP\spltmp.wav
+FunctionEnd
+
+Calling format
+        advsplash::show Delay FadeIn FadeOut KeyColor FileName
+
+Delay - length to show the screen for (in milliseconds)
+FadeIn - length to show the fadein scene (in ms) (not included in Delay)
+FadeOut - length to show the fadeout scene (in ms) (not included in Delay)
+KeyColor - color used for transparency, could be any RGB value 
+        (for ex. R=255 G=100 B=16 -> KeyColor=0xFF6410), 
+        use KeyColor=-1 if there is no transparent color at your image.
+FileName - splash bitmap filename (without the .bmp). The BMP file used will be 
+        this parameter.bmp, and the wave file used (if present) will be this 
+        parameter.wav.
+
+(If you already have an .onInit function, put that in it)
+
+Note 1: fadein/fadeout supported only on win2k/winxp systems, all other systems
+will show simple splash screen with Delay = Delay + FadeIn + FadeOut. Also, I've
+noted my winXP uses no transparent color at 16 bpp, so at bpps lower than 32
+for images with transparent color no fading effect will occur.
+
+Note 2: the return value of splash is 1 if the user closed the splash 
+screen early (pop it from the stack)
+
+-Justin
+Converted to a plugin DLL by Amir Szekely (kichik)
+Fading and transparency by Nik Medved (brainsucker)
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/AdvSplash/advsplash.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/VPatch/Readme.html
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/VPatch/Readme.html	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/VPatch/Readme.html	(revision 728)
@@ -0,0 +1,334 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>VPatch 3</title>
+<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
+<style type="text/css">
+/*<![CDATA[*/
+
+body
+        {
+        padding: 10px;
+        background-color: #F0F0F0;
+        font-family: Verdana, Arial, Helvetica, sans-serif;
+        font-size: 13px;
+        font-weight: normal;
+        text-align: left;
+        }
+
+p, li
+        {
+        font-size: 13px;
+        }
+
+.center
+        {
+        text-align: center;
+        }
+
+table
+        {
+        margin: auto;
+        font-size: 13px;
+        background-color: #FFFFFF;
+        }
+
+.maintable
+        {
+        border: 2px solid #376EAB;
+        }
+
+.parameter
+        {
+        font-weight: bold;
+        color: #6586AC;
+        }
+
+
+h1
+        {
+        font-size: 30px;
+        color: #333333;
+        font-weight: normal;
+        text-align: center;
+        margin-top: 20px;
+        }
+
+h2
+        {
+        font-size: 20px;
+        color: #7A7272;
+        font-weight: normal;
+        }
+
+h3
+        {
+        font-size: 17px;
+        font-weight: bold;
+        color: #303030;
+        }
+
+pre     {
+        font-size: 13px;
+        }
+
+div
+        {
+        margin: 20px;
+        }
+
+a:link, a:visited, a:active
+        {
+        color: #294F75;
+        text-decoration: none;
+        }
+
+a:hover
+        {
+        color: #182634;
+        text-decoration: underline;
+        }
+
+/*]]>*/
+</style>
+</head>
+<body>
+<table width="750" class="maintable" cellspacing="0" cellpadding="0" align="center">
+    <tr> 
+      <td> 
+        
+      <h1>VPatch 3.1</h1>
+        <div> 
+          <h2>Introduction</h2>
+          <div>
+          <p>VPatch allows to create a patch file to update previous versions 
+            of your software. The GenPat utility generates the patch file. The 
+            plug-in can use the patch to update a file. Using a patch, you can 
+            reduce the download size of your updates because only the differences 
+            between the files are included in the patch file.</p>
+          </div>
+          <h2>How to use</h2>
+          <div>
+          <h3>Generate the patch file</h3>
+          <div>
+          <p>Make sure you have the source file (original version) and the target 
+            file (version to update to). For example, DATA.DTA (currently on user 
+            system) and DATA_20.DTA (version 2.0 of this data file). Now call 
+            the command line tool GenPat.exe:</p>
+          <pre>
+GENPAT oldfile.txt newfile.txt patch.pat
+</pre>
+          <p>Now, the patch will be generated, this will take some time.</p>
+            <p>Using the /B=(BlockSize) parameter of the GenPat utility (put it 
+              after the filenames), you can use a different block size. A smaller 
+              block size may result in a smaller patch, but the generation will 
+              take more time (the default blocksize is 64).</p>
+            <p>If you have trouble using this command-line utility, you can download 
+              a GUI (graphical user interface) for VPatch from its own website: 
+              <a href="http://www.tibed.net/vpatch">http://www.tibed.net/vpatch</a>.</p>
+          </div>
+          <h3>Update the file during installation</h3>
+          <div>
+          <p>Use the VPatch plug-in to update a file using a patch file:</p>
+          <pre>
+vpatch::vpatchfile "patch.pat" "oldfile.txt" "temporary_newfile.txt"
+</pre>
+          <p>The result of the patch operating will be added to the stack and 
+            can be one of the following texts:</p>
+          <ul>
+            <li>OK</li>
+            <li>OK, new version already installed</li>
+            <li>An error occurred while patching</li>
+            <li>Patch data is invalid or corrupt</li>
+            <li>No suitable patches were found</li>
+          </ul>
+            <p>Check <a href="../../Examples/VPatch/example.nsi">example.nsi</a> for an example. You 
+              should check whether the stack string starts with &quot;OK&quot; 
+              because then the patch has succeeded and you can rename &quot;temporary_newfile.txt&quot; 
+              to &quot;oldfile.txt&quot; to replace the original, if you want.</p>
+          </div>
+          <h3>Multiple patches in one file</h3>
+          <div>
+          <p>GenPat appends a patch to the file you specified. If there is already 
+            a patch for the same original file, with the same CRC/MD5, in the patch file,
+            the patch will be replaced. For example, if you want to be able to upgrade
+            version 1 and 2 to version 3, you can put a 1 &gt; 3 and 2 &gt; 3 patch in 
+            one file.</p>
+          <p>You can also put patches for different files in one patch file, for 
+            example, a patch from file A version 1 to file A version 2 and a patch 
+            from file B version 1 to file B version 2. Just call the plug-in multiple 
+            times with the same patch file. It will automatically select the right 
+            patch (based on the file CRC).</p>
+          </div>
+          <h3>Patch generator (GenPat) exit codes</h3>
+          <div>
+            <p>In version 3 the following exit codes (known as error levels in 
+              the DOS period) can be returned by GenPat. GenPat will return an 
+              exit code based on success of the patch generation. Here is a list 
+              of the possible exit codes:</p>
+            <table width="547" border="0" cellspacing="0" cellpadding="0">
+              <tr> 
+                <td><b>Exit code</b></td>
+                <td><b>Description</b></td>
+              </tr>
+              <tr> 
+                <td>0</td>
+                <td>Success</td>
+              </tr>
+              <tr> 
+                <td>1</td>
+                <td>Arguments missing</td>
+              </tr>
+              <tr> 
+                <td>2</td>
+                <td>Other error</td>
+              </tr>
+              <tr>
+                <td>3</td>
+                <td>Source file already has a patch in specified patch file (ERROR), 
+                  use /R switch to override</td>
+              </tr>
+            </table>
+            <p>These exit codes can be useful when you generate patch files through 
+              a NSIS script.</p>
+        </div>
+        </div>
+        </div>
+        <div>
+          <h2>Source code</h2>
+          <div>
+          <p>Source code is available in the original package and in the SVN repository of NSIS.</p>
+          <h3>NSIS plug-in (C++)</h3>
+          <div>
+          <p>The source of the NSIS plug-in that applies patches can be found 
+            in the Source\Plugin folder.</p>
+          </div>
+          <h3>Patch Generator (C++)</h3>
+          <div>
+            <p>The most interesting part of VPatch, the actual patch generation 
+              algorithm, can be found in Source\GenPat\PatchGenerator.cpp. The 
+              header of that file contains a brief explanation of the algorithm 
+              as well.</p>
+          </div>
+          <h3>User interface (Delphi)</h3>
+          <div>
+          <p>A user interface is included as well, which you will have to build 
+            yourself because the GUI executable was too large to include. Besides 
+            Borland Delphi 6 or higher (you can use the freely available Personal 
+            edition), you will also need to install the <a href=
+"http://www.delphi-gems.com">VirtualTreeView</a> component by Mike Lischke.</p>
+          </div>
+          </div>
+          <h2>Version history</h2>
+          <div>
+          <ul>
+            <li>3.1 
+              <ul>
+                <li>GenPat now compiles on POSIX platforms (MinGW/GCC), Visual 
+                  C++ 6 and Borland C++.</li>
+                <li>More test cases to verify functionality of GenPat.</li>
+              </ul>
+            </li>
+            <li>3.0 
+              <ul>
+                <li><b>Final</b>: Updates to the GUI, installer</li>
+                <li><b>RC8</b>: GenPat will now flag replacement of a patch (e.g. 
+                  the source file has the same contents as a previous patch inside 
+                  a patch file) as an error. You can specifically allow it using 
+                  the /R switch. Added license to source files.</li>
+                <li><b>RC7</b>: Fixed critical bug in GenPat with multiple patches 
+                  in a single file. Fixed serious bug in stand-alone EXE runtime: 
+                  process kept on running forever. Included case testing through 
+                  a Python script to test common usage (and prevent bugs like 
+                  the one in GenPat in the future).</li>
+                <li><b>RC6</b>: Upgraded to non-beta compiler. Added /A switch 
+                  to change block match limit and /O to deactivate the limit. 
+                  Updated GUI to support the /O switch.</li>
+                <li><b>RC4a to RC5a</b>: input block size is now checked for power 
+                  of 2 and fixed if incorrect. When patch file does not yet exist, 
+                  no longer forgets to create the header. No longer tries to allocate 
+                  memory when there are no chunks. Fixed memory leaks.</li>
+                <li>Target file date is now preserved inside a patch and restored 
+                  on the user system.</li>
+                <li>MD5 checksums are now used instead of CRC32 checksums, unless 
+                  existing patches in a file already are in CRC32 mode.</li>
+                <li>The patch generator, GenPat, has been completely rewritten 
+                  in C++. It no longer needs to keep the entire files in memory, 
+                  instead memory usage is a certain percentage of the source file 
+                  size. The percentage is based on the block size, larger block 
+                  sizes will reduce memory usage.</li>
+                <li>All runtimes now share a common codebase, perform proper error 
+                  checking and don't leave behind files if the input file was 
+                  already up to date.</li>
+                <li>Bug Fix: The patch generator algorithm no longer reduces to 
+                  a quadratic runtime if there are many blocks with the same content 
+                  in the files to patch.</li>
+                <li>Bug Fix: The documentation of the command-line utilities was 
+                  incorrect and no warnings would be given by the runtimes, causing 
+                  the patch not to work (this does not apply to NSIS patches).</li>
+              </ul>
+            </li>
+            <li>2.1 
+              <ul>
+                <li>Added argument checking and error handling to GenPat. Now 
+                  returns exit codes as well to indicate success/failure (and 
+                  the reason for failure). Only GenPat has changed in this version 
+                  compared to 2.0 final.</li>
+                <li>Bug Fix: GenPat no longer gives an Access Violation when attempting 
+                  to patch a file smaller than 64 bytes into a file larger than 
+                  64 bytes.</li>
+              </ul>
+            </li>
+            <li>2.0 final 
+              <ul>
+                <li>Cleaned up source code for the patch generator, which is now 
+                  included (this code is written in Borland Delphi 6 and compiles 
+                  with the freely available Personal edition).</li>
+              </ul>
+            </li>
+            <li>2.0 beta 2 
+              <ul>
+                <li>All new algorithm used in the patch generator: much faster 
+                  (up to 90%) while using smaller block sizes (higher compression)</li>
+                <li>Created a NSIS 2 plugin</li>
+                <li>Works with small files</li>
+                <li>Replaces existing patch in file if original file CRC is identical</li>
+              </ul>
+            </li>
+          </ul>
+          </div>
+          <h2>Credits</h2>
+          <div>
+          <p>Written by Koen van de Sande<br />
+            C plug-in initially by Edgewize, updated by Koen van de Sande<br />
+            New documentation and example by Joost Verburg and Koen van de Sande</p>
+          </div>
+          <h2>License</h2>
+          <div>
+          <pre>
+Copyright (C) 2001-2005 Koen van de Sande / Van de Sande Productions
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute
+it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; 
+   you must not claim that you wrote the original software.
+   If you use this software in a product, an acknowledgment in the
+   product documentation would be appreciated but is not required.
+2. Altered versions must be plainly marked as such,
+   and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any distribution.
+</pre>
+</div>
+        </div>
+      </td>
+</tr>
+</table>
+</body>
+</html>

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/VPatch/Readme.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/nsExec/nsExec.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/nsExec/nsExec.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/nsExec/nsExec.txt	(revision 728)
@@ -0,0 +1,49 @@
+nsExec
+------
+nsExec will execute command-line based programs and capture the output
+without opening a dos box.
+
+
+Usage
+-----
+nsExec::Exec [/OEM] [/TIMEOUT=x] path
+
+-or-
+
+nsExec::ExecToLog [/OEM] [/TIMEOUT=x] path
+
+-or-
+
+nsExec::ExecToStack [/OEM] [/TIMEOUT=x] path
+
+All functions are the same except ExecToLog will print the output
+to the log window and ExecToStack will push up to ${NSIS_MAX_STRLEN}
+characters of output onto the stack after the return value.
+
+Use the /OEM switch to convert the output text from OEM to ANSI.
+
+The timeout value is optional.  The timeout is the time in
+milliseconds nsExec will wait for output.  If output from the
+process is received, the timeout value is reset and it will
+again wait for more output using the timeout value.  See Return 
+Value for how to check if there was a timeout.
+
+To ensure that command are executed without problems on all windows versions,
+is recommended to use the following syntax:
+
+   nsExec::ExecToStack [OPTIONS] '"PATH" param1 param2 paramN'
+
+This way the application path may contain non 8.3 paths (with spaces)
+
+Return Value
+------------
+If nsExec is unable to execute the process, it will return "error"
+on the top of the stack, if the process timed out it will return
+"timeout", else it will return the return code from the
+executed process.
+
+
+Copyright Info
+--------------
+Copyright (c) 2002 Robert Rainwater
+Thanks to Justin Frankel and Amir Szekely
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/nsExec/nsExec.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/MultiUser/Readme.html
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/MultiUser/Readme.html	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/MultiUser/Readme.html	(revision 728)
@@ -0,0 +1,404 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+    <title>Multi-User Header File (MultiUser.nsh)</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
+    <style type="text/css">
+        td
+        {
+            padding: 5px;
+            vertical-align: top;
+            border-bottom: 1px solid black;
+        }
+    </style>
+</head>
+<body>
+    <h1>
+        Multi-User Header File (MultiUser.nsh)</h1>
+    <p>
+        <i>Installer configuration for multi-user Windows environments</i></p>
+    <h2>
+        Table of Contents</h2>
+    <ul>
+        <li><a href="#introduction">Introduction</a></li>
+        <li><a href="#executionlevel">Initalization and Execution Level</a>
+            <li><a href="#installationmode">Installation Mode</a></ul>
+    <h2>
+        <a name="introduction"></a>Introduction</h2>
+    <p>
+        Modern Windows versions support multiple users accounts on a single computer, each
+        with different privileges. For security reasons, the privileges of applications
+        can also be limited. For an installer, the <i>execution level</i> and <i>installation
+            mode</i> are important. The execution level determines the privileges of the
+        installer application. For example, to install hardware drivers, administrator privileges
+        are required. Applications can also be installed for a single user or for all users
+        on a computer, which is determined by the installation mode. Installation for all
+        users requires a higher execution level as compared with a single user setup. The
+        MultiUser.nsh header files provides the features to automatically handle all these
+        aspects related to user accounts and installer privileges.</p>
+    <p>
+        Note that all settings need to be set before including the MultiUser.nsh header
+        file.</p>
+    <h2>
+        Initialization and <a name="executionlevel"></a>Execution Level&nbsp;</h2>
+    <p>
+        Before the MultiUser.nsh file is included, the MULTIUSER_EXECUTIONLEVEL define should
+        be set to one of the following values depending on the execution level that is required:</p>
+    <table>
+        <tr>
+            <td>
+                <b>Value </b>
+            </td>
+            <td>
+                <b>Description</b>
+            </td>
+            <td>
+                <b>Typical application</b>
+            </td>
+        </tr>
+        <tr>
+            <td>
+                Admin
+            </td>
+            <td>
+                Administrator privileges are required
+            </td>
+            <td>
+                Access data of all users accounts
+            </td>
+        </tr>
+        <tr>
+            <td>
+                Power
+            </td>
+            <td>
+                Power User privileges are required<br />
+                (Power Users no longer exist in Windows Vista. For Vista this is equivalent to Admin)
+            </td>
+            <td>
+                Installation for all users (writing to &quot;Program Files&quot; or HKLM registry
+                keys), driver installation
+            </td>
+        </tr>
+        <tr>
+            <td>
+                Highest
+            </td>
+            <td>
+                Request the highest possible execution level for the current user
+            </td>
+            <td>
+                Mixed-mode installer that can both be installed per-machine or per-user
+            </td>
+        </tr>
+        <tr>
+            <td>
+                Standard
+            </td>
+            <td>
+                No special rights required
+            </td>
+            <td>
+                Installation for current user only
+            </td>
+        </tr>
+    </table>
+    <p>
+        Insert the MULTIUSER_INIT and MULTIUSER_UNINT macros in the .onInit and un.onInit
+        function to verify these privileges. If no uninstaller is created in the script,
+        set MULTIUSER_NOUNINSTALL.</p>
+    <blockquote>
+        <pre>!define MULTIUSER_EXECUTIONLEVEL Highest
+;!define MULTIUSER_NOUNINSTALL ;Uncomment if no uninstaller is created
+!include MultiUser.nsh
+
+...
+
+Function .onInit
+  !insertmacro MULTIUSER_INIT
+FunctionEnd
+
+Function un.onInit
+  !insertmacro MULTIUSER_UNINIT
+FunctionEnd</pre>
+    </blockquote>
+    <p>
+        Whether the required privileges can be obtained depends on the user that starts
+        the installer:</p>
+    <ul>
+        <li>Windows NT 4/2000/XP/2003 give the installer the same privileges as the user itself.
+            If the privileges of the user are not sufficient (e.g. Admin level is required is
+            set but the user has no administrator rights), the macros will display an error
+            message and quit the installer. If is however possible to manually run the installer
+            with an administrator account.</li>
+        <li>Windows Vista restricts the privileges of all applications by default. Depending
+            on requested execution level, MultiUser.nsh will set the RequestExecutionLevel flag
+            to request privileges. The user will be asked for confirmation and (if necessary)
+            for an administrator password.</li>
+        <li>Windows 95/98/98 do not set any restrictions on users or applications. Administrator
+            rights are always available.</li>
+    </ul>
+    <p>
+        It is recommended to insert these initialization macros before macros that require
+        user intervention. For example, it does not make sense to ask a user for an installer
+        language if the installer will quit afterwards because the user account does not
+        have the required privileges. After the macros are inserted, the variable $MultiUser.Privileges
+        will contain the current execution level (Admin, Power, User or Guest).</p>
+    <p>
+        The following additional settings are available to customize the initialization:</p>
+    <table>
+        <tr>
+            <td>
+                <b>Setting<td>
+                    <b>Description</b>
+                </td>
+        </tr>
+        <tr>
+            <td>
+                MULTIUSER_INIT_TEXT_ADMINREQUIRED
+            </td>
+            <td>
+                Error message to be displayed when administrator rights are required but not available.
+            </td>
+        </tr>
+        <tr>
+            <td>
+                MULTIUSER_INIT_TEXT_POWERREQUIRED
+            </td>
+            <td>
+                Error message to be displayed when Power User rights are required but not available.
+            </td>
+        </tr>
+        <tr>
+            <td>
+                MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE
+            </td>
+            <td>
+                Error message to be displayed when administrator or Power User rights are required
+                because of an installation mode setting on the command line (see below) but are
+                not available.
+            </td>
+        </tr>
+        <tr>
+            <td>
+                MULTIUSER_INIT_FUNCTIONQUIT<br />
+                MULTIUSER_INIT_UNFUNCTIONQUIT
+            </td>
+            <td>
+                A custom function to be called when the installer is closed due to insufficient
+                privileges.
+            </td>
+        </tr>
+    </table>
+    <h2>
+        <a name="installationmode"></a>Installation Mode</h2>
+    <p>
+        As mentioned before, applications can both be installed for a single users or for
+        all users on a computer. Applications for all users are typically installed in the
+        Program Files folder and appear in the Start Menu of every user. On the contrary,
+        applications for a single user are usually installed in the local Application Data
+        folder and only a appear in the Start Menu of the user who installed the application.</p>
+    <p>
+        By default, MultiUser.nsh will set the installation mode for a per-machine installation
+        if Administrator or Power User rights are available (this is always the case if
+        the execution level is set to Admin or Power, if Highest is set it depends on the
+        user account). For the Standard execution level the installation will always be
+        for a single user. On Windows 95/98/Me installation for a single user is not possible.</p>
+    <p>
+        The following settings are available to change the default installation mode:
+        <table>
+            <tr>
+                <td>
+                    <b>Setting</b>
+                </td>
+                <td>
+                    <b>Description</b>
+                </td>
+                </td>
+            </tr>
+            <tr>
+                <td>
+                    MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER
+                </td>
+                <td>
+                    Set default to a per-user installation, even if the rights for a per-machine installation
+                    are available.
+                </td>
+            </tr>
+            <tr>
+                <td>
+                    MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME
+                </td>
+                <td>
+                    Non-empty registry key that is created during the installation in either HKCU or
+                    HKLM. The default installation mode will automatically be set to the previously
+                    selected mode depending on the location of the key.
+                </td>
+            </tr>
+        </table>
+        <p>
+            After initialization, the variable $MultiUser.InstallMode will contain the current
+            installation mode (AllUsers or CurrentUser).
+        </p>
+        <h3>
+            Mixed-Mode Installation</h3>
+        <p>
+            For the Admin and Power levels, both a per-machine as well as a per-user installation
+            is possible. If the Highest level is set and the user is an Administrator or Power
+            User, both options are also available.</p>
+        <p>
+            Usually it's a good thing to give the user to choice between these options. For
+            users of the Modern UI version 2, a page is provided that asks the user for the
+            installation mode. To use this page, define MULTIUSER_MUI before including User.nsh.
+            Then, the MULTIUSER_PAGE_INSTALLMODE macro can be used just like a normal Modern
+            UI page (this page will automatically be skipped when running Windows 95/98/Me):</p>
+        <pre>!define MULTIUSER_EXECUTIONLEVEL Highest
+<b>!define MULTIUSER_MUI</b>
+!define MULTIUSER_INSTALLMODE_COMMANDLINE
+!include MultiUser.nsh
+!include MUI2.nsh
+
+<b>!insertmacro MULTIUSER_PAGE_INSTALLMODE</b>
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES 
+
+!insertmacro MUI_LANGUAGE English
+
+...
+
+Function .onInit
+  !insertmacro MULTIUSER_INIT
+FunctionEnd
+
+Function un.onInit
+  !insertmacro MULTIUSER_UNINIT
+FunctionEnd
+</pre>
+        <p>
+            The MULTIUSER_INSTALLMODE_COMMANDLINE setting that also appears in this example
+            enables the installation mode to be set using the /AllUsers or /CurrentUser command
+            line parameters. This is especially useful for silent setup.</p>
+        <p>
+            The following settings can be used to customize the texts on the page (in addition
+            to the general Modern UI page settings):</p>
+        <table>
+            <tr>
+                <td>
+                    <b>Setting</b>
+                </td>
+                <td>
+                    <b>Description</b>
+                </td>
+            </tr>
+            <tr>
+                <td>
+                    MULTIUSER_INSTALLMODEPAGE_TEXT_TOP
+                </td>
+                <td>
+                    Text to display on the top of the page.
+                </td>
+            </tr>
+            <tr>
+                <td>
+                    MULTIUSER_INSTALLMODEPAGE_TEXT_ALLUSERS
+                </td>
+                <td>
+                    Text to display on the combo button for a per-machine installation.
+                </td>
+            </tr>
+            <tr>
+                <td>
+                    MULTIUSER_INSTALLMODEPAGE_TEXT_CURRENTUSER
+                </td>
+                <td>
+                    Text to display on the combo button for a per-user installation.
+                </td>
+            </tr>
+        </table>
+        <h3>
+            Installation Mode Initalization</h3>
+        <p>
+            The SetShellVarContext flag (which determines the folders for e.g. shortcuts, like
+            $DESKTOP) is automatically set depending on the installation mode. In addition,
+            the following settings can be used to perform additional actions when the installation
+            mode is initialized:</p>
+        <table>
+            <tr>
+                <td>
+                    <b>Setting</b>
+                </td>
+                <td>
+                    <b>Description</b>
+                </td>
+                </td>
+            </tr>
+            <tr>
+                <td>
+                    MULTIUSER_INSTALLMODE_INSTDIR
+                </td>
+                <td>
+                    Name of the folder in which to install the application, without a path. This folder
+                    will be located in Program Files for a per-machine installation and in the local
+                    Application Data folder for a per-user installation (if supported).
+                </td>
+            </tr>
+            <tr>
+                <td>
+                    MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME
+                </td>
+                <td>
+                    Registry key from which to obtain a previously stored installation folder. It will
+                    be retrieved from HKCU for per-user and HKLM for per-machine.
+                </td>
+            </tr>
+            <tr>
+                <td>
+                    MULTIUSER_INSTALLMODE_FUNCTION<br />
+                    MULTIUSER_INSTALLMODE_UNFUNCTION
+                </td>
+                <td>
+                    A custom fuction to be called during the initialization of the installation mode
+                    to set additional installer settings that depend on the mode
+                </td>
+        </table>
+        <p>
+            To set the installation mode manually, call one of these four functions:</p>
+        <table>
+            <tr>
+                <td>
+                    <b>Function name</b>
+                </td>
+                <td>
+                    <b>Installation mode</b>
+                </td>
+            </tr>
+            <tr>
+                <td>
+                    MultiUser.InstallMode.AllUsers
+                </td>
+                <td>
+                    Installer: Per-machine installation
+                </td>
+            </tr>
+            <tr>
+                <td>
+                    MultiUser.InstallMode.CurrentUser
+                    <td>
+                        Installer: Per-user installation
+                    </td>
+            </tr>
+            <tr>
+                <td>
+                    un.MultiUser.InstallMode.AllUsers<td>
+                        Uninstaller: Per-machine installation
+                    </td>
+            </tr>
+            <tr>
+                <td>
+                    un.MultiUser.InstallMode.CurrentUser<td>
+                        Uninstaller: Per-user installation
+                    </td>
+            </tr>
+        </table>
+</body>
+</html>

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/MultiUser/Readme.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/Math/Math.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/Math/Math.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/Math/Math.txt	(revision 728)
@@ -0,0 +1,197 @@
+Math::Script NSIS plugin.
+
+C-like style scripting (operators at least).
+Tip1: plugin watches the case of the letters.
+Tip2: plugin makes almost no error checks. So YOU should check your script
+twice before run :)
+
+New HOW TO USE: run the MathTest.Exe, and try yourself. After spending 
+some minutes your should be able to write your script by yourself.
+To include it to your NSIS script just insert that: 
+        Math::Script "YourScript1"
+        Math::Script "YourScript2"
+        Math::Script "YourScriptFinal"
+
+How to use it? Simple:
+        Strcpy $0 "Brainsucker"
+        Math::Script "a = 'Math'; B = 'Script'; r0 += ' wants to use ' + a + '::' + b +'!'"
+        DetailPrint "$0"
+That string will fill r0 with some shit. 
+
+Here are some other samples:
+        10! (factorial, r0 will contain '10! = 362880'):
+                r0 = '10! = ' + (1*2*3*4*5*6*7*8*9)
+        the same:
+                a = b = 1; #{++a <= 10, b = b*a}; r0 = (a-1) + '! = ' + b
+        Some floating point:
+                Strcpy $R0 "1e1"
+                Math::Script "pi = 3.14159; R1 = 2*pi*R0; r0 = 'Length of circle with radius ' + R0 + ' is equal to ' + R1 + '.'"
+                Detailprint "$0"        
+
+Ok. Variables. 
+NSIS: r0-r9 -> $0-$9. R0-R9 -> $R0-$R9. 
+Also CL ($CMDLINE), ID ($INSTDIR), OD ($OUTDIR), LG ($LANG), ED ($EXEDIR).
+User definable: name starting from character, up to 28 letters long.
+
+Stacks. Two stacks are supported: NSIS stack and plugin's own stack. I see no 
+reasons for using plugin stack, but if you will, remember - the plugin stores
+variables used at function to that stack before function execution, and restores
+after execution. Even less I recommend you to use NSIS stack. You should use it
+only for input/output.
+How to use? It's variable styled. Plugins stack is associated with S variable,
+and NSIS stack associated with NS variable. To push to stack just do "S=0" or
+"NS=0", to pop from stack "a=S" or "b=NS". Combined operations supported too: 
+"S += 1.5" will increment value at the top of stack by 1.5.
+
+Supported types: int (in fact that is __int64), float (double in fact),
+string.
+Int: just numbers, may include sign.
+Float: -123.456, 123.456e-78, 123e-45
+String: something in quotes ("", '', ``).
+
+There is also an array type. It is actually a reference type, so if b is array
+and you will perform "a=b", the a and b will reference a single array.
+To create a copy of array, use ca func: dest = ca(source). Btw - you couldn't
+control dimensions of arrays - they are autosized.
+To declare array:
+a = {};
+To declare array and initialize some items with values:
+{"Hello!", "Use", "mixed types", 1.01e23, "like that" ,1234};
+To access array:
+a[index] = "Cool";
+
+Also [] operation could be used to strings. str[x] gives you a single char with
+index x (zero-based) as new string. str[-x] - the same, but x counts from the
+string end (so the last char is -1). str[x,y] gives you characters in range x-y
+(inclusive), both x and y could be <0 - in this case they counted from the end
+of the string.
+
+The function could be useful - is conversion of arrays to strings and back.
+Example:
+a = a("Hello"); str = s(a);
+After running such script array a will contain 6 integers (chars and last zero 
+- end of string), and str will contain your string back.
+
+Operators (some binary, some unary):
+>>= <<= -= += /= *= |= &= ^= %= -- ++ >> << && || <= =< >= => != ==
+= + - * / % < > & | ^ ~ !
+Only some are applicable to float (logic & arithmetic) and string (+ and logic) 
+of course. 
+Additional case: reference/de-reference operators (& and *). & will
+give you the reference to argument which should be a variable (NSIS, user, array
+item, stack), and * will convert it back to original variable. For example 
+(a=&b; *a=10) will set b to 10. Expression (*&a) is equal to simple (a).
+
+Script is set of expressions (mathematical in general) delimited with ';'.
+Processing is mathematically right (2+2*2 will give 6), operations are performed
+in a C like order (precedence).
+
+Flow control:
+        if-then-else like:      #[if-expression, then-expr, else-expr]
+                example:
+                        #[a==0, b=1; c=2, b *= (--c); c/=10]               
+                C eq:
+                        if (a==0) { b=1; c=2;} else { b*=(c++);c-=10; }
+        while (expr) do; like   #{expr, do}
+                example:
+                        #{(c<1.1e25)&&(b < 10), b++; c*=1.23}
+                C eq:
+                        while ((c<1.1e25)&&(b<10)) { b++; c*=1.23; }
+
+WATCH OUT! Comma (,) separates if-expr, then-expr, and else-expr from each 
+other. All sub-expressions separated by (;) are the part of one expression,
+and the result of the last one of these sub-exprs gives you the result of 
+expression.
+
+All the shit (like variables and functions) will be saved between calls.
+
+Functions:
+        type conversions:
+                l(string)       returns the length of string or array argument
+                s(source)       converts source to string type
+                i(source)       converts source to int type
+                f(source)       converts source to float type
+                c(source)       if source is string, returns int value of first
+                        char, if source is int, returns string which consists
+                        of a single char (source) (+0 terminator).
+                a(source)       converts source to array (only string supported)
+                ff(float, format)       converts float to string, with format
+                                        options.
+                        options = precision + flags.
+                        Precision shows how many digits after decimal point
+                        will be shown. Flags:
+                                16 (or 0x10) - No Exponential View 
+                                        (number will be shown as 123.123)
+                                32 (or 0x20) - Only exponential view
+                                        (number will be shown as 123.12e123)
+                                64 (or 0x40) - use 'E' character instead of 'e' 
+                        By default the plugin decides itself how to show your
+                        number.
+
+        math (description of all these functions is available at MSDN, use the
+            second given name for search):
+                sin(x),         sin     Sine of argument
+                cos(x),         cos     Cosine of argument
+                cel(x),         ceil    Ceil of argument (no fract. part) 
+                csh(x),         cosh    Hyperbolic Cosine of Argument        
+                exp(x),         exp     Exponential
+                abs(x),         abs     Absolute value (warning: float)
+                flr(x),         floor   Floor of argument (no fract. part) 
+                asn(x),         asin    ArcSine of argument
+                acs(x),         acos    ArcCosine of argument
+                atn(x),         atan    ArcTangent of argument
+                ln(x),          log     Exponential Logarithm
+                log(x),         log10   Decimal logarithm
+                snh(x),         sinh    Hyperbolic Sine of Argument
+                sqt(x),         sqrt    Square root of argument
+                tan(x),         tan     Tangent of argument
+                tnh(x),         tanh    Hyperbolic tangent  of argument
+
+          functions taking two arguments
+                at2(x, y)       atan2    Arctangent of the value (y/x)
+                pow(x, y)       pow      power, x^y
+                fmd(x, y)       fmod     floating point remainder
+                fex(x, o)       frexp    Gets the mantissa (result = r) 
+                                        and exponent (o) of floating-point 
+                                        number (x): x = r*(2^o)
+                mdf(x, o)       modf    Splits a floating-point value into 
+                                        fractional and integer parts.
+
+User-defined functions.
+It's very simple. Example:
+        test(a,b) (a+b);
+After that test(1,2) will give you 3. 
+        test2(a,b) (a=a+b; b *= a);
+The result of function is always the result of last expression.
+As said before it better not to use stack (S) in between function calls.
+It will be better to develop variable-safe functions, i.e. functions which will
+not corrupt variables. For this you should either push/pop them to stack, or
+declare as additional arguments, which will never be used. Example:
+        test3(a,b,c) (c=10; #{--c > 0, a=sqrt(a*b)}; a)
+No matter how many arguments will be passed to function, the values of all three 
+vars (a,b,c) will be saved. 
+Such variable-safe functions could be recursive:
+        Math::Script 'rec(a) (#[a > 0, rec(a-1), 0]+a);'
+        Math::Script 'R1 = rec(10)'
+will set R1 to right result 55.
+Sometimes functions will need to return more than one value, in this case you
+could declare argument as referent (b at example):
+        test4(a, &b) (*b = a*a; a*a*a)
+In this case test4 will return a^3, and if we will call it like that test4(a,c),
+it will place a^2 to c. BUT! Note: you should use de-referencer (*) with variable,
+at example *b. CAUTION: never use the same variable as function internal reference
+variable and external argument variable (for example test4(a,b)). It will surely 
+fail. Also: if you declared argument as reference - you should never supply
+a constant expression to it. It could be either array item (array[1]), NSIS
+register R0, any of the user variables (beside the variable with the same name:), 
+but never the constant.
+
+Another may-be-useful possibility is to redeclare the function (the usual 
+declaration at the time when function already defined will simply call that
+function). For such task you could use "#name", like "func()(1); #func()(2);".
+But beware, function declaration occurs at time of parsing, so it's not possible
+to perform flow controlled declaration. 
+SUCH IS NOT POSSIBLE: "#[a<0, #func()(1), #func()(2)]"
+IT WILL SIMPLY DEFINE #func as (2), as the latest variant.
+        
+(c) Nik Medved (brainsucker)
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Math/Math.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/Splash/splash.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/Splash/splash.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/Splash/splash.txt	(revision 728)
@@ -0,0 +1,41 @@
+Splash.dll - small (4k), simple plugin that lets you throw 
+up a splash screen in NSIS installers.
+
+--- UPDATED in 2.0b0 - will break old scripts ---
+
+To use:
+
+Create a .BMP file of your splash screen.
+(optional) Create a .WAV file to play while your splash screen shows.
+
+Add the following lines to your .NSI file:
+
+Function .onInit
+  SetOutPath $TEMP
+  File /oname=spltmp.bmp "my_splash.bmp"
+
+; optional
+; File /oname=spltmp.wav "my_splashshit.wav"
+
+  splash::show 1000 $TEMP\spltmp
+
+  Pop $0 ; $0 has '1' if the user closed the splash screen early,
+	 ; '0' if everything closed normally, and '-1' if some error occurred.
+
+  Delete $TEMP\spltmp.bmp
+;  Delete $TEMP\spltmp.wav
+FunctionEnd
+
+Note that the first parameter to splash.exe is the length to show the
+screen for (in milliseconds), and the second is the splash bitmap filename (without
+the .bmp). The BMP file used will be this parameter.bmp, and the wave file used
+(if present) will be this parameter.wav.
+
+(If you already have an .onInit function, put that in it)
+
+Note: the return value of splash is 1 if the user closed the splash 
+screen early (pop it from the stack)
+
+-Justin
+
+Converted to a plugin DLL by Amir Szekely (kichik)

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Splash/splash.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/BgImage/BgImage.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/BgImage/BgImage.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/BgImage/BgImage.txt	(revision 728)
@@ -0,0 +1,92 @@
+BgImage.DLL - NSIS extension DLL
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Displays an image or a gradient with user defined texts and/or images behind the NSIS window.
+Can also play WAVs.
+
+See Example.nsi for a usage example.
+
+Usage
+~~~~~
+
+1) Call SetBg to set the background
+2) Call AddText, or AddImage to add texts and images
+3) Call Redraw to update the background window
+4) Optional - repeat steps 2-3 to add more images
+           -or-
+   call Clear and repeat steps 1-3 for a completely new background.
+5) Call Destroy when the background is no longer required (.onGUIEnd for example)
+
+Notes
+~~~~~
+
+* This plugin requires NSIS 2.42 and above.
+
+* Do not call SetBg (which creates the window) from a section or a function called by a section.
+   BgImge must be run from the GUI thread as the installation thread is not built to handle GUI.
+
+Available functions
+~~~~~~~~~~~~~~
+
+SetBg [/FILLSCREEN|/TILED] path_to_bitmap
+SetBg /GRADIENT R G B R G B
+   Sets the background and creates the window if necessary
+   Use /FILLSCREEN to make the image fill the screen
+   Use /TILED to set a tiled background
+   Use /GRADIENT to set a gradient background
+
+   If SetReturn on was called returns "success" on the stack
+     or an error string if there was an error
+
+   Do not use in .onInit!
+
+AddImage [/TRANSPARENT R G B] path_to_bitmap X Y
+   Adds an image to the background window at (X,Y)
+     X and Y can be negative to specify distance from right/bottom
+   Use /TRANSPARENT to make BgImage draw the image transparently
+     Define the transparent color using R G B
+
+   If SetReturn on was called returns "success" on the stack
+     or an error string if there was an error
+
+AddText text font_handle R G B X Y X Y
+  Adds text to the background window
+  Use NSIS's CreateFont to create a font and pass it as font_handle
+  Use R G B to set the text color
+  The first X Y is for the top left corner of the text box
+  The second X Y is for the bottom right corner of the text box
+  X and Y can be negative to specify distance from right/bottoms
+
+  If SetReturn on was called returns "success" on the stack
+     or an error string if there was an error
+
+Clear
+   Clears all of the current background, images and texts
+
+Destroy
+   Destroys the current background window
+   Destroy calls Clear automatically
+
+Sound [/WAIT|/LOOP] path_to_wav
+Sound /STOP
+   Plays a wave file
+   Use /WAIT to wait for the sound to finish playing
+   Use /LOOP to loop the sound
+   Use Sound /STOP to stop the loop
+
+SetReturn on|off
+   Enable return values from SetBg, AddImage and AddText
+   Default value is off because all of the possible errors
+     are either things you should handle when debugging your script
+     such as "can't load bitmap" or errors you can do nothing about
+     such as "memory allocation error"
+
+Credits
+~~~~~~~
+
+Coded by Amir Szekely, aka KiCHiK
+
+Ximon Eighteen, aka Sunjammer - Fixed window title bar issues
+iceman_k - Text idea and original implementation
+Lajos Molnar, aka orfanik - Tile idea and original implementation
+Jason Reis - Coding help
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/BgImage/BgImage.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/NSISdl/ReadMe.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/NSISdl/ReadMe.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/NSISdl/ReadMe.txt	(revision 728)
@@ -0,0 +1,91 @@
+NSISdl 1.3 - HTTP downloading plugin for NSIS
+---------------------------------------------
+
+Copyright (C) 2001-2002 Yaroslav Faybishenko & Justin Frankel
+
+This plugin can be used from NSIS to download files via http.
+
+To connect to the internet, use the Dialer plugin.
+
+USAGE
+-----
+
+NSISdl::download http://www.domain.com/file localfile.exe
+
+You can also pass /TIMEOUT to set the timeout in milliseconds:
+
+NSISdl::download /TIMEOUT=30000 http://www.domain.com/file localfile.exe
+
+The return value is pushed to the stack:
+
+  "cancel" if cancelled
+  "success" if success
+  otherwise, an error string describing the error
+
+If you don't want the progress window to appear, use NSISdl::download_quiet.
+
+Example of usage:
+
+NSISdl::download http://www.domain.com/file localfile.exe
+Pop $R0 ;Get the return value
+  StrCmp $R0 "success" +3
+    MessageBox MB_OK "Download failed: $R0"
+    Quit
+
+For another example, see waplugin.nsi in the examples directory.
+
+PROXIES
+-------
+
+NSISdl supports only basic configurations of proxies. It doesn't support
+proxies which require authentication, automatic configuration script, etc.
+NSISdl reads the proxy configuration from Internet Explorer's registry key
+under HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings. It
+reads and parses ProxyEnable and ProxyServer.
+
+If you don't want NSISdl to use Internet Explorer's settings, use the
+/NOIEPROXY flag. /NOIEPROXY should be used after /TRANSLATE and
+/TIMEOUT. For example:
+
+If you want to specify a proxy on your own, use the /PROXY flag.
+
+NSISdl::download /NOIEPROXY http://www.domain.com/file localfile.exe
+NSISdl::download /TIMEOUT=30000 /NOIEPROXY http://www.domain.com/file localfile.exe
+NSISdl::download /PROXY proxy.whatever.com http://www.domain.com/file localfile.exe
+NSISdl::download /PROXY proxy.whatever.com:8080 http://www.domain.com/file localfile.exe
+
+TRANSLATE
+---------
+
+To translate NSISdl add the following values to the call line:
+
+/TRANSLATE2 downloading connecting second minute hour seconds minutes hours progress
+
+Default values are:
+ 
+  downloading - "Downloading %s"
+  connecting - "Connecting ..."
+  second - " (1 second remaining)"
+  minute - " (1 minute remaining)"
+  hour - " (1 hour remaining)"
+  seconds - " (%u seconds remaining)"
+  minutes - " (%u minutes remaining)"
+  hours - " (%u hours remaining)"
+  progress - "%skB (%d%%) of %skB @ %u.%01ukB/s"
+
+The old /TRANSLATE method still works for backward compatibility.
+
+/TRANSLATE downloading connecting second minute hour plural progress remianing
+
+Default values are:
+
+  downloading - "Downloading %s"
+  connecting - "Connecting ..."
+  second - "second"
+  minute - "minute"
+  hour - "hour"
+  plural - "s"
+  progress - "%dkB (%d%%) of %ukB @ %d.%01dkB/s"
+  remaining -  " (%d %s%s remaining)"
+
+/TRANSLATE and /TRANSLATE2 must come before /TIMEOUT.

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/NSISdl/ReadMe.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/NSISdl/License.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/NSISdl/License.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/NSISdl/License.txt	(revision 728)
@@ -0,0 +1,18 @@
+NSISdl 1.1 - HTTP downloading plugin for NSIS
+Copyright (C) 2001-2002 Yaroslav Faybishenko & Justin Frankel
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+   claim that you wrote the original software. If you use this software
+   in a product, an acknowledgment in the product documentation would be
+   appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+   misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/NSISdl/License.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/Dialer/Dialer.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/Dialer/Dialer.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/Dialer/Dialer.txt	(revision 728)
@@ -0,0 +1,121 @@
+DIALER PLUGIN
+-------------
+
+Written by Amir Szekely aka KiCHiK
+Readme by Joost Verburg
+
+The Dialer plugin for NSIS provides five functions related to internet connections.
+
+To download files from the internet, use the NSISdl plugin.
+
+USAGE
+-----
+
+Example of usage:
+
+ClearErrors           ;Clear the error flag
+Dialer::FunctionName  ;Call Dialer function
+IfErrors "" +3        ;Check for errors
+  MessageBox MB_OK "Function not available"
+  Quit
+Pop $R0               ;Get the return value from the stack
+MessageBox MB_OK $R0  ;Display the return value
+
+EXAMPLE FUNCTION
+----------------
+
+; ConnectInternet (uses Dialer plugin)
+; Written by Joost Verburg 
+;
+; This function attempts to make a connection to the internet if there is no
+; connection available. If you are not sure that a system using the installer
+; has an active internet connection, call this function before downloading
+; files with NSISdl.
+; 
+; The function requires Internet Explorer 3, but asks to connect manually if
+; IE3 is not installed.
+
+Function ConnectInternet
+
+  Push $R0
+    
+    ClearErrors
+    Dialer::AttemptConnect
+    IfErrors noie3
+    
+    Pop $R0
+    StrCmp $R0 "online" connected
+      MessageBox MB_OK|MB_ICONSTOP "Cannot connect to the internet."
+      Quit ;Remove to make error not fatal
+    
+    noie3:
+  
+    ; IE3 not installed
+    MessageBox MB_OK|MB_ICONINFORMATION "Please connect to the internet now."
+    
+    connected:
+  
+  Pop $R0
+  
+FunctionEnd
+
+FUNCTIONS
+---------
+
+If a function is not available on the system, the error flag will be set.
+
+* AttemptConnect
+
+  Attempts to make a connection to the Internet if the system is not connected.
+  
+  online - already connected / connection successful
+  offline - connection failed
+  
+  Requires Internet Explorer 3 or later
+
+* AutodialOnline
+
+  Causes the modem to automatically dial the default Internet connection if the system
+  is not connected to the internet. If the system is not set up to automatically
+  connect, it will prompt the user.
+  
+  Return values:
+  
+  online - already connected / connection successful
+  offline - connection failed
+  
+  Requires Internet Explorer 4 or later
+
+* AutodialUnattended
+
+  Causes the modem to automatically dial the default Internet connection if the system
+  is not connected to the internet. The user will not be prompted.
+  
+  Return values:
+  
+  online - already connected / connection successful
+  offline - connection failed
+  
+  Requires Internet Explorer 4 or later
+
+* AutodialHangup
+
+  Disconnects an automatic dial-up connection.
+  
+  Return values:
+
+  success - disconnection successful
+  failure - disconnection failed
+  
+  Requires Internet Explorer 4 or later
+
+* GetConnectedState
+
+  Checks whether the system is connected to the internet.
+  
+  Return values:
+
+  online - system is online
+  offline - system is offline
+  
+  Requires Internet Explorer 4 or later
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Dialer/Dialer.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/makensisw/Readme.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/makensisw/Readme.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/makensisw/Readme.txt	(revision 728)
@@ -0,0 +1,214 @@
+----------------------------------------------------
+MakeNSISW - MakeNSIS Windows Wrapper
+----------------------------------------------------
+
+
+About MakeNSISW
+---------------
+MakeNSISW is a wrapper for the MakeNSIS that is distributed with
+NSIS (http://www.nullsoft.com/free/nsis/).  MakeNSISW allows you 
+to compile NSIS scripts using a Windows GUI interface.  To install
+MakeNSISW, compile the source using Visual C++ or Mingw.
+
+
+Requirements
+------------
+MakeNSISW requires NSIS be installed on your system.  The default 
+directory for this installation is $PROGRAMFILES\NSIS\Contrib\MakeNSISW.
+
+
+Usage:
+------
+If you installed the Shell Extensions option during the installation, then
+all that is required is that you choose 'Compile NSI' from the right-
+click menu on a NSIS script.  This will invoke MakeNSISW.
+
+The format of the parameters when calling MakeNSISW from the commandline is:
+  makensisw [options] [script.nsi | - [...]]
+
+For the options, please see the MakeNSIS documentation.
+
+
+Shortcut Keys
+-------------
+Ctrl+A: Select All text
+Ctrl+B: Open Script Folder
+Ctrl+C: Copy selected text
+Ctrl+D: Opens the Define Symbols dialog
+Ctrl+E: Edits the script
+Ctrl+F: Find text
+Ctrl+L: Load a script
+Ctrl+R: Recompiles the script
+Ctrl+T: Tests the installer
+Ctrl+W: Clear Log Window
+Alt+X: Exits the application
+F1: View Documentation
+
+
+Version History
+---------------
+0.1
+ - Initial Release
+
+0.2
+ - Added ability to save output and copy output
+
+0.3
+ - Added option to recompile script (F2 or File|Recompile)
+ - Added Help Menu
+ - Return code is now always set
+ - Added Accelerator key support for Exit and Recompile
+ - No longer uses NSIS's version string
+ - Made clearer status message in title bar
+ - Disabled menu/accelerator functions during compile
+
+0.4
+ - Fixed Copy Selected bug
+
+0.5
+ - Minor Makefile changes (mingw)
+ - Moved strings into global strings to make editing easier
+ - Added Clear Log Command under Edit menu
+ - Recompile no longer clears the log window (use F5)
+ - Close is now the default button when you hit enter
+ - added VC++ project, updated resources to work with VC++
+ - rearranged directory structure
+ - makefiles now target ../../makensisw.exe
+ - removed makensisw home link in help menu (hope this is ok,
+   doesn't really seem needed to me)
+ - made display use a fixed width font (Some people may not like
+   this, but I do)
+ - added 'test' button (peeks output for 'Output' line)
+ - made it so that the log shows the most recent 32k.
+ - made it so that the log always clears on a recompile.
+ - compiled with VC++ so no longer needs msvcrt.dll
+ - made the compiler name be a full path (for more flexibility)
+
+0.6
+ - print correct usage if unable to execute compiler
+ - removed mingw warnings
+ - set title/branding before errors
+ - some docs changes
+ - Added Edit|Edit Script function
+
+0.7
+ - Edit Script should now work for output>32k
+ - Added resize support (thanks to felfert)
+ - Added window position saving (thanks to felfert)
+ - Disable some items when exec of makensis failed
+
+0.8
+ - Added window size constraints (thanks to bcheck)
+ - Cleaned up the resource file
+
+0.9
+ - Removed global strings (moved into #defines)
+ - Some GUI changes
+ - No longer focused Close button (its default anyways)
+ - Fixed resize bug on minimize/restore (thanks to felfert)
+ - Made window placement stored in HKLM instead of HKCU, cause
+   I hate things that get littered in HKCU.
+
+1.0
+ - Fixed bug with large output causing crash
+
+1.1
+ - Crash may actually be fixed
+
+1.2
+ - XP visual style support
+
+1.3
+ - Added Documentation menu item
+ - Fix GUI problem with About dialog
+
+1.4
+ - Edit Script command will now work with or without file associations
+ - Added default filename for save dialog
+ - Use standard fonts
+ - Documentation menuitem caused recompile
+
+1.5
+ - Fixed Copy All function
+
+1.6
+ - Reduced size from 44k to 12k (kichik)
+ - Editbox not limited to 32k (now using richedit control)
+ - Made the log window font-size smaller.
+
+1.7
+ - Added check for warnings
+ - Added sound for sucessfull compilations
+ - Update home page and documentation menu items to Sourceforge page
+
+1.8
+ - Contents of log window are now streamed in
+ - Empty log window check (to prevent random crashes)
+
+1.9
+ - Text always scrolls to bottom (kichik)
+ - Updated link to new docs
+ - Makensisw now takes the same parameters as makensis.exe
+ - Fixed some random crashes
+ - Drag and Drop Support into the Makensisw window
+ - Updated icon to more sexy one
+ - Added Load Script option on File menu
+ - Added Search Dialog (Ctrl+F) (kichik)
+ - Added Select All (Ctrl+A), Copy (Ctrl+C), Exit (Alt+X) keys
+ - Branding text now reflects NSIS version
+ - Added some simple tool tips
+ - Added Context Menu in log window
+ - Added resize gripper
+ - Ctrl+L loads a script
+ - Added Clear Log (Ctrl+W)
+ - Browse Script (Ctrl+B) launches explorer in script directory
+ - Check for Update command
+ - Added link to the NSIS Forum under Help menu
+ - Bunch of other stuff not worth mentioning
+ - Define Symbols menu (Ctrl+D)
+
+2.0
+ - Improved user interface
+ - Define Symbols is available even if a script is not loaded
+ - Defined Symbols are saved on exit and reloaded on start
+ - Added NSIS Update menu
+ - Added toolbar for commonly used menus
+ - Made the Toolbar style flat
+ - Added option for compile & run
+ - Added compressor setting option
+ - Added support for lzma compression
+ - Added named Symbols sets.
+
+2.1
+ - Added "Cancel compilation" menu item
+
+2.2
+- Settings saved in HKCU instead of HKLM
+- Added menu accelerators to MRU list
+
+2.3
+- Escape button closes MakeNSISw
+
+2.3.1
+- Fixed broken command line parameter handling
+ 
+Copyright Information
+---------------------
+Copyright (c) 2002 Robert Rainwater
+Contributors: Justin Frankel, Fritz Elfert, Amir Szekely, Sunil Kamath, Joost Verburg
+
+This software is provided 'as-is', without any express or implied
+warranty.  In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/makensisw/Readme.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/makensisw/License.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/makensisw/License.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/makensisw/License.txt	(revision 728)
@@ -0,0 +1,17 @@
+Copyright (c) 2002 Robert Rainwater <rrainwater@yahoo.com>
+
+This software is provided 'as-is', without any express or implied
+warranty.  In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/makensisw/License.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/AccessControl/AccessControl.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/AccessControl/AccessControl.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/AccessControl/AccessControl.txt	(revision 728)
@@ -0,0 +1,253 @@
+ACCESS CONTROL PLUGIN
+---------------------
+
+Written by Mathias Hasselmann <mathias@taschenorakel.de>
+Modifications by:
+* Afrow UK <afrowuk@afrowsoft.co.uk>
+* AndersK <anders_k@users.sf.net>
+
+The AccessControl plugin for NSIS provides a set of functions related 
+Windows NT access control list (ACL) management.
+
+
+MODIFICATIONS
+-------------
+
+v1.0.8.1 - 7th July 2014 - AndersK
+* Don't require SE_RESTORE_NAME and SE_TAKE_OWNERSHIP_NAME when changing owner.
+* Fixed broken return value when trustee parsing failed
+
+v1.0.8.0 - 24th March 2014 - AndersK
+* Added basic String SID parsing in the emulated ConvertStringSidToSid (Broken in v1.0.6)
+* Fixed WinNT4 and Win95 support? (Unicode DLL will not load on Win95 but will probably load on Win98)
+* Fixed leaks from ParseSid and ConvertSidToStringSid
+* NameToSid and SidToName now pushes "error" and error details
+* Better GetCurrentUserName error handling (Still returns the problematic "error" string)
+
+v1.0.7.0 - 25th February 2012 - Afrow UK
+* Fixed DisableFileInheritance (broken in v1.0.5.0).
+
+v1.0.6.0 - 26th January 2012 - Afrow UK
+* Wrote replacements for ConvertSidToStringSid/ConvertStringSidToSid for
+  backwards compatibility with Windows NT4/ME (ANSI build only).
+* Loads RegSetKeySecurity/RegGetKeySecurity functions at run-time for
+  backwards compatibility with Windows NT4/ME (ANSI build only).
+* Removed commented out legacy code.
+
+v1.0.5.0 - 25th January 2012 - Afrow UK
+* Removed IsUserTheAdministrator.
+* Added NameToSid.
+* Major code cleanup/rewrite.
+* Proper Unicode build (with Unicode plugin API).
+* Support for 64-bit registry (SetRegView 64).
+* Functions now return "ok" on success or "error" otherwise. On "error",
+  the next item on the stack will be the error description.
+* Added version information resource.
+
+23rd January 2008 - Afrow UK
+* Added function IsUserTheAdministrator.
+* Cleaned up code. Rebuilt as pure cpp, decreasing DLL size.
+* No longer using gobal temp variable for strings.
+
+7th January 2008 - Afrow UK
+* Fixed registry instructions.
+
+8th November 2007 - Afrow UK
+* EnableInheritance/DisableInheritance names changed.
+* Functions added:
+    EnableFileInheritance
+    DisableFileInheritance
+    EnableRegKeyInheritance
+    DisableRegKeyInheritance
+    GetFileOwner
+    GetFileGroup
+    GetRegKeyOwner
+    GetRegKeyGroup
+    ClearOnFile
+    ClearOnRegKey
+    GetCurrentUserName
+    SidToName
+
+21st August 2007 - Afrow UK
+* Added /noinherit switch to prevent child objects inheriting a
+  particular permission.
+* Added EnableInheritance and DisableInheritance functions.
+* Removed code to print items in the install log.
+
+13th July 2007 - kichik
+* Return proper error codes (return value instead of GetLastError())
+
+30th June 2006 - Afrow UK
+* Error MessageBox removed.
+* Error messages are now just returned on NSIS stack.
+
+
+CONVENTIONS
+-----------
+
+<filename>
+  A valid Windows(tm) filename (ie. "C:\WINDOWS\" or
+  "\\HOSTNAME\SHARE").
+
+<rootkey>
+  The well-known root of a registry key. Following values are defined:
+
+    HKCR - HKEY_CLASSES_ROOT
+    HKLM - HKEY_LOCAL_MACHINE
+    HKCU - HKEY_CURRENT_USER
+    HKU  - HKEY_USERS
+
+<regkey>
+  The name of the registry to alter (ie. "Software\Microsoft\Windows").
+
+<trustee>
+  A valid Windows(tm) account. The account can be specified as relative 
+  account name (ie. "Administrator" or "Everyone"), a qualified account 
+    name (ie. "Domain\Administrator") or as security identifier (SID, 
+  ie. "(S-1-5-32-545)"). "BUILTIN\USERS" is also a valid account name.
+  For a list of trustee names, open up
+    Control Panel > Administrative Tools > Computer Management >
+    Local Users and Groups.
+  WinNT4 uses a emulated version of ConvertStringSidToSid and 
+  only supports the following SDDL strings: AN, AU, BA, BU, IU, SY and WD
+
+<permissions>
+  A combination of access rights (ie. "FullAccess" or 
+  "GenericRead + GenericWrite").
+  For a full list of access rights, open the AccessControl.cpp source
+  file in Notepad.
+
+/NOINHERIT
+  Ensures the specified ACEs (Access Control Entries) are not inherited
+  by child nodes (i.e for directory or registry key objects).
+
+HANDLING ERRORS
+---------------
+
+To handle errors, check the result on the stack:
+
+  AccessControl::SetOnRegKey HKLM Software\MyApp Stuart FullAccess
+  Pop $R0
+  ${If} $R0 == error
+    Pop $R0
+    DetailPrint `AccessControl error: $R0`
+  ${EndIf}
+
+FUNCTIONS
+---------
+
+GrantOnFile [/NOINHERIT] <filename> <trustee> <permissions>
+GrantOnRegKey [/NOINHERIT] <rootkey> <regkey> <trustee> <permissions>
+Pop $Result ; "ok" or "error" + error details
+
+  Makes sure that the trustee get the requested access rights on 
+  that object.
+
+---------
+
+SetOnFile [/NOINHERIT] <filename> <trustee> <permissions>
+SetOnRegKey [/NOINHERIT] <rootkey> <regkey> <trustee> <permissions>
+Pop $Result ; "ok" or "error" + error details
+
+  Replaces any existing access rights for the trustee on the object
+  with the specified access rights.
+
+---------
+
+ClearOnFile [/NOINHERIT] <filename> <trustee> <permissions>
+ClearOnRegKey [/NOINHERIT] <rootkey> <regkey> <trustee> <permissions>
+Pop $Result ; "ok" or "error" + error details
+
+  Replaces all trustees on the object with the specified trustee and
+  access rights.
+
+---------
+
+DenyOnFile [/NOINHERIT] <filename> <trustee> <permissions>
+DenyOnRegKey [/NOINHERIT] <rootkey> <regkey> <trustee> <permissions>
+Pop $Result ; "ok" or "error" + error details
+
+  Explicitly denies an access right on a object.
+
+---------
+
+RevokeOnFile [/NOINHERIT] <filename> <trustee> <permissions>
+RevokeOnRegKey [/NOINHERIT] <rootkey> <regkey> <trustee> <permissions>
+Pop $Result ; "ok" or "error" + error details
+
+  Removes a formerly defined access right for that object.
+  Note that access rights will still be revoked even if they are
+  inherited.
+
+---------
+
+SetFileOwner <filename> <trustee>
+SetRegKeyOwner <rootkey> <regkey> <trustee>
+Pop $Result ; "ok" or "error" + error details
+
+  Changes the owner of an object.
+
+---------
+
+GetFileOwner <filename>
+GetRegKeyOwner <rootkey> <regkey>
+Pop $Owner ; or "error" + error details
+
+  Gets the owner of an object.
+
+---------
+
+SetFileGroup <filename> <trustee>
+SetRegKeyGroup <rootkey> <regkey> <trustee>
+Pop $Result ; "ok" or "error" + error details
+
+  Changes the primary group of the object.
+
+---------
+
+GetFileGroup <filename>
+GetRegKeyGroup <rootkey> <regkey>
+Pop $Group ; or "error" + error details
+
+  Gets the primary group of the object.
+
+---------
+
+EnableFileInheritance <filename>
+EnableRegKeyInheritance <rootkey> <regkey>
+Pop $Result ; "ok" or "error" + error details
+
+  Enables inheritance of parent object permissions.
+
+---------
+
+DisableFileInheritance <filename>
+DisableRegKeyInheritance <rootkey> <regkey>
+Pop $Result ; "ok" or "error" + error details
+
+  Disables inheritance of parent object permissions.
+
+---------
+
+SidToName <sidstring>
+Pop $Domain ; or "error" + error details
+Pop $Username
+
+  Converts an SID on the local machine to the corresponding username and
+  domain name.
+
+---------
+
+NameToSid <username>
+Pop $SID ; or "error" + error details
+
+  Gets the SID of the specified username on the local machine.
+
+---------
+
+GetCurrentUserName
+Pop $Username ; or "error"
+
+  Gets the username of the current user running the setup.
+
+---------
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/AccessControl/AccessControl.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/License.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/License.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/License.txt	(revision 728)
@@ -0,0 +1,10 @@
+Copyright © 2002-2015 Joost Verburg
+
+This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
+   If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any distribution.
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/License.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/Readme.html
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/Readme.html	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/Readme.html	(revision 728)
@@ -0,0 +1,1157 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <title>NSIS Modern User Interface - Documentation</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
+    <style type="text/css">
+        /*<![CDATA[*/body
+        {
+            padding: 10px;
+            background-color: #F0F0F0;
+            font-size: 13px;
+            font-family: Verdana, Arial, Helvetica, sans-serif;
+            font-weight: normal;
+            text-align: justify;
+        }
+        p, li
+        {
+            font-size: 13px;
+        }
+        table
+        {
+            margin: auto;
+            background-color: #FFFFFF;
+        }
+        .maintable
+        {
+            border: 2px solid #376EAB;
+        }
+        .parameter
+        {
+            font-weight: bold;
+            color: #6586AC;
+        }
+        h1
+        {
+            font-size: 20px;
+            color: #7A7272;
+            font-weight: normal;
+        }
+        h2
+        {
+            font-size: 17px;
+            font-weight: bold;
+            color: #303030;
+        }
+        h3
+        {
+            font-size: 14px;
+            font-weight: bold;
+            color: #2B5885;
+        }
+        pre
+        {
+            font-size: 13px;
+        }
+        div
+        {
+            margin: 20px;
+        }
+        div.settings
+        {
+            margin-right: 0;
+        }
+        a:link, a:visited, a:active
+        {
+            color: #294F75;
+            text-decoration: none;
+        }
+        a:hover
+        {
+            color: #182634;
+            text-decoration: underline;
+        }
+        .trigger
+        {
+            cursor: pointer;
+            cursor: hand;
+            height: 14px;
+        }
+        .toggle
+        {
+            display: none;
+        }
+        .options
+        {
+            text-align: center;
+            cursor: pointer;
+            cursor: hand;
+            color: #294F75;
+        }
+        /*]]>*/</style>
+
+    <script type="text/javascript">
+//<![CDATA[
+
+   var image_open = new Image();
+   image_open.src = "images/open.gif";
+   var image_closed = new Image();
+   image_closed.src = "images/closed.gif";
+   
+   function toggle(image, section) {
+   
+      if(document.all) {
+        if(document.all[section].style.display == "block") {
+           document.all[section].style.display = "none";
+           document.all[image].src = image_closed.src;
+        }
+        else
+        {              
+           document.all[section].style.display = "block";
+           document.all[image].src = image_open.src;
+        }
+      }
+      else
+      {
+      if(document.getElementById(section).style.display == "block") {
+         document.getElementById(section).style.display = "none";
+         document.getElementById(image).src = image_closed.src;
+         }
+      else
+         {              
+         document.getElementById(section).style.display = "block";
+         document.getElementById(image).src = image_open.src;
+         }
+      }
+   
+   }
+
+   function expandall() {
+
+     var divNodeList = document.getElementsByTagName('div'); 
+     for (i = 0; i < divNodeList.length; i++) { 
+        if(divNodeList[i].id) {
+           divNodeList[i].style.display = "block";
+           document.getElementById('trigger_' + divNodeList[i].id.substr(7)).src = "images/open.gif";
+        }
+     }
+     
+   }
+
+   function collapseall() {
+
+     var divNodeList = document.getElementsByTagName('div'); 
+     for (i = 0; i < divNodeList.length; i++) { 
+        if(divNodeList[i].id) {
+           divNodeList[i].style.display = "none";
+           document.getElementById('trigger_' + divNodeList[i].id.substr(7)).src = "images/closed.gif";
+        }
+     }
+
+   }
+
+//]]>
+    </script>
+
+</head>
+<body>
+    <table width="750" class="maintable" cellspacing="0" cellpadding="0" align="center">
+        <tr>
+            <td>
+                <img src="images/header.gif" width="750" height="80" alt="" />
+                <p class="options">
+                    <a onclick="expandall()">[Expand all]</a>&nbsp; &nbsp;<a onclick="collapseall()">[Collapse
+                        all]</a></p>
+                <div>
+                    <h1>
+                        Introduction</h1>
+                    <div>
+                        <p>
+                            The Modern UI provides a user interface for NSIS installers with a modern wizard
+                            style, similar to the wizards of recent Windows versions. It is based on the basic
+                            user interface that is provided by the NSIS compiler itself and extends it with
+                            more interface features and pages.</p>
+                        <p>
+                            All standard NSIS pages (such as the pages to select components and the installation
+                            folder) are supported as well as a number of additional pages. The welcome page
+                            allows you to provide an introduction to the installation process, while the finish
+                            page provides a way to let the user decide what steps should be performed after
+                            the setup wizard is closed (for example, whether the application should be started
+                            immediately). A finish page can also be used to ask for a system restart is necessary.</p>
+                        <h3>
+                            <img class="trigger" alt="Open/Close section" id="trigger_scr" src="images/closed.gif"
+                                onclick="toggle('trigger_scr', 'toggle_scr');" />
+                            Screenshots</h3>
+                        <div class="toggle" id="toggle_scr">
+                            <p>
+                                <img src="images/screen1.png" width="503" height="393" alt="" /></p>
+                            <p>
+                                <img src="images/screen2.png" width="503" height="393" alt="" /></p>
+                        </div>
+                    </div>
+                    <h1>
+                        Modern UI 2.0</h1>
+                    <div>
+                        <p>
+                            This new version makes it easier to customize pages, because the same method can
+                            be used to&nbsp; change standard NSIS pages as well as additional pages provided
+                            by the Modern UI. It is now also possible for other NSIS plug-ins to add new pages
+                            to the Modern UI. You can expect to see examples of this soon.</p>
+                        <p>
+                            The welcome and finish page are no longer implemented using InstallOptions. Instead,
+                            the new nsDialogs plug-in is used. nsDialogs allows you to create custom pages or
+                            customize existing pages directly from the script.</p>
+                        <p>
+                            To upgrade a Modern UI 1.8 script, you should:</p>
+                        <ul>
+                            <li>Insert the MUI2.nsh header file instead of MUI.nsh.</li>
+                            <li>The macros for InstallOptions have been moved to a separate header file unrelated
+                                to the Modern UI. If you are still using InstallOptions for custom pages, insert
+                                InstallOptions.nsh and use the INSTALLOPTIONS_* macros instead of the MUI_INSTALLOPTIONS_*
+                                macros. The macros themselves have remained the same.</li>
+                            <li>Rewrite customization code for the Modern UI 1.8 welcome and finish pages in which
+                                the InstallOptions INI file is used. nsDialogs commands should be used instead.</li>
+                            <li>Use the standard NSIS method to escape special characters in all texts. For example,
+                                $\r$\n creates newline.</li>
+                        </ul>
+                    </div>
+                    <h1>
+                        Script header</h1>
+                    <div>
+                        <p>
+                            The settings for the Modern UI should be inserted in the header of the script file.
+                            It&#39;s important to follow the same order as the items below.&nbsp;For example,
+                            interface settings should be defined before you insert pages, because the pages
+                            depend on the interface configuration. It may be useful to look at the <a href="#examples">
+                                example scripts</a> too see how this is done in actual script files.</p>
+                        <p>
+                            Parameters are given in this format: <span class="parameter">required (option1 | option2)
+                                [optional]</span></p>
+                    </div>
+                    <h2>
+                        1. Header file</h2>
+                    <div>
+                        <p>
+                            First of all, add this line to the top of script to include the Modern UI:</p>
+                        <pre>
+!include MUI2.nsh
+</pre>
+                    </div>
+                    <h2>
+                        2. Interface configuration</h2>
+                    <div>
+                        <p>
+                            Then, you may want to use interface settings to change the look and feel of the
+                            installer. These settings apply to all pages.<p>
+                                The interface settings provided by the NSIS compiler itself (such as LicenseText,
+                                Icon, CheckBitmap, InstallColors) should not be used in Modern UI scripts. The Modern
+                                UI provides equalivent or extended versions of these settings.<p>
+                                    Examples:</p>
+                                <pre>
+!define MUI_COMPONENTSPAGE_SMALLDESC ;No value
+!define MUI_UI &quot;myUI.exe&quot; ;Value
+!define MUI_INSTFILESPAGE_COLORS &quot;FFFFFF 000000&quot; ;Two colors
+</pre>
+                                <h3>
+                                    <img class="trigger" alt="Open/Close section" id="trigger_in" src="images/closed.gif"
+                                        onclick="toggle('trigger_in', 'toggle_in');" />
+                                    Interface settings</h3>
+                                <div class="toggle" id="toggle_in">
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_ingen" src="images/closed.gif"
+                                            onclick="toggle('trigger_ingen', 'toggle_ingen');" />
+                                        Page header</h3>
+                                    <div class="toggle" id="toggle_ingen">
+                                        <p>
+                                            <strong>MUI_ICON</strong> <span class="parameter">icon_file</span><br />
+                                            The icon for the installer.<br />
+                                            <em>Default: ${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico</em></p>
+                                        <p>
+                                            <strong>MUI_UNICON</strong> <span class="parameter">icon_file</span><br />
+                                            The icon for the uninstaller.<br />
+                                            <em>Default: ${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico</em></p>
+                                        <p>
+                                            <strong>MUI_HEADERIMAGE</strong><br />
+                                            Display an image on the header of the page.</p>
+                                        <div class="settings">
+                                            <p>
+                                                <strong>MUI_HEADERIMAGE_BITMAP</strong> <span class="parameter">bmp_file</span><br />
+                                                Bitmap image to display on the header of installers pages (recommended size: 150x57
+                                                pixels).<br />
+                                                <em>Default: ${NSISDIR}\Contrib\Graphics\Header\nsis.bmp</em></p>
+                                            <div class="settings">
+                                                <p>
+                                                    <strong>MUI_HEADERIMAGE_BITMAP_NOSTRETCH</strong><br />
+                                                    Do not stretch the installer header bitmap to fit the size of the field. Use this
+                                                    option only if you have an image that does not use the whole space. If you have
+                                                    a full size bitmap that fits exactly, you should not use this option because the
+                                                    size of the field will be different if the user has a custom DPI setting.</p>
+                                                <p>
+                                                    <strong>MUI_HEADERIMAGE_BITMAP_RTL</strong> <span class="parameter">bmp_file</span><br />
+                                                    Bitmap image to display on the header of installers pages when using a RTL language
+                                                    (recommended size: 150x57 pixels).<br />
+                                                    <em>Default: Non-RTL bitmap</em></p>
+                                                <div class="settings">
+                                                    <p>
+                                                        <strong>MUI_HEADERIMAGE_BITMAP_RTL_NOSTRETCH</strong><br />
+                                                        Do not stretch the installer header bitmap when using a RTL language to fit the
+                                                        size of the field. Use this option only if you have an image that does not use the
+                                                        whole space. If you have a full size bitmap that fits exactly, you should not use
+                                                        this option because the size of the field will be different if the user has a custom
+                                                        DPI setting.</p>
+                                                </div>
+                                            </div>
+                                            <p>
+                                                <strong>MUI_HEADERIMAGE_UNBITMAP</strong> <span class="parameter">bmp_file</span><br />
+                                                Bitmap image to display on the header of uninstaller pages (recommended size: 150x57
+                                                pixels).<br />
+                                                <em>Default: Installer header bitmap</em></p>
+                                            <div class="settings">
+                                                <p>
+                                                    <strong>MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH</strong><br />
+                                                    Do not stretch the uninstaller header bitmap to fit the size of the field. Use this
+                                                    option only if you have an image that does not use the whole space. If you have
+                                                    a full size bitmap that fits exactly, you should not use this option because the
+                                                    size of the field will be different if the user has a custom DPI setting.</p>
+                                                <p>
+                                                    <strong>MUI_HEADERIMAGE_UNBITMAP_RTL</strong> <span class="parameter">bmp_file</span><br />
+                                                    Bitmap image to display on the header of uninstallers pages when using a RTL language
+                                                    (recommended size: 150x57 pixels).<br />
+                                                    <em>Default: Installer RTL header bitmap</em></p>
+                                                <div class="settings">
+                                                    <p>
+                                                        <strong>MUI_HEADERIMAGE_UNBITMAP_RTL_NOSTRETCH</strong><br />
+                                                        Do not stretch the uninstaller header bitmap when using a RTL language to fit the
+                                                        size of the field. Use this option only if you have an image that does not use the
+                                                        whole space. If you have a full size bitmap that fits exactly, you should not use
+                                                        this option because the size of the field will be different if the user has a custom
+                                                        DPI setting.</p>
+                                                </div>
+                                            </div>
+                                            <p>
+                                                <strong>MUI_HEADERIMAGE_RIGHT</strong><br />
+                                                Display the header image on the right side instead of the left side (when using
+                                                a RTL language it will be displayed on the left side instead of the right side).</p>
+                                        </div>
+                                        <p>
+                                            <strong>MUI_BGCOLOR</strong> <span class="parameter">(color: RRGGBBR hexadecimal)</span><br />
+                                            Background color for the header, the Welcome page and the Finish page.<br />
+                                            <em>Default: FFFFFF</em></p>
+                                        <p>
+                                            <strong>MUI_HEADER_TRANSPARENT_TEXT</strong><br />
+                                            Set a transparent background for the header's label controls. Useful for custom
+                                            user interfaces that set a bigger header image.</p>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_inres" src="images/closed.gif"
+                                            onclick="toggle('trigger_inres', 'toggle_inres');" />
+                                        Interface resources</h3>
+                                    <div class="toggle" id="toggle_inres">
+                                        <p>
+                                            <strong>MUI_UI</strong> <span class="parameter">ui_file</span><br />
+                                            The interface file with the dialog resources. Change this if you have made your
+                                            own customized UI.<br />
+                                            <em>Default: ${NSISDIR}\Contrib\UIs\modern.exe</em></p>
+                                        <p>
+                                            <strong>MUI_UI_HEADERIMAGE</strong> <span class="parameter">ui_file</span><br />
+                                            The interface files with the dialog resource IDD_INST that contains a bitmap control
+                                            and space for the header bitmap.<br />
+                                            <em>Default: ${NSISDIR}\Contrib\UIs\modern_headerbmp.exe</em></p>
+                                        <p>
+                                            <strong>MUI_UI_HEADERIMAGE_RIGHT</strong> <span class="parameter">ui_file</span><br />
+                                            The interface files with the dialog resource IDD_INST that contains a bitmap control
+                                            and space for the header bitmap on the right side.<br />
+                                            <em>Default: ${NSISDIR}\Contrib\UIs\modern_headerbmpr.exe</em></p>
+                                        <p>
+                                            <strong>MUI_UI_COMPONENTSPAGE_SMALLDESC</strong> <span class="parameter">ui_file</span><br />
+                                            The interface files with a customized dialog resource IDD_SELCOM with a small description
+                                            area.<br />
+                                            <em>Default: ${NSISDIR}\Contrib\UIs\modern_smalldesc.exe</em></p>
+                                        <p>
+                                            <strong>MUI_UI_COMPONENTSPAGE_NODESC</strong> <span class="parameter">ui_file</span><br />
+                                            The interface files with a customized dialog resource IDD_SELCOM without a description
+                                            area.<br />
+                                            <em>Default: ${NSISDIR}\Contrib\UIs\modern_nodesc.exe</em></p>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_inwf" src="images/closed.gif"
+                                            onclick="toggle('trigger_inwf', 'toggle_inwf');" />
+                                        Installer welcome/finish page</h3>
+                                    <div class="toggle" id="toggle_inwf">
+                                        <p>
+                                            <strong>MUI_WELCOMEFINISHPAGE_BITMAP</strong> <span class="parameter">bmp_file</span><br />
+                                            Bitmap for the Welcome page and the Finish page (recommended size: 164x314 pixels).<br />
+                                            <em>Default: ${NSISDIR}\Contrib\Graphics\Wizard\win.bmp</em></p>
+                                        <div class="settings">
+                                            <p>
+                                                <strong>MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH</strong><br />
+                                                Do not stretch the bitmap for the Welcome and Finish page to fit the size of the
+                                                field. Use this option only if you have an image that does not use the whole space.
+                                                If you have a full size bitmap that fits exactly, you should not use this option
+                                                because the size of the field will be different if the user has a custom DPI setting.</p>
+                                        </div>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_inuwf" src="images/closed.gif"
+                                            onclick="toggle('trigger_inuwf', 'toggle_inuwf');" />
+                                        Uninstaller welcome/finish page</h3>
+                                    <div class="toggle" id="toggle_inuwf">
+                                        <p>
+                                            <strong>MUI_UNWELCOMEFINISHPAGE_BITMAP</strong> <span class="parameter">bmp_file</span><br />
+                                            Bitmap for the Welcome page and the Finish page (recommended size: 164x314 pixels).<br />
+                                            <em>Default: ${NSISDIR}\Contrib\Graphics\Wizard\win.bmp</em></p>
+                                        <div class="settings">
+                                            <p>
+                                                <strong>MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH</strong><br />
+                                                Do not stretch the bitmap for the Welcome and Finish page to fit the size of the
+                                                field. Use this option only if you have an image that does not use the whole space.
+                                                If you have a full size bitmap that fits exactly, you should not use this option
+                                                because the size of the field will be different if the user has a custom DPI setting.</p>
+                                        </div>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_inl" src="images/closed.gif"
+                                            onclick="toggle('trigger_inl', 'toggle_inl');" />
+                                        License page</h3>
+                                    <div class="toggle" id="toggle_inl">
+                                        <p>
+                                            <strong>MUI_LICENSEPAGE_BGCOLOR</strong> <span class="parameter">(/windows | /grey |
+                                                (color: RRGGBB hexadecimal))</span><br />
+                                            The background color for the license textbox. Use /windows for the Windows text
+                                            background color (usually white). Use the /grey for the window background color
+                                            (usually grey).<br />
+                                            <em>Default: /windows</em></p>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_inc" src="images/closed.gif"
+                                            onclick="toggle('trigger_inc', 'toggle_inc');" />
+                                        Components page</h3>
+                                    <div class="toggle" id="toggle_inc">
+                                        <p>
+                                            <strong>MUI_COMPONENTSPAGE_CHECKBITMAP</strong> <span class="parameter">bitmap_file</span><br />
+                                            The bitmap with images for the checks of the component select treeview.<br />
+                                            <em>Default: ${NSISDIR}\Contrib\Graphics\Checks\modern.bmp</em></p>
+                                        <p>
+                                            <strong>MUI_COMPONENTSPAGE_SMALLDESC</strong><br />
+                                            A small description area on the bottom of the page. Use this layout if you have
+                                            a lot of sections and don't need large descriptions.</p>
+                                        <p>
+                                            <strong>MUI_COMPONENTSPAGE_NODESC</strong><br />
+                                            No description area.</p>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_ind" src="images/closed.gif"
+                                            onclick="toggle('trigger_ind', 'toggle_ind');" />
+                                        Directory page</h3>
+                                    <div class="toggle" id="toggle_ind">
+                                        <p>
+                                            <strong>MUI_DIRECTORYPAGE_BGCOLOR</strong> <span class="parameter">(color: RRGGBB hexadecimal)</span><br />
+                                            The background color for the directory textbox.</p>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_ins" src="images/closed.gif"
+                                            onclick="toggle('trigger_ins', 'toggle_ins');" />
+                                        Start Menu folder page</h3>
+                                    <div class="toggle" id="toggle_ins">
+                                        <p>
+                                            <strong>MUI_STARTMENUPAGE_BGCOLOR</strong> <span class="parameter">(color: RRGGBB hexadecimal)</span><br />
+                                            The background color for the startmenu directory list and textbox.</p>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_ini" src="images/closed.gif"
+                                            onclick="toggle('trigger_ini', 'toggle_ini');" />
+                                        Installation page</h3>
+                                    <div class="toggle" id="toggle_ini">
+                                        <p>
+                                            <strong>MUI_INSTFILESPAGE_COLORS</strong> <span class="parameter">(/windows | &quot;(foreground
+                                                color: RRGGBB hexadecimal) (background color: RRGGBB hexadecimal)&quot;)</span><br />
+                                            The colors of the details screen. Use /windows for the default Windows colors.<br />
+                                            <em>Default: /windows</em></p>
+                                        <p>
+                                            <strong>MUI_INSTFILESPAGE_PROGRESSBAR</strong> <span class="parameter">(&quot;&quot;
+                                                | colored | smooth)</span><br />
+                                            The style of the progress bar. Colored makes it use the MUI_INSTALLCOLORS.<br />
+                                            <em>Default: smooth</em></p>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_inf" src="images/closed.gif"
+                                            onclick="toggle('trigger_inf', 'toggle_inf');" />
+                                        Installer finish page</h3>
+                                    <div class="toggle" id="toggle_inf">
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_NOAUTOCLOSE</strong><br />
+                                            Do not automatically jump to the finish page, to allow the user to check the install
+                                            log.</p>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_uinf" src="images/closed.gif"
+                                            onclick="toggle('trigger_uinf', 'toggle_uinf');" />
+                                        Uninstaller finish page</h3>
+                                    <div class="toggle" id="toggle_uinf">
+                                        <p>
+                                            <strong>MUI_UNFINISHPAGE_NOAUTOCLOSE</strong><br />
+                                            Do not automatically jump to the finish page, to allow the user to check the uninstall
+                                            log.</p>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_inaw" src="images/closed.gif"
+                                            onclick="toggle('trigger_inaw', 'toggle_inaw');" />
+                                        Abort warning</h3>
+                                    <div class="toggle" id="toggle_inaw">
+                                        <p>
+                                            <strong>MUI_ABORTWARNING</strong><br />
+                                            Show a message box with a warning when the user wants to close the installer.</p>
+                                        <div class="settings">
+                                            <p>
+                                                <strong>MUI_ABORTWARNING_TEXT</strong> <span class="parameter">text</span><br />
+                                                Text to display on the abort warning message box.</p>
+                                            <p>
+                                                <strong>MUI_ABORTWARNING_CANCEL_DEFAULT</strong><br />
+                                                Set the Cancel button as the default button on the message box.</p>
+                                        </div>
+                                    </div>
+                                    <h3>
+                                        <img class="trigger" alt="Open/Close section" id="trigger_inuaw" src="images/closed.gif"
+                                            onclick="toggle('trigger_inuaw', 'toggle_inuaw');" />
+                                        Uninstaller abort warning</h3>
+                                    <div class="toggle" id="toggle_inuaw">
+                                        <p>
+                                            <strong>MUI_UNABORTWARNING</strong><br />
+                                            Show a message box with a warning when the user wants to close the uninstaller.</p>
+                                        <div class="settings">
+                                            <p>
+                                                <strong>MUI_UNABORTWARNING_TEXT</strong> <span class="parameter">text</span><br />
+                                                Text to display on the abort warning message box.</p>
+                                            <p>
+                                                <strong>MUI_UNABORTWARNING_CANCEL_DEFAULT</strong><br />
+                                                Set the Cancel button as the default button on the message box.</p>
+                                        </div>
+                                    </div>
+                                </div>
+                    </div>
+                    <h2>
+                        3. Pages</h2>
+                    <div>
+                        <p>
+                            Insert the following macros to set the pages you want to use. The pages will appear
+                            in the order in which you insert them in the script. You can also insert custom
+                            Page commands between the macros to add custom pages.</p>
+                        <p>
+                            You can add multiple pages of certain types (for example, if you want the user to
+                            specify multiple folders).</p>
+                        <p>
+                            Examples:</p>
+                        <pre>
+!insertmacro MUI_PAGE_LICENSE &quot;License.rtf&quot;
+!insertmacro MUI_PAGE_COMPONENTS
+
+Var StartMenuFolder
+!insertmacro MUI_PAGE_STARTMENU &quot;Application&quot; $StartMenuFolder
+</pre>
+                        <p>
+                            You will need the page ID for the Start Menu folder page when using the Start Menu
+                            folder macros. The folder will be stored in the specified variable.</p>
+                        <p>
+                            <strong>Installer pages</strong><br />
+                            MUI_PAGE_WELCOME<br />
+                            MUI_PAGE_LICENSE <span class="parameter">textfile</span><br />
+                            MUI_PAGE_COMPONENTS<br />
+                            MUI_PAGE_DIRECTORY<br />
+                            MUI_PAGE_STARTMENU <span class="parameter">pageid variable</span><br />
+                            MUI_PAGE_INSTFILES<br />
+                            MUI_PAGE_FINISH</p>
+                        <p>
+                            <strong>Uninstaller pages</strong><br />
+                            MUI_UNPAGE_WELCOME<br />
+                            MUI_UNPAGE_CONFIRM<br />
+                            MUI_UNPAGE_LICENSE <span class="parameter">textfile</span><br />
+                            MUI_UNPAGE_COMPONENTS<br />
+                            MUI_UNPAGE_DIRECTORY<br />
+                            MUI_UNPAGE_INSTFILES<br />
+                            MUI_UNPAGE_FINISH</p>
+                        <h3>
+                            <img class="trigger" alt="Open/Close section" id="trigger_pg" src="images/closed.gif"
+                                onclick="toggle('trigger_pg', 'toggle_pg');" />
+                            Page settings</h3>
+                        <div class="toggle" id="toggle_pg">
+                            <p>
+                                Page settings apply to a single page and should be set before inserting a page macro.
+                                The same settings can be used for installer and uninstaller pages. You have to repeat
+                                the setting if you want it to apply to multiple pages. Example:</p>
+                            <pre>
+;Add a directory page to let the user specify a plug-ins folder
+;Store the folder in $PluginsFolder
+
+Var PLUGINS_FOLDER
+!define MUI_DIRECTORYPAGE_VARIABLE $PluginsFolder
+!insertmacro MUI_PAGE_DIRECTORY
+</pre>
+                            <p>
+                                <p>
+                                    All standard texts in the user interface are loaded from language files, which are
+                                    available for all languages supported by NSIS. So you only need to define these
+                                    texts if you want to change the default.</p>
+                                <p>
+                                    If the parameter is a text that should be different for each language, define a
+                                    language string using LangString and use $(LangStringName) as value. For a license
+                                    text in multiple languages, LicenseLangString can be used. Refer the NSIS Users
+                                    Manual for more information about installers with multiple languages.</p>
+                                <p>
+                                    In all text settings, the doublequote character (&quot;) should be escaped in the
+                                    following form: $\&quot;</p>
+                                <h3>
+                                    <img class="trigger" alt="Open/Close section" id="trigger_pgg" src="images/closed.gif"
+                                        onclick="toggle('trigger_pgg', 'toggle_pgg');" />
+                                    General page settings</h3>
+                                <div class="toggle" id="toggle_pgg">
+                                    <p>
+                                        <strong>MUI_PAGE_HEADER_TEXT</strong> <span class="parameter">text</span><br />
+                                        Text to display on the header of the page.</p>
+                                    <p>
+                                        <strong>MUI_PAGE_HEADER_SUBTEXT</strong> <span class="parameter">text</span><br />
+                                        Subtext to display on the header of the page.</p>
+                                </div>
+                                <h3>
+                                    <img class="trigger" alt="Open/Close section" id="trigger_pgw" src="images/closed.gif"
+                                        onclick="toggle('trigger_pgw', 'toggle_pgw');" />
+                                    Welcome page settings</h3>
+                                <div class="toggle" id="toggle_pgw">
+                                    <p>
+                                        <strong>MUI_WELCOMEPAGE_TITLE</strong> <span class="parameter">title</span><br />
+                                        Title to display on the top of the page.</p>
+                                    <p>
+                                        <strong>MUI_WELCOMEPAGE_TITLE_3LINES</strong><br />
+                                        Extra space for the title area.</p>
+                                    <p>
+                                        <strong>MUI_WELCOMEPAGE_TEXT</strong> <span class="parameter">text</span><br />
+                                        Text to display on the page.</p>
+                                </div>
+                                <h3>
+                                    <img class="trigger" alt="Open/Close section" id="trigger_pgl" src="images/closed.gif"
+                                        onclick="toggle('trigger_pgl', 'toggle_pgl');" />
+                                    License page settings</h3>
+                                <div class="toggle" id="toggle_pgl">
+                                    <p>
+                                        <strong>MUI_LICENSEPAGE_TEXT_TOP</strong> <span class="parameter">text</span><br />
+                                        Text to display on the top of the page.</p>
+                                    <p>
+                                        <strong>MUI_LICENSEPAGE_TEXT_BOTTOM</strong> <span class="parameter">text</span><br />
+                                        Text to display on the bottom of the page.</p>
+                                    <p>
+                                        <strong>MUI_LICENSEPAGE_BUTTON</strong> <span class="parameter">button_text</span><br />
+                                        Text to display on the 'I Agree' button.</p>
+                                    <p>
+                                        <strong>MUI_LICENSEPAGE_CHECKBOX</strong><br />
+                                        Display a checkbox the user has to check to agree with the license terms.</p>
+                                    <div class="settings">
+                                        <p>
+                                            <strong>MUI_LICENSEPAGE_CHECKBOX_TEXT</strong> <span class="parameter">text</span><br />
+                                            Text to display next to the checkbox to agree with the license terms.</p>
+                                    </div>
+                                    <p>
+                                        <strong>MUI_LICENSEPAGE_RADIOBUTTONS</strong><br />
+                                        Display two radio buttons to allow the user to choose between accepting the license
+                                        terms or not.</p>
+                                    <div class="settings">
+                                        <p>
+                                            <strong>MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT</strong> <span class="parameter">text</span><br />
+                                            Text to display next to the checkbox to accept the license terms.</p>
+                                        <p>
+                                            <strong>MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE</strong> <span class="parameter">text</span><br />
+                                            Text to display next to the checkbox to decline the license terms.</p>
+                                    </div>
+                                </div>
+                                <h3>
+                                    <img class="trigger" alt="Open/Close section" id="trigger_pgc" src="images/closed.gif"
+                                        onclick="toggle('trigger_pgc', 'toggle_pgc');" />
+                                    Components page settings</h3>
+                                <div class="toggle" id="toggle_pgc">
+                                    <p>
+                                        <strong>MUI_COMPONENTSPAGE_TEXT_TOP</strong> <span class="parameter">text</span><br />
+                                        Text to display on the top of the page.</p>
+                                    <p>
+                                        <strong>MUI_COMPONENTSPAGE_TEXT_COMPLIST</strong> <span class="parameter">text</span><br />
+                                        Text to display on next to the components list.</p>
+                                    <p>
+                                        <strong>MUI_COMPONENTSPAGE_TEXT_INSTTYPE</strong> <span class="parameter">text</span><br />
+                                        Text to display on next to the installation type combo box.</p>
+                                    <p>
+                                        <strong>MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE</strong> <span class="parameter">text</span><br />
+                                        Text to display on the of the top of the description box.</p>
+                                    <p>
+                                        <strong>MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO</strong> <span class="parameter">text</span><br />
+                                        Text to display inside the description box when no section is selected.</p>
+                                </div>
+                                <h3>
+                                    <img class="trigger" alt="Open/Close section" id="trigger_pgd" src="images/closed.gif"
+                                        onclick="toggle('trigger_pgd', 'toggle_pgd');" />
+                                    Directory page settings</h3>
+                                <div class="toggle" id="toggle_pgd">
+                                    <p>
+                                        <strong>MUI_DIRECTORYPAGE_TEXT_TOP</strong> <span class="parameter">text</span><br />
+                                        Text to display on top of the page.</p>
+                                    <p>
+                                        <strong>MUI_DIRECTORYPAGE_TEXT_DESTINATION</strong> <span class="parameter">text</span><br />
+                                        Text to display on the destination folder frame.</p>
+                                    <p>
+                                        <strong>MUI_DIRECTORYPAGE_VARIABLE</strong> <span class="parameter">variable</span><br />
+                                        Variable in which to store the selected folder.<br />
+                                        <em>Default: $INSTDIR</em></p>
+                                    <p>
+                                        <strong>MUI_DIRECTORYPAGE_VERIFYONLEAVE</strong><br />
+                                        Does not disable the Next button when a folder is invalid but allows you to use
+                                        GetInstDirError in the leave function to handle an invalid folder.</p>
+                                </div>
+                                <h3>
+                                    <img class="trigger" alt="Open/Close section" id="trigger_pgs" src="images/closed.gif"
+                                        onclick="toggle('trigger_pgs', 'toggle_pgs');" />
+                                    Start Menu folder page settings</h3>
+                                <div class="toggle" id="toggle_pgs">
+                                    <p>
+                                        <strong>MUI_STARTMENUPAGE_TEXT_TOP</strong> <span class="parameter">text</span><br />
+                                        Text to display on the top of the page.</p>
+                                    <p>
+                                        <strong>MUI_STARTMENUPAGE_TEXT_CHECKBOX</strong> <span class="parameter">text</span><br />
+                                        Text to display next to the checkbox to disable the Start Menu folder creation.</p>
+                                    <p>
+                                        <strong>MUI_STARTMENUPAGE_DEFAULTFOLDER</strong> <span class="parameter">folder</span><br />
+                                        The default Start Menu Folder.</p>
+                                    <p>
+                                        <strong>MUI_STARTMENUPAGE_NODISABLE</strong><br />
+                                        Do not display the checkbox to disable the creation of Start Menu shortcuts.</p>
+                                    <p>
+                                        <strong>MUI_STARTMENUPAGE_REGISTRY_ROOT</strong> <span class="parameter">root</span><br />
+                                        <strong>MUI_STARTMENUPAGE_REGISTRY_KEY</strong> <span class="parameter">key</span><br />
+                                        <strong>MUI_STARTMENUPAGE_REGISTRY_VALUENAME</strong> <span class="parameter">value_name</span><br />
+                                        The registry key to store the Start Menu folder. The page will use it to remember
+                                        the users preference. You should also use for the uninstaller to remove the Start
+                                        Menu folders. Don't forget to remove this key during uninstallation.</p>
+                                    <p>
+                                        For the uninstaller, use the MUI_STARTMENU_GETFOLDER macro to get the Start Menu
+                                        folder:</p>
+                                    <pre>
+!insertmacro MUI_STARTMENU_GETFOLDER page_id $R0
+  Delete &quot;$SMPROGRAMS\$R0\Your Shortcut.lnk&quot;
+</pre>
+                                </div>
+                                <h3>
+                                    <img class="trigger" alt="Open/Close section" id="trigger_pgi" src="images/closed.gif"
+                                        onclick="toggle('trigger_pgi', 'toggle_pgi');" />
+                                    Installation page settings</h3>
+                                <div class="toggle" id="toggle_pgi">
+                                    <p>
+                                        <strong>MUI_INSTFILESPAGE_FINISHHEADER_TEXT</strong> <span class="parameter">text</span><br />
+                                        Text to display on the header of the installation page when the installation has
+                                        been completed (won't be displayed when using a Finish page without MUI_(UN)FINISHPAGE_NOAUTOCLOSE).</p>
+                                    <p>
+                                        <strong>MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT</strong> <span class="parameter">text</span><br />
+                                        Subtext to display on the header of the installation page when the installation
+                                        has been completed (won't be displayed when using a Finish page without MUI_(UN)FINISHPAGE_NOAUTOCLOSE).</p>
+                                    <p>
+                                        <strong>MUI_INSTFILESPAGE_ABORTHEADER_TEXT</strong> <span class="parameter">text</span><br />
+                                        Text to display on the header of the installation page when the installation has
+                                        been aborted.</p>
+                                    <p>
+                                        <strong>MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT</strong> <span class="parameter">text</span><br />
+                                        Subext to display on the header of the installation page when the installation has
+                                        been aborted.</p>
+                                </div>
+                                <h3>
+                                    <img class="trigger" alt="Open/Close section" id="trigger_pgf" src="images/closed.gif"
+                                        onclick="toggle('trigger_pgf', 'toggle_pgf');" />
+                                    Finish page settings</h3>
+                                <div class="toggle" id="toggle_pgf">
+                                    <p>
+                                        <strong>MUI_FINISHPAGE_TITLE</strong> <span class="parameter">title</span><br />
+                                        Title to display on the top of the page.</p>
+                                    <p>
+                                        <strong>MUI_FINISHPAGE_TITLE_3LINES</strong><br />
+                                        Extra space for the title area.</p>
+                                    <p>
+                                        <strong>MUI_FINISHPAGE_TEXT</strong> <span class="parameter">text</span><br />
+                                        Text to display on the page.</p>
+                                    <p>
+                                        <strong>MUI_FINISHPAGE_TEXT_LARGE</strong><br />
+                                        Extra space for the text area (if using checkboxes).</p>
+                                    <p>
+                                        <strong>MUI_FINISHPAGE_BUTTON</strong> <span class="parameter">text</span><br />
+                                        Text to display on the Finish button.</p>
+                                    <p>
+                                        <strong>MUI_FINISHPAGE_CANCEL_ENABLED</strong><br />
+                                        Enable the Cancel button so the user can skip any options displayed on the finish
+                                        page.</p>
+                                    <p>
+                                        <strong>MUI_FINISHPAGE_TEXT_REBOOT</strong> <span class="parameter">text</span><br />
+                                        Text to display on the finish page when asking for a system reboot.</p>
+                                    <p>
+                                        <strong>MUI_FINISHPAGE_TEXT_REBOOTNOW</strong> <span class="parameter">text</span><br />
+                                        Text to display next to the 'Reboot now' option button.</p>
+                                    <p>
+                                        <strong>MUI_FINISHPAGE_TEXT_REBOOTLATER</strong> <span class="parameter">text</span><br />
+                                        Text to display next to the 'Reboot later' option button.</p>
+                                    <p>
+                                        <strong>MUI_FINISHPAGE_REBOOTLATER_DEFAULT</strong><br />
+                                        Sets the 'Reboot later' option as the default option.</p>
+                                    <p>
+                                        <strong>MUI_FINISHPAGE_RUN</strong> <span class="parameter">exe_file</span><br />
+                                        Application which the user can select to run using a checkbox. You don't need to
+                                        put quotes around the filename when it contains spaces.</p>
+                                    <div class="settings">
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_RUN_TEXT</strong> <span class="parameter">text</span><br />
+                                            Texts to display next to the 'Run program' checkbox.</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_RUN_PARAMETERS</strong> <span class="parameter">parameters</span><br />
+                                            Parameters for the application to run. Don't forget to escape double quotes in the
+                                            value (use $\&quot;).</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_RUN_NOTCHECKED</strong><br />
+                                            Do not check the 'Run program' checkbox by default</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_RUN_FUNCTION</strong> <span class="parameter">function</span><br />
+                                            Call a function instead of executing an application (define MUI_FINISHPAGE_RUN without
+                                            parameters). You can use the function to execute multiple applications or you can
+                                            change the checkbox name and use it for other things.</p>
+                                    </div>
+                                    <p>
+                                        <strong>MUI_FINISHPAGE_SHOWREADME</strong> <span class="parameter">file/url</span><br />
+                                        File or website which the user can select to view using a checkbox. You don't need
+                                        to put quotes around the filename when it contains spaces.</p>
+                                    <div class="settings">
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_SHOWREADME_TEXT</strong> <span class="parameter">text</span><br />
+                                            Texts to display next to the 'Show Readme' checkbox.</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_SHOWREADME_NOTCHECKED</strong><br />
+                                            Do not check the 'Show Readme' checkbox by default</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_SHOWREADME_FUNCTION</strong> <span class="parameter">function</span><br />
+                                            Call a function instead of showing a file (define MUI_FINISHPAGE_SHOWREADME without
+                                            parameters). You can use the function to show multiple files or you can change the
+                                            checkbox name and use it for other things.</p>
+                                    </div>
+                                    <p>
+                                        <strong>MUI_FINISHPAGE_LINK</strong> <span class="parameter">link_text</span><br />
+                                        Text for a link on the which the user can click to view a website or file.</p>
+                                    <div class="settings">
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_LINK_LOCATION</strong> <span class="parameter">file/url</span><br />
+                                            Website or file which the user can select to view using the link. You don't need
+                                            to put quotes around the filename when it contains spaces.</p>
+                                        <p>
+                                            <strong>MUI_FINISHPAGE_LINK_COLOR</strong> <span class="parameter">(color: RRGGBB hexadecimal)</span><br />
+                                            Text color for the link on the Finish page.<br />
+                                            <em>Default: 000080</em></p>
+                                    </div>
+                                    <p>
+                                        <strong>MUI_FINISHPAGE_NOREBOOTSUPPORT</strong><br />
+                                        Disables support for the page that allows the user to reboot the system. Define
+                                        this option to save some space if you are not using the /REBOOTOK flag or SetRebootFlag.</p>
+                                </div>
+                                <h3>
+                                    <img class="trigger" alt="Open/Close section" id="trigger_pgu" src="images/closed.gif"
+                                        onclick="toggle('trigger_pgu', 'toggle_pgu');" />
+                                    Uninstall confirm page settings</h3>
+                                <div class="toggle" id="toggle_pgu">
+                                    <p>
+                                        <strong>MUI_UNCONFIRMPAGE_TEXT_TOP</strong> <span class="parameter">text</span><br />
+                                        Text to display on the top of the page.</p>
+                                    <p>
+                                        <strong>MUI_UNCONFIRMPAGE_TEXT_LOCATION</strong> <span class="parameter">text</span><br />
+                                        Text to display next to the uninstall location text box.</p>
+                                </div>
+                        </div>
+                    </div>
+                    <h2>
+                        4. Language files</h2>
+                    <div>
+                        <p>
+                            Insert the Modern UI language files for the languages to want to include.</p>
+                        <pre>
+!insertmacro MUI_LANGUAGE &quot;English&quot;
+</pre>
+                        <p>
+                            The standard NSIS language files are loaded automatically, there is no need to use
+                            LoadLanguageFile.</p>
+                    </div>
+                    <h2>
+                        5. Reserve files</h2>
+                    <div>
+                        <p>
+                            If you are using solid compression, files that are required before the actual installation
+                            should be stored first in the data block, because this will make your installer
+                            start faster. Include reserve file commands for such files before your sections
+                            and functions:</p>
+                        <pre>
+ReserveFile MyPlugin.dll
+!insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog
+...
+</pre>
+                    </div>
+                    <h1>
+                        Script code for pages</h1>
+                    <div>
+                        <p>
+                            Some pages allow you to show additional information or can be used to get user input.
+                            Here you can find the script code to use these features.</p>
+                        <h2>
+                            Components page descriptions</h2>
+                        <div>
+                            <p>
+                                The Modern UI components page has a text box in which a description can be shown
+                                when the user hovers the mouse over a component. If you don't want to use these
+                                descriptions, insert the MUI_COMPONENTSPAGE_NODESC interface setting.</p>
+                            <p>
+                                To set a description for a section, an additional parameter needs to be added to
+                                Section commmand with a unique identifier for the section. This name can later be
+                                used to set the description for this section.</p>
+                            <pre>
+Section &quot;Section Name 1&quot; Section1
+   ...
+SectionEnd
+</pre>
+                            <p>
+                                After the sections, use these macros to set the descriptions:</p>
+                            <pre>
+LangString DESC_Section1 ${LANG_ENGLISH} &quot;Description of section 1.&quot;
+LangString DESC_Section2 ${LANG_ENGLISH} &quot;Description of section 2.&quot;
+
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+  !insertmacro MUI_DESCRIPTION_TEXT ${Section1} $(DESC_Section1)
+  !insertmacro MUI_DESCRIPTION_TEXT ${Section2} $(DESC_Section2)
+!insertmacro MUI_FUNCTION_DESCRIPTION_END
+</pre>
+                            <p>
+                                For the uninstaller, use the MUI_UNFUNCTION_DESCRIPTION_BEGIN and MUI_UNFUNCTION_DESCRIPTION_END
+                                macros.</p>
+                        </div>
+                        <h2>
+                            Start Menu folder</h2>
+                        <div>
+                            <p>
+                                Put the code to write the shortcuts (using CreateShortcut) between the MUI_STARTMENU_WRITE_BEGIN
+                                and MUI_STARTMENU_WRITE_END macros:</p>
+                            <pre>
+!insertmacro MUI_STARTMENU_WRITE_BEGIN pageid
+  ...create shortcuts...
+!insertmacro MUI_STARTMENU_WRITE_END
+</pre>
+                            <p>
+                                The page ID should be the ID of the page on which the user has selected the folder
+                                for the shortcuts you want to write.</p>
+                            <p>
+                                The variable which contains the folder and the page ID are set as parameters of
+                                the page macro.</p>
+                        </div>
+                    </div>
+                    <h1>
+                        Language selection dialog</h1>
+                    <div>
+                        <p>
+                            If you want the installer to display a language selection dialog (see the the <a
+                                href="../../Examples/Modern%20UI/MultiLanguage.nsi">MultiLanguage.nsi</a> example),
+                            insert the MUI_LANGDLL_DISPLAY macro in the .onInit function:</p>
+                        <pre>
+Function .onInit
+
+  !insertmacro MUI_LANGDLL_DISPLAY
+
+FunctionEnd
+</pre>
+                        <p>
+                            This macro can also be used in the un.onInit function.</p>
+                        <h3>
+                            <img class="trigger" alt="Open/Close section" id="trigger_lss" src="images/closed.gif"
+                                onclick="toggle('trigger_lss', 'toggle_lss');" />
+                            Settings for registry storage of selected language</h3>
+                        <div class="toggle" id="toggle_lss">
+                            <p>
+                                To remember the user's preference, you can define a registry key. These defines
+                                should be set before inserting the installation page macro.</p>
+                            <p>
+                                <strong>MUI_LANGDLL_REGISTRY_ROOT</strong> <span class="parameter">root</span><br />
+                                <strong>MUI_LANGDLL_REGISTRY_KEY</strong> <span class="parameter">key</span><br />
+                                <strong>MUI_LANGDLL_REGISTRY_VALUENAME</strong> <span class="parameter">value_name</span><br />
+                                The registry key to store the language. The users preference will be remembered.
+                                You can also use it for the uninstaller to display the right language. Don't forget
+                                to remove this key in the uninstaller.</p>
+                            <p>
+                                For the uninstaller, insert the MUI_UNGETLANGUAGE macro in un.onInit to get the
+                                stored language preference:</p>
+                            <pre>
+Function un.onInit
+
+  !insertmacro MUI_UNGETLANGUAGE
+
+FunctionEnd
+</pre>
+                        </div>
+                        <h3>
+                            <img class="trigger" alt="Open/Close section" id="trigger_lsin" src="images/closed.gif"
+                                onclick="toggle('trigger_lsin', 'toggle_lsin');" />
+                            Interface settings for selection dialog</h3>
+                        <div class="toggle" id="toggle_lsin">
+                            <p>
+                                To customize the language selection dialog interface, use these defines before inserting
+                                the MUI_LANGDLL_DISPLAY macro.</p>
+                            <p>
+                                <strong>MUI_LANGDLL_WINDOWTITLE</strong> <span class="parameter">text</span><br />
+                                The window title of the language selection dialog.</p>
+                            <p>
+                                <strong>MUI_LANGDLL_INFO</strong> <span class="parameter">text</span><br />
+                                The text to display on the language selection dialog.</p>
+                            <p>
+                                <strong>MUI_LANGDLL_ALWAYSSHOW</strong><br />
+                                Always show the language selection dialog, even if a language has been stored in
+                                the registry. The language stored in the registry will be selected by default.</p>
+                            <p>
+                                <strong>MUI_LANGDLL_ALLLANGUAGES</strong><br />
+                                Always show all available languages and don't filter according to their codepage.</p>
+                        </div>
+                    </div>
+                    <h1>
+                        Custom pages</h1>
+                    <div>
+                        <p>
+                            If you want add your custom pages to your installer, you can insert your own page
+                            commands between the page macros.</p>
+                        <pre>
+!insertmacro MUI_PAGE_WELCOME
+Page custom FunctionName ;Custom page
+!insertmacro MUI_PAGE_COMPONENTS
+ 
+;Uninstaller
+!insertmacro MUI_UNPAGE_CONFIRM
+UninstPage custom un.FunctionName ;Custom page
+!insertmacro MUI_UNPAGE_INSTFILES
+</pre>
+                        <p>
+                            Use the MUI_HEADER_TEXT macro to set the text on the page header in a page function:</p>
+                        <pre>
+LangString PAGE_TITLE ${LANG_ENGLISH} &quot;Title&quot;
+LangString PAGE_SUBTITLE ${LANG_ENGLISH} &quot;Subtitle&quot;
+
+Function CustomPageFunction
+  !insermacro MUI_HEADER_TEXT $(PAGE_TITLE) $(PAGE_SUBTITLE)
+  ...
+FuctionEnd
+</pre>
+                    </div>
+                    <h1>
+                        Custom functions</h1>
+                    <div>
+                        <p>
+                            Interface functions provided by NSIS, like the .onGUIInit function and the page
+                            functions are automatically included by the Modern UI and filled with code to support
+                            new interface features. If you want to add additional code to these function, create
+                            a function with the custom script code in the script use the Modern UI functions
+                            call them.</p>
+                        <p>
+                            Example:</p>
+                        <pre class="text">
+!define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit
+
+Function myGUIInit
+  ...
+FunctionEnd</pre>
+                        <p>
+                            Modern UI pages can also customized using custom functions.</p>
+                        <h3>
+                            <img class="trigger" alt="Open/Close section" id="trigger_cfg" src="images/closed.gif"
+                                onclick="toggle('trigger_cfg', 'toggle_cfg');" />
+                            General Custom Functions</h3>
+                        <div class="toggle" id="toggle_cfg">
+                            <p>
+                                These defines should be set before inserting the language macros.</p>
+                            <p>
+                                <strong>MUI_CUSTOMFUNCTION_GUIINIT</strong> <span class="parameter">function</span><br />
+                                <strong>MUI_CUSTOMFUNCTION_UNGUIINIT</strong> <span class="parameter">function</span><br />
+                                <strong>MUI_CUSTOMFUNCTION_ABORT</strong> <span class="parameter">function</span><br />
+                                <strong>MUI_CUSTOMFUNCTION_UNABORT</strong> <span class="parameter">function</span><br />
+                                <strong>MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION</strong> <span class="parameter">function</span><br />
+                                <strong>MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION</strong> <span class="parameter">function</span></p>
+							<p>
+                                Mouse over functions are only available when the description macros
+								(MUI_FUNCTION_DESCRIPTION_BEGIN) are used. When component page descriptions are not
+								used, regular .onMouseOverSection and un.onMouseOverSection must be used.</p>
+                        </div>
+                        <h3>
+                            <img class="trigger" alt="Open/Close section" id="trigger_cfpg" src="images/closed.gif"
+                                onclick="toggle('trigger_cfpg', 'toggle_cfpg');" />
+                            Page Custom Functions</h3>
+                        <div class="toggle" id="toggle_cfpg">
+                            <p>
+                                These defines should be set before inserting a page macro.</p>
+                            <p>
+                                <strong>MUI_PAGE_CUSTOMFUNCTION_PRE</strong> <span class="parameter">function</span><br />
+                                <strong>MUI_PAGE_CUSTOMFUNCTION_SHOW</strong> <span class="parameter">function</span><br />
+                                <strong>MUI_PAGE_CUSTOMFUNCTION_LEAVE</strong> <span class="parameter">function</span><br />
+                            </p>
+                            <p>
+                                The pre function is called first and allows you to initalize variables or decide
+                                whether the page should be skipped. Then, the show function is called, which can
+                                be used to customize the interface. Finally, the user input can be validated in the
+								leave function. The NSIS Users Manual provides more information about these functions.</p>
+                            <p>
+                                In the show function, the window handles of all controls on the page can be retrieved
+                                from a Modern UI variable. A list of the variables names is not yet available. For
+                                now, refer to the source files of the Modern UI 2.0. The variable declarations can
+                                be found in the first lines of the header file for a certain page.</p>
+                        </div>
+                    </div>
+                    <h1>
+                        <a name="examples" id="examples">Example scripts</a></h1>
+                    <div>
+                        <p>
+                            Basic: <a href="../../Examples/Modern%20UI/Basic.nsi">Basic.nsi</a><br />
+                            Welcome/Finish page: <a href="../../Examples/Modern%20UI/WelcomeFinish.nsi">WelcomeFinish.nsi</a><br />
+                            Multiple languages: <a href="../../Examples/Modern%20UI/MultiLanguage.nsi">MultiLanguage.nsi</a><br />
+                            Header image: <a href="../../Examples/Modern%20UI/HeaderBitmap.nsi">HeaderBitmap.nsi</a><br />
+                            Start Menu Folder page: <a href="../../Examples/Modern%20UI/StartMenu.nsi">StartMenu.nsi</a></p>
+                    </div>
+                    <h1>
+                        Credits</h1>
+                    <div>
+                        <p>
+                            Written by Joost Verburg.<br />
+                            Icons designed by Nikos Adamamas, aka adni18.<br />
+                            Thanks to Amir Szekely, aka KiCHiK, for his work on NSIS to make this possible.</p>
+                    </div>
+                    <h1>
+                        License</h1>
+                    <div>
+                        <p>
+                            The zlib/libpng license applies to the Modern UI.</p>
+                        <h3>
+                            <img class="trigger" alt="Open/Close section" id="trigger_lic" src="images/closed.gif"
+                                onclick="toggle('trigger_lic', 'toggle_lic');" />
+                            License Terms</h3>
+                        <div class="toggle" id="toggle_lic">
+                            <pre>
+Copyright &copy; 2002-2015 Joost Verburg
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute
+it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; 
+   you must not claim that you wrote the original software.
+   If you use this software in a product, an acknowledgment in the
+   product documentation would be appreciated but is not required.
+2. Altered versions must be plainly marked as such,
+   and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any distribution.
+</pre>
+                        </div>
+                    </div>
+                </div>
+            </td>
+        </tr>
+    </table>
+</body>
+</html>

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/Readme.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/images/screen2.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/images/screen2.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/images/open.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/images/open.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/images/header.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/images/header.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/images/closed.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/images/closed.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/images/screen1.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Modern UI 2/images/screen1.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Docs/Banner/Readme.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Docs/Banner/Readme.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Docs/Banner/Readme.txt	(revision 728)
@@ -0,0 +1,47 @@
+BANNER PLUG-IN
+--------------
+
+The Banner plug-in shows a banner with customizable text. It uses the IDD_VERIFY dialog of the UI.
+
+There are three functions - show, getWindow and destroy.
+
+Usage
+-----
+
+Banner::show "Text to show"
+
+[optional] Banner::getWindow
+
+Banner::destroy
+
+See Example.nsi for an example.
+
+Modern UI
+---------
+
+The Modern UI has two labels on the IDD_VERIFY dialog. To change all the texts, use:
+
+Banner::show /set 76 "Text 1 (replaces Please wait while Setup is loading...)" "Normal text"
+
+Custom UI
+---------
+
+If you have more labels on your IDD_VERIFY dialog, you can use multiple /set parameters to change the texts.
+
+Example:
+
+Banner::show /set 76 "bah #1" /set 54 "bah #2" "Normal text"
+
+The second parameter for /set is the ID of the control.
+
+Some More Tricks
+----------------
+
+If you use /set to set the main string (IDC_STR, 1030) you can specify a different string for the window's caption and for the main string.
+
+If you use an empty string as the main string (Banner::show "") the banner window will not show on the taskbar.
+
+Credits
+-------
+
+A joint effort of brainsucker and kichik in honor of the messages dropped during the battle
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Docs/Banner/Readme.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/nsisconf.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/nsisconf.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/nsisconf.nsh	(revision 728)
@@ -0,0 +1,62 @@
+;------------------------
+;DEFAULT NSIS CONFIG FILE
+;------------------------
+
+;This header file will be included when compiling any NSIS installer,
+;you can use it to add script code to every installer you compile.
+
+;This file is treated as if it is in the directory of your script.
+;When using relative paths, the files have to be in your build directory.
+
+;------------------------
+;EXAMPLES
+;------------------------
+
+;Compress installer exehead with an executable compressor (such as UPX / Petite).
+
+;Paths should be absolute to allow building from any location.
+;Note that your executable compressor should not compress the first icon.
+
+;!packhdr temp.dat '"C:\Program Files\upx\upx" -9 -q temp.dat'
+;!packhdr temp.dat '"C:\Program Files\petite\petite" -9 -b0 -r** -p0 -y temp.dat'
+
+;------------------------
+
+;Set default compressor
+
+;SetCompressor bzip2
+
+;------------------------
+
+;Change the default icons
+
+;Icon "${NSISDIR}\Contrib\Graphics\Icons\arrow-install.ico"
+;UninstallIcon "${NSISDIR}\Contrib\Graphics\Icons\arrow-uninstall.ico"
+
+;------------------------
+
+;Define symbols
+
+;!define COMPANYNAME "bla"
+
+;------------------------
+;MODERN UI
+;------------------------
+
+;The Modern UI will insert the MUI_NSISCONF macro just before processing the settings.
+;Here you can set default settings for the Modern UI.
+
+;------------------------
+
+!define MUI_INSERT_NSISCONF
+
+!macro MUI_NSISCONF
+
+  ;Example: Change the default Modern UI icons
+  
+  ;!ifndef MUI_ICON & MUI_UNICON
+  ;  !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\arrow-install.ico"
+  ;  !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\arrow-uninstall.ico"
+  ;!endif
+  
+!macroend
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/makensis.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/makensis.exe
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/NSIS.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/NSIS.exe
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Examples/Banner/Example.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Banner/Example.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Banner/Example.nsi	(revision 728)
@@ -0,0 +1,38 @@
+# Look at Readme.txt for usage alongside with the Modern UI
+
+!include "WinMessages.nsh"
+
+Name "Banner.dll test"
+
+OutFile "Banner Test.exe"
+
+ShowInstDetails show
+
+Function .onInit
+	Banner::show "Calculating important stuff..."
+
+	Banner::getWindow
+	Pop $1
+
+	again:
+		IntOp $0 $0 + 1
+		Sleep 1
+		StrCmp $0 100 0 again
+
+	GetDlgItem $2 $1 1030
+	SendMessage $2 ${WM_SETTEXT} 0 "STR:Calculating more important stuff..."
+
+	again2:
+		IntOp $0 $0 + 1
+		Sleep 1
+		StrCmp $0 200 0 again2
+
+	Banner::destroy
+FunctionEnd
+
+Section
+	DetailPrint "Using previous calculations to quickly calculate 1*2000..."
+	Sleep 1000
+	DetailPrint "Eureka! It's $0!!!"
+	DetailPrint ""
+SectionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/WordFunc.ini
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/WordFunc.ini	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/WordFunc.ini	(revision 728)
@@ -0,0 +1,107 @@
+[Settings]
+NumFields=13
+NextButtonText=&Enter
+
+[Field 1]
+Type=Droplist
+Flags=NOTIFY
+State=1. WordFind        (Find word by number)
+ListItems=1. WordFind        (Find word by number)|                           (Delimiter exclude)|                           (Sum of words)|                           (Sum of delimiters)|                           (Find word number)|                           ( }} )|                           ( {} )|                           ( *} )|2. WordFind2X|3. WordReplace (Replace)|                           (Delete)|                           (Multiple-replace)|4. WordAdd        (Add)|                           (Delete) |5. WordInsert|6. StrFilter           (UpperCase)|                           (LowerCase)|                           (Filter)|7. VersionCompare|8. VersionConvert
+Left=44
+Right=190
+Top=10
+Bottom=191
+
+[Field 2]
+Type=Text
+State=C:\io.sys|C:\logo.sys|C:\Program Files|C:\WINDOWS
+Left=44
+Right=-10
+Top=30
+Bottom=41
+
+[Field 3]
+Type=Text
+State=|C:\
+Left=44
+Right=-10
+Top=46
+Bottom=59
+
+[Field 4]
+Type=Text
+Flags=DISABLED
+Left=44
+Right=-10
+Top=62
+Bottom=75
+
+[Field 5]
+Type=Text
+State=-4
+Left=44
+Right=-10
+Top=80
+Bottom=92
+
+[Field 6]
+Type=Text
+Left=10
+Right=-30
+Top=108
+Bottom=120
+
+[Field 7]
+Type=Text
+Left=-22
+Right=-10
+Top=108
+Bottom=120
+
+[Field 8]
+Type=Label
+Text=String
+Left=10
+Right=43
+Top=32
+Bottom=44
+
+[Field 9]
+Type=Label
+Text=Delimiter
+Left=10
+Right=43
+Top=48
+Bottom=60
+
+[Field 10]
+Type=Label
+Left=10
+Right=44
+Top=65
+Bottom=76
+
+[Field 11]
+Type=Label
+Text=Word #
+Left=10
+Right=43
+Top=81
+Bottom=94
+
+[Field 12]
+Type=Label
+Text=Result (Word):
+Left=10
+Right=236
+Top=97
+Bottom=110
+
+[Field 13]
+Type=Label
+Text=EL
+Left=-21
+Right=-10
+Top=97
+Bottom=110
+

Property changes on: tmp/trunk/org.txm.setups/nsis/Examples/WordFunc.ini
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Examples/FileFunc.ini
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/FileFunc.ini	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/FileFunc.ini	(revision 728)
@@ -0,0 +1,91 @@
+[Settings]
+NumFields=11
+NextButtonText=&Enter
+
+[Field 1]
+Type=Droplist
+Flags=NOTIFY
+State="  1. Locate"
+ListItems=|  1. Locate|  2. GetSize                 (file)|                                   (directory)|                                   (no size, no subdir)|  3. DriveSpace|  4. GetDrives             (by type)|                                   (all by letter)|  5. GetTime                (local time)|                                   (file time)|  6. GetFileAttributes|  7. GetFileVersion|  8. GetExeName|  9. GetExePath|10. GetParameters|11. GetOptions|12. GetRoot|13. GetParent|14. GetFileName|15. GetBaseName|16. GetFileExt|17. BannerTrimPath|18. DirState|19. RefreshShellIcons
+Left=44
+Right=190
+Top=1
+Bottom=210
+
+[Field 2]
+Type=FileRequest
+Left=44
+Right=-10
+Top=22
+Bottom=33
+
+[Field 3]
+Type=DirRequest
+Left=44
+Right=-10
+Top=22
+Bottom=33
+
+[Field 4]
+Type=Text
+Left=44
+Right=-10
+Top=36
+Bottom=49
+
+[Field 5]
+Type=Text
+State=LocateCallback
+Left=44
+Right=232
+Top=53
+Bottom=66
+
+[Field 6]
+Type=Button
+Text=view
+Flags=NOTIFY
+Left=236
+Right=255
+Top=54
+Bottom=65
+
+[Field 7]
+Type=Text
+Flags=MULTILINE|VSCROLL|HSCROLL|READONLY
+Left=44
+Right=-10
+Top=73
+Bottom=128
+
+[Field 8]
+Type=Label
+Text=Path
+Left=10
+Right=43
+Top=24
+Bottom=36
+
+[Field 9]
+Type=Label
+Text=Options
+Left=10
+Right=43
+Top=40
+Bottom=52
+
+[Field 10]
+Type=Label
+Text=Function
+Left=10
+Right=44
+Top=56
+Bottom=67
+
+[Field 11]
+Type=Label
+Text=Result:
+Left=12
+Right=42
+Top=94
+Bottom=102

Property changes on: tmp/trunk/org.txm.setups/nsis/Examples/FileFunc.ini
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Examples/LogicLib.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/LogicLib.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/LogicLib.nsi	(revision 728)
@@ -0,0 +1,619 @@
+!verbose 2
+
+Name "NSIS LogicLib Example"
+OutFile "LogicLib.exe"
+ShowInstDetails show
+RequestExecutionLevel user
+
+!include "LogicLib.nsh"
+
+;!undef LOGICLIB_VERBOSITY
+;!define LOGICLIB_VERBOSITY 4   ; For debugging - watch what logiclib does with your code!
+
+Page components "" "" ComponentsLeave
+Page instfiles
+
+Section /o "Run tests" TESTS
+
+  ; kinds of if other than "value1 comparison value2"
+  ClearErrors
+  FindFirst $R1 $R2 "$PROGRAMFILES\*"
+  ${Unless} ${Errors}
+    ${Do}
+      ${Select} $R2
+        ${Case2} "." ".."
+          ; Do nothing
+        ${CaseElse}
+          DetailPrint "Found $PROGRAMFILES\$R2"
+      ${EndSelect}
+      FindNext $R1 $R2
+    ${LoopUntil} ${Errors}
+    FindClose $R1
+  ${EndUnless}
+
+  ${If} ${FileExists} "${__FILE__}"
+    DetailPrint 'Source file "${__FILE__}" still exists'
+  ${Else}
+    DetailPrint 'Source file "${__FILE__}" has gone'
+  ${EndIf}
+
+  ; if..endif
+  StrCpy $R1 1
+  StrCpy $R2 ""
+  ${If} $R1 = 1
+    StrCpy $R2 $R2A
+  ${EndIf}
+  ${If} $R1 = 2
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} $R1 < 2
+    StrCpy $R2 $R2C
+  ${EndIf}
+  ${If} $R1 < -2
+    StrCpy $R2 $R2D
+  ${EndIf}
+  ${If} $R1 > 2
+    StrCpy $R2 $R2E
+  ${EndIf}
+  ${If} $R1 > -2
+    StrCpy $R2 $R2F
+  ${EndIf}
+  ${If} $R1 <> 1
+    StrCpy $R2 $R2G
+  ${EndIf}
+  ${If} $R1 <> 2
+    StrCpy $R2 $R2H
+  ${EndIf}
+  ${If} $R1 >= 2
+    StrCpy $R2 $R2I
+  ${EndIf}
+  ${If} $R1 >= -2
+    StrCpy $R2 $R2J
+  ${EndIf}
+  ${If} $R1 <= 2
+    StrCpy $R2 $R2K
+  ${EndIf}
+  ${If} $R1 <= -2
+    StrCpy $R2 $R2L
+  ${EndIf}
+  ${If} $R2 == "ACFHJK"
+    DetailPrint "PASSED If..EndIf test"
+  ${Else}
+    DetailPrint "FAILED If..EndIf test"
+  ${EndIf}
+
+  ; if..elseif..else..endif
+  StrCpy $R1 A
+  StrCpy $R2 ""
+  ${If} $R1 == A
+    StrCpy $R2 $R2A
+  ${ElseIf} $R1 == B
+    StrCpy $R2 $R2B
+  ${ElseUnless} $R1 != C
+    StrCpy $R2 $R2C
+  ${Else}
+    StrCpy $R2 $R2D
+  ${EndIf}
+  ${If} $R1 == D
+    StrCpy $R2 $R2D
+  ${ElseIf} $R1 == A
+    StrCpy $R2 $R2A
+  ${ElseUnless} $R1 != B
+    StrCpy $R2 $R2B
+  ${Else}
+    StrCpy $R2 $R2C
+  ${EndIf}
+  ${If} $R1 == C
+    StrCpy $R2 $R2C
+  ${ElseIf} $R1 == D
+    StrCpy $R2 $R2D
+  ${ElseUnless} $R1 != A
+    StrCpy $R2 $R2A
+  ${Else}
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} $R1 == B
+    StrCpy $R2 $R2B
+  ${ElseIf} $R1 == C
+    StrCpy $R2 $R2C
+  ${ElseUnless} $R1 != D
+    StrCpy $R2 $R2D
+  ${Else}
+    StrCpy $R2 $R2A
+  ${EndIf}
+  ${If} $R2 == "$R1$R1$R1$R1"
+    DetailPrint "PASSED If..ElseIf..Else..EndIf test"
+  ${Else}
+    DetailPrint "FAILED If..ElseIf..Else..EndIf test"
+  ${EndIf}
+
+  ; if..andif..orif..endif
+  StrCpy $R2 ""
+  ${If} 1 = 1
+  ${AndIf} 2 = 2
+    StrCpy $R2 $R2A
+  ${Else}
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} 1 = 1
+  ${AndIf} 2 = 3
+    StrCpy $R2 $R2B
+  ${Else}
+    StrCpy $R2 $R2A
+  ${EndIf}
+  ${If} 1 = 2
+  ${AndIf} 2 = 2
+    StrCpy $R2 $R2B
+  ${Else}
+    StrCpy $R2 $R2A
+  ${EndIf}
+  ${If} 1 = 2
+  ${AndIf} 2 = 3
+    StrCpy $R2 $R2B
+  ${Else}
+    StrCpy $R2 $R2A
+  ${EndIf}
+
+  ${If} 1 = 1
+  ${OrIf} 2 = 2
+    StrCpy $R2 $R2A
+  ${Else}
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} 1 = 1
+  ${OrIf} 2 = 3
+    StrCpy $R2 $R2A
+  ${Else}
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} 1 = 2
+  ${OrIf} 2 = 2
+    StrCpy $R2 $R2A
+  ${Else}
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} 1 = 2
+  ${OrIf} 2 = 3
+    StrCpy $R2 $R2B
+  ${Else}
+    StrCpy $R2 $R2A
+  ${EndIf}
+
+  ${If} 1 = 1
+  ${AndIf} 2 = 2
+  ${OrIf} 3 = 3
+    StrCpy $R2 $R2A
+  ${Else}
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} 1 = 1
+  ${AndIf} 2 = 3
+  ${OrIf} 3 = 3
+    StrCpy $R2 $R2A
+  ${Else}
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} 1 = 2
+  ${AndIf} 2 = 2
+  ${OrIf} 3 = 3
+    StrCpy $R2 $R2A
+  ${Else}
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} 1 = 2
+  ${AndIf} 2 = 3
+  ${OrIf} 3 = 3
+    StrCpy $R2 $R2A
+  ${Else}
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} 1 = 1
+  ${AndIf} 2 = 2
+  ${OrIf} 3 = 4
+    StrCpy $R2 $R2A
+  ${Else}
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} 1 = 1
+  ${AndIf} 2 = 3
+  ${OrIf} 3 = 4
+    StrCpy $R2 $R2B
+  ${Else}
+    StrCpy $R2 $R2A
+  ${EndIf}
+  ${If} 1 = 2
+  ${AndIf} 2 = 2
+  ${OrIf} 3 = 4
+    StrCpy $R2 $R2B
+  ${Else}
+    StrCpy $R2 $R2A
+  ${EndIf}
+  ${If} 1 = 2
+  ${AndIf} 2 = 3
+  ${OrIf} 3 = 4
+    StrCpy $R2 $R2B
+  ${Else}
+    StrCpy $R2 $R2A
+  ${EndIf}
+
+  ${If} 1 = 1
+  ${OrIf} 2 = 2
+  ${AndIf} 3 = 3
+    StrCpy $R2 $R2A
+  ${Else}
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} 1 = 1
+  ${OrIf} 2 = 3
+  ${AndIf} 3 = 3
+    StrCpy $R2 $R2A
+  ${Else}
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} 1 = 2
+  ${OrIf} 2 = 2
+  ${AndIf} 3 = 3
+    StrCpy $R2 $R2A
+  ${Else}
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} 1 = 2
+  ${OrIf} 2 = 3
+  ${AndIf} 3 = 3
+    StrCpy $R2 $R2B
+  ${Else}
+    StrCpy $R2 $R2A
+  ${EndIf}
+  ${If} 1 = 1
+  ${OrIf} 2 = 2
+  ${AndIf} 3 = 4
+    StrCpy $R2 $R2B
+  ${Else}
+    StrCpy $R2 $R2A
+  ${EndIf}
+  ${If} 1 = 1
+  ${OrIf} 2 = 3
+  ${AndIf} 3 = 4
+    StrCpy $R2 $R2B
+  ${Else}
+    StrCpy $R2 $R2A
+  ${EndIf}
+  ${If} 1 = 2
+  ${OrIf} 2 = 2
+  ${AndIf} 3 = 4
+    StrCpy $R2 $R2B
+  ${Else}
+    StrCpy $R2 $R2A
+  ${EndIf}
+  ${If} 1 = 2
+  ${OrIf} 2 = 3
+  ${AndIf} 3 = 4
+    StrCpy $R2 $R2B
+  ${Else}
+    StrCpy $R2 $R2A
+  ${EndIf}
+
+  ${If} $R2 == "AAAAAAAAAAAAAAAAAAAAAAAA"
+    DetailPrint "PASSED If..AndIf..OrIf..Else..EndIf test"
+  ${Else}
+    DetailPrint "FAILED If..AndIf..OrIf..Else..EndIf test"
+  ${EndIf}
+
+  ; ifthen..|..|
+  StrCpy $R1 1
+  StrCpy $R2 ""
+  ${IfThen} $R1 = 1 ${|} StrCpy $R2 $R2A ${|}
+  ${IfThen} $R1 = 2 ${|} StrCpy $R2 $R2B ${|}
+  ${IfNotThen} $R1 = 1 ${|} StrCpy $R2 $R2C ${|}
+  ${IfNotThen} $R1 = 2 ${|} StrCpy $R2 $R2D ${|}
+  ${If} $R2 == "AD"
+    DetailPrint "PASSED IfThen test"
+  ${Else}
+    DetailPrint "FAILED IfThen test"
+  ${EndIf}
+
+  ; ifcmd..||..| and if/unless cmd
+  StrCpy $R2 ""
+  ${IfCmd} MessageBox MB_YESNO "Please click Yes" IDYES ${||} StrCpy $R2 $R2A ${|}
+  ${Unless} ${Cmd} `MessageBox MB_YESNO|MB_DEFBUTTON2 "Please click No" IDYES`
+    StrCpy $R2 $R2B
+  ${EndUnless}
+  ${If} $R2 == "AB"
+    DetailPrint "PASSED IfCmd/If Cmd test"
+  ${Else}
+    DetailPrint "FAILED IfCmd/If Cmd test"
+  ${EndIf}
+
+  ; select..case..case2..case3..case4..case5..caseelse..endselect
+  StrCpy $R1 1
+  StrCpy $R2 ""
+  ${Select} $R1
+    ${Case} "1"
+      StrCpy $R2 $R2A
+    ${Case} "2"
+      StrCpy $R2 $R2B
+    ${Case2} "3" "4"
+      StrCpy $R2 $R2C
+    ${CaseElse}
+      StrCpy $R2 $R2D
+  ${EndSelect}
+  ${Select} $R1
+    ${Case} "2"
+      StrCpy $R2 $R2A
+    ${Case} "3"
+      StrCpy $R2 $R2B
+    ${Case2} "4" "5"
+      StrCpy $R2 $R2C
+    ${CaseElse}
+      StrCpy $R2 $R2D
+  ${EndSelect}
+  ${Select} $R1
+    ${Case} "3"
+      StrCpy $R2 $R2A
+    ${Case} "4"
+      StrCpy $R2 $R2B
+    ${Case2} "5" "1"
+      StrCpy $R2 $R2C
+    ${CaseElse}
+      StrCpy $R2 $R2D
+  ${EndSelect}
+  ${Select} $R1
+    ${Case} "4"
+      StrCpy $R2 $R2A
+    ${Case} "5"
+      StrCpy $R2 $R2B
+    ${Case2} "1" "2"
+      StrCpy $R2 $R2C
+    ${CaseElse}
+      StrCpy $R2 $R2D
+  ${EndSelect}
+  ${If} $R2 == "ADCC"
+    DetailPrint "PASSED Select..Case*..EndSelect test"
+  ${Else}
+    DetailPrint "FAILED Select..Case*..EndSelect test"
+  ${EndIf}
+
+  ; switch..case..caseelse..endswitch
+  StrCpy $R2 ""
+  ${For} $R1 1 10
+    ${Switch} $R1
+      ${Case} 3
+        StrCpy $R2 $R2A
+      ${Case} 4
+        StrCpy $R2 $R2B
+        ${Break}
+      ${Case} 5
+        StrCpy $R2 $R2C
+    ${EndSwitch}
+    ${Switch} $R1
+      ${Case} 1
+        StrCpy $R2 $R2D
+      ${Default}
+        StrCpy $R2 $R2E
+        ${Break}
+      ${Case} 2
+        StrCpy $R2 $R2F
+    ${EndSwitch}
+    ${Switch} $R1
+      ${Case} 6
+      ${Case} 7
+        StrCpy $R2 $R2G
+        ${If} $R1 = 6
+      ${Case} 8
+          StrCpy $R2 $R2H
+          ${Switch} $R1
+            ${Case} 6
+              StrCpy $R2 $R2I
+              ${Break}
+            ${Case} 8
+              StrCpy $R2 $R2J
+          ${EndSwitch}
+        ${EndIf}
+        StrCpy $R2 $R2K
+        ${Break}
+      ${Default}
+        StrCpy $R2 $R2L
+      ${Case} 9
+        StrCpy $R2 $R2M
+    ${EndSwitch}
+  ${Next}
+  ${If} $R2 == "DELMFLMABELMBELMCELMEGHIKEGKEHJKEMELM"
+    DetailPrint "PASSED Switch..Case*..EndSwitch test"
+  ${Else}
+    DetailPrint "FAILED Switch..Case*..EndSwitch test"
+  ${EndIf}
+
+  ; for[each]..exitfor..next
+  StrCpy $R2 ""
+  ${For} $R1 1 5
+    StrCpy $R2 $R2$R1
+  ${Next}
+  ${ForEach} $R1 10 1 - 1
+    StrCpy $R2 $R2$R1
+  ${Next}
+  ${For} $R1 1 0
+    StrCpy $R2 $R2$R1
+  ${Next}
+  ${If} $R2 == "1234510987654321"
+    DetailPrint "PASSED For[Each]..Next test"
+  ${Else}
+    DetailPrint "FAILED For[Each]..Next test"
+  ${EndIf}
+
+  ; do..loop
+  StrCpy $R1 0
+  Call DoLoop
+  ${If} $R1 == 5
+    DetailPrint "PASSED Do..Loop test"
+  ${Else}
+    DetailPrint "FAILED Do..Loop test"
+  ${EndIf}
+
+  ; do..exitdo..loop
+  StrCpy $R1 0
+  StrCpy $R2 ""
+  ${Do}
+    StrCpy $R2 $R2$R1
+    IntOp $R1 $R1 + 1
+    ${If} $R1 > 10
+      ${ExitDo}
+    ${EndIf}
+  ${Loop}
+  ${If} $R2 == "012345678910"
+    DetailPrint "PASSED Do..ExitDo..Loop test"
+  ${Else}
+    DetailPrint "FAILED Do..ExitDo..Loop test"
+  ${EndIf}
+
+  ; do..exitdo..loopuntil
+  StrCpy $R1 0
+  StrCpy $R2 ""
+  ${Do}
+    StrCpy $R2 $R2$R1
+    IntOp $R1 $R1 + 1
+  ${LoopUntil} $R1 >= 5
+  ${If} $R2 == "01234"
+    DetailPrint "PASSED Do..ExitDo..LoopUntil test"
+  ${Else}
+    DetailPrint "FAILED Do..ExitDo..LoopUntil test"
+  ${EndIf}
+
+  ; dountil..exitdo..loop
+  StrCpy $R1 0
+  StrCpy $R2 ""
+  ${DoUntil} $R1 >= 5
+    StrCpy $R2 $R2$R1
+    IntOp $R1 $R1 + 1
+  ${Loop}
+  ${If} $R2 == "01234"
+    DetailPrint "PASSED DoUntil..ExitDo..Loop test"
+  ${Else}
+    DetailPrint "FAILED DoUntil..ExitDo..Loop test"
+  ${EndIf}
+
+  ; nested do test
+  StrCpy $R1 0
+  StrCpy $R2 0
+  StrCpy $R3 ""
+  ${Do}
+    StrCpy $R3 $R3$R1$R2
+    IntOp $R1 $R1 + 1
+    ${If} $R1 > 5
+      ${ExitDo}
+    ${EndIf}
+    StrCpy $R2 0
+    ${Do}
+      StrCpy $R3 $R3$R1$R2
+      IntOp $R2 $R2 + 1
+      ${If} $R2 >= 5
+        ${ExitDo}
+      ${EndIf}
+    ${Loop}
+  ${Loop}
+  ${If} $R3 == "00101112131415202122232425303132333435404142434445505152535455"
+    DetailPrint "PASSED nested Do test"
+  ${Else}
+    DetailPrint "FAILED nested Do test"
+  ${EndIf}
+
+  ; while..exitwhile..endwhile (exact replica of dowhile..enddo}
+  StrCpy $R1 0
+  StrCpy $R2 ""
+  ${While} $R1 < 5
+    StrCpy $R2 $R2$R1
+    IntOp $R1 $R1 + 1
+  ${EndWhile}
+  ${If} $R2 == "01234"
+    DetailPrint "PASSED While..ExitWhile..EndWhile test"
+  ${Else}
+    DetailPrint "FAILED While..ExitWhile..EndWhile test"
+  ${EndIf}
+
+  ; Unsigned integer tests
+  StrCpy $R2 ""
+  ${If} -1 < 1
+    StrCpy $R2 $R2A
+  ${EndIf}
+  ${If} -1 U< 1
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} 0xFFFFFFFF > 1
+    StrCpy $R2 $R2C
+  ${EndIf}
+  ${If} 0xFFFFFFFF U> 1
+    StrCpy $R2 $R2D
+  ${EndIf}
+  ${If} $R2 == "AD"
+    DetailPrint "PASSED unsigned integer test"
+  ${Else}
+    DetailPrint "FAILED unsigned integer test"
+  ${EndIf}
+
+  ; 64-bit integer tests (uses System.dll)
+  StrCpy $R2 ""
+  ${If} 0x100000000 L= 4294967296
+    StrCpy $R2 $R2A
+  ${EndIf}
+  ${If} 0x100000000 L< 0x200000000
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} 0x500000000 L>= 0x500000000
+    StrCpy $R2 $R2C
+  ${EndIf}
+  ${If} $R2 == "ABC"
+    DetailPrint "PASSED 64-bit integer test"
+  ${Else}
+    DetailPrint "FAILED 64-bit integer test"
+  ${EndIf}
+
+  ; Extra string tests (uses System.dll)
+  StrCpy $R2 ""
+  ${If} "A" S< "B"
+    StrCpy $R2 $R2A
+  ${EndIf}
+  ${If} "b" S> "A"
+    StrCpy $R2 $R2B
+  ${EndIf}
+  ${If} "a" S<= "B"
+    StrCpy $R2 $R2C
+  ${EndIf}
+  ${If} "B" S< "B"
+    StrCpy $R2 $R2D
+  ${EndIf}
+  ${If} "A" S== "A"
+    StrCpy $R2 $R2E
+  ${EndIf}
+  ${If} "A" S== "a"
+    StrCpy $R2 $R2F
+  ${EndIf}
+  ${If} "A" S!= "a"
+    StrCpy $R2 $R2G
+  ${EndIf}
+  ${If} $R2 == "ABCEG"
+    DetailPrint "PASSED extra string test"
+  ${Else}
+    DetailPrint "FAILED extra string test"
+  ${EndIf}
+
+SectionEnd
+
+Function ComponentsLeave
+  ; Section flags tests (requires sections.nsh be included)
+  ${Unless} ${SectionIsSelected} ${TESTS}
+    MessageBox MB_OK "Please select the component"
+    Abort
+  ${EndIf}
+FunctionEnd
+
+Function DoLoop
+
+  ${Do}
+    IntOp $R1 $R1 + 1
+    ${If} $R1 == 5
+      Return
+    ${EndIf}
+  ${Loop}
+
+FunctionEnd
+
+!verbose 3
Index: tmp/trunk/org.txm.setups/nsis/Examples/StartMenu/Example.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/StartMenu/Example.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/StartMenu/Example.nsi	(revision 728)
@@ -0,0 +1,50 @@
+Name "StartMenu.dll test"
+
+OutFile "StartMenu Test.exe"
+
+XPStyle on
+
+Page directory
+DirText "This installer will create some shortcuts to MakeNSIS in the start menu.$\nFor this it needs NSIS's path." \
+  "Please specify the path in which you have installed NSIS:"
+InstallDir "${NSISDIR}"
+Function .onVerifyInstDir
+	IfFileExists $INSTDIR\makensis.exe +2
+		Abort
+FunctionEnd
+
+Page custom StartMenuGroupSelect "" ": Start Menu Folder"
+Function StartMenuGroupSelect
+	Push $R1
+
+	StartMenu::Select /checknoshortcuts "Don't create a start menu folder" /autoadd /lastused $R0 "StartMenu.dll test"
+	Pop $R1
+
+	StrCmp $R1 "success" success
+	StrCmp $R1 "cancel" done
+		; error
+		MessageBox MB_OK $R1
+		StrCpy $R0 "StartMenu.dll test" # use default
+		Return
+	success:
+	Pop $R0
+
+	done:
+	Pop $R1
+FunctionEnd
+
+Page instfiles
+Section
+	# this part is only necessary if you used /checknoshortcuts
+	StrCpy $R1 $R0 1
+	StrCmp $R1 ">" skip
+
+		CreateDirectory $SMPROGRAMS\$R0
+		CreateShortCut $SMPROGRAMS\$R0\MakeNSISw.lnk $INSTDIR\makensisw.exe
+
+		SetShellVarContext All
+		CreateDirectory $SMPROGRAMS\$R0
+		CreateShortCut "$SMPROGRAMS\$R0\All users MakeNSISw.lnk" $INSTDIR\makensisw.exe
+
+	skip:
+SectionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/Modern UI/MultiLanguage.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Modern UI/MultiLanguage.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Modern UI/MultiLanguage.nsi	(revision 728)
@@ -0,0 +1,178 @@
+;NSIS Modern User Interface
+;Multilingual Example Script
+;Written by Joost Verburg
+
+;--------------------------------
+;Include Modern UI
+
+  !include "MUI2.nsh"
+
+;--------------------------------
+;General
+
+  ;Name and file
+  Name "Modern UI Test"
+  OutFile "MultiLanguage.exe"
+
+  ;Default installation folder
+  InstallDir "$LOCALAPPDATA\Modern UI Test"
+  
+  ;Get installation folder from registry if available
+  InstallDirRegKey HKCU "Software\Modern UI Test" ""
+
+  ;Request application privileges for Windows Vista
+  RequestExecutionLevel user
+
+;--------------------------------
+;Interface Settings
+
+  !define MUI_ABORTWARNING
+
+;--------------------------------
+;Language Selection Dialog Settings
+
+  ;Remember the installer language
+  !define MUI_LANGDLL_REGISTRY_ROOT "HKCU" 
+  !define MUI_LANGDLL_REGISTRY_KEY "Software\Modern UI Test" 
+  !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
+
+;--------------------------------
+;Pages
+
+  !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
+  !insertmacro MUI_PAGE_COMPONENTS
+  !insertmacro MUI_PAGE_DIRECTORY
+  !insertmacro MUI_PAGE_INSTFILES
+  
+  !insertmacro MUI_UNPAGE_CONFIRM
+  !insertmacro MUI_UNPAGE_INSTFILES
+
+;--------------------------------
+;Languages
+
+  !insertmacro MUI_LANGUAGE "English" ;first language is the default language
+  !insertmacro MUI_LANGUAGE "French"
+  !insertmacro MUI_LANGUAGE "German"
+  !insertmacro MUI_LANGUAGE "Spanish"
+  !insertmacro MUI_LANGUAGE "SpanishInternational"
+  !insertmacro MUI_LANGUAGE "SimpChinese"
+  !insertmacro MUI_LANGUAGE "TradChinese"
+  !insertmacro MUI_LANGUAGE "Japanese"
+  !insertmacro MUI_LANGUAGE "Korean"
+  !insertmacro MUI_LANGUAGE "Italian"
+  !insertmacro MUI_LANGUAGE "Dutch"
+  !insertmacro MUI_LANGUAGE "Danish"
+  !insertmacro MUI_LANGUAGE "Swedish"
+  !insertmacro MUI_LANGUAGE "Norwegian"
+  !insertmacro MUI_LANGUAGE "NorwegianNynorsk"
+  !insertmacro MUI_LANGUAGE "Finnish"
+  !insertmacro MUI_LANGUAGE "Greek"
+  !insertmacro MUI_LANGUAGE "Russian"
+  !insertmacro MUI_LANGUAGE "Portuguese"
+  !insertmacro MUI_LANGUAGE "PortugueseBR"
+  !insertmacro MUI_LANGUAGE "Polish"
+  !insertmacro MUI_LANGUAGE "Ukrainian"
+  !insertmacro MUI_LANGUAGE "Czech"
+  !insertmacro MUI_LANGUAGE "Slovak"
+  !insertmacro MUI_LANGUAGE "Croatian"
+  !insertmacro MUI_LANGUAGE "Bulgarian"
+  !insertmacro MUI_LANGUAGE "Hungarian"
+  !insertmacro MUI_LANGUAGE "Thai"
+  !insertmacro MUI_LANGUAGE "Romanian"
+  !insertmacro MUI_LANGUAGE "Latvian"
+  !insertmacro MUI_LANGUAGE "Macedonian"
+  !insertmacro MUI_LANGUAGE "Estonian"
+  !insertmacro MUI_LANGUAGE "Turkish"
+  !insertmacro MUI_LANGUAGE "Lithuanian"
+  !insertmacro MUI_LANGUAGE "Slovenian"
+  !insertmacro MUI_LANGUAGE "Serbian"
+  !insertmacro MUI_LANGUAGE "SerbianLatin"
+  !insertmacro MUI_LANGUAGE "Arabic"
+  !insertmacro MUI_LANGUAGE "Farsi"
+  !insertmacro MUI_LANGUAGE "Hebrew"
+  !insertmacro MUI_LANGUAGE "Indonesian"
+  !insertmacro MUI_LANGUAGE "Mongolian"
+  !insertmacro MUI_LANGUAGE "Luxembourgish"
+  !insertmacro MUI_LANGUAGE "Albanian"
+  !insertmacro MUI_LANGUAGE "Breton"
+  !insertmacro MUI_LANGUAGE "Belarusian"
+  !insertmacro MUI_LANGUAGE "Icelandic"
+  !insertmacro MUI_LANGUAGE "Malay"
+  !insertmacro MUI_LANGUAGE "Bosnian"
+  !insertmacro MUI_LANGUAGE "Kurdish"
+  !insertmacro MUI_LANGUAGE "Irish"
+  !insertmacro MUI_LANGUAGE "Uzbek"
+  !insertmacro MUI_LANGUAGE "Galician"
+  !insertmacro MUI_LANGUAGE "Afrikaans"
+  !insertmacro MUI_LANGUAGE "Catalan"
+  !insertmacro MUI_LANGUAGE "Esperanto"
+
+;--------------------------------
+;Reserve Files
+  
+  ;If you are using solid compression, files that are required before
+  ;the actual installation should be stored first in the data block,
+  ;because this will make your installer start faster.
+  
+  !insertmacro MUI_RESERVEFILE_LANGDLL
+
+;--------------------------------
+;Installer Sections
+
+Section "Dummy Section" SecDummy
+
+  SetOutPath "$INSTDIR"
+  
+  ;ADD YOUR OWN FILES HERE...
+  
+  ;Store installation folder
+  WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR
+  
+  ;Create uninstaller
+  WriteUninstaller "$INSTDIR\Uninstall.exe"
+
+SectionEnd
+
+;--------------------------------
+;Installer Functions
+
+Function .onInit
+
+  !insertmacro MUI_LANGDLL_DISPLAY
+
+FunctionEnd
+
+;--------------------------------
+;Descriptions
+
+  ;USE A LANGUAGE STRING IF YOU WANT YOUR DESCRIPTIONS TO BE LANGAUGE SPECIFIC
+
+  ;Assign descriptions to sections
+  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} "A test section."
+  !insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+ 
+;--------------------------------
+;Uninstaller Section
+
+Section "Uninstall"
+
+  ;ADD YOUR OWN FILES HERE...
+
+  Delete "$INSTDIR\Uninstall.exe"
+
+  RMDir "$INSTDIR"
+
+  DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
+
+SectionEnd
+
+;--------------------------------
+;Uninstaller Functions
+
+Function un.onInit
+
+  !insertmacro MUI_UNGETLANGUAGE
+  
+FunctionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/Modern UI/Basic.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Modern UI/Basic.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Modern UI/Basic.nsi	(revision 728)
@@ -0,0 +1,88 @@
+;NSIS Modern User Interface
+;Basic Example Script
+;Written by Joost Verburg
+
+;--------------------------------
+;Include Modern UI
+
+  !include "MUI2.nsh"
+
+;--------------------------------
+;General
+
+  ;Name and file
+  Name "Modern UI Test"
+  OutFile "Basic.exe"
+
+  ;Default installation folder
+  InstallDir "$LOCALAPPDATA\Modern UI Test"
+  
+  ;Get installation folder from registry if available
+  InstallDirRegKey HKCU "Software\Modern UI Test" ""
+
+  ;Request application privileges for Windows Vista
+  RequestExecutionLevel user
+
+;--------------------------------
+;Interface Settings
+
+  !define MUI_ABORTWARNING
+
+;--------------------------------
+;Pages
+
+  !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
+  !insertmacro MUI_PAGE_COMPONENTS
+  !insertmacro MUI_PAGE_DIRECTORY
+  !insertmacro MUI_PAGE_INSTFILES
+  
+  !insertmacro MUI_UNPAGE_CONFIRM
+  !insertmacro MUI_UNPAGE_INSTFILES
+  
+;--------------------------------
+;Languages
+ 
+  !insertmacro MUI_LANGUAGE "English"
+
+;--------------------------------
+;Installer Sections
+
+Section "Dummy Section" SecDummy
+
+  SetOutPath "$INSTDIR"
+  
+  ;ADD YOUR OWN FILES HERE...
+  
+  ;Store installation folder
+  WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR
+  
+  ;Create uninstaller
+  WriteUninstaller "$INSTDIR\Uninstall.exe"
+
+SectionEnd
+
+;--------------------------------
+;Descriptions
+
+  ;Language strings
+  LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
+
+  ;Assign language strings to sections
+  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
+  !insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+;--------------------------------
+;Uninstaller Section
+
+Section "Uninstall"
+
+  ;ADD YOUR OWN FILES HERE...
+
+  Delete "$INSTDIR\Uninstall.exe"
+
+  RMDir "$INSTDIR"
+
+  DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
+
+SectionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/Modern UI/StartMenu.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Modern UI/StartMenu.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Modern UI/StartMenu.nsi	(revision 728)
@@ -0,0 +1,114 @@
+;NSIS Modern User Interface
+;Start Menu Folder Selection Example Script
+;Written by Joost Verburg
+
+;--------------------------------
+;Include Modern UI
+
+  !include "MUI2.nsh"
+
+;--------------------------------
+;General
+
+  ;Name and file
+  Name "Modern UI Test"
+  OutFile "StartMenu.exe"
+
+  ;Default installation folder
+  InstallDir "$LOCALAPPDATA\Modern UI Test"
+  
+  ;Get installation folder from registry if available
+  InstallDirRegKey HKCU "Software\Modern UI Test" ""
+
+  ;Request application privileges for Windows Vista
+  RequestExecutionLevel user
+
+;--------------------------------
+;Variables
+
+  Var StartMenuFolder
+
+;--------------------------------
+;Interface Settings
+
+  !define MUI_ABORTWARNING
+
+;--------------------------------
+;Pages
+
+  !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
+  !insertmacro MUI_PAGE_COMPONENTS
+  !insertmacro MUI_PAGE_DIRECTORY
+  
+  ;Start Menu Folder Page Configuration
+  !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" 
+  !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Modern UI Test" 
+  !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
+  
+  !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
+  
+  !insertmacro MUI_PAGE_INSTFILES
+  
+  !insertmacro MUI_UNPAGE_CONFIRM
+  !insertmacro MUI_UNPAGE_INSTFILES
+
+;--------------------------------
+;Languages
+ 
+  !insertmacro MUI_LANGUAGE "English"
+
+;--------------------------------
+;Installer Sections
+
+Section "Dummy Section" SecDummy
+
+  SetOutPath "$INSTDIR"
+  
+  ;ADD YOUR OWN FILES HERE...
+  
+  ;Store installation folder
+  WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR
+  
+  ;Create uninstaller
+  WriteUninstaller "$INSTDIR\Uninstall.exe"
+  
+  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
+    
+    ;Create shortcuts
+    CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
+    CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
+  
+  !insertmacro MUI_STARTMENU_WRITE_END
+
+SectionEnd
+
+;--------------------------------
+;Descriptions
+
+  ;Language strings
+  LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
+
+  ;Assign language strings to sections
+  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
+  !insertmacro MUI_FUNCTION_DESCRIPTION_END
+ 
+;--------------------------------
+;Uninstaller Section
+
+Section "Uninstall"
+
+  ;ADD YOUR OWN FILES HERE...
+
+  Delete "$INSTDIR\Uninstall.exe"
+
+  RMDir "$INSTDIR"
+  
+  !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
+    
+  Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
+  RMDir "$SMPROGRAMS\$StartMenuFolder"
+  
+  DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
+
+SectionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/Modern UI/HeaderBitmap.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Modern UI/HeaderBitmap.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Modern UI/HeaderBitmap.nsi	(revision 728)
@@ -0,0 +1,90 @@
+;NSIS Modern User Interface
+;Header Bitmap Example Script
+;Written by Joost Verburg
+
+;--------------------------------
+;Include Modern UI
+
+  !include "MUI2.nsh"
+
+;--------------------------------
+;General
+
+  ;Name and file
+  Name "Modern UI Test"
+  OutFile "HeaderBitmap.exe"
+
+  ;Default installation folder
+  InstallDir "$LOCALAPPDATA\Modern UI Test"
+  
+  ;Get installation folder from registry if available
+  InstallDirRegKey HKCU "Software\Modern UI Test" ""
+
+  ;Request application privileges for Windows Vista
+  RequestExecutionLevel user
+
+;--------------------------------
+;Interface Configuration
+
+  !define MUI_HEADERIMAGE
+  !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp" ; optional
+  !define MUI_ABORTWARNING
+
+;--------------------------------
+;Pages
+
+  !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
+  !insertmacro MUI_PAGE_COMPONENTS
+  !insertmacro MUI_PAGE_DIRECTORY
+  !insertmacro MUI_PAGE_INSTFILES
+  
+  !insertmacro MUI_UNPAGE_CONFIRM
+  !insertmacro MUI_UNPAGE_INSTFILES
+  
+;--------------------------------
+;Languages
+ 
+  !insertmacro MUI_LANGUAGE "English"
+
+;--------------------------------
+;Installer Sections
+
+Section "Dummy Section" SecDummy
+
+  SetOutPath "$INSTDIR"
+  
+  ;ADD YOUR OWN FILES HERE...
+  
+  ;Store installation folder
+  WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR
+  
+  ;Create uninstaller
+  WriteUninstaller "$INSTDIR\Uninstall.exe"
+
+SectionEnd
+
+;--------------------------------
+;Descriptions
+
+  ;Language strings
+  LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
+
+  ;Assign language strings to sections
+  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
+  !insertmacro MUI_FUNCTION_DESCRIPTION_END
+ 
+;--------------------------------
+;Uninstaller Section
+
+Section "Uninstall"
+
+  ;ADD YOUR OWN FILES HERE...
+
+  Delete "$INSTDIR\Uninstall.exe"
+
+  RMDir "$INSTDIR"
+
+  DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
+
+SectionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/Modern UI/WelcomeFinish.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Modern UI/WelcomeFinish.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Modern UI/WelcomeFinish.nsi	(revision 728)
@@ -0,0 +1,92 @@
+;NSIS Modern User Interface
+;Welcome/Finish Page Example Script
+;Written by Joost Verburg
+
+;--------------------------------
+;Include Modern UI
+
+  !include "MUI2.nsh"
+
+;--------------------------------
+;General
+
+  ;Name and file
+  Name "Modern UI Test"
+  OutFile "WelcomeFinish.exe"
+
+  ;Default installation folder
+  InstallDir "$LOCALAPPDATA\Modern UI Test"
+
+  ;Get installation folder from registry if available
+  InstallDirRegKey HKCU "Software\Modern UI Test" ""
+
+  ;Request application privileges for Windows Vista
+  RequestExecutionLevel user
+
+;--------------------------------
+;Interface Settings
+
+  !define MUI_ABORTWARNING
+
+;--------------------------------
+;Pages
+
+  !insertmacro MUI_PAGE_WELCOME
+  !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
+  !insertmacro MUI_PAGE_COMPONENTS
+  !insertmacro MUI_PAGE_DIRECTORY
+  !insertmacro MUI_PAGE_INSTFILES
+  !insertmacro MUI_PAGE_FINISH
+
+  !insertmacro MUI_UNPAGE_WELCOME
+  !insertmacro MUI_UNPAGE_CONFIRM
+  !insertmacro MUI_UNPAGE_INSTFILES
+  !insertmacro MUI_UNPAGE_FINISH
+
+;--------------------------------
+;Languages
+
+  !insertmacro MUI_LANGUAGE "English"
+
+;--------------------------------
+;Installer Sections
+
+Section "Dummy Section" SecDummy
+
+  SetOutPath "$INSTDIR"
+
+  ;ADD YOUR OWN FILES HERE...
+
+  ;Store installation folder
+  WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR
+
+  ;Create uninstaller
+  WriteUninstaller "$INSTDIR\Uninstall.exe"
+
+SectionEnd
+
+;--------------------------------
+;Descriptions
+
+  ;Language strings
+  LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
+
+  ;Assign language strings to sections
+  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
+  !insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+;--------------------------------
+;Uninstaller Section
+
+Section "Uninstall"
+
+  ;ADD YOUR OWN FILES HERE...
+
+  Delete "$INSTDIR\Uninstall.exe"
+
+  RMDir "$INSTDIR"
+
+  DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
+
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testlink.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testlink.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testlink.nsi	(revision 728)
@@ -0,0 +1,58 @@
+;InstallOptions Test Script
+;Written by Ramon
+;This script demonstrates the power of the new control "LINK"
+;that allows you to execute files, send mails, open wepsites, etc.
+;--------------------------
+
+!define TEMP1 $R0 ;Temp variable
+
+;The name of the installer
+Name "InstallOptions Test Link"
+
+;The file to write
+OutFile "TestLink.exe"
+
+; Show install details
+ShowInstDetails show
+
+;Things that need to be extracted on startup (keep these lines before any File command!)
+;Only useful for BZIP2 compression
+;Use ReserveFile for your own InstallOptions INI files too!
+
+ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
+ReserveFile "testlink.ini"
+
+;Order of pages
+Page custom SetCustom
+Page instfiles
+
+Section "Components"
+
+  ;Get Install Options dialog user input
+
+SectionEnd
+
+Function .onInit
+
+  ;Extract InstallOptions files
+  ;$PLUGINSDIR will automatically be removed when the installer closes
+  
+  InitPluginsDir
+  File /oname=$PLUGINSDIR\test.ini "testlink.ini"
+  WriteIniStr $PLUGINSDIR\test.ini "Field 2" "State" "$WINDIR\Notepad.exe"
+  
+FunctionEnd
+
+Function SetCustom
+
+  ;Display the InstallOptions dialog
+
+  Push ${TEMP1}
+
+    InstallOptions::dialog "$PLUGINSDIR\test.ini"
+    Pop ${TEMP1}
+  
+  Pop ${TEMP1}
+
+FunctionEnd
+
Index: tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testnotify.ini
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testnotify.ini	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testnotify.ini	(revision 728)
@@ -0,0 +1,105 @@
+[Settings]
+NumFields=11
+
+[Field 1]
+Type=Groupbox
+Text="This is a group box..."
+Left=0
+Right=-1
+Top=0
+Bottom=-4
+
+[Field 2]
+Type=Checkbox
+Text=Install support for X
+Flags=NOTIFY
+State=1
+Left=10
+Right=100
+Top=17
+Bottom=25
+
+[Field 3]
+Type=Checkbox
+Text=Install support for Y
+State=0
+Left=10
+Right=100
+Top=30
+Bottom=38
+
+[Field 4]
+Type=Checkbox
+Text=Install support for Z
+Flags=RIGHT
+State=0
+Left=10
+Right=100
+Top=43
+Bottom=51
+
+[Field 5]
+Type=FileRequest
+Flags=GROUP|FILE_MUST_EXIST|FILE_EXPLORER|FILE_HIDEREADONLY
+State=C:\poop.poop
+Filter=Poop Files|*.poop|All files|*.*
+Left=10
+Right=-10
+Top=56
+Bottom=69
+
+[Field 6]
+Type=DirRequest
+Text=Select a directory...
+State=C:\Program Files\NSIS
+Left=10
+Right=-10
+Top=74
+Bottom=87
+
+[Field 7]
+Type=Label
+Text=This is a label...
+Left=10
+Right=-10
+Top=89
+Bottom=97
+
+[Field 8]
+Type=Text
+Flags=MULTILINE|VSCROLL|WANTRETURN|NOWORDWRAP
+State="Multiline\r\nedit..."
+Left=10
+Right=-10
+Top=97
+Bottom=118
+MinLen=1
+ValidateText=Please enter some text before proceeding.
+
+[Field 9]
+Type=Button
+Flags=NOTIFY
+Text=&Clear
+Left=-60
+Right=-10
+Top=19
+Bottom=33
+
+[Field 10]
+Type=Button
+Text=&Email
+State=mailto:someone@anywhere.com
+Left=-60
+Right=-10
+Top=35
+Bottom=49
+
+[Field 11]
+Type=DROPLIST
+ListItems=Show|Hide
+State=Show
+Flags=NOTIFY
+Left=120
+Right=-80
+Top=20
+Bottom=56

Property changes on: tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testnotify.ini
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/test.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/test.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/test.nsi	(revision 728)
@@ -0,0 +1,84 @@
+;InstallOptions Test Script
+;Written by Joost Verburg
+;--------------------------
+
+!define TEMP1 $R0 ;Temp variable
+
+;The name of the installer
+Name "InstallOptions Test"
+
+;The file to write
+OutFile "Test.exe"
+
+; Show install details
+ShowInstDetails show
+
+;Things that need to be extracted on startup (keep these lines before any File command!)
+;Only useful for BZIP2 compression
+;Use ReserveFile for your own InstallOptions INI files too!
+
+ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
+ReserveFile "test.ini"
+
+;Order of pages
+Page custom SetCustom ValidateCustom ": Testing InstallOptions" ;Custom page. InstallOptions gets called in SetCustom.
+Page instfiles
+
+Section "Components"
+
+  ;Get Install Options dialog user input
+
+  ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 2" "State"
+  DetailPrint "Install X=${TEMP1}"
+  ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 3" "State"
+  DetailPrint "Install Y=${TEMP1}"
+  ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 4" "State"
+  DetailPrint "Install Z=${TEMP1}"
+  ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 5" "State"
+  DetailPrint "File=${TEMP1}"
+  ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 6" "State"
+  DetailPrint "Dir=${TEMP1}"
+  ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 8" "State"
+  DetailPrint "Info=${TEMP1}"
+  
+SectionEnd
+
+Function .onInit
+
+  ;Extract InstallOptions files
+  ;$PLUGINSDIR will automatically be removed when the installer closes
+  
+  InitPluginsDir
+  File /oname=$PLUGINSDIR\test.ini "test.ini"
+  
+FunctionEnd
+
+Function SetCustom
+
+  ;Display the InstallOptions dialog
+
+  Push ${TEMP1}
+
+    InstallOptions::dialog "$PLUGINSDIR\test.ini"
+    Pop ${TEMP1}
+  
+  Pop ${TEMP1}
+
+FunctionEnd
+
+Function ValidateCustom
+
+  ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 2" "State"
+  StrCmp ${TEMP1} 1 done
+  
+  ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 3" "State"
+  StrCmp ${TEMP1} 1 done
+
+  ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 4" "State"
+  StrCmp ${TEMP1} 1 done
+    MessageBox MB_ICONEXCLAMATION|MB_OK "You must select at least one install option!"
+    Abort
+
+  done:
+  
+FunctionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testimgs.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testimgs.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testimgs.nsi	(revision 728)
@@ -0,0 +1,59 @@
+;InstallOptions Test Script
+;Written by Joost Verburg
+;--------------------------
+
+;The name of the installer
+Name "InstallOptions Test"
+
+;The file to write
+OutFile "Test.exe"
+
+; Show install details
+ShowInstDetails show
+
+;Things that need to be extracted on startup (keep these lines before any File command!)
+;Only useful for BZIP2 compression
+;Use ReserveFile for your own InstallOptions INI files too!
+
+ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
+ReserveFile "testimgs.ini"
+ReserveFile "${NSISDIR}\Contrib\Graphics\Checks\colorful.bmp"
+ReserveFile "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp"
+ReserveFile "${NSISDIR}\Contrib\Graphics\Icons\pixel-install.ico"
+
+;Order of pages
+Page custom SetCustom "" ": Testing InstallOptions" ;Custom page. InstallOptions gets called in SetCustom.
+Page instfiles
+
+Section  
+SectionEnd
+
+Function .onInit
+
+  ;Extract InstallOptions files
+  ;$PLUGINSDIR will automatically be removed when the installer closes
+  
+  InitPluginsDir
+  File /oname=$PLUGINSDIR\testimgs.ini "testimgs.ini"
+  File /oname=$PLUGINSDIR\image.bmp "${NSISDIR}\Contrib\Graphics\Checks\colorful.bmp"
+  File /oname=$PLUGINSDIR\image2.bmp "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp"
+  File /oname=$PLUGINSDIR\icon.ico "${NSISDIR}\Contrib\Graphics\Icons\pixel-install.ico"
+
+  ;Write image paths to the INI file
+
+  WriteINIStr $PLUGINSDIR\testimgs.ini "Field 2" "Text" $PLUGINSDIR\image.bmp
+  WriteINIStr $PLUGINSDIR\testimgs.ini "Field 3" "Text" $PLUGINSDIR\image2.bmp
+  WriteINIStr $PLUGINSDIR\testimgs.ini "Field 4" "Text" $PLUGINSDIR\image.bmp
+  WriteINIStr $PLUGINSDIR\testimgs.ini "Field 5" "Text" $PLUGINSDIR\image2.bmp
+  WriteINIStr $PLUGINSDIR\testimgs.ini "Field 6" "Text" $PLUGINSDIR\icon.ico
+  ;No Text for Field 7 so it'll show the installer's icon
+  
+FunctionEnd
+
+Function SetCustom
+
+  ;Display the InstallOptions dialog
+  InstallOptions::dialog "$PLUGINSDIR\testimgs.ini"
+  Pop $0
+
+FunctionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testlink.ini
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testlink.ini	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testlink.ini	(revision 728)
@@ -0,0 +1,44 @@
+[Settings]
+NumFields=5
+
+[Field 1]
+Type=Label
+Left=10
+Right=-40
+Top=10
+Bottom=18
+Text=This custom page demonstrates the "Link" control
+
+[Field 2]
+Type=Link
+Left=20
+Right=-40
+Top=40
+Bottom=50
+Text=* Run notepad
+
+[Field 3]
+Type=Link
+Left=20
+Right=-40
+Top=55
+Bottom=65
+State=mailto:someone@anywhere.com
+Text=* Send E-mail
+
+[Field 4]
+Type=Link
+Left=20
+Right=-40
+Top=70
+Bottom=80
+State=http://nsis.sourceforge.net/
+Text=* Homepage http://nsis.sourceforge.net/
+
+[Field 5]
+Type=Text
+Left=20
+Right=-40
+Top=85
+Bottom=98
+State=Just to test proper interaction with the other fields

Property changes on: tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testlink.ini
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/test.ini
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/test.ini	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/test.ini	(revision 728)
@@ -0,0 +1,76 @@
+[Settings]
+NumFields=8
+
+[Field 1]
+Type=GroupBox
+Left=0
+Right=-1
+Top=0
+Bottom=-5
+Text=" This is a group box... "
+
+[Field 2]
+Type=checkbox
+Text=Install support for X
+Left=10
+Right=-10
+Top=17
+Bottom=25
+State=0
+Flags=GROUP
+
+[Field 3]
+Type=checkbox
+Text=Install support for Y
+Left=10
+Right=-10
+Top=30
+Bottom=38
+State=1
+Flags=NOTABSTOP
+
+[Field 4]
+Type=checkbox
+Text=Install support for Z
+Left=10
+Right=-10
+Top=43
+Bottom=51
+State=0
+Flags=NOTABSTOP
+
+[Field 5]
+Type=FileRequest
+State=C:\poop.poop
+Left=10
+Right=-10
+Top=56
+Bottom=68
+Filter=Poop Files|*.poop|All files|*.*
+Flags=GROUP|FILE_MUST_EXIST|FILE_EXPLORER|FILE_HIDEREADONLY
+
+[Field 6]
+Type=DirRequest
+Left=10
+Right=-10
+Top=73
+Bottom=85
+Text=Select a directory...
+State=C:\Program Files\NSIS
+
+[Field 7]
+Type=Label
+Left=10
+Right=-10
+Top=90
+Bottom=98
+Text=This is a label...
+
+[Field 8]
+Type=Text
+Left=10
+Right=-10
+Top=98
+Bottom=120
+State="Multiline\r\nedit..."
+Flags=MULTILINE|VSCROLL|WANTRETURN
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/test.ini
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testimgs.ini
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testimgs.ini	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testimgs.ini	(revision 728)
@@ -0,0 +1,65 @@
+[Settings]
+NumFields=8
+
+[Field 1]
+Type=GroupBox
+Left=0
+Right=-1
+Top=0
+Bottom=-5
+Text=" Images "
+
+[Field 2]
+Type=Bitmap
+Left=10
+Right=-10
+Top=10
+Bottom=30
+Flags=TRANSPARENT
+
+[Field 3]
+Type=Bitmap
+Left=10
+Right=-10
+Top=35
+Bottom=45
+Flags=TRANSPARENT
+
+[Field 4]
+Type=Bitmap
+Left=10
+Right=-10
+Top=50
+Bottom=70
+Flags=RESIZETOFIT|TRANSPARENT
+
+[Field 5]
+Type=Bitmap
+Left=10
+Right=-10
+Top=75
+Bottom=95
+Flags=RESIZETOFIT|TRANSPARENT
+
+[Field 6]
+Type=Icon
+Left=10
+Right=40
+Top=100
+Bottom=120
+
+[Field 7]
+Type=Icon
+Left=50
+Right=80
+Top=100
+Bottom=120
+
+[Field 8]
+Type=Label
+Left=10
+Right=-10
+Top=10
+Bottom=-10
+Text=ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ
+

Property changes on: tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testimgs.ini
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testnotify.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testnotify.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/InstallOptions/testnotify.nsi	(revision 728)
@@ -0,0 +1,133 @@
+; InstallOptions script demonstrating custom buttons
+;----------------------------------------------------
+
+!include WinMessages.nsh
+
+; The name of the installer
+Name "InstallOptions Test"
+
+; The file to write
+OutFile "TestNotify.exe"
+
+; Show install details
+ShowInstDetails show
+
+; Called before anything else as installer initialises
+Function .onInit
+
+  ; Extract InstallOptions files
+  ; $PLUGINSDIR will automatically be removed when the installer closes
+  InitPluginsDir
+  File /oname=$PLUGINSDIR\test.ini "testnotify.ini"
+
+FunctionEnd
+
+; Our custom page
+Page custom ShowCustom LeaveCustom ": Testing InstallOptions"
+
+Function ShowCustom
+
+  ; Initialise the dialog but don't show it yet
+  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Test the right-to-left version?" IDNO +2
+    WriteINIStr "$PLUGINSDIR\test.ini" "Settings" "RTL" "1"
+  InstallOptions::initDialog "$PLUGINSDIR\test.ini"
+  ; In this mode InstallOptions returns the window handle so we can use it
+  Pop $0
+  ; Now show the dialog and wait for it to finish
+  InstallOptions::show
+  ; Finally fetch the InstallOptions status value (we don't care what it is though)
+  Pop $0
+
+FunctionEnd
+
+Function LeaveCustom
+
+  ; At this point the user has either pressed Next or one of our custom buttons
+  ; We find out which by reading from the INI file
+  ReadINIStr $0 "$PLUGINSDIR\test.ini" "Settings" "State"
+  StrCmp $0 0 validate  ; Next button?
+  StrCmp $0 2 supportx  ; "Install support for X"?
+  StrCmp $0 9 clearbtn  ; "Clear" button?
+  StrCmp $0 11 droplist ; "Show|Hide" drop-list?
+  Abort ; Return to the page
+
+supportx:
+  ; Make the FileRequest field depend on the first checkbox
+  ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 2" "State"
+  ReadINIStr $1 "$PLUGINSDIR\test.ini" "Field 5" "HWND"
+  EnableWindow $1 $0
+  ReadINIStr $1 "$PLUGINSDIR\test.ini" "Field 5" "HWND2"
+  EnableWindow $1 $0
+  ; Add the disabled flag too so when we return to this page it's disabled again
+  StrCmp $0 0 0 +3
+
+    WriteINIStr "$PLUGINSDIR\test.ini" "Field 5" "Flags" "GROUP|FILE_MUST_EXIST|FILE_EXPLORER|FILE_HIDEREADONLY|DISABLED"
+    Goto +2
+
+    WriteINIStr "$PLUGINSDIR\test.ini" "Field 5" "Flags" "GROUP|FILE_MUST_EXIST|FILE_EXPLORER|FILE_HIDEREADONLY"
+  Abort ; Return to the page
+
+clearbtn:
+  ; Clear all text fields
+  ReadINIStr $1 "$PLUGINSDIR\test.ini" "Field 5" "HWND"
+  SendMessage $1 ${WM_SETTEXT} 0 "STR:"
+  ReadINIStr $1 "$PLUGINSDIR\test.ini" "Field 6" "HWND"
+  SendMessage $1 ${WM_SETTEXT} 0 "STR:"
+  ReadINIStr $1 "$PLUGINSDIR\test.ini" "Field 8" "HWND"
+  SendMessage $1 ${WM_SETTEXT} 0 "STR:"
+  Abort ; Return to the page
+
+droplist:
+  ; Make the DirRequest field depend on the droplist
+  ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 11" "State"
+  StrCmp $0 "Show" +3
+    StrCpy $0 0
+  Goto +2
+    StrCpy $0 1
+  ReadINIStr $1 "$PLUGINSDIR\test.ini" "Field 6" "HWND"
+  EnableWindow $1 $0
+  ReadINIStr $1 "$PLUGINSDIR\test.ini" "Field 6" "HWND2"
+  EnableWindow $1 $0
+  ; Add the disabled flag too so when we return to this page it's disabled again
+  StrCmp $0 0 0 +3
+
+    WriteINIStr "$PLUGINSDIR\test.ini" "Field 6" "Flags" "DISABLED"
+    Goto +2
+
+    WriteINIStr "$PLUGINSDIR\test.ini" "Field 6" "Flags" ""
+  Abort ; Return to the page
+
+validate:
+  ; At this point we know the Next button was pressed, so perform any validation
+  ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 2" "State"
+  StrCmp $0 1 done
+  ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 3" "State"
+  StrCmp $0 1 done
+  ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 4" "State"
+  StrCmp $0 1 done
+    MessageBox MB_ICONEXCLAMATION|MB_OK "You must select at least one install option!"
+    Abort
+done:
+
+FunctionEnd
+
+; Installation page
+Page instfiles
+
+Section
+
+  ;Get Install Options dialog user input
+  ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 2" "State"
+  DetailPrint "Install X=$0"
+  ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 3" "State"
+  DetailPrint "Install Y=$0"
+  ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 4" "State"
+  DetailPrint "Install Z=$0"
+  ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 5" "State"
+  DetailPrint "File=$0"
+  ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 6" "State"
+  DetailPrint "Dir=$0"
+  ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 8" "State"
+  DetailPrint "Info=$0"
+
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/nsDialogs/example.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/nsDialogs/example.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/nsDialogs/example.nsi	(revision 728)
@@ -0,0 +1,82 @@
+!include nsDialogs.nsh
+!include LogicLib.nsh
+
+Name "nsDialogs Example"
+OutFile "nsDialogs Example.exe"
+
+XPStyle on
+
+Page license
+Page custom nsDialogsPage
+
+Var BUTTON
+Var EDIT
+Var CHECKBOX
+
+Function nsDialogsPage
+
+	nsDialogs::Create 1018
+	Pop $0
+
+	GetFunctionAddress $0 OnBack
+	nsDialogs::OnBack $0
+
+	${NSD_CreateButton} 0 0 100% 12u Test
+	Pop $BUTTON
+	GetFunctionAddress $0 OnClick
+	nsDialogs::OnClick $BUTTON $0
+
+	${NSD_CreateText} 0 35 100% 12u hello
+	Pop $EDIT
+	GetFunctionAddress $0 OnChange
+	nsDialogs::OnChange $EDIT $0
+
+	${NSD_CreateCheckbox} 0 -50 100% 8u Test
+	Pop $CHECKBOX
+	GetFunctionAddress $0 OnCheckbox
+	nsDialogs::OnClick $CHECKBOX $0
+
+	${NSD_CreateLabel} 0 40u 75% 40u "* Type `hello there` above.$\n* Click the button.$\n* Check the checkbox.$\n* Hit the Back button."
+	Pop $0
+
+	nsDialogs::Show
+
+FunctionEnd
+
+Function OnClick
+
+	Pop $0 # HWND
+
+	MessageBox MB_OK clicky
+
+FunctionEnd
+
+Function OnChange
+
+	Pop $0 # HWND
+
+	System::Call user32::GetWindowText(i$EDIT,t.r0,i${NSIS_MAX_STRLEN})
+
+	${If} $0 == "hello there"
+		MessageBox MB_OK "right back at ya"
+	${EndIf}
+
+FunctionEnd
+
+Function OnBack
+
+	MessageBox MB_YESNO "are you sure?" IDYES +2
+	Abort
+
+FunctionEnd
+
+Function OnCheckbox
+
+	Pop $0 # HWND
+
+	MessageBox MB_OK "checkbox clicked"
+
+FunctionEnd
+
+Section
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/nsDialogs/welcome.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/nsDialogs/welcome.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/nsDialogs/welcome.nsi	(revision 728)
@@ -0,0 +1,320 @@
+!include MUI.nsh
+!include LogicLib.nsh
+!include WinMessages.nsh
+!include FileFunc.nsh
+
+Name "nsDialogs Welcome"
+OutFile "nsDialogs Welcome.exe"
+
+Page custom nsDialogsWelcome
+Page custom nsDialogsDirectory
+!insertmacro MUI_PAGE_INSTFILES
+
+!insertmacro MUI_LANGUAGE English
+
+!define WS_EX_CLIENTEDGE    0x00000200
+
+!define WS_CHILD            0x40000000
+!define WS_VISIBLE          0x10000000
+!define WS_DISABLED         0x08000000
+!define WS_CLIPSIBLINGS     0x04000000
+!define WS_MAXIMIZE         0x01000000
+!define WS_VSCROLL          0x00200000
+!define WS_HSCROLL          0x00100000
+!define WS_GROUP            0x00020000
+!define WS_TABSTOP          0x00010000
+
+!define ES_LEFT             0x00000000
+!define ES_CENTER           0x00000001
+!define ES_RIGHT            0x00000002
+!define ES_MULTILINE        0x00000004
+!define ES_UPPERCASE        0x00000008
+!define ES_LOWERCASE        0x00000010
+!define ES_PASSWORD         0x00000020
+!define ES_AUTOVSCROLL      0x00000040
+!define ES_AUTOHSCROLL      0x00000080
+!define ES_NOHIDESEL        0x00000100
+!define ES_OEMCONVERT       0x00000400
+!define ES_READONLY         0x00000800
+!define ES_WANTRETURN       0x00001000
+!define ES_NUMBER           0x00002000
+
+!define SS_LEFT             0x00000000
+!define SS_CENTER           0x00000001
+!define SS_RIGHT            0x00000002
+!define SS_ICON             0x00000003
+!define SS_BLACKRECT        0x00000004
+!define SS_GRAYRECT         0x00000005
+!define SS_WHITERECT        0x00000006
+!define SS_BLACKFRAME       0x00000007
+!define SS_GRAYFRAME        0x00000008
+!define SS_WHITEFRAME       0x00000009
+!define SS_USERITEM         0x0000000A
+!define SS_SIMPLE           0x0000000B
+!define SS_LEFTNOWORDWRAP   0x0000000C
+!define SS_OWNERDRAW        0x0000000D
+!define SS_BITMAP           0x0000000E
+!define SS_ENHMETAFILE      0x0000000F
+!define SS_ETCHEDHORZ       0x00000010
+!define SS_ETCHEDVERT       0x00000011
+!define SS_ETCHEDFRAME      0x00000012
+!define SS_TYPEMASK         0x0000001F
+!define SS_REALSIZECONTROL  0x00000040
+!define SS_NOPREFIX         0x00000080
+!define SS_NOTIFY           0x00000100
+!define SS_CENTERIMAGE      0x00000200
+!define SS_RIGHTJUST        0x00000400
+!define SS_REALSIZEIMAGE    0x00000800
+!define SS_SUNKEN           0x00001000
+!define SS_EDITCONTROL      0x00002000
+!define SS_ENDELLIPSIS      0x00004000
+!define SS_PATHELLIPSIS     0x00008000
+!define SS_WORDELLIPSIS     0x0000C000
+!define SS_ELLIPSISMASK     0x0000C000
+
+!define BS_PUSHBUTTON       0x00000000
+!define BS_DEFPUSHBUTTON    0x00000001
+!define BS_CHECKBOX         0x00000002
+!define BS_AUTOCHECKBOX     0x00000003
+!define BS_RADIOBUTTON      0x00000004
+!define BS_3STATE           0x00000005
+!define BS_AUTO3STATE       0x00000006
+!define BS_GROUPBOX         0x00000007
+!define BS_USERBUTTON       0x00000008
+!define BS_AUTORADIOBUTTON  0x00000009
+!define BS_PUSHBOX          0x0000000A
+!define BS_OWNERDRAW        0x0000000B
+!define BS_TYPEMASK         0x0000000F
+!define BS_LEFTTEXT         0x00000020
+!define BS_TEXT             0x00000000
+!define BS_ICON             0x00000040
+!define BS_BITMAP           0x00000080
+!define BS_LEFT             0x00000100
+!define BS_RIGHT            0x00000200
+!define BS_CENTER           0x00000300
+!define BS_TOP              0x00000400
+!define BS_BOTTOM           0x00000800
+!define BS_VCENTER          0x00000C00
+!define BS_PUSHLIKE         0x00001000
+!define BS_MULTILINE        0x00002000
+!define BS_NOTIFY           0x00004000
+!define BS_FLAT             0x00008000
+!define BS_RIGHTBUTTON      ${BS_LEFTTEXT}
+
+!define LR_DEFAULTCOLOR     0x0000
+!define LR_MONOCHROME       0x0001
+!define LR_COLOR            0x0002
+!define LR_COPYRETURNORG    0x0004
+!define LR_COPYDELETEORG    0x0008
+!define LR_LOADFROMFILE     0x0010
+!define LR_LOADTRANSPARENT  0x0020
+!define LR_DEFAULTSIZE      0x0040
+!define LR_VGACOLOR         0x0080
+!define LR_LOADMAP3DCOLORS  0x1000
+!define LR_CREATEDIBSECTION 0x2000
+!define LR_COPYFROMRESOURCE 0x4000
+!define LR_SHARED           0x8000
+
+!define IMAGE_BITMAP        0
+!define IMAGE_ICON          1
+!define IMAGE_CURSOR        2
+!define IMAGE_ENHMETAFILE   3
+
+Var DIALOG
+Var HEADLINE
+Var TEXT
+Var IMAGECTL
+Var IMAGE
+Var DIRECTORY
+Var FREESPACE
+
+Var HEADLINE_FONT
+
+Function .onInit
+
+	CreateFont $HEADLINE_FONT "$(^Font)" "14" "700"
+
+	InitPluginsDir
+	File /oname=$PLUGINSDIR\welcome.bmp "${NSISDIR}\Contrib\Graphics\Wizard\orange-nsis.bmp"
+
+FunctionEnd
+
+Function HideControls
+
+    LockWindow on
+    GetDlgItem $0 $HWNDPARENT 1028
+    ShowWindow $0 ${SW_HIDE}
+
+    GetDlgItem $0 $HWNDPARENT 1256
+    ShowWindow $0 ${SW_HIDE}
+
+    GetDlgItem $0 $HWNDPARENT 1035
+    ShowWindow $0 ${SW_HIDE}
+
+    GetDlgItem $0 $HWNDPARENT 1037
+    ShowWindow $0 ${SW_HIDE}
+
+    GetDlgItem $0 $HWNDPARENT 1038
+    ShowWindow $0 ${SW_HIDE}
+
+    GetDlgItem $0 $HWNDPARENT 1039
+    ShowWindow $0 ${SW_HIDE}
+
+    GetDlgItem $0 $HWNDPARENT 1045
+    ShowWindow $0 ${SW_NORMAL}
+    LockWindow off
+
+FunctionEnd
+
+Function ShowControls
+
+    LockWindow on
+    GetDlgItem $0 $HWNDPARENT 1028
+    ShowWindow $0 ${SW_NORMAL}
+
+    GetDlgItem $0 $HWNDPARENT 1256
+    ShowWindow $0 ${SW_NORMAL}
+
+    GetDlgItem $0 $HWNDPARENT 1035
+    ShowWindow $0 ${SW_NORMAL}
+
+    GetDlgItem $0 $HWNDPARENT 1037
+    ShowWindow $0 ${SW_NORMAL}
+
+    GetDlgItem $0 $HWNDPARENT 1038
+    ShowWindow $0 ${SW_NORMAL}
+
+    GetDlgItem $0 $HWNDPARENT 1039
+    ShowWindow $0 ${SW_NORMAL}
+
+    GetDlgItem $0 $HWNDPARENT 1045
+    ShowWindow $0 ${SW_HIDE}
+    LockWindow off
+
+FunctionEnd
+
+Function nsDialogsWelcome
+
+	nsDialogs::Create 1044
+	Pop $DIALOG
+
+	nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${SS_BITMAP} 0 0 0 109u 193u ""
+	Pop $IMAGECTL
+
+	StrCpy $0 $PLUGINSDIR\welcome.bmp
+	System::Call 'user32::LoadImage(i 0, t r0, i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_LOADFROMFILE}) i.s'
+	Pop $IMAGE
+	
+	SendMessage $IMAGECTL ${STM_SETIMAGE} ${IMAGE_BITMAP} $IMAGE
+
+	nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 120u 10u -130u 20u "Welcome to nsDialogs!"
+	Pop $HEADLINE
+
+	SendMessage $HEADLINE ${WM_SETFONT} $HEADLINE_FONT 0
+
+	nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 120u 32u -130u -32u "nsDialogs is the next generation of user interfaces in NSIS. It gives the developer full control over custom pages. Some of the features include control text containing variables, callbacks directly into script functions and creation of any type of control. Create boring old edit boxes or load some external library and create custom controls with no need of creating your own plug-in.$\r$\n$\r$\nUnlike InstallOptions, nsDialogs doesn't use INI files to communicate with the script. By interacting directly with the script, nsDialogs can perform much faster without the need of costly, old and inefficient INI operations. Direct interaction also allows direct calls to functions defined in the script and removes the need of conversion functions like Io2Nsis.$\r$\n$\r$\nHit the Next button to see how it all fits into a mock directory page."
+	Pop $TEXT
+
+	SetCtlColors $DIALOG "" 0xffffff
+	SetCtlColors $HEADLINE "" 0xffffff
+	SetCtlColors $TEXT "" 0xffffff
+
+	Call HideControls
+
+	nsDialogs::Show
+
+	Call ShowControls
+
+	System::Call gdi32::DeleteObject(i$IMAGE)
+
+FunctionEnd
+
+!define SHACF_FILESYSTEM 1
+
+Function nsDialogsDirectory
+
+	!insertmacro MUI_HEADER_TEXT "Choose Install Location" "Choose the folder in which to install $(^NameDA)."
+
+	GetDlgItem $0 $HWNDPARENT 1
+	EnableWindow $0 0
+
+	nsDialogs::Create 1018
+	Pop $DIALOG
+
+	nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${SS_CENTER} 0 0 0 100% 30 "Directory page"
+	Pop $HEADLINE
+
+	SendMessage $HEADLINE ${WM_SETFONT} $HEADLINE_FONT 0
+
+	nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 30 100% 40 "Select the installation directory of NSIS to continue. $_CLICK"
+	Pop $TEXT
+
+	nsDialogs::CreateControl EDIT ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${ES_AUTOHSCROLL}|${WS_TABSTOP} ${WS_EX_CLIENTEDGE} 0 75 100% 12u ""
+	Pop $DIRECTORY
+
+	SendMessage $HWNDPARENT ${WM_NEXTDLGCTL} $DIRECTORY 1
+
+	GetFunctionAddress $0 DirChange
+	nsDialogs::OnChange $DIRECTORY $0
+
+	System::Call shlwapi::SHAutoComplete(i$DIRECTORY,i${SHACF_FILESYSTEM})
+
+	nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 -10u 100% 10u ""
+	Pop $FREESPACE
+
+	Call UpdateFreeSpace
+
+	nsDialogs::Show
+
+FunctionEnd
+
+Function UpdateFreeSpace
+
+	${GetRoot} $INSTDIR $0
+	StrCpy $1 " bytes"
+
+	System::Call kernel32::GetDiskFreeSpaceEx(tr0,*l,*l,*l.r0)
+
+	${If} $0 > 1024
+	${OrIf} $0 < 0
+		System::Int64Op $0 / 1024
+		Pop $0
+		StrCpy $1 "kb"
+		${If} $0 > 1024
+		${OrIf} $0 < 0
+			System::Int64Op $0 / 1024
+			Pop $0
+			StrCpy $1 "mb"
+			${If} $0 > 1024
+			${OrIf} $0 < 0
+				System::Int64Op $0 / 1024
+				Pop $0
+				StrCpy $1 "gb"
+			${EndIf}
+		${EndIf}
+	${EndIf}
+
+	SendMessage $FREESPACE ${WM_SETTEXT} 0 "STR:Free space: $0$1"
+
+FunctionEnd
+
+Function DirChange
+
+	Pop $0 # dir hwnd
+
+	GetDlgItem $0 $HWNDPARENT 1
+
+	System::Call user32::GetWindowText(i$DIRECTORY,t.d,i${NSIS_MAX_STRLEN})
+
+	${If} ${FileExists} $INSTDIR\makensis.exe
+		EnableWindow $0 1
+	${Else}
+		EnableWindow $0 0
+	${EndIf}
+
+	Call UpdateFreeSpace
+
+FunctionEnd
+
+Section
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/nsDialogs/timer.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/nsDialogs/timer.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/nsDialogs/timer.nsi	(revision 728)
@@ -0,0 +1,102 @@
+!include LogicLib.nsh
+!include nsDialogs.nsh
+
+Name "nsDialogs Timer Example"
+OutFile "nsDialogs Timer Example.exe"
+XPStyle on
+
+Var DIALOG
+Var TEXT
+Var PROGBAR
+Var PROGBAR2
+Var PROGBAR3
+Var BUTTON
+Var BUTTON2
+
+Page custom nsDialogsPage
+
+Function OnTimer
+
+  	SendMessage $PROGBAR ${PBM_GETPOS} 0 0 $1
+	${If} $1 = 100
+		SendMessage $PROGBAR ${PBM_SETPOS} 0 0
+	${Else}
+		SendMessage $PROGBAR ${PBM_DELTAPOS} 10 0
+	${EndIf}
+
+FunctionEnd
+
+Function OnTimer2
+
+  	SendMessage $PROGBAR2 ${PBM_GETPOS} 0 0 $1
+	${If} $1 = 100
+		SendMessage $PROGBAR2 ${PBM_SETPOS} 0 0
+	${Else}
+		SendMessage $PROGBAR2 ${PBM_DELTAPOS} 5 0
+	${EndIf}
+
+FunctionEnd
+
+Function OnTimer3
+
+  	SendMessage $PROGBAR3 ${PBM_GETPOS} 0 0 $1
+	${If} $1 >= 100
+		${NSD_KillTimer} OnTimer3
+ 		MessageBox MB_OK "Timer 3 killed"
+	${Else}
+		SendMessage $PROGBAR3 ${PBM_DELTAPOS} 2 0
+	${EndIf}
+
+FunctionEnd
+
+Function OnClick
+
+	Pop $0
+
+	${NSD_KillTimer} OnTimer
+
+FunctionEnd
+
+Function OnClick2
+
+	Pop $0
+
+	${NSD_KillTimer} OnTimer2
+
+FunctionEnd
+
+Function nsDialogsPage
+
+	nsDialogs::Create 1018
+	Pop $DIALOG
+
+	${NSD_CreateLabel} 0u 0u 100% 9u "nsDialogs timer example"
+	Pop $TEXT
+
+	${NSD_CreateProgressBar} 0u 10u 100% 12u ""
+	Pop $PROGBAR
+
+	${NSD_CreateButton} 0u 25u 100u 14u "Kill Timer 1"
+	Pop $BUTTON
+	${NSD_OnClick} $BUTTON OnClick
+
+	${NSD_CreateProgressBar} 0u 52u 100% 12u ""
+	Pop $PROGBAR2
+
+	${NSD_CreateButton} 0u 67u 100u 14u "Kill Timer 2"
+	Pop $BUTTON2
+	${NSD_OnClick} $BUTTON2 OnClick2
+
+	${NSD_CreateProgressBar} 0u 114u 100% 12u ""
+	Pop $PROGBAR3
+
+	${NSD_CreateTimer} OnTimer 1000
+	${NSD_CreateTimer} OnTimer2 100
+	${NSD_CreateTimer} OnTimer3 200
+
+	nsDialogs::Show
+
+FunctionEnd
+
+Section
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/nsDialogs/InstallOptions.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/nsDialogs/InstallOptions.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/nsDialogs/InstallOptions.nsi	(revision 728)
@@ -0,0 +1,47 @@
+!include LogicLib.nsh
+!include WinMessages.nsh
+
+Name "nsDialogs IO"
+OutFile "nsDialogs IO.exe"
+
+Page custom nsDialogsIO UpdateINIState
+Page instfiles
+
+XPStyle on
+
+ShowInstDetails show
+
+!include nsDialogs.nsh
+!insertmacro NSD_FUNCTION_INIFILE
+
+Function nsDialogsIO
+
+	InitPluginsDir
+	File /oname=$PLUGINSDIR\io.ini "${NSISDIR}\Examples\InstallOptions\test.ini"
+
+	${If} ${Cmd} `MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Test the right-to-left version?" IDYES`
+		WriteINIStr $PLUGINSDIR\io.ini Settings RTL 1
+	${EndIf}
+
+	StrCpy $0 $PLUGINSDIR\io.ini
+
+	Call CreateDialogFromINI
+
+FunctionEnd
+
+Section
+
+  ReadINIStr $0 "$PLUGINSDIR\io.ini" "Field 2" "State"
+  DetailPrint "Install X=$0"
+  ReadINIStr $0 "$PLUGINSDIR\io.ini" "Field 3" "State"
+  DetailPrint "Install Y=$0"
+  ReadINIStr $0 "$PLUGINSDIR\io.ini" "Field 4" "State"
+  DetailPrint "Install Z=$0"
+  ReadINIStr $0 "$PLUGINSDIR\io.ini" "Field 5" "State"
+  DetailPrint "File=$0"
+  ReadINIStr $0 "$PLUGINSDIR\io.ini" "Field 6" "State"
+  DetailPrint "Dir=$0"
+  ReadINIStr $0 "$PLUGINSDIR\io.ini" "Field 8" "State"
+  DetailPrint "Info=$0"
+
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/AdvSplash/Example.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/AdvSplash/Example.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/AdvSplash/Example.nsi	(revision 728)
@@ -0,0 +1,35 @@
+Name "AdvSplash.dll test"
+
+OutFile "AdvSplash Test.exe"
+
+XPStyle on
+
+Function .onInit
+        # the plugins dir is automatically deleted when the installer exits
+        InitPluginsDir
+        File /oname=$PLUGINSDIR\splash.bmp "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp"
+        #optional
+        #File /oname=$PLUGINSDIR\splash.wav "C:\myprog\sound.wav"
+
+        MessageBox MB_OK "Fading"
+
+        advsplash::show 1000 600 400 -1 $PLUGINSDIR\splash
+
+        Pop $0          ; $0 has '1' if the user closed the splash screen early,
+                        ; '0' if everything closed normally, and '-1' if some error occurred.
+
+        MessageBox MB_OK "Transparency"
+        File /oname=$PLUGINSDIR\splash.bmp "${NSISDIR}\Contrib\Graphics\Wizard\orange-uninstall.bmp"
+        advsplash::show 2000 0 0 0x1856B1 $PLUGINSDIR\splash
+        Pop $0 
+
+        MessageBox MB_OK "Transparency/Fading"
+        File /oname=$PLUGINSDIR\splash.bmp "${NSISDIR}\Contrib\Graphics\Wizard\llama.bmp"
+        advsplash::show 1000 600 400 0x04025C $PLUGINSDIR\splash
+        Pop $0 
+
+        Delete $PLUGINSDIR\splash.bmp
+FunctionEnd
+
+Section
+SectionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/VPatch/patch.pat
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Examples/VPatch/patch.pat
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Examples/VPatch/example.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/VPatch/example.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/VPatch/example.nsi	(revision 728)
@@ -0,0 +1,62 @@
+;VPatch example
+;Written by Joost Verburg
+
+;--------------------------------
+
+; The name of the installer
+Name "VPatch Test"
+
+; The file to write
+OutFile "vpatchtest.exe"
+
+; The default installation directory
+InstallDir "$PROGRAMFILES\VPatch Test"
+
+; The text to prompt the user to enter a directory
+DirText "Choose a folder in which to install the VPatch Test!"
+
+; Show details
+ShowInstDetails show
+
+;--------------------------------
+;  The normal way to use VPatch
+;--------------------------------
+!include "VPatchLib.nsh"
+
+Section "Update file"
+  ; Set output path to the installation directory
+  SetOutPath $INSTDIR
+
+  ; Extract the old file under name 'updatefile.txt'
+  File /oname=updatefile.txt oldfile.txt
+  
+  ; Update the file - it will be replaced with the new version
+  DetailPrint "Updating updatefile.txt using patch..."
+  !insertmacro VPatchFile "patch.pat" "$INSTDIR\updatefile.txt" "$INSTDIR\temporaryfile.txt"
+  
+SectionEnd
+
+;-------------------------------
+;  The hard way to use VPatch
+;-------------------------------
+Section "New version in separate file"
+
+  ; Set output path to the installation directory
+  SetOutPath $INSTDIR
+  
+  ; Extract the old file
+  File oldfile.txt
+ 
+  ; Extract the patch to the plug-ins folder (temporary)
+  InitPluginsDir
+  File /oname=$PLUGINSDIR\patch.pat patch.pat
+  
+  ; Update the old file to the new file using the patch
+  DetailPrint "Updating oldfile.txt using patch to newfile.txt..."
+  vpatch::vpatchfile "$PLUGINSDIR\patch.pat" "$INSTDIR\oldfile.txt" "$INSTDIR\newfile.txt"
+  
+  ; Show result
+  Pop $R0
+  DetailPrint "Result: $R0"
+  
+SectionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/VPatch/newfile.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/VPatch/newfile.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/VPatch/newfile.txt	(revision 728)
@@ -0,0 +1,6 @@
+*** THIS IS A TEST FILE FOR THE VPATCH EXAMPLE ***
+*** COMPILE EXAMPLE.NSI TO TEST ***
+
+newfile - vpatch
+
+67890 - GHIJKL
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Examples/VPatch/newfile.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Examples/VPatch/oldfile.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/VPatch/oldfile.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/VPatch/oldfile.txt	(revision 728)
@@ -0,0 +1,6 @@
+*** THIS IS A TEST FILE FOR THE VPATCH EXAMPLE ***
+*** COMPILE EXAMPLE.NSI TO TEST ***
+
+oldfile - vpatch
+
+12345 - ABCDEF
\ No newline at end of file

Property changes on: tmp/trunk/org.txm.setups/nsis/Examples/VPatch/oldfile.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Examples/silent.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/silent.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/silent.nsi	(revision 728)
@@ -0,0 +1,63 @@
+# This example shows how to handle silent installers.
+# In short, you need IfSilent and the /SD switch for MessageBox to make your installer
+# really silent when the /S switch is used.
+
+Name "Silent"
+OutFile "silent.exe"
+RequestExecutionLevel user
+
+# uncomment the following line to make the installer silent by default.
+; SilentInstall silent
+
+Function .onInit
+  # `/SD IDYES' tells MessageBox to automatically choose IDYES if the installer is silent
+  # in this case, the installer can only be silent if the user used the /S switch or if
+  # you've uncommented line number 5
+  MessageBox MB_YESNO|MB_ICONQUESTION "Would you like the installer to be silent from now on?" \
+    /SD IDYES IDNO no IDYES yes
+
+  # SetSilent can only be used in .onInit and doesn't work well along with `SetSilent silent'
+
+  yes:
+    SetSilent silent
+    Goto done
+  no:
+    SetSilent normal
+  done:
+FunctionEnd
+
+Section
+  IfSilent 0 +2
+    MessageBox MB_OK|MB_ICONINFORMATION 'This is a "silent" installer'
+
+  # there is no need to use IfSilent for this one because the /SD switch takes care of that
+  MessageBox MB_OK|MB_ICONINFORMATION "This is not a silent installer" /SD IDOK
+
+  # when `SetOverwrite on' (which is the default) is used, the installer will show a message
+  # if it can't open a file for writing. On silent installers, the ignore option will be
+  # automatically selected. if `AllowSkipFiles off' (default is on) was used, there is no
+  # ignore option and the cancel option will be automatically selected.
+
+  # on is default
+  ; AllowSkipFiles on
+
+  # lock file
+  FileOpen $0 $TEMP\silentOverwrite w
+  # try to extract - will fail
+  File /oname=$TEMP\silentOverwrite silent.nsi
+  # unlcok
+  FileClose $0
+
+  # this will always show on silent installers because ignore is the option automatically
+  # selected when a file can't be opened for writing on a silent installer
+  MessageBox MB_OK|MB_ICONINFORMATION "This message box always shows if the installer is silent"
+
+  AllowSkipFiles off
+
+  # lock file
+  FileOpen $0 $TEMP\silentOverwrite w
+  # try to extract - will fail
+  File /oname=$TEMP\silentOverwrite silent.nsi
+  # unlcok
+  FileClose $0
+SectionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/viewhtml.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/viewhtml.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/viewhtml.nsi	(revision 728)
@@ -0,0 +1,53 @@
+; viewhtml.nsi
+;
+; This script creates a silent installer which extracts one (or more) HTML
+; files to a temporary directory, opens Internet Explorer to view the file(s),
+; and when Internet Explorer has quit, deletes the file(s).
+
+;--------------------------------
+
+; The name of the installer (not really used in a silent install)
+Name "ViewHTML"
+
+; Set to silent mode
+SilentInstall silent
+
+; The file to write
+OutFile "viewhtml.exe"
+
+; Request application privileges for Windows Vista
+RequestExecutionLevel user
+
+;--------------------------------
+
+; The stuff to install
+Section ""
+
+  ; Get a temporary filename (in the Windows Temp directory)
+  GetTempFileName $R0
+  
+  ; Extract file
+  ; Lets skip this one, it's not built to be showin in IE
+  ; File /oname=$R0 "..\Menu\compiler.html"
+  ; and write our own! :)
+  FileOpen $0 $R0 "w"
+  FileWrite $0 "<HTML><BODY><H1>HTML page for viewhtml.nsi</H1></BODY></HTML>"
+  FileClose $0
+  
+  ; View file
+  ExecWait '"$PROGRAMFILES\Internet Explorer\iexplore.exe" "$R0"'
+
+  ; Note: another way of doing this would be to use ExecShell, but then you
+  ; really couldn't get away with deleting the files. Here is the ExecShell
+  ; line that you would want to use:
+  ;
+  ; ExecShell "open" '"$R0"'
+  ;
+  ; The advantage of this way is that it would use the default browser to
+  ; open the HTML.
+  ;
+  
+  ; Delete the files (on reboot if file is in use)
+  Delete /REBOOTOK $R0
+
+SectionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/TextFunc.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/TextFunc.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/TextFunc.nsi	(revision 728)
@@ -0,0 +1,834 @@
+;_____________________________________________________________________________
+;
+;                          Text Functions
+;_____________________________________________________________________________
+;
+; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
+
+Name "Text Functions"
+OutFile "TextFunc.exe"
+Caption "$(^Name)"
+XPStyle on
+RequestExecutionLevel user
+
+!include "WinMessages.nsh"
+!include "TextFunc.nsh"
+
+Var HWND
+Var INI
+Var LOG
+Var PROJECT
+Var CALLBACK
+Var VIEW
+Var FUNCTION
+Var LINEFIND1
+Var LINEFIND2
+Var LINEFIND3
+Var LINEREAD1
+Var LINEREAD2
+Var FILEREADFROMEND1
+Var LINESUM1
+Var FILEJOIN1
+Var FILEJOIN2
+Var FILEJOIN3
+Var TEXTCOMPARE1
+Var TEXTCOMPARE2
+Var TEXTCOMPARE3
+Var CONFIGREAD1
+Var CONFIGREAD2
+Var CONFIGWRITE1
+Var CONFIGWRITE2
+Var CONFIGWRITE3
+Var FILERECODE1
+Var FILERECODE2
+
+Page Custom ShowCustom LeaveCustom
+
+Function ShowCustom
+	InstallOptions::initDialog "$INI"
+	Pop $hwnd
+	GetDlgItem $0 $HWND 1206
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1208
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1209
+	ShowWindow $0 0
+	StrCpy $FUNCTION LineFind
+	StrCpy $LINEREAD2 10
+	StrCpy $TEXTCOMPARE3 FastDiff
+	StrCpy $CONFIGREAD1 "$WINDIR\system.ini"
+	StrCpy $CONFIGREAD2 "shell="
+	StrCpy $FILERECODE2 CharToOem
+	InstallOptions::show
+	Pop $0
+FunctionEnd
+
+Function LeaveCustom
+	ReadINIStr $0 $INI "Settings" "State"
+ 	ReadINIStr $R0 $INI "Field 1" "State" 	
+	ReadINIStr $R1 $INI "Field 2" "State"
+ 	ReadINIStr $R2 $INI "Field 3" "State"
+ 	ReadINIStr $R3 $INI "Field 4" "State"
+ 	ReadINIStr $R4 $INI "Field 5" "State"
+ 	ReadINIStr $R5 $INI "Field 6" "State"
+	StrCpy $R4 $R4 8
+	StrCpy $R5 $R5 8
+	StrCpy $6 0
+	StrCpy $7 '$${'
+	StrCpy $8 'r'
+	StrCpy $9 'n'
+
+	StrCmp $0 10 Log
+	StrCmp $0 9 ViewOrEdit
+	StrCmp $0 0 Enter
+	goto MainSend
+
+	Log:
+	Exec 'notepad.exe $LOG'
+	Abort
+
+	ViewOrEdit:
+	StrCmp $FUNCTION FileReadFromEnd 0 Edit
+	StrCmp $VIEW '' 0 ViewFileReadFromEndCallback
+	GetTempFileName $VIEW $PLUGINSDIR
+	StrCpy $7 '$$'
+	FileOpen $0 $VIEW w
+	FileWrite $0 `Function FileReadFromEndCallback$\r$\n`
+	FileWrite $0 `	MessageBox MB_OKCANCEL '$7$$9       "Line"=[$$9]$7\$9$7$$8           "#"=[$$8]$7\$9$7$$7          "-#"=[$$7]' IDOK +2$\r$\n`
+	FileWrite $0 `	StrCpy $$R0 StopFileReadFromEnd$\r$\n$\r$\n`
+	FileWrite $0 `	Push $$R0$\r$\n`
+	FileWrite $0 `FunctionEnd$\r$\n`
+	FileClose $0
+	StrCpy $7 '$${'
+	SetFileAttributes $VIEW READONLY
+	ViewFileReadFromEndCallback:
+	Exec 'notepad.exe $VIEW'
+	Abort
+
+	Edit:
+	StrCmp $CALLBACK '' +5
+	StrCmp $6$R6 '0$R0$R4$R5' showproject
+	StrCmp $R6 '$R0$R4$R5' +3
+	Delete $CALLBACK
+	StrCpy $CALLBACK ''
+	StrCpy $R6 '$R0$R4$R5'
+
+	#Project#
+	StrCmp $6$R0 "01. LineFind" 0 +5
+	IfFileExists $CALLBACK +2
+	GetTempFileName $CALLBACK $PLUGINSDIR
+	FileOpen $0 $CALLBACK w
+	goto function
+	IfFileExists $PROJECT +2
+	GetTempFileName $PROJECT $PLUGINSDIR
+	FileOpen $0 $PROJECT w
+
+	#Name#
+	FileWrite $0 'Name "$FUNCTION"$\r$\n'
+	FileWrite $0 'OutFile "$PROJECT.exe"$\r$\n$\r$\n'
+
+	#!include#
+	StrCmp $R0$R4 '1. LineFindExample5' 0 TextFuncInclude
+	IfFileExists '$EXEDIR\WordFunc.nsh' 0 +3
+	FileWrite $0 '!include "$EXEDIR\WordFunc.nsh"$\r$\n'
+	goto +2
+	FileWrite $0 '!include "WordFunc.nsh"$\r$\n'
+	FileWrite $0 '!insertmacro WordFind$\r$\n'
+	FileWrite $0 '!insertmacro WordFindS$\r$\n'
+	FileWrite $0 '!insertmacro WordFind2X$\r$\n'
+	FileWrite $0 '!insertmacro WordFind2XS$\r$\n'
+	FileWrite $0 '!insertmacro WordFind3X$\r$\n'
+	FileWrite $0 '!insertmacro WordFind3XS$\r$\n'
+	FileWrite $0 '!insertmacro WordReplace$\r$\n'
+	FileWrite $0 '!insertmacro WordReplaceS$\r$\n'
+	FileWrite $0 '!insertmacro WordAdd$\r$\n'
+	FileWrite $0 '!insertmacro WordAddS$\r$\n'
+	FileWrite $0 '!insertmacro WordInsert$\r$\n'
+	FileWrite $0 '!insertmacro WordInsertS$\r$\n'
+	FileWrite $0 '!insertmacro StrFilter$\r$\n'
+	FileWrite $0 '!insertmacro StrFilterS$\r$\n'
+	TextFuncInclude:
+	IfFileExists '$EXEDIR\TextFunc.nsh' 0 +3
+	FileWrite $0 '!include "$EXEDIR\TextFunc.nsh"$\r$\n'
+	goto +2
+	FileWrite $0 '!include "TextFunc.nsh"$\r$\n'
+	FileWrite $0 '!insertmacro $FUNCTION$\r$\n'
+	StrCmp $FUNCTION TextCompare +2
+	FileWrite $0 '!insertmacro TrimNewLines$\r$\n'
+
+	#Section#
+	FileWrite $0 '$\r$\nSection -empty$\r$\n'
+	FileWrite $0 'SectionEnd$\r$\n$\r$\n'
+
+	#Function .onInit#
+	FileWrite $0 'Function .onInit$\r$\n'
+	StrCmp $R0$R5 "6. TextCompareExample1" 0 TextCompareExample235
+	FileWrite $0 '	StrCpy $$R0 ""$\r$\n'
+	FileWrite $0 '	$7TextCompare} "$R1" "$R2" "$R3" "$R5"$\r$\n'
+	FileWrite $0 '	IfErrors error$\r$\n'
+	FileWrite $0 '	StrCmp $$R0 NotEqual 0 +2$\r$\n'
+	FileWrite $0 '	MessageBox MB_OK "             Files differ" IDOK +2$\r$\n'
+	FileWrite $0 '	MessageBox MB_OK "           Files identical"$\r$\n'
+	FileWrite $0 '	goto end$\r$\n$\r$\n'
+	goto endoninit
+	TextCompareExample235:
+	StrCmp $R0$R5 "6. TextCompareExample2" +3
+	StrCmp $R0$R5 "6. TextCompareExample3" +2
+	StrCmp $R0$R5 "6. TextCompareExample5" 0 TextCompareExample4
+	FileWrite $0 '	StrCpy $$R0 "$R1"$\r$\n'
+	FileWrite $0 '	StrCpy $$R1 "$R2"$\r$\n$\r$\n'
+	FileWrite $0 '	GetTempFileName $$R2$\r$\n'
+	FileWrite $0 '	FileOpen $$R3 $$R2 w$\r$\n'
+	FileWrite $0 '	FileWrite $$R3 "$$R0 | $$R1$$\$8$$\$9"$\r$\n'
+	FileWrite $0 '	$7TextCompare} "$$R0" "$$R1" "$R3" "$R5"$\r$\n'
+	FileWrite $0 '	IfErrors error$\r$\n'
+	FileWrite $0 '	Exec "notepad.exe $$R2"$\r$\n'
+	FileWrite $0 '	goto end$\r$\n$\r$\n'
+	goto endoninit
+	TextCompareExample4:
+	StrCmp $R0$R5 "6. TextCompareExample4" 0 LineFindExample123456
+	FileWrite $0 '	StrCpy $$R0 "$R1"$\r$\n'
+	FileWrite $0 '	StrCpy $$R1 "$R2"$\r$\n$\r$\n'
+	FileWrite $0 '	GetTempFileName $$R2$\r$\n'
+	FileWrite $0 '	FileOpen $$R3 $$R2 w$\r$\n'
+	FileWrite $0 '	FileWrite $$R3 "$$R0 | $$R1$$\$8$$\$9"$\r$\n'
+	FileWrite $0 '	$7TextCompare} "$$R0" "$$R1" "$R3" "$R5"$\r$\n'
+	FileWrite $0 '	IfErrors error$\r$\n'
+	FileWrite $0 '	FileWrite $$R3 "$$\$8$$\$9$$R1 | $$R0$$\$8$$\$9"$\r$\n'
+	FileWrite $0 '	$7TextCompare} "$$R1" "$$R0" "$R3" "$R5"$\r$\n'
+	FileWrite $0 '	FileClose $$R3$\r$\n'
+	FileWrite $0 '	IfErrors error$\r$\n'
+	FileWrite $0 '	Exec "notepad.exe $$R2"$\r$\n$\r$\n'
+	FileWrite $0 '	goto end$\r$\n$\r$\n'
+	goto endoninit
+	LineFindExample123456:
+	FileWrite $0 '	$7$FUNCTION} "$R1" "$R2" "$R3" "$R4"$\r$\n'
+	FileWrite $0 '	IfErrors error$\r$\n'
+	FileWrite $0 '	MessageBox MB_YESNO "          Open output file?" IDNO end$\r$\n'
+	FileWrite $0 '	StrCmp "$R2" "" 0 +3$\r$\n'
+	FileWrite $0 `	Exec 'notepad.exe "$R1"'$\r$\n`
+	FileWrite $0 '	goto end$\r$\n'
+	FileWrite $0 '	SearchPath $$R2 "$R2"$\r$\n'
+	FileWrite $0 `	Exec 'notepad.exe "$$R2"'$\r$\n`
+	FileWrite $0 '	goto end$\r$\n$\r$\n'
+	endoninit:
+	FileWrite $0 '	error:$\r$\n'
+	FileWrite $0 '	MessageBox MB_OK "Error"$\r$\n$\r$\n'
+	FileWrite $0 '	end:$\r$\n'
+	FileWrite $0 '	Quit$\r$\n'
+	FileWrite $0 'FunctionEnd$\r$\n$\r$\n'
+	#FunctionEnd#
+
+
+	#Function CallBack#
+	StrCmp $CALLBACK '' 0 close
+	function:
+	StrCmp $R0 '1. LineFind' 0 +8
+	FileWrite $0 'Function $R4$\r$\n'
+	StrCmp $R4 "Example1" Example1LF
+	StrCmp $R4 "Example2" Example2LF
+	StrCmp $R4 "Example3" Example3LF
+	StrCmp $R4 "Example4" Example4LF
+	StrCmp $R4 "Example5" Example5LF
+	StrCmp $R4 "Example6" Example6LF
+
+	FileWrite $0 'Function $R5$\r$\n'
+	StrCmp $R5 "Example1" Example1TC
+	StrCmp $R5 "Example2" Example2TC
+	StrCmp $R5 "Example3" Example3TC
+	StrCmp $R5 "Example4" Example4TC
+	StrCmp $R5 "Example5" Example3TC
+
+	Example1LF:
+	FileWrite $0 "	$7TrimNewLines} '$$R9' $$R9$\r$\n"
+	FileWrite $0 "	StrCpy $$R9 $$R9 '' 2       ;delete first two symbols$\r$\n"
+	FileWrite $0 "	StrCpy $$R9 '$$R9$$\$8$$\$9'$\r$\n$\r$\n"
+	goto endwrite
+	Example2LF:
+	FileWrite $0 "	$7TrimNewLines} '$$R9' $$R9$\r$\n"
+	FileWrite $0 "	StrCpy $$R9 '$$R9   ~Changed line ($$R8)~$$\$8$$\$9'$\r$\n$\r$\n"
+	goto endwrite
+	Example3LF:
+	FileWrite $0 "	StrCpy $$0 SkipWrite$\r$\n$\r$\n"
+	goto endwrite
+	Example4LF:
+	FileWrite $0 "	FileWrite $$R4 '---First Line---$$\$8$$\$9'$\r$\n"
+	FileWrite $0 "	FileWrite $$R4 '---Second Line ...---$$\$8$$\$9'$\r$\n$\r$\n"
+	goto endwrite
+	Example5LF:
+	FileWrite $0 "	; You can use:$\r$\n"
+	FileWrite $0 "	; $7WordFind}|$7WordFindS}|$7WordFind2X}|$7WordFind2XS}|$\r$\n"
+	FileWrite $0 "	; $7WordFind3X}|$7WordFind3XS}|$7WordReplace}|$7WordReplaceS}|$\r$\n"
+	FileWrite $0 "	; $7WordAdd}|$7WordAddS}|$7WordInsert}|$7WordInsertS}|$\r$\n"
+	FileWrite $0 "	; $7StrFilter}|$7StrFilterS}$\r$\n$\r$\n"
+	FileWrite $0 "	$7WordReplace} '$$R9' ' ' '_' '+*' $$R9$\r$\n$\r$\n"
+	goto endwrite
+	Example6LF:
+	FileWrite $0 '	;(Cut lines from a line to another line (also including that line))$\r$\n'
+	FileWrite $0 '	StrCmp $$R0 finish stop$\r$\n'
+	FileWrite $0 '	StrCmp $$R0 start finish$\r$\n'
+	FileWrite $0 '	StrCmp $$R9 "Start Line$$\$8$$\$9" 0 skip$\r$\n'
+	FileWrite $0 '	StrCpy $$R0 start$\r$\n'
+	FileWrite $0 '	StrCpy $$R1 $$R9$\r$\n'
+	FileWrite $0 '	goto code$\r$\n'
+	FileWrite $0 '	finish:$\r$\n'
+	FileWrite $0 '	StrCmp $$R9 "Finish Line$$\$8$$\$9" 0 code$\r$\n'
+	FileWrite $0 '	StrCpy $$R0 finish$\r$\n'
+	FileWrite $0 '	StrCpy $$R2 $$R8$\r$\n'
+	FileWrite $0 '	goto code$\r$\n'
+	FileWrite $0 '	skip:$\r$\n'
+	FileWrite $0 '	StrCpy $$0 SkipWrite$\r$\n'
+	FileWrite $0 '	goto output$\r$\n'
+	FileWrite $0 '	stop:$\r$\n'
+	FileWrite $0 '	StrCpy $$0 StopLineFind$\r$\n'
+	FileWrite $0 '	goto output$\r$\n$\r$\n'
+	FileWrite $0 '	;;(Delete lines from a line to another line (also including that line))$\r$\n'
+	FileWrite $0 '	; StrCmp $$R0 finish code$\r$\n'
+	FileWrite $0 '	; StrCmp $$R0 start finish$\r$\n'
+	FileWrite $0 '	; StrCmp $$R9 "Start Line$$\$8$$\$9" 0 code$\r$\n'
+	FileWrite $0 '	; StrCpy $$R0 start$\r$\n'
+	FileWrite $0 '	; StrCpy $$R1 $$R8$\r$\n'
+	FileWrite $0 '	; goto skip$\r$\n'
+	FileWrite $0 '	; finish:$\r$\n'
+	FileWrite $0 '	; StrCmp $$R9 "Finish Line$$\$8$$\$9" 0 skip$\r$\n'
+	FileWrite $0 '	; StrCpy $$R0 finish$\r$\n'
+	FileWrite $0 '	; StrCpy $$R2 $$R8$\r$\n'
+	FileWrite $0 '	; skip:$\r$\n'
+	FileWrite $0 '	; StrCpy $$0 SkipWrite$\r$\n'
+	FileWrite $0 '	; goto output$\r$\n$\r$\n'
+	FileWrite $0 '	code:$\r$\n'
+	FileWrite $0 '	;...$\r$\n$\r$\n'
+	FileWrite $0 '	output:$\r$\n'
+	goto endwrite
+	Example1TC:
+	FileWrite $0 "	StrCpy $$R0 NotEqual$\r$\n"
+	FileWrite $0 "	StrCpy $$0 StopTextCompare$\r$\n$\r$\n"
+	goto endwrite
+	Example2TC:
+	FileWrite $0 "	FileWrite $$R3 '$$8=$$9'$\r$\n"
+	FileWrite $0 "	FileWrite $$R3 '$$6=$$7$$\$8$$\$9'$\r$\n$\r$\n"
+	goto endwrite
+	Example3TC:
+	FileWrite $0 "	FileWrite $$R3 '$$8|$$6=$$9'$\r$\n$\r$\n"
+	goto endwrite
+	Example4TC:
+	FileWrite $0 "	FileWrite $$R3 '$$8=$$9'$\r$\n$\r$\n"
+	goto endwrite
+	endwrite:
+	FileWrite $0 '	Push $$0$\r$\n'
+	FileWrite $0 'FunctionEnd$\r$\n'
+	close:
+	FileClose $0
+	goto $6
+	#FunctionEnd#
+
+	showproject:
+	StrCmp $R0 '1. LineFind' 0 +3
+	ExecWait 'notepad.exe $CALLBACK'
+	goto +4
+	SetFileAttributes $PROJECT READONLY
+	ExecWait 'notepad.exe $PROJECT'
+	SetFileAttributes $PROJECT NORMAL
+	Abort
+
+	MainSend:
+	GetDlgItem $0 $HWND 1210
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $0 $HWND 1203
+	ShowWindow $0 1
+	EnableWindow $0 1
+	GetDlgItem $0 $HWND 1204
+	ShowWindow $0 1
+	EnableWindow $0 1
+	GetDlgItem $0 $HWND 1205
+	EnableWindow $0 1
+	GetDlgItem $0 $HWND 1206
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1207
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1208
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1209
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1211
+	EnableWindow $0 1
+
+	StrCmp $FUNCTION LineFind 0 +5
+	StrCpy $LINEFIND1 $R1
+	StrCpy $LINEFIND2 $R2
+	StrCpy $LINEFIND3 $R3
+	goto LineFindSend
+	StrCmp $FUNCTION LineRead 0 +4
+	StrCpy $LINEREAD1 $R1
+	StrCpy $LINEREAD2 $R2
+	goto LineFindSend
+	StrCmp $FUNCTION FileReadFromEnd 0 +3
+	StrCpy $FILEREADFROMEND1 $R1
+	goto LineFindSend
+	StrCmp $FUNCTION LineSum 0 +3
+	StrCpy $LINESUM1 $R1
+	goto LineFindSend
+	StrCmp $FUNCTION FileJoin 0 +5
+	StrCpy $FILEJOIN1 $R1
+	StrCpy $FILEJOIN2 $R2
+	StrCpy $FILEJOIN3 $R3
+	goto LineFindSend
+	StrCmp $FUNCTION TextCompare 0 +5
+	StrCpy $TEXTCOMPARE1 $R1
+	StrCpy $TEXTCOMPARE2 $R2
+	StrCpy $TEXTCOMPARE3 $R3
+	goto LineFindSend
+	StrCmp $FUNCTION ConfigRead 0 +4
+	StrCpy $CONFIGREAD1 $R1
+	StrCpy $CONFIGREAD2 $R2
+	goto LineFindSend
+	StrCmp $FUNCTION ConfigWrite 0 +5
+	StrCpy $CONFIGWRITE1 $R1
+	StrCpy $CONFIGWRITE2 $R2
+	StrCpy $CONFIGWRITE3 $R3
+	goto LineFindSend
+	StrCmp $FUNCTION FileRecode 0 +3
+	StrCpy $FILERECODE1 $R1
+	StrCpy $FILERECODE2 $R2
+
+	LineFindSend:
+	StrCmp $R0 "1. LineFind" 0 LineReadSend
+	StrCmp $FUNCTION LineFind 0 LineFindSend2
+	StrCmp $R4 "Example1" 0 +3
+	StrCpy $LINEFIND3 "3:-1"
+	goto LineFindSend2
+	StrCmp $R4 "Example2" 0 +3
+	StrCpy $LINEFIND3 "{5:12 15 -6:-5 -1}"
+	goto LineFindSend2
+	StrCmp $R4 "Example3" 0 +3
+	StrCpy $LINEFIND3 "2:3 10:-5 -3:-2"
+	goto LineFindSend2
+	StrCmp $R4 "Example4" 0 +3
+	StrCpy $LINEFIND3 "10"
+	goto LineFindSend2
+	StrCmp $R4 "Example5" 0 +3
+	StrCpy $LINEFIND3 "1:-1"
+	goto LineFindSend2
+	StrCmp $R4 "Example6" 0 +3
+	StrCpy $LINEFIND3 ""
+	goto LineFindSend2
+	StrCmp $R4 "Example7" 0 +2
+	StrCpy $LINEFIND3 "1:-1"
+
+	LineFindSend2:
+	StrCpy $FUNCTION LineFind
+	StrCmp $LINEFIND2 '/NUL' 0 +2
+	StrCpy $LINEFIND2 ''
+	GetDlgItem $0 $HWND 1201
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$LINEFIND1"
+	GetDlgItem $0 $HWND 1203
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$LINEFIND2"
+	GetDlgItem $0 $HWND 1205
+	ShowWindow $0 1
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$LINEFIND3"
+	GetDlgItem $0 $HWND 1207
+	ShowWindow $0 1
+	GetDlgItem $0 $HWND 1211
+	ShowWindow $0 1
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:Edit"
+	GetDlgItem $0 $HWND 1212
+	ShowWindow $0 1
+	StrCmp $LOG '' +2
+	EnableWindow $0 1
+	GetDlgItem $0 $HWND 1213
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:InputFile"
+	GetDlgItem $0 $HWND 1214
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:OutputFile"
+	GetDlgItem $0 $HWND 1215
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:Range"
+	GetDlgItem $0 $HWND 1216
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:Function"
+
+	StrCmp $R4 "Example7" 0 +9
+	GetDlgItem $0 $HWND 1203
+	EnableWindow $0 0
+	SendMessage $0 ${WM_ENABLE} 1 0
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:/NUL"
+	GetDlgItem $0 $HWND 1204
+	EnableWindow $0 0
+	GetDlgItem $0 $HWND 1211
+	EnableWindow $0 0
+	abort
+
+
+	LineReadSend:
+	StrCmp $R0 "2. LineRead" 0 FileReadFromEndSend
+	StrCpy $FUNCTION LineRead
+	GetDlgItem $0 $HWND 1201
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$LINEREAD1"
+	GetDlgItem $0 $HWND 1203
+	ShowWindow $0 1
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$LINEREAD2"
+	GetDlgItem $0 $HWND 1204
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1205
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1211
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1212
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1213
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:InputFile"
+	GetDlgItem $0 $HWND 1214
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:Line #"
+	GetDlgItem $0 $HWND 1215
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $0 $HWND 1216
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:"
+	Abort
+
+	FileReadFromEndSend:
+	StrCmp $R0 "3. FileReadFromEnd" 0 LineSumSend
+	StrCpy $FUNCTION FileReadFromEnd
+	GetDlgItem $0 $HWND 1201
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$FILEREADFROMEND1"
+	GetDlgItem $0 $HWND 1203
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1204
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1205
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1209
+	ShowWindow $0 1
+	GetDlgItem $0 $HWND 1211
+	ShowWindow $0 1
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:View"
+	GetDlgItem $0 $HWND 1212
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1213
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:InputFile"
+	GetDlgItem $0 $HWND 1214
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $0 $HWND 1215
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $0 $HWND 1216
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:Function"
+	Abort
+
+	LineSumSend:
+	StrCmp $R0 "4. LineSum" 0 FileJoinSend
+	StrCpy $FUNCTION LineSum
+	GetDlgItem $0 $HWND 1201
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$LINESUM1"
+	GetDlgItem $0 $HWND 1203
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1204
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1205
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1211
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1212
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1213
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:InputFile"
+	GetDlgItem $0 $HWND 1214
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $0 $HWND 1215
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $0 $HWND 1216
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:"
+	Abort
+
+	FileJoinSend:
+	StrCmp $R0 "5. FileJoin" 0 TextCompareSend
+	StrCpy $FUNCTION FileJoin
+	GetDlgItem $0 $HWND 1201
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$FILEJOIN1"
+	GetDlgItem $0 $HWND 1203
+	ShowWindow $0 1
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$FILEJOIN2"
+	GetDlgItem $0 $HWND 1204
+	ShowWindow $0 1
+	GetDlgItem $0 $HWND 1205
+	ShowWindow $0 1
+	EnableWindow $0 1
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$FILEJOIN3"
+	GetDlgItem $0 $HWND 1206
+	ShowWindow $0 1
+	GetDlgItem $0 $HWND 1211
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1212
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1213
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:InputFile1"
+	GetDlgItem $0 $HWND 1214
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:InputFile2"
+	GetDlgItem $0 $HWND 1215
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:OutputFile"
+	GetDlgItem $0 $HWND 1216
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:"
+	Abort
+
+	TextCompareSend:
+	StrCmp $R0 "6. TextCompare" 0 ConfigReadSend
+	StrCmp $FUNCTION TextCompare 0 TextCompareSend2
+	StrCmp $R5 "Example1" 0 +3
+	StrCpy $TEXTCOMPARE3 "FastDiff"
+	goto TextCompareSend2
+	StrCmp $R5 "Example2" 0 +3
+	StrCpy $TEXTCOMPARE3 "FastDiff"
+	goto TextCompareSend2
+	StrCmp $R5 "Example3" 0 +3
+	StrCpy $TEXTCOMPARE3 "FastEqual"
+	goto TextCompareSend2
+	StrCmp $R5 "Example4" 0 +3
+	StrCpy $TEXTCOMPARE3 "SlowDiff"
+	goto TextCompareSend2
+	StrCmp $R5 "Example5" 0 +2
+	StrCpy $TEXTCOMPARE3 "SlowEqual"
+
+	TextCompareSend2:
+	StrCpy $FUNCTION TextCompare
+	GetDlgItem $0 $HWND 1201
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$TEXTCOMPARE1"
+	GetDlgItem $0 $HWND 1203
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$TEXTCOMPARE2"
+	GetDlgItem $0 $HWND 1204
+	ShowWindow $0 1
+	GetDlgItem $0 $HWND 1205
+	ShowWindow $0 1
+	EnableWindow $0 0
+	SendMessage $0 ${WM_ENABLE} 1 0
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$TEXTCOMPARE3"
+	GetDlgItem $0 $HWND 1208
+	ShowWindow $0 1
+	GetDlgItem $0 $HWND 1211
+	ShowWindow $0 1
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:View"
+	GetDlgItem $0 $HWND 1212
+	ShowWindow $0 1
+	GetDlgItem $0 $HWND 1213
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:TextFile1"
+	GetDlgItem $0 $HWND 1214
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:TextFile2"
+	GetDlgItem $0 $HWND 1215
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:Option"
+	GetDlgItem $0 $HWND 1216
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:Function"
+	abort
+
+	ConfigReadSend:
+	StrCmp $R0 "7. ConfigRead" 0 ConfigWriteSend
+	StrCpy $FUNCTION ConfigRead
+	GetDlgItem $0 $HWND 1201
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$CONFIGREAD1"
+	GetDlgItem $0 $HWND 1203
+	ShowWindow $0 1
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$CONFIGREAD2"
+	GetDlgItem $0 $HWND 1204
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1205
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1211
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1212
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1213
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:InputFile"
+	GetDlgItem $0 $HWND 1214
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:Entry"
+	GetDlgItem $0 $HWND 1215
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $0 $HWND 1216
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:"
+	Abort
+
+	ConfigWriteSend:
+	StrCmp $R0 "8. ConfigWrite" 0 FileRecodeSend
+	StrCpy $FUNCTION ConfigWrite
+	GetDlgItem $0 $HWND 1201
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$CONFIGWRITE1"
+	GetDlgItem $0 $HWND 1203
+	ShowWindow $0 1
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$CONFIGWRITE2"
+	GetDlgItem $0 $HWND 1204
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1205
+	ShowWindow $0 1
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$CONFIGWRITE3"
+	GetDlgItem $0 $HWND 1211
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1212
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1213
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:InputFile"
+	GetDlgItem $0 $HWND 1214
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:Entry"
+	GetDlgItem $0 $HWND 1215
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:Value"
+	GetDlgItem $0 $HWND 1216
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:"
+	Abort
+
+	FileRecodeSend:
+	StrCmp $R0 "9. FileRecode" 0 Abort
+	StrCpy $FUNCTION FileRecode
+	GetDlgItem $0 $HWND 1201
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$FILERECODE1"
+	GetDlgItem $0 $HWND 1203
+	ShowWindow $0 1
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:$FILERECODE2"
+	GetDlgItem $0 $HWND 1204
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1205
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1211
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1212
+	ShowWindow $0 0
+	GetDlgItem $0 $HWND 1213
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:InputFile"
+	GetDlgItem $0 $HWND 1214
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:Format"
+	GetDlgItem $0 $HWND 1215
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $0 $HWND 1216
+	SendMessage $0 ${WM_SETTEXT} 1 "STR:"
+	Abort
+
+;=Enter=
+	Enter:
+	StrCmp $R1 '' 0 +3
+	StrCpy $0 'Choose InputFile'
+	goto send
+	IfFileExists $R1 +3
+	StrCpy $0 'InputFile is not exist'
+	goto send
+
+	StrCmp $R0 "1. LineFind" LineFindRead
+	StrCmp $R0 "2. LineRead" LineRead
+	StrCmp $R0 "3. FileReadFromEnd" FileReadFromEnd
+	StrCmp $R0 "4. LineSum" LineSum
+	StrCmp $R0 "5. FileJoin" FileJoin
+	StrCmp $R0 "6. TextCompare" LineFind-TextCompare
+	StrCmp $R0 "7. ConfigRead" ConfigRead
+	StrCmp $R0 "8. ConfigWrite" ConfigWrite
+	StrCmp $R0 "9. FileRecode" FileRecode
+	Abort
+
+	LineFindRead:
+	StrCmp $R4 "Example7" 0 LineFind-TextCompare
+	${LineFind} '$R1' '/NUL' '$R3' LineFindCallback
+	IfErrors error
+	StrCmp $R0 StopLineFind 0 done
+	StrCpy $0 'stopped'
+	goto send
+
+	LineFind-TextCompare:
+	GetLabelAddress $6 LineFindBack
+	goto Edit
+	LineFindBack:
+	FileClose $0
+	StrCmp $R0 "6. TextCompare" Compile
+	StrCmp $CALLBACK '' Compile
+	${FileJoin} "$PROJECT" "$CALLBACK" ""
+
+	Compile:
+	StrCmp $LOG '' 0 +4
+	GetTempFileName $LOG $PLUGINSDIR
+	GetDlgItem $0 $HWND 1212
+	EnableWindow $0 1
+	ReadRegStr $0 HKLM "SOFTWARE\NSIS" ""
+	IfErrors 0 +2
+	StrCpy $0 "${NSISDIR}"
+	nsExec::Exec '"$0\makensis.exe" /O$LOG $PROJECT'
+	Pop $0
+	StrCmp $0 0 0 +6
+	ExecWait '$PROJECT.exe' $0
+	Delete $PROJECT
+	Delete $PROJECT.exe
+	StrCpy $PROJECT ''
+	goto done
+	MessageBox MB_YESNO|MB_ICONEXCLAMATION "Compile error. Open log?" IDNO +2
+	Exec 'notepad.exe $LOG'
+	StrCpy $0 "Compile Error"
+	goto send
+
+	LineRead:
+	${LineRead} "$R1" "$R2" $0
+	IfErrors error send
+
+	FileReadFromEnd:
+	${FileReadFromEnd} "$R1" "FileReadFromEndCallback"
+	IfErrors error
+	StrCmp $R0 StopFileReadFromEnd 0 done
+	StrCpy $0 'stopped'
+	goto send
+
+	LineSum:
+	${LineSum} "$R1" $0
+	IfErrors error send
+
+	FileJoin:
+	${FileJoin} "$R1" "$R2" "$R3"
+	IfErrors error
+	MessageBox MB_YESNO "          Open output file?" IDNO done
+	StrCmp $R3 '' 0 +3
+	Exec '"notepad.exe" "$R1"'
+	goto done
+	Exec '"notepad.exe" "$R3"'
+	goto done
+
+	ConfigRead:
+	${ConfigRead} "$R1" "$R2" $0
+	IfErrors error send
+
+	ConfigWrite:
+	${ConfigWrite} "$R1" "$R2" "$R3" $0
+	IfErrors error
+	MessageBox MB_YESNO "          Open output file?" IDNO send
+	Exec '"notepad.exe" "$R1"'
+	goto send
+
+	FileRecode:
+	${FileRecode} "$R1" "$R2"
+	IfErrors error
+	MessageBox MB_YESNO "          Open output file?" IDNO done
+	Exec '"notepad.exe" "$R1"'
+	goto done
+
+	error:
+	StrCpy $0 'error'
+	goto send
+
+	done:
+	StrCpy $0 'Done'
+
+	send:
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$0"
+
+	abort:
+	Abort
+FunctionEnd
+
+Function LineFindCallback
+	MessageBox MB_OKCANCEL '$$R9       "Line"=[$R9]$\n$$R8           "#"=[$R8]$\n$$R7          "-#"=[$R7]$\n$$R6   "Range"=[$R6]$\n$$R5     "Read"=[$R5]$\n$$R4     "Write"=[$R4]' IDOK +2
+	StrCpy $R0 StopLineFind
+
+	Push $R0
+FunctionEnd
+
+Function FileReadFromEndCallback
+	MessageBox MB_OKCANCEL '$$9       "Line"=[$9]$\n$$8           "#"=[$8]$\n$$7          "-#"=[$7]' IDOK +2
+	StrCpy $R0 StopFileReadFromEnd
+
+	Push $R0
+FunctionEnd
+
+Function .onInit
+	InitPluginsDir
+	GetTempFileName $INI $PLUGINSDIR
+	File /oname=$INI "TextFunc.ini"
+FunctionEnd
+
+Page instfiles
+
+Section -Empty
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/TextFuncTest.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/TextFuncTest.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/TextFuncTest.nsi	(revision 728)
@@ -0,0 +1,414 @@
+;_____________________________________________________________________________
+;
+;                          Text Functions Test
+;_____________________________________________________________________________
+;
+; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
+
+Name "Text Functions Test"
+OutFile "TextFuncTest.exe"
+Caption "$(^Name)"
+ShowInstDetails show
+XPStyle on
+RequestExecutionLevel user
+
+Var FUNCTION
+Var TEMPFILE1
+Var TEMPFILE2
+Var TEMPFILE3
+Var HANDLE
+Var OUT
+
+!include "TextFunc.nsh"
+
+;############### INSTALL ###############
+
+!define StackVerificationStart `!insertmacro StackVerificationStart`
+!macro StackVerificationStart _FUNCTION
+	StrCpy $FUNCTION ${_FUNCTION}
+	Call StackVerificationStart
+!macroend
+
+!define StackVerificationEnd `!insertmacro StackVerificationEnd`
+!macro StackVerificationEnd
+	Call StackVerificationEnd
+!macroend
+
+Function StackVerificationStart
+	StrCpy $0 !0
+	StrCpy $1 !1
+	StrCpy $2 !2
+	StrCpy $3 !3
+	StrCpy $4 !4
+	StrCpy $5 !5
+	StrCpy $6 !6
+	StrCpy $7 !7
+	StrCpy $8 !8
+	StrCpy $9 !9
+	StrCpy $R0 !R0
+	StrCpy $R1 !R1
+	StrCpy $R2 !R2
+	StrCpy $R3 !R3
+	StrCpy $R4 !R4
+	StrCpy $R5 !R5
+	StrCpy $R6 !R6
+	StrCpy $R7 !R7
+	StrCpy $R8 !R8
+	StrCpy $R9 !R9
+FunctionEnd
+
+Function StackVerificationEnd
+	IfErrors +3
+	DetailPrint 'PASSED $FUNCTION no errors'
+	goto +2
+	DetailPrint 'FAILED   $FUNCTION error'
+
+	StrCmp $0 '!0' 0 error
+	StrCmp $1 '!1' 0 error
+	StrCmp $2 '!2' 0 error
+	StrCmp $3 '!3' 0 error
+	StrCmp $4 '!4' 0 error
+	StrCmp $5 '!5' 0 error
+	StrCmp $6 '!6' 0 error
+	StrCmp $7 '!7' 0 error
+	StrCmp $8 '!8' 0 error
+	StrCmp $9 '!9' 0 error
+	StrCmp $R0 '!R0' 0 error
+	StrCmp $R1 '!R1' 0 error
+	StrCmp $R2 '!R2' 0 error
+	StrCmp $R3 '!R3' 0 error
+	StrCmp $R4 '!R4' 0 error
+	StrCmp $R5 '!R5' 0 error
+	StrCmp $R6 '!R6' 0 error
+	StrCmp $R7 '!R7' 0 error
+	StrCmp $R8 '!R8' 0 error
+	StrCmp $R9 '!R9' 0 error
+	DetailPrint 'PASSED $FUNCTION stack'
+	goto end
+
+	error:
+	DetailPrint 'FAILED   $FUNCTION stack'
+;	MessageBox MB_OKCANCEL '$$0={$0}$\n$$1={$1}$\n$$2={$2}$\n$$3={$3}$\n$$4={$4}$\n$$5={$5}$\n$$6={$6}$\n$$7={$7}$\n$$8={$8}$\n$$9={$9}$\n$$R0={$R0}$\n$$R1={$R1}$\n$$R2={$R2}$\n$$R3={$R3}$\n$$R4={$R4}$\n$$R5={$R5}$\n$$R6={$R6}$\n$$R7={$R7}$\n$$R8={$R8}$\n$$R9={$R9}' IDOK +2
+;	quit
+
+	end:
+FunctionEnd
+
+
+
+Section CreateTestFile
+	GetTempFileName $TEMPFILE1
+	FileOpen $HANDLE $TEMPFILE1 w
+	FileWrite $HANDLE '1A=a$\r$\n'
+	FileWrite $HANDLE '2B=b$\r$\n'
+	FileWrite $HANDLE '3C=c$\r$\n'
+	FileWrite $HANDLE '4D=d$\r$\n'
+	FileWrite $HANDLE '5E=e$\r$\n'
+	FileClose $HANDLE
+	GetTempFileName $TEMPFILE2
+	GetTempFileName $TEMPFILE3
+SectionEnd
+
+
+Section LineFind
+	${StackVerificationStart} LineFind
+
+	${LineFind} '$TEMPFILE1' '/NUL' '1:-4 3 -1' 'LineFindCallback1'
+	IfErrors error
+	StrCmp $OUT '|1:2|-5|1|1A=a$\r$\n|1:2|-4|2|2B=b$\r$\n|3:3|-3|3|3C=c$\r$\n' 0 error
+
+	StrCpy $OUT ''
+	SetDetailsPrint none
+	${LineFind} '$TEMPFILE1' '$TEMPFILE2' '1:-1' 'LineFindCallback2'
+	SetDetailsPrint both
+	IfErrors error
+	StrCmp $OUT '|1:-1||1|1A=a$\r$\n|1:-1||2|4D=d$\r$\n|1:-1||3|3C=c$\r$\n|1:-1||4|2B=B$\r$\n|1:-1||5|5E=e$\r$\n' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+Function LineFindCallback1
+	StrCpy $OUT '$OUT|$R6|$R7|$R8|$R9'
+	StrCmp $R8 3 0 +2
+	StrCpy $0 StopLineFind
+
+	Push $0
+FunctionEnd
+
+Function LineFindCallback2
+	StrCmp $R8 2 0 +2
+	StrCpy $R9 '4D=d$\r$\n'
+	StrCmp $R8 4 0 +2
+	StrCpy $R9 '2B=B$\r$\n'
+
+	StrCpy $OUT '$OUT|$R6|$R7|$R8|$R9'
+
+	Push $0
+FunctionEnd
+
+
+Section LineRead
+	${StackVerificationStart} LineRead
+
+	${LineRead} '$TEMPFILE1' '-1' $OUT
+	IfErrors error
+	StrCmp $OUT '5E=e$\r$\n' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section FileReadFromEnd
+	${StackVerificationStart} FileReadFromEnd
+
+	StrCpy $OUT ''
+	${FileReadFromEnd} '$TEMPFILE1' 'FileReadFromEndCallback'
+	IfErrors error
+	StrCmp $OUT '|-1|5|5E=e$\r$\n|-2|4|4D=d$\r$\n|-3|3|3C=c$\r$\n|-4|2|2B=b$\r$\n' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+Function FileReadFromEndCallback
+	StrCpy $OUT '$OUT|$7|$8|$9'
+	StrCmp $8 2 0 +2
+	StrCpy $0 StopFileReadFromEnd
+
+	Push $0
+FunctionEnd
+
+
+Section LineSum
+	${StackVerificationStart} LineSum
+
+	${LineSum} '$TEMPFILE1' $OUT
+	IfErrors error
+	StrCmp $OUT '5' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section FileJoin
+	${StackVerificationStart} FileJoin
+
+	SetDetailsPrint none
+	${FileJoin} '$TEMPFILE1' '$TEMPFILE2' '$TEMPFILE3'
+	SetDetailsPrint both
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section TextCompare
+	${StackVerificationStart} TextCompare
+
+	StrCpy $OUT ''
+	${TextCompare} '$TEMPFILE1' '$TEMPFILE2' 'FastDiff' 'TextCompareCallback'
+	StrCmp $OUT '|2|4D=d$\r$\n|2|2B=b$\r$\n|4|2B=B$\r$\n|4|4D=d$\r$\n' 0 error
+
+	StrCpy $OUT ''
+	${TextCompare} '$TEMPFILE1' '$TEMPFILE2' 'FastEqual' 'TextCompareCallback'
+	StrCmp $OUT '|1|1A=a$\r$\n|1|1A=a$\r$\n|3|3C=c$\r$\n|3|3C=c$\r$\n|5|5E=e$\r$\n|5|5E=e$\r$\n' 0 error
+
+	StrCpy $OUT ''
+	${TextCompare} '$TEMPFILE1' '$TEMPFILE2' 'SlowDiff' 'TextCompareCallback'
+	StrCmp $OUT '' 0 error
+
+	StrCpy $OUT ''
+	${TextCompare} '$TEMPFILE1' '$TEMPFILE2' 'SlowEqual' 'TextCompareCallback'
+	StrCmp $OUT '|1|1A=a$\r$\n|1|1A=a$\r$\n|4|2B=B$\r$\n|2|2B=b$\r$\n|3|3C=c$\r$\n|3|3C=c$\r$\n|2|4D=d$\r$\n|4|4D=d$\r$\n|5|5E=e$\r$\n|5|5E=e$\r$\n' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+Section TextCompareS
+	${StackVerificationStart} TextCompareS
+
+	StrCpy $OUT ''
+	${TextCompareS} '$TEMPFILE1' '$TEMPFILE2' 'SlowDiff' 'TextCompareCallback'
+	StrCmp $OUT '|||2|2B=b$\r$\n' 0 error
+
+	StrCpy $OUT ''
+	${TextCompareS} '$TEMPFILE1' '$TEMPFILE2' 'SlowEqual' 'TextCompareCallback'
+	StrCmp $OUT '|1|1A=a$\r$\n|1|1A=a$\r$\n|3|3C=c$\r$\n|3|3C=c$\r$\n|2|4D=d$\r$\n|4|4D=d$\r$\n|5|5E=e$\r$\n|5|5E=e$\r$\n' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+Function TextCompareCallback
+	StrCpy $OUT '$OUT|$6|$7|$8|$9'
+
+	Push $0
+FunctionEnd
+
+
+Section ConfigRead
+	${StackVerificationStart} ConfigRead
+
+	${ConfigRead} '$TEMPFILE1' '3c=' $OUT
+	StrCmp $OUT 'c' 0 error
+
+	${ConfigRead} '$TEMPFILE1' '6F=' $OUT
+	StrCmp $OUT '' 0 error
+
+	${ConfigRead} '$TEMPFILE1' 'FF=' $OUT
+	IfErrors 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section ConfigReadS
+	${StackVerificationStart} ConfigReadS
+
+	${ConfigReadS} '$TEMPFILE1' '3C=' $OUT
+	StrCmp $OUT 'c' 0 error
+
+	${ConfigReadS} '$TEMPFILE1' '3c=' $OUT
+	IfErrors 0 error
+	StrCmp $OUT '' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section ConfigWrite
+	${StackVerificationStart} ConfigWrite
+
+	${ConfigWrite} '$TEMPFILE1' '5E=' 'e**' $OUT
+	StrCmp $OUT 'CHANGED' 0 error
+
+	${ConfigWrite} '$TEMPFILE1' '2B=' '' $OUT
+	StrCmp $OUT 'DELETED' 0 error
+
+	${ConfigWrite} '$TEMPFILE1' '3c=' 'c' $OUT
+	StrCmp $OUT 'SAME' 0 error
+
+	${ConfigWrite} '$TEMPFILE1' '6F=' '*' $OUT
+	StrCmp $OUT 'ADDED' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section ConfigWriteS
+	${StackVerificationStart} ConfigWriteS
+
+	${ConfigWriteS} '$TEMPFILE1' '5e=' 'e**' $OUT
+	StrCmp $OUT 'ADDED' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section FileRecode
+	${StackVerificationStart} FileRecode
+
+	${FileRecode} '$TEMPFILE1' 'CharToOem'
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section TrimNewLines
+	${StackVerificationStart} TrimNewLines
+
+	${TrimNewLines} 'Text Line$\r$\n' $OUT
+	StrCmp $OUT 'Text Line' 0 error
+
+	${TrimNewLines} 'Text Line' $OUT
+	StrCmp $OUT 'Text Line' 0 error
+
+	${TrimNewLines} 'Text Line$\n' $OUT
+	StrCmp $OUT 'Text Line' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section WriteUninstaller
+	SetDetailsPrint none
+	Delete $TEMPFILE1
+	Delete $TEMPFILE2
+	Delete $TEMPFILE3
+	SetDetailsPrint both
+	goto +2
+	WriteUninstaller '$EXEDIR\un.TextFuncTest.exe'
+SectionEnd
+
+
+
+;############### UNINSTALL ###############
+
+Section un.Uninstall
+	${LineFind} '$TEMPFILE1' '/NUL' '1:-1' 'un.LineFindCallback'
+	${LineRead} '$TEMPFILE1' '-1' $OUT
+	${FileReadFromEnd} '$TEMPFILE1' 'un.FileReadFromEndCallback'
+	${LineSum} '$TEMPFILE1' $OUT
+	${FileJoin} '$TEMPFILE1' '$TEMPFILE2' '$TEMPFILE3'
+	${TextCompare} '$TEMPFILE1' '$TEMPFILE2' 'FastDiff' 'un.TextCompareCallback'
+	${TextCompareS} '$TEMPFILE1' '$TEMPFILE2' 'FastDiff' 'un.TextCompareCallback'
+	${ConfigRead} '$TEMPFILE1' '3c=' $OUT
+	${ConfigReadS} '$TEMPFILE1' '3c=' $OUT
+	${ConfigWrite} '$TEMPFILE1' '5E=' 'e**' $OUT
+	${ConfigWriteS} '$TEMPFILE1' '5E=' 'e**' $OUT
+	${FileRecode} '$TEMPFILE1' 'CharToOem'
+	${TrimNewLines} 'Text Line$\r$\n' $OUT
+SectionEnd
+
+Function un.LineFindCallback
+	Push $0
+FunctionEnd
+
+Function un.FileReadFromEndCallback
+	Push $0
+FunctionEnd
+
+Function un.TextCompareCallback
+	Push $0
+FunctionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/VersionInfo.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/VersionInfo.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/VersionInfo.nsi	(revision 728)
@@ -0,0 +1,29 @@
+; VersionInfo.nsi
+;
+; This script shows you how to add version information to an installer.
+; Windows shows this information on the Version tab of the File properties.
+
+;--------------------------------
+
+Name "Version Info"
+
+OutFile "VersionInfo.exe"
+
+LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
+;--------------------------------
+;Version Information
+
+  VIProductVersion "1.2.3.4"
+  VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Test Application"
+  VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "A test comment"
+  VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Fake company"
+  VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Test Application is a trademark of Fake company"
+  VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright Fake company"
+  VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Test Application"
+  VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "1.2.3"
+
+;--------------------------------
+
+Section ""
+
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/bigtest.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/bigtest.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/bigtest.nsi	(revision 728)
@@ -0,0 +1,308 @@
+; bigtest.nsi
+;
+; This script attempts to test most of the functionality of the NSIS exehead.
+
+;--------------------------------
+
+!ifdef HAVE_UPX
+!packhdr tmp.dat "upx\upx -9 tmp.dat"
+!endif
+
+!ifdef NOCOMPRESS
+SetCompress off
+!endif
+
+;--------------------------------
+
+Name "BigNSISTest"
+Caption "NSIS Big Test"
+Icon "${NSISDIR}\Contrib\Graphics\Icons\nsis1-install.ico"
+OutFile "bigtest.exe"
+
+SetDateSave on
+SetDatablockOptimize on
+CRCCheck on
+SilentInstall normal
+BGGradient 000000 800000 FFFFFF
+InstallColors FF8080 000030
+XPStyle on
+
+InstallDir "$PROGRAMFILES\NSISTest\BigNSISTest"
+InstallDirRegKey HKLM "Software\NSISTest\BigNSISTest" "Install_Dir"
+
+CheckBitmap "${NSISDIR}\Contrib\Graphics\Checks\classic-cross.bmp"
+
+LicenseText "A test text, make sure it's all there"
+LicenseData "bigtest.nsi"
+
+RequestExecutionLevel admin
+
+;--------------------------------
+
+Page license
+Page components
+Page directory
+Page instfiles
+
+UninstPage uninstConfirm
+UninstPage instfiles
+
+;--------------------------------
+
+!ifndef NOINSTTYPES ; only if not defined
+  InstType "Most"
+  InstType "Full"
+  InstType "More"
+  InstType "Base"
+  ;InstType /NOCUSTOM
+  ;InstType /COMPONENTSONLYONCUSTOM
+!endif
+
+AutoCloseWindow false
+ShowInstDetails show
+
+;--------------------------------
+
+Section "" ; empty string makes it hidden, so would starting with -
+
+  ; write reg info
+  StrCpy $1 "POOOOOOOOOOOP"
+  DetailPrint "I like to be able to see what is going on (debug) $1"
+  WriteRegStr HKLM SOFTWARE\NSISTest\BigNSISTest "Install_Dir" "$INSTDIR"
+
+  ; write uninstall strings
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BigNSISTest" "DisplayName" "BigNSISTest (remove only)"
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BigNSISTest" "UninstallString" '"$INSTDIR\bt-uninst.exe"'
+
+  SetOutPath $INSTDIR
+  File /a "silent.nsi"
+  CreateDirectory "$INSTDIR\MyProjectFamily\MyProject" ; 2 recursively create a directory for fun.
+  WriteUninstaller "bt-uninst.exe"
+  
+  Nop ; for fun
+
+SectionEnd
+
+Section "TempTest"
+
+SectionIn 1 2 3
+  Start: MessageBox MB_OK "Start:"
+
+  MessageBox MB_YESNO "Goto MyLabel" IDYES MyLabel
+
+  MessageBox MB_OK "Right before MyLabel:"
+
+  MyLabel: MessageBox MB_OK "MyLabel:"
+  
+  MessageBox MB_OK "Right after MyLabel:"
+
+  MessageBox MB_YESNO "Goto Start:?" IDYES Start
+
+SectionEnd
+
+SectionGroup /e SectionGroup1
+
+Section "Test Registry/INI functions"
+
+SectionIn 1 4 3
+
+  WriteRegStr HKLM SOFTWARE\NSISTest\BigNSISTest "StrTest_INSTDIR" "$INSTDIR"
+  WriteRegDword HKLM SOFTWARE\NSISTest\BigNSISTest "DwordTest_0xDEADBEEF" 0xdeadbeef
+  WriteRegDword HKLM SOFTWARE\NSISTest\BigNSISTest "DwordTest_123456" 123456
+  WriteRegDword HKLM SOFTWARE\NSISTest\BigNSISTest "DwordTest_0123" 0123
+  WriteRegBin HKLM SOFTWARE\NSISTest\BigNSISTest "BinTest_deadbeef01f00dbeef" "DEADBEEF01F00DBEEF"
+  StrCpy $8 "$SYSDIR\IniTest"
+  WriteINIStr "$INSTDIR\test.ini"  "MySection" "Value1" $8
+  WriteINIStr "$INSTDIR\test.ini"  "MySectionIni" "Value1" $8
+  WriteINIStr "$INSTDIR\test.ini"  "MySectionIni" "Value2" $8
+  WriteINIStr "$INSTDIR\test.ini"  "IniOn" "Value1" $8
+
+  Call MyFunctionTest
+
+  DeleteINIStr "$INSTDIR\test.ini" "IniOn" "Value1"
+  DeleteINISec "$INSTDIR\test.ini" "MySectionIni"
+
+  ReadINIStr $1 "$INSTDIR\test.ini" "MySectionIni" "Value1"
+  StrCmp $1 "" INIDelSuccess
+    MessageBox MB_OK "DeleteINISec failed"
+  INIDelSuccess:
+
+  ClearErrors
+  ReadRegStr $1 HKCR "software\microsoft" xyz_cc_does_not_exist
+  IfErrors 0 NoError
+    MessageBox MB_OK "could not read from HKCR\software\microsoft\xyz_cc_does_not_exist"
+    Goto ErrorYay
+  NoError:
+    MessageBox MB_OK "read '$1' from HKCR\software\microsoft\xyz_cc_does_not_exist"
+  ErrorYay:
+  
+SectionEnd
+
+Section "Test CreateShortCut"
+
+  SectionIn 1 2 3
+
+  Call CSCTest
+
+SectionEnd
+
+SectionGroup Group2
+
+Section "Test Branching" 
+  
+  BeginTestSection:
+  SectionIn 1 2 3
+ 
+  SetOutPath $INSTDIR
+
+  IfFileExists "$INSTDIR\LogicLib.nsi" 0 BranchTest69
+    
+    MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to overwrite $INSTDIR\LogicLib.nsi?" IDNO NoOverwrite ; skipped if file doesn't exist
+
+    BranchTest69:
+  
+    SetOverwrite ifnewer ; NOT AN INSTRUCTION, NOT COUNTED IN SKIPPINGS
+
+  NoOverwrite:
+
+  File "LogicLib.nsi" ; skipped if answered no
+  SetOverwrite try ; NOT AN INSTRUCTION, NOT COUNTED IN SKIPPINGS
+
+  MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to skip the rest of this section?" IDYES EndTestBranch
+  MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to go back to the beginning of this section?" IDYES BeginTestSection
+  MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to hide the installer and wait five seconds?" IDNO NoHide
+
+    HideWindow
+    Sleep 5000
+    BringToFront
+
+  NoHide:
+
+  MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to call the function 5 times?" IDNO NoRecurse
+
+    StrCpy $1 "x"
+
+  LoopTest: 
+      
+    Call myfunc
+    StrCpy $1 "x$1"
+    StrCmp $1 "xxxxxx" 0 LoopTest
+      
+  NoRecurse:
+
+  EndTestBranch:
+
+SectionEnd
+
+SectionGroupEnd
+
+Section "Test CopyFiles"
+
+  SectionIn 1 2 3
+
+  SetOutPath $INSTDIR\cpdest
+  CopyFiles "$WINDIR\*.ini" "$INSTDIR\cpdest" 0
+
+SectionEnd
+
+SectionGroupEnd
+
+Section "Test Exec functions" TESTIDX
+
+  SectionIn 1 2 3
+  
+  SearchPath $1 notepad.exe
+
+  MessageBox MB_OK "notepad.exe=$1"
+  Exec '"$1"'
+  ExecShell "open" '"$INSTDIR"'
+  Sleep 500
+  BringToFront
+
+SectionEnd
+
+Section "Test ActiveX control registration"
+
+  SectionIn 2
+
+  UnRegDLL "$SYSDIR\spin32.ocx"
+  Sleep 1000
+  RegDLL "$SYSDIR\spin32.ocx"
+  Sleep 1000
+  
+SectionEnd
+
+;--------------------------------
+
+Function "CSCTest"
+  
+  CreateDirectory "$SMPROGRAMS\Big NSIS Test"
+  SetOutPath $INSTDIR ; for working directory
+  CreateShortCut "$SMPROGRAMS\Big NSIS Test\Uninstall BIG NSIS Test.lnk" "$INSTDIR\bt-uninst.exe" ; use defaults for parameters, icon, etc.
+  ; this one will use notepad's icon, start it minimized, and give it a hotkey (of Ctrl+Shift+Q)
+  CreateShortCut "$SMPROGRAMS\Big NSIS Test\silent.nsi.lnk" "$INSTDIR\silent.nsi" "" "$WINDIR\notepad.exe" 0 SW_SHOWMINIMIZED CONTROL|SHIFT|Q
+  CreateShortCut "$SMPROGRAMS\Big NSIS Test\TheDir.lnk" "$INSTDIR\" "" "" 0 SW_SHOWMAXIMIZED CONTROL|SHIFT|Z
+
+FunctionEnd
+
+Function myfunc
+
+  StrCpy $2 "MyTestVar=$1"
+  MessageBox MB_OK "myfunc: $2"
+
+FunctionEnd
+
+Function MyFunctionTest
+
+  ReadINIStr $1 "$INSTDIR\test.ini" "MySectionIni" "Value1"
+  StrCmp $1 $8 NoFailedMsg
+    MessageBox MB_OK "WriteINIStr failed"
+  
+  NoFailedMsg:
+
+FunctionEnd
+
+Function .onSelChange
+
+  SectionGetText ${TESTIDX} $0
+  StrCmp $0 "" e
+    SectionSetText ${TESTIDX} ""
+  Goto e2
+e:
+  SectionSetText ${TESTIDX} "TextInSection"
+e2:
+
+FunctionEnd
+
+;--------------------------------
+
+; Uninstaller
+
+UninstallText "This will uninstall example2. Hit next to continue."
+UninstallIcon "${NSISDIR}\Contrib\Graphics\Icons\nsis1-uninstall.ico"
+
+Section "Uninstall"
+
+  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BigNSISTest"
+  DeleteRegKey HKLM "SOFTWARE\NSISTest\BigNSISTest"
+  Delete "$INSTDIR\silent.nsi"
+  Delete "$INSTDIR\LogicLib.nsi"
+  Delete "$INSTDIR\bt-uninst.exe"
+  Delete "$INSTDIR\test.ini"
+  Delete "$SMPROGRAMS\Big NSIS Test\*.*"
+  RMDir "$SMPROGRAMS\BiG NSIS Test"
+  
+  MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to remove the directory $INSTDIR\cpdest?" IDNO NoDelete
+    Delete "$INSTDIR\cpdest\*.*"
+    RMDir "$INSTDIR\cpdest" ; skipped if no
+  NoDelete:
+  
+  RMDir "$INSTDIR\MyProjectFamily\MyProject"
+  RMDir "$INSTDIR\MyProjectFamily"
+  RMDir "$INSTDIR"
+
+  IfFileExists "$INSTDIR" 0 NoErrorMsg
+    MessageBox MB_OK "Note: $INSTDIR could not be removed!" IDOK 0 ; skipped if file doesn't exist
+  NoErrorMsg:
+
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/UserInfo/UserInfo.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/UserInfo/UserInfo.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/UserInfo/UserInfo.nsi	(revision 728)
@@ -0,0 +1,44 @@
+Name "UserInfo.dll test"
+OutFile UserInfo.exe
+
+!define REALMSG "$\nOriginal non-restricted account type: $2"
+
+Section
+	ClearErrors
+	UserInfo::GetName
+	IfErrors Win9x
+	Pop $0
+	UserInfo::GetAccountType
+	Pop $1
+	# GetOriginalAccountType will check the tokens of the original user of the
+	# current thread/process. If the user tokens were elevated or limited for
+	# this process, GetOriginalAccountType will return the non-restricted
+	# account type.
+	# On Vista with UAC, for example, this is not the same value when running
+	# with `RequestExecutionLevel user`. GetOriginalAccountType will return
+	# "admin" while GetAccountType will return "user".
+	UserInfo::GetOriginalAccountType
+	Pop $2
+	StrCmp $1 "Admin" 0 +3
+		MessageBox MB_OK 'User "$0" is in the Administrators group${REALMSG}'
+		Goto done
+	StrCmp $1 "Power" 0 +3
+		MessageBox MB_OK 'User "$0" is in the Power Users group${REALMSG}'
+		Goto done
+	StrCmp $1 "User" 0 +3
+		MessageBox MB_OK 'User "$0" is just a regular user${REALMSG}'
+		Goto done
+	StrCmp $1 "Guest" 0 +3
+		MessageBox MB_OK 'User "$0" is a guest${REALMSG}'
+		Goto done
+	MessageBox MB_OK "Unknown error"
+	Goto done
+
+	Win9x:
+		# This one means you don't need to care about admin or
+		# not admin because Windows 9x doesn't either
+		MessageBox MB_OK "Error! This DLL can't run under Windows 9x!"
+
+	done:
+SectionEnd
+
Index: tmp/trunk/org.txm.setups/nsis/Examples/Library.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Library.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Library.nsi	(revision 728)
@@ -0,0 +1,129 @@
+# This example tests the compile time aspect of the Library macros
+# more than the runtime aspect. It is more of a syntax example,
+# rather than a usage example.
+
+!include "Library.nsh"
+
+Name "Library Test"
+OutFile "Library Test.exe"
+
+InstallDir "$TEMP\Library Test"
+
+Page directory
+Page instfiles
+
+XPStyle on
+
+RequestExecutionLevel user
+
+!define TestDLL '"${NSISDIR}\Plugins\LangDLL.dll"'
+!define TestEXE '"${NSISDIR}\Contrib\UIs\default.exe"'
+
+Section
+
+!insertmacro InstallLib DLL       NOTSHARED REBOOT_PROTECTED      ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib DLL       NOTSHARED NOREBOOT_PROTECTED    ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib DLL       NOTSHARED REBOOT_NOTPROTECTED   ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib DLL       NOTSHARED NOREBOOT_NOTPROTECTED ${TestDLL} $INSTDIR\test.dll $INSTDIR
+
+!insertmacro InstallLib REGDLL    NOTSHARED REBOOT_PROTECTED      ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib REGDLL    NOTSHARED NOREBOOT_PROTECTED    ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib REGDLL    NOTSHARED REBOOT_NOTPROTECTED   ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib REGDLL    NOTSHARED NOREBOOT_NOTPROTECTED ${TestDLL} $INSTDIR\test.dll $INSTDIR
+
+!insertmacro InstallLib TLB       NOTSHARED REBOOT_PROTECTED      ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib TLB       NOTSHARED NOREBOOT_PROTECTED    ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib TLB       NOTSHARED REBOOT_NOTPROTECTED   ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib TLB       NOTSHARED NOREBOOT_NOTPROTECTED ${TestDLL} $INSTDIR\test.dll $INSTDIR
+
+!insertmacro InstallLib REGDLLTLB NOTSHARED REBOOT_PROTECTED      ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib REGDLLTLB NOTSHARED NOREBOOT_PROTECTED    ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib REGDLLTLB NOTSHARED REBOOT_NOTPROTECTED   ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib REGDLLTLB NOTSHARED NOREBOOT_NOTPROTECTED ${TestDLL} $INSTDIR\test.dll $INSTDIR
+
+!insertmacro InstallLib DLL       $0        REBOOT_PROTECTED      ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib DLL       $0        NOREBOOT_PROTECTED    ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib DLL       $0        REBOOT_NOTPROTECTED   ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib DLL       $0        NOREBOOT_NOTPROTECTED ${TestDLL} $INSTDIR\test.dll $INSTDIR
+
+!insertmacro InstallLib REGDLL    $0        REBOOT_PROTECTED      ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib REGDLL    $0        NOREBOOT_PROTECTED    ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib REGDLL    $0        REBOOT_NOTPROTECTED   ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib REGDLL    $0        NOREBOOT_NOTPROTECTED ${TestDLL} $INSTDIR\test.dll $INSTDIR
+
+!insertmacro InstallLib TLB       $0        REBOOT_PROTECTED      ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib TLB       $0        NOREBOOT_PROTECTED    ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib TLB       $0        REBOOT_NOTPROTECTED   ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib TLB       $0        NOREBOOT_NOTPROTECTED ${TestDLL} $INSTDIR\test.dll $INSTDIR
+
+!insertmacro InstallLib REGDLLTLB $0        REBOOT_PROTECTED      ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib REGDLLTLB $0        NOREBOOT_PROTECTED    ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib REGDLLTLB $0        REBOOT_NOTPROTECTED   ${TestDLL} $INSTDIR\test.dll $INSTDIR
+!insertmacro InstallLib REGDLLTLB $0        NOREBOOT_NOTPROTECTED ${TestDLL} $INSTDIR\test.dll $INSTDIR
+
+!insertmacro InstallLib REGEXE    $0        REBOOT_PROTECTED      ${TestEXE} $INSTDIR\test.exe $INSTDIR
+!insertmacro InstallLib REGEXE    $0        NOREBOOT_PROTECTED    ${TestEXE} $INSTDIR\test.exe $INSTDIR
+!insertmacro InstallLib REGEXE    $0        REBOOT_NOTPROTECTED   ${TestEXE} $INSTDIR\test.exe $INSTDIR
+!insertmacro InstallLib REGEXE    $0        NOREBOOT_NOTPROTECTED ${TestEXE} $INSTDIR\test.exe $INSTDIR
+
+WriteUninstaller $INSTDIR\uninstall.exe
+
+SectionEnd
+
+Section uninstall
+
+!insertmacro UninstallLib DLL       NOTSHARED NOREMOVE               $INSTDIR\test.dll
+!insertmacro UninstallLib DLL       NOTSHARED REBOOT_PROTECTED       $INSTDIR\test.dll
+!insertmacro UninstallLib DLL       NOTSHARED NOREBOOT_PROTECTED     $INSTDIR\test.dll
+!insertmacro UninstallLib DLL       NOTSHARED REBOOT_NOTPROTECTED    $INSTDIR\test.dll
+!insertmacro UninstallLib DLL       NOTSHARED NOREBOOT_NOTPROTECTED  $INSTDIR\test.dll
+
+!insertmacro UninstallLib REGDLL    NOTSHARED NOREMOVE               $INSTDIR\test.dll
+!insertmacro UninstallLib REGDLL    NOTSHARED REBOOT_PROTECTED       $INSTDIR\test.dll
+!insertmacro UninstallLib REGDLL    NOTSHARED NOREBOOT_PROTECTED     $INSTDIR\test.dll
+!insertmacro UninstallLib REGDLL    NOTSHARED REBOOT_NOTPROTECTED    $INSTDIR\test.dll
+!insertmacro UninstallLib REGDLL    NOTSHARED NOREBOOT_NOTPROTECTED  $INSTDIR\test.dll
+
+!insertmacro UninstallLib TLB       NOTSHARED NOREMOVE               $INSTDIR\test.dll
+!insertmacro UninstallLib TLB       NOTSHARED REBOOT_PROTECTED       $INSTDIR\test.dll
+!insertmacro UninstallLib TLB       NOTSHARED NOREBOOT_PROTECTED     $INSTDIR\test.dll
+!insertmacro UninstallLib TLB       NOTSHARED REBOOT_NOTPROTECTED    $INSTDIR\test.dll
+!insertmacro UninstallLib TLB       NOTSHARED NOREBOOT_NOTPROTECTED  $INSTDIR\test.dll
+
+!insertmacro UninstallLib REGDLLTLB NOTSHARED NOREMOVE               $INSTDIR\test.dll
+!insertmacro UninstallLib REGDLLTLB NOTSHARED REBOOT_PROTECTED       $INSTDIR\test.dll
+!insertmacro UninstallLib REGDLLTLB NOTSHARED NOREBOOT_PROTECTED     $INSTDIR\test.dll
+!insertmacro UninstallLib REGDLLTLB NOTSHARED REBOOT_NOTPROTECTED    $INSTDIR\test.dll
+!insertmacro UninstallLib REGDLLTLB NOTSHARED NOREBOOT_NOTPROTECTED  $INSTDIR\test.dll
+
+!insertmacro UninstallLib DLL       SHARED    NOREMOVE               $INSTDIR\test.dll
+!insertmacro UninstallLib DLL       SHARED    REBOOT_PROTECTED       $INSTDIR\test.dll
+!insertmacro UninstallLib DLL       SHARED    NOREBOOT_PROTECTED     $INSTDIR\test.dll
+!insertmacro UninstallLib DLL       SHARED    REBOOT_NOTPROTECTED    $INSTDIR\test.dll
+!insertmacro UninstallLib DLL       SHARED    NOREBOOT_NOTPROTECTED  $INSTDIR\test.dll
+
+!insertmacro UninstallLib REGDLL    SHARED    NOREMOVE               $INSTDIR\test.dll
+!insertmacro UninstallLib REGDLL    SHARED    REBOOT_PROTECTED       $INSTDIR\test.dll
+!insertmacro UninstallLib REGDLL    SHARED    NOREBOOT_PROTECTED     $INSTDIR\test.dll
+!insertmacro UninstallLib REGDLL    SHARED    REBOOT_NOTPROTECTED    $INSTDIR\test.dll
+!insertmacro UninstallLib REGDLL    SHARED    NOREBOOT_NOTPROTECTED  $INSTDIR\test.dll
+
+!insertmacro UninstallLib TLB       SHARED    NOREMOVE               $INSTDIR\test.dll
+!insertmacro UninstallLib TLB       SHARED    REBOOT_PROTECTED       $INSTDIR\test.dll
+!insertmacro UninstallLib TLB       SHARED    NOREBOOT_PROTECTED     $INSTDIR\test.dll
+!insertmacro UninstallLib TLB       SHARED    REBOOT_NOTPROTECTED    $INSTDIR\test.dll
+!insertmacro UninstallLib TLB       SHARED    NOREBOOT_NOTPROTECTED  $INSTDIR\test.dll
+
+!insertmacro UninstallLib REGDLLTLB SHARED    NOREMOVE               $INSTDIR\test.dll
+!insertmacro UninstallLib REGDLLTLB SHARED    REBOOT_PROTECTED       $INSTDIR\test.dll
+!insertmacro UninstallLib REGDLLTLB SHARED    NOREBOOT_PROTECTED     $INSTDIR\test.dll
+!insertmacro UninstallLib REGDLLTLB SHARED    REBOOT_NOTPROTECTED    $INSTDIR\test.dll
+!insertmacro UninstallLib REGDLLTLB SHARED    NOREBOOT_NOTPROTECTED  $INSTDIR\test.dll
+
+!insertmacro UninstallLib REGEXE    SHARED    NOREMOVE               $INSTDIR\test.exe
+!insertmacro UninstallLib REGEXE    SHARED    REBOOT_PROTECTED       $INSTDIR\test.exe
+!insertmacro UninstallLib REGEXE    SHARED    NOREBOOT_PROTECTED     $INSTDIR\test.exe
+!insertmacro UninstallLib REGEXE    SHARED    REBOOT_NOTPROTECTED    $INSTDIR\test.exe
+!insertmacro UninstallLib REGEXE    SHARED    NOREBOOT_NOTPROTECTED  $INSTDIR\test.exe
+
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/languages.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/languages.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/languages.nsi	(revision 728)
@@ -0,0 +1,179 @@
+; languages.nsi
+;
+; This is an example of a multilingual installer
+; The user can select the language on startup
+
+;--------------------------------
+
+OutFile languages.exe
+
+XPStyle on
+
+RequestExecutionLevel user
+
+;--------------------------------
+
+Page license
+Page components
+Page instfiles
+
+;--------------------------------
+
+; First is default
+LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
+LoadLanguageFile "${NSISDIR}\Contrib\Language files\Dutch.nlf"
+LoadLanguageFile "${NSISDIR}\Contrib\Language files\French.nlf"
+LoadLanguageFile "${NSISDIR}\Contrib\Language files\German.nlf"
+LoadLanguageFile "${NSISDIR}\Contrib\Language files\Korean.nlf"
+LoadLanguageFile "${NSISDIR}\Contrib\Language files\Russian.nlf"
+LoadLanguageFile "${NSISDIR}\Contrib\Language files\Spanish.nlf"
+LoadLanguageFile "${NSISDIR}\Contrib\Language files\Swedish.nlf"
+LoadLanguageFile "${NSISDIR}\Contrib\Language files\TradChinese.nlf"
+LoadLanguageFile "${NSISDIR}\Contrib\Language files\SimpChinese.nlf"
+LoadLanguageFile "${NSISDIR}\Contrib\Language files\Slovak.nlf"
+
+; License data
+; Not exactly translated, but it shows what's needed
+LicenseLangString myLicenseData ${LANG_ENGLISH} "bigtest.nsi"
+LicenseLangString myLicenseData ${LANG_DUTCH} "waplugin.nsi"
+LicenseLangString myLicenseData ${LANG_FRENCH} "example1.nsi"
+LicenseLangString myLicenseData ${LANG_GERMAN} "example2.nsi"
+LicenseLangString myLicenseData ${LANG_KOREAN} "gfx.nsi"
+LicenseLangString myLicenseData ${LANG_RUSSIAN} "languages.nsi"
+LicenseLangString myLicenseData ${LANG_SPANISH} "LogicLib.nsi"
+LicenseLangString myLicenseData ${LANG_SWEDISH} "makensis.nsi"
+LicenseLangString myLicenseData ${LANG_TRADCHINESE} "one-section.nsi"
+LicenseLangString myLicenseData ${LANG_SIMPCHINESE} "primes.nsi"
+LicenseLangString myLicenseData ${LANG_SLOVAK} "silent.nsi"
+
+LicenseData $(myLicenseData)
+
+; Set name using the normal interface (Name command)
+LangString Name ${LANG_ENGLISH} "English"
+LangString Name ${LANG_DUTCH} "Dutch"
+LangString Name ${LANG_FRENCH} "French"
+LangString Name ${LANG_GERMAN} "German"
+LangString Name ${LANG_KOREAN} "Korean"
+LangString Name ${LANG_RUSSIAN} "Russian"
+LangString Name ${LANG_SPANISH} "Spanish"
+LangString Name ${LANG_SWEDISH} "Swedish"
+LangString Name ${LANG_TRADCHINESE} "Traditional Chinese"
+LangString Name ${LANG_SIMPCHINESE} "Simplified Chinese"
+LangString Name ${LANG_SLOVAK} "Slovak"
+
+Name $(Name)
+
+; Directly change the inner lang strings (Same as ComponentText)
+LangString ^ComponentsText ${LANG_ENGLISH} "English component page"
+LangString ^ComponentsText ${LANG_DUTCH} "Dutch component page"
+LangString ^ComponentsText ${LANG_FRENCH} "French component page"
+LangString ^ComponentsText ${LANG_GERMAN} "German component page"
+LangString ^ComponentsText ${LANG_KOREAN} "Korean component page"
+LangString ^ComponentsText ${LANG_RUSSIAN} "Russian component page"
+LangString ^ComponentsText ${LANG_SPANISH} "Spanish component page"
+LangString ^ComponentsText ${LANG_SWEDISH} "Swedish component page"
+LangString ^ComponentsText ${LANG_TRADCHINESE} "Traditional Chinese component page"
+LangString ^ComponentsText ${LANG_SIMPCHINESE} "Simplified Chinese component page"
+LangString ^ComponentsText ${LANG_SLOVAK} "Slovak component page"
+
+; Set one text for all languages (simply don't use a LangString)
+CompletedText "Languages example completed"
+
+; A LangString for the section name
+LangString Sec1Name ${LANG_ENGLISH} "English section #1"
+LangString Sec1Name ${LANG_DUTCH} "Dutch section #1"
+LangString Sec1Name ${LANG_FRENCH} "French section #1"
+LangString Sec1Name ${LANG_GERMAN} "German section #1"
+LangString Sec1Name ${LANG_KOREAN} "Korean section #1"
+LangString Sec1Name ${LANG_RUSSIAN} "Russian section #1"
+LangString Sec1Name ${LANG_SPANISH} "Spanish section #1"
+LangString Sec1Name ${LANG_SWEDISH} "Swedish section #1"
+LangString Sec1Name ${LANG_TRADCHINESE} "Trandional Chinese section #1"
+LangString Sec1Name ${LANG_SIMPCHINESE} "Simplified Chinese section #1"
+LangString Sec1Name ${LANG_SLOVAK} "Slovak section #1"
+
+; A multilingual message
+LangString Message ${LANG_ENGLISH} "English message"
+LangString Message ${LANG_DUTCH} "Dutch message"
+LangString Message ${LANG_FRENCH} "French message"
+LangString Message ${LANG_GERMAN} "German message"
+LangString Message ${LANG_KOREAN} "Korean message"
+LangString Message ${LANG_RUSSIAN} "Russian message"
+LangString Message ${LANG_SPANISH} "Spanish message"
+LangString Message ${LANG_SWEDISH} "Swedish message"
+LangString Message ${LANG_TRADCHINESE} "Trandional Chinese message"
+LangString Message ${LANG_SIMPCHINESE} "Simplified Chinese message"
+LangString Message ${LANG_SLOVAK} "Slovak message"
+
+;--------------------------------
+
+;Section names set by Language strings
+;It works with ! too
+Section !$(Sec1Name) sec1
+	MessageBox MB_OK $(Message)
+SectionEnd
+
+; The old, slow, wasteful way
+; Look at this section and see why LangString is so much easier
+Section "Section number two"
+	StrCmp $LANGUAGE ${LANG_ENGLISH} 0 +2
+		MessageBox MB_OK "Installing English stuff"
+	StrCmp $LANGUAGE ${LANG_DUTCH} 0 +2
+		MessageBox MB_OK "Installing Dutch stuff"
+	StrCmp $LANGUAGE ${LANG_FRENCH} 0 +2
+		MessageBox MB_OK "Installing French stuff"
+	StrCmp $LANGUAGE ${LANG_GERMAN} 0 +2
+		MessageBox MB_OK "Installing German stuff"
+	StrCmp $LANGUAGE ${LANG_KOREAN} 0 +2
+		MessageBox MB_OK "Installing Korean stuff"
+	StrCmp $LANGUAGE ${LANG_RUSSIAN} 0 +2
+		MessageBox MB_OK "Installing Russian stuff"
+	StrCmp $LANGUAGE ${LANG_SPANISH} 0 +2
+		MessageBox MB_OK "Installing Spanish stuff"
+	StrCmp $LANGUAGE ${LANG_SWEDISH} 0 +2
+		MessageBox MB_OK "Installing Swedish stuff"
+	StrCmp $LANGUAGE ${LANG_TRADCHINESE} 0 +2
+		MessageBox MB_OK "Installing Traditional Chinese stuff"
+	StrCmp $LANGUAGE ${LANG_SIMPCHINESE} 0 +2
+		MessageBox MB_OK "Installing Simplified Chinese stuff"
+	StrCmp $LANGUAGE ${LANG_SLOVAK} 0 +2
+		MessageBox MB_OK "Installing Slovak stuff"
+SectionEnd
+
+;--------------------------------
+
+Function .onInit
+
+	;Language selection dialog
+
+	Push ""
+	Push ${LANG_ENGLISH}
+	Push English
+	Push ${LANG_DUTCH}
+	Push Dutch
+	Push ${LANG_FRENCH}
+	Push French
+	Push ${LANG_GERMAN}
+	Push German
+	Push ${LANG_KOREAN}
+	Push Korean
+	Push ${LANG_RUSSIAN}
+	Push Russian
+	Push ${LANG_SPANISH}
+	Push Spanish
+	Push ${LANG_SWEDISH}
+	Push Swedish
+	Push ${LANG_TRADCHINESE}
+	Push "Traditional Chinese"
+	Push ${LANG_SIMPCHINESE}
+	Push "Simplified Chinese"
+	Push ${LANG_SLOVAK}
+	Push Slovak
+	Push A ; A means auto count languages
+	       ; for the auto count to work the first empty push (Push "") must remain
+	LangDLL::LangDialog "Installer Language" "Please select the language of the installer"
+
+	Pop $LANGUAGE
+	StrCmp $LANGUAGE "cancel" 0 +2
+		Abort
+FunctionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/UserVars.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/UserVars.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/UserVars.nsi	(revision 728)
@@ -0,0 +1,69 @@
+; UserVars.nsi
+;
+; This script shows you how to declare and user variables.
+
+;--------------------------------
+
+  Name "User Variables Text"
+  OutFile "UserVars.exe"
+  
+  InstallDir "$PROGRAMFILES\User Variables Test"
+  
+  RequestExecutionLevel admin
+  
+;--------------------------------
+
+  ;Pages
+  Page directory
+  Page instfiles
+  
+  UninstPage uninstConfirm
+  UninstPage instfiles
+
+;--------------------------------
+; Declaration of user variables (Var command), allowed charaters for variables names : [a-z][A-Z][0-9] and '_'
+
+  Var "Name"
+  Var "Serial"
+  Var "Info"
+
+;--------------------------------
+; Installer
+
+Section "Dummy Section" SecDummy
+
+     StrCpy $0 "Admin"
+     StrCpy "$Name" $0
+     StrCpy "$Serial" "12345"
+     MessageBox MB_OK "User Name: $Name $\n$\nSerial Number: $Serial"
+
+     CreateDirectory $INSTDIR
+     WriteUninstaller "$INSTDIR\Uninst.exe"
+     
+SectionEnd
+
+Section "Another Section"
+
+     Var /GLOBAL "AnotherVar"
+
+     StrCpy $AnotherVar "test"
+
+SectionEnd
+
+;--------------------------------
+; Uninstaller
+
+Section "Uninstall"
+
+     StrCpy $Info "User variables test uninstalled successfully."
+     Delete "$INSTDIR\Uninst.exe"
+     RmDir $INSTDIR
+
+SectionEnd
+
+Function un.OnUninstSuccess
+
+     HideWindow
+     MessageBox MB_OK "$Info"
+     
+FunctionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/makensis.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/makensis.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/makensis.nsi	(revision 728)
@@ -0,0 +1,1052 @@
+;NSIS Setup Script
+;--------------------------------
+
+!ifndef VERSION
+  !define VERSION 'anonymous-build'
+!endif
+
+;--------------------------------
+;Configuration
+
+!ifdef OUTFILE
+  OutFile "${OUTFILE}"
+!else
+  OutFile ..\nsis-${VERSION}-setup.exe
+!endif
+
+SetCompressor /SOLID lzma
+
+InstType "Full"
+InstType "Lite"
+InstType "Minimal"
+
+InstallDir $PROGRAMFILES\NSIS
+InstallDirRegKey HKLM Software\NSIS ""
+
+RequestExecutionLevel admin
+
+;--------------------------------
+;Header Files
+
+!include "MUI2.nsh"
+!include "Sections.nsh"
+!include "LogicLib.nsh"
+!include "Memento.nsh"
+!include "WordFunc.nsh"
+
+;--------------------------------
+;Functions
+
+!ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
+
+  !insertmacro VersionCompare
+
+!endif
+
+;--------------------------------
+;Definitions
+
+!define SHCNE_ASSOCCHANGED 0x8000000
+!define SHCNF_IDLIST 0
+
+;--------------------------------
+;Configuration
+
+;Names
+Name "NSIS"
+Caption "NSIS ${VERSION} Setup"
+
+;Memento Settings
+!define MEMENTO_REGISTRY_ROOT HKLM
+!define MEMENTO_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS"
+
+;Interface Settings
+!define MUI_ABORTWARNING
+
+!define MUI_HEADERIMAGE
+!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\nsis.bmp"
+
+!define MUI_COMPONENTSPAGE_SMALLDESC
+
+;Pages
+!define MUI_WELCOMEPAGE_TITLE "Welcome to the NSIS ${VERSION} Setup Wizard"
+!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of NSIS (Nullsoft Scriptable Install System) ${VERSION}, the next generation of the Windows installer and uninstaller system that doesn't suck and isn't huge.$\r$\n$\r$\nNSIS 2 includes a new Modern User Interface, LZMA compression, support for multiple languages and an easy plug-in system.$\r$\n$\r$\n$_CLICK"
+
+!insertmacro MUI_PAGE_WELCOME
+!insertmacro MUI_PAGE_LICENSE "..\COPYING"
+!ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
+Page custom PageReinstall PageLeaveReinstall
+!endif
+!insertmacro MUI_PAGE_COMPONENTS
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES
+
+!define MUI_FINISHPAGE_LINK "Visit the NSIS site for the latest news, FAQs and support"
+!define MUI_FINISHPAGE_LINK_LOCATION "http://nsis.sf.net/"
+
+!define MUI_FINISHPAGE_RUN "$INSTDIR\NSIS.exe"
+!define MUI_FINISHPAGE_NOREBOOTSUPPORT
+
+!define MUI_FINISHPAGE_SHOWREADME
+!define MUI_FINISHPAGE_SHOWREADME_TEXT "Show release notes"
+!define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReleaseNotes
+
+!insertmacro MUI_PAGE_FINISH
+
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_INSTFILES
+
+;--------------------------------
+;Languages
+
+!insertmacro MUI_LANGUAGE "English"
+
+;--------------------------------
+;Installer Sections
+
+${MementoSection} "NSIS Core Files (required)" SecCore
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing NSIS Core Files..."
+  SetDetailsPrint listonly
+
+  SectionIn 1 2 3 RO
+  SetOutPath $INSTDIR
+  RMDir /r $SMPROGRAMS\NSIS
+
+  SetOverwrite on
+  File ..\makensis.exe
+  File ..\makensisw.exe
+  File ..\COPYING
+  File ..\NSIS.chm
+  !searchparse /file "..\NSIS.chm" "ITSF" VALIDATE_CHM
+  File ..\NSIS.exe
+  File /nonfatal ..\NSIS.exe.manifest
+
+  IfFileExists $INSTDIR\nsisconf.nsi "" +2
+  Rename $INSTDIR\nsisconf.nsi $INSTDIR\nsisconf.nsh
+  SetOverwrite off
+  File ..\nsisconf.nsh
+  SetOverwrite on
+
+  SetOutPath $INSTDIR\Stubs
+  File ..\Stubs\bzip2
+  File ..\Stubs\bzip2_solid
+  File ..\Stubs\lzma
+  File ..\Stubs\lzma_solid
+  File ..\Stubs\zlib
+  File ..\Stubs\zlib_solid
+  File ..\Stubs\uninst
+
+  SetOutPath $INSTDIR\Include
+  File ..\Include\WinMessages.nsh
+  File ..\Include\Sections.nsh
+  File ..\Include\Library.nsh
+  File ..\Include\UpgradeDLL.nsh
+  File ..\Include\LogicLib.nsh
+  File ..\Include\StrFunc.nsh
+  File ..\Include\Colors.nsh
+  File ..\Include\FileFunc.nsh
+  File ..\Include\TextFunc.nsh
+  File ..\Include\WordFunc.nsh
+  File ..\Include\WinVer.nsh
+  File ..\Include\x64.nsh
+  File ..\Include\Memento.nsh
+  File ..\Include\LangFile.nsh
+  File ..\Include\InstallOptions.nsh
+  File ..\Include\MultiUser.nsh
+  File ..\Include\VB6RunTime.nsh
+  File ..\Include\Util.nsh
+  File ..\Include\WinCore.nsh
+
+  SetOutPath $INSTDIR\Include\Win
+  File ..\Include\Win\WinDef.nsh
+  File ..\Include\Win\WinError.nsh
+  File ..\Include\Win\WinNT.nsh
+  File ..\Include\Win\WinUser.nsh
+
+  SetOutPath $INSTDIR\Docs\StrFunc
+  File ..\Docs\StrFunc\StrFunc.txt
+
+  SetOutPath $INSTDIR\Docs\MultiUser
+  File ..\Docs\MultiUser\Readme.html
+
+  SetOutPath $INSTDIR\Docs\makensisw
+  File ..\Docs\makensisw\*.txt
+
+  SetOutPath $INSTDIR\Menu
+  File ..\Menu\*.html
+  SetOutPath $INSTDIR\Menu\images
+  File ..\Menu\images\header.gif
+  File ..\Menu\images\line.gif
+  File ..\Menu\images\site.gif
+
+  Delete $INSTDIR\makensis.htm
+  Delete $INSTDIR\Docs\*.html
+  Delete $INSTDIR\Docs\style.css
+  RMDir $INSTDIR\Docs
+
+  SetOutPath $INSTDIR\Bin
+  File ..\Bin\LibraryLocal.exe
+  File ..\Bin\RegTool.bin
+
+  SetOutPath $INSTDIR\Plugins
+  File ..\Plugins\TypeLib.dll
+
+  ReadRegStr $R0 HKCR ".nsi" ""
+  StrCmp $R0 "NSISFile" 0 +2
+    DeleteRegKey HKCR "NSISFile"
+
+  WriteRegStr HKCR ".nsi" "" "NSIS.Script"
+  WriteRegStr HKCR "NSIS.Script" "" "NSIS Script File"
+  WriteRegStr HKCR "NSIS.Script\DefaultIcon" "" "$INSTDIR\makensisw.exe,1"
+  ReadRegStr $R0 HKCR "NSIS.Script\shell\open\command" ""
+  StrCmp $R0 "" 0 no_nsiopen
+    WriteRegStr HKCR "NSIS.Script\shell" "" "open"
+    WriteRegStr HKCR "NSIS.Script\shell\open\command" "" 'notepad.exe "%1"'
+  no_nsiopen:
+  WriteRegStr HKCR "NSIS.Script\shell\compile" "" "Compile NSIS Script"
+  WriteRegStr HKCR "NSIS.Script\shell\compile\command" "" '"$INSTDIR\makensisw.exe" "%1"'
+  WriteRegStr HKCR "NSIS.Script\shell\compile-compressor" "" "Compile NSIS Script (Choose Compressor)"
+  WriteRegStr HKCR "NSIS.Script\shell\compile-compressor\command" "" '"$INSTDIR\makensisw.exe" /ChooseCompressor "%1"'
+
+  ReadRegStr $R0 HKCR ".nsh" ""
+  StrCmp $R0 "NSHFile" 0 +2
+    DeleteRegKey HKCR "NSHFile"
+
+  WriteRegStr HKCR ".nsh" "" "NSIS.Header"
+  WriteRegStr HKCR "NSIS.Header" "" "NSIS Header File"
+  WriteRegStr HKCR "NSIS.Header\DefaultIcon" "" "$INSTDIR\makensisw.exe,1"
+  ReadRegStr $R0 HKCR "NSIS.Header\shell\open\command" ""
+  StrCmp $R0 "" 0 no_nshopen
+    WriteRegStr HKCR "NSIS.Header\shell" "" "open"
+    WriteRegStr HKCR "NSIS.Header\shell\open\command" "" 'notepad.exe "%1"'
+  no_nshopen:
+
+  System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
+
+${MementoSectionEnd}
+
+${MementoSection} "Script Examples" SecExample
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Script Examples..."
+  SetDetailsPrint listonly
+
+  SectionIn 1 2
+  SetOutPath $INSTDIR\Examples
+  File ..\Examples\makensis.nsi
+  File ..\Examples\example1.nsi
+  File ..\Examples\example2.nsi
+  File ..\Examples\viewhtml.nsi
+  File ..\Examples\waplugin.nsi
+  File ..\Examples\bigtest.nsi
+  File ..\Examples\primes.nsi
+  File ..\Examples\rtest.nsi
+  File ..\Examples\gfx.nsi
+  File ..\Examples\one-section.nsi
+  File ..\Examples\languages.nsi
+  File ..\Examples\Library.nsi
+  File ..\Examples\VersionInfo.nsi
+  File ..\Examples\UserVars.nsi
+  File ..\Examples\LogicLib.nsi
+  File ..\Examples\silent.nsi
+  File ..\Examples\StrFunc.nsi
+  File ..\Examples\FileFunc.nsi
+  File ..\Examples\FileFunc.ini
+  File ..\Examples\FileFuncTest.nsi
+  File ..\Examples\TextFunc.nsi
+  File ..\Examples\TextFunc.ini
+  File ..\Examples\TextFuncTest.nsi
+  File ..\Examples\WordFunc.nsi
+  File ..\Examples\WordFunc.ini
+  File ..\Examples\WordFuncTest.nsi
+  File ..\Examples\Memento.nsi
+
+  SetOutPath $INSTDIR\Examples\Plugin
+  File ..\Examples\Plugin\exdll.c
+  File ..\Examples\Plugin\exdll.dpr
+  File ..\Examples\Plugin\exdll.dsp
+  File ..\Examples\Plugin\exdll.dsw
+  File ..\Examples\Plugin\exdll_with_unit.dpr
+  File ..\Examples\Plugin\exdll-vs2008.sln
+  File ..\Examples\Plugin\exdll-vs2008.vcproj
+  File ..\Examples\Plugin\extdll.inc
+  File ..\Examples\Plugin\nsis.pas
+
+  SetOutPath $INSTDIR\Examples\Plugin\nsis
+  File ..\Examples\Plugin\nsis\pluginapi.h
+  File ..\Examples\Plugin\nsis\pluginapi.lib
+  File ..\Examples\Plugin\nsis\api.h
+
+${MementoSectionEnd}
+
+!ifndef NO_STARTMENUSHORTCUTS
+${MementoSection} "Start Menu and Desktop Shortcuts" SecShortcuts
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Start Menu and Desktop Shortcuts..."
+  SetDetailsPrint listonly
+
+!else
+${MementoSection} "Desktop Shortcut" SecShortcuts
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Desktop Shortcut..."
+  SetDetailsPrint listonly
+
+!endif
+  SectionIn 1 2
+  SetOutPath $INSTDIR
+!ifndef NO_STARTMENUSHORTCUTS
+  CreateShortCut "$SMPROGRAMS\NSIS.lnk" "$INSTDIR\NSIS.exe"
+!endif
+
+  CreateShortCut "$DESKTOP\NSIS.lnk" "$INSTDIR\NSIS.exe"
+
+${MementoSectionEnd}
+
+SectionGroup "User Interfaces" SecInterfaces
+
+${MementoSection} "Modern User Interface" SecInterfacesModernUI
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing User Interfaces | Modern User Interface..."
+  SetDetailsPrint listonly
+
+  SectionIn 1 2
+
+  SetOutPath "$INSTDIR\Examples\Modern UI"
+  File "..\Examples\Modern UI\Basic.nsi"
+  File "..\Examples\Modern UI\HeaderBitmap.nsi"
+  File "..\Examples\Modern UI\MultiLanguage.nsi"
+  File "..\Examples\Modern UI\StartMenu.nsi"
+  File "..\Examples\Modern UI\WelcomeFinish.nsi"
+
+  SetOutPath "$INSTDIR\Contrib\Modern UI"
+  File "..\Contrib\Modern UI\System.nsh"
+  File "..\Contrib\Modern UI\ioSpecial.ini"
+
+  SetOutPath "$INSTDIR\Docs\Modern UI"
+  File "..\Docs\Modern UI\Readme.html"
+  File "..\Docs\Modern UI\Changelog.txt"
+  File "..\Docs\Modern UI\License.txt"
+
+  SetOutPath "$INSTDIR\Docs\Modern UI\images"
+  File "..\Docs\Modern UI\images\header.gif"
+  File "..\Docs\Modern UI\images\screen1.png"
+  File "..\Docs\Modern UI\images\screen2.png"
+  File "..\Docs\Modern UI\images\open.gif"
+  File "..\Docs\Modern UI\images\closed.gif"
+
+  SetOutPath $INSTDIR\Contrib\UIs
+  File "..\Contrib\UIs\modern.exe"
+  File "..\Contrib\UIs\modern_headerbmp.exe"
+  File "..\Contrib\UIs\modern_headerbmpr.exe"
+  File "..\Contrib\UIs\modern_nodesc.exe"
+  File "..\Contrib\UIs\modern_smalldesc.exe"
+
+  SetOutPath $INSTDIR\Include
+  File "..\Include\MUI.nsh"
+
+  SetOutPath "$INSTDIR\Contrib\Modern UI 2"
+  File "..\Contrib\Modern UI 2\Deprecated.nsh"
+  File "..\Contrib\Modern UI 2\Interface.nsh"
+  File "..\Contrib\Modern UI 2\Localization.nsh"
+  File "..\Contrib\Modern UI 2\MUI2.nsh"
+  File "..\Contrib\Modern UI 2\Pages.nsh"
+
+  SetOutPath "$INSTDIR\Contrib\Modern UI 2\Pages"
+  File "..\Contrib\Modern UI 2\Pages\Components.nsh"
+  File "..\Contrib\Modern UI 2\Pages\Directory.nsh"
+  File "..\Contrib\Modern UI 2\Pages\Finish.nsh"
+  File "..\Contrib\Modern UI 2\Pages\InstallFiles.nsh"
+  File "..\Contrib\Modern UI 2\Pages\License.nsh"
+  File "..\Contrib\Modern UI 2\Pages\StartMenu.nsh"
+  File "..\Contrib\Modern UI 2\Pages\UninstallConfirm.nsh"
+  File "..\Contrib\Modern UI 2\Pages\Welcome.nsh"
+
+  SetOutPath "$INSTDIR\Docs\Modern UI 2"
+  File "..\Docs\Modern UI 2\Readme.html"
+  File "..\Docs\Modern UI 2\License.txt"
+
+  SetOutPath "$INSTDIR\Docs\Modern UI 2\images"
+  File "..\Docs\Modern UI 2\images\header.gif"
+  File "..\Docs\Modern UI 2\images\screen1.png"
+  File "..\Docs\Modern UI 2\images\screen2.png"
+  File "..\Docs\Modern UI 2\images\open.gif"
+  File "..\Docs\Modern UI 2\images\closed.gif"
+
+  SetOutPath $INSTDIR\Include
+  File "..\Include\MUI2.nsh"
+
+${MementoSectionEnd}
+
+${MementoSection} "Default User Interface" SecInterfacesDefaultUI
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing User Interfaces | Default User Interface..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath "$INSTDIR\Contrib\UIs"
+  File "..\Contrib\UIs\default.exe"
+
+${MementoSectionEnd}
+
+${MementoSection} "Tiny User Interface" SecInterfacesTinyUI
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing User Interfaces | Tiny User Interface..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath "$INSTDIR\Contrib\UIs"
+  File "..\Contrib\UIs\sdbarker_tiny.exe"
+
+${MementoSectionEnd}
+
+SectionGroupEnd
+
+${MementoSection} "Graphics" SecGraphics
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Graphics..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  Delete $INSTDIR\Contrib\Icons\*.ico
+  Delete $INSTDIR\Contrib\Icons\*.bmp
+  RMDir $INSTDIR\Contrib\Icons
+  SetOutPath $INSTDIR\Contrib\Graphics
+  File /r "..\Contrib\Graphics\*.ico"
+  File /r "..\Contrib\Graphics\*.bmp"
+${MementoSectionEnd}
+
+${MementoSection} "Language Files" SecLangFiles
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Language Files..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath "$INSTDIR\Contrib\Language files"
+  File "..\Contrib\Language files\*.nlf"
+
+  SetOutPath $INSTDIR\Bin
+  File ..\Bin\MakeLangID.exe
+
+  !insertmacro SectionFlagIsSet ${SecInterfacesModernUI} ${SF_SELECTED} mui nomui
+  mui:
+    SetOutPath "$INSTDIR\Contrib\Language files"
+    File "..\Contrib\Language files\*.nsh"
+  nomui:
+
+${MementoSectionEnd}
+
+SectionGroup "Tools" SecTools
+
+${MementoSection} "Zip2Exe" SecToolsZ2E
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Tools | Zip2Exe..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath $INSTDIR\Bin
+  File ..\Bin\zip2exe.exe
+  SetOutPath $INSTDIR\Contrib\zip2exe
+  File ..\Contrib\zip2exe\Base.nsh
+  File ..\Contrib\zip2exe\Modern.nsh
+  File ..\Contrib\zip2exe\Classic.nsh
+
+${MementoSectionEnd}
+
+SectionGroupEnd
+
+SectionGroup "Plug-ins" SecPluginsPlugins
+
+${MementoSection} "Banner" SecPluginsBanner
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Plug-ins | Banner..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath $INSTDIR\Plugins
+  File ..\Plugins\Banner.dll
+  SetOutPath $INSTDIR\Docs\Banner
+  File ..\Docs\Banner\Readme.txt
+  SetOutPath $INSTDIR\Examples\Banner
+  File ..\Examples\Banner\Example.nsi
+${MementoSectionEnd}
+
+${MementoSection} "Language DLL" SecPluginsLangDLL
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Plug-ins | Language DLL..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+  SetOutPath $INSTDIR\Plugins
+  File ..\Plugins\LangDLL.dll
+${MementoSectionEnd}
+
+${MementoSection} "nsExec" SecPluginsnsExec
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Plug-ins | nsExec..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath $INSTDIR\Plugins
+  File ..\Plugins\nsExec.dll
+  SetOutPath $INSTDIR\Docs\nsExec
+  File ..\Docs\nsExec\nsExec.txt
+  SetOutPath $INSTDIR\Examples\nsExec
+  File ..\Examples\nsExec\test.nsi
+${MementoSectionEnd}
+
+${MementoSection} "Splash" SecPluginsSplash
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Plug-ins | Splash..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath $INSTDIR\Plugins
+  File ..\Plugins\splash.dll
+  SetOutPath $INSTDIR\Docs\Splash
+  File ..\Docs\Splash\splash.txt
+  SetOutPath $INSTDIR\Examples\Splash
+  File ..\Examples\Splash\Example.nsi
+${MementoSectionEnd}
+
+${MementoSection} "AdvSplash" SecPluginsSplashT
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Plug-ins | AdvSplash..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath $INSTDIR\Plugins
+  File ..\Plugins\advsplash.dll
+  SetOutPath $INSTDIR\Docs\AdvSplash
+  File ..\Docs\AdvSplash\advsplash.txt
+  SetOutPath $INSTDIR\Examples\AdvSplash
+  File ..\Examples\AdvSplash\Example.nsi
+${MementoSectionEnd}
+
+${MementoSection} "BgImage" SecPluginsBgImage
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Plug-ins | BgImage..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath $INSTDIR\Plugins
+  File ..\Plugins\BgImage.dll
+  SetOutPath $INSTDIR\Docs\BgImage
+  File ..\Docs\BgImage\BgImage.txt
+  SetOutPath $INSTDIR\Examples\BgImage
+  File ..\Examples\BgImage\Example.nsi
+${MementoSectionEnd}
+
+${MementoSection} "InstallOptions" SecPluginsIO
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Plug-ins | InstallOptions..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath $INSTDIR\Plugins
+  File ..\Plugins\InstallOptions.dll
+  SetOutPath $INSTDIR\Docs\InstallOptions
+  File ..\Docs\InstallOptions\Readme.html
+  File ..\Docs\InstallOptions\Changelog.txt
+  SetOutPath $INSTDIR\Examples\InstallOptions
+  File ..\Examples\InstallOptions\test.ini
+  File ..\Examples\InstallOptions\test.nsi
+  File ..\Examples\InstallOptions\testimgs.ini
+  File ..\Examples\InstallOptions\testimgs.nsi
+  File ..\Examples\InstallOptions\testlink.ini
+  File ..\Examples\InstallOptions\testlink.nsi
+  File ..\Examples\InstallOptions\testnotify.ini
+  File ..\Examples\InstallOptions\testnotify.nsi
+${MementoSectionEnd}
+
+${MementoSection} "nsDialogs" SecPluginsDialogs
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Plug-ins | nsDialogs..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath $INSTDIR\Plugins
+  File ..\Plugins\nsDialogs.dll
+  SetOutPath $INSTDIR\Examples\nsDialogs
+  File ..\Examples\nsDialogs\example.nsi
+  File ..\Examples\nsDialogs\InstallOptions.nsi
+  File ..\Examples\nsDialogs\timer.nsi
+  File ..\Examples\nsDialogs\welcome.nsi
+  SetOutPath $INSTDIR\Include
+  File ..\Include\nsDialogs.nsh
+  SetOutPath $INSTDIR\Docs\nsDialogs
+  File ..\Docs\nsDialogs\Readme.html
+${MementoSectionEnd}
+
+${MementoSection} "Math" SecPluginsMath
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Plug-ins | Math..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath $INSTDIR\Plugins
+  File ..\Plugins\Math.dll
+  SetOutPath $INSTDIR\Docs\Math
+  File ..\Docs\Math\Math.txt
+  SetOutPath $INSTDIR\Examples\Math
+  File ..\Examples\Math\math.nsi
+  File ..\Examples\Math\mathtest.txt
+  File ..\Examples\Math\mathtest.nsi
+  File ..\Examples\Math\mathtest.ini
+
+${MementoSectionEnd}
+
+${MementoSection} "NSISdl" SecPluginsNSISDL
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Plug-ins | NSISdl..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath $INSTDIR\Plugins
+  File ..\Plugins\nsisdl.dll
+  SetOutPath $INSTDIR\Docs\NSISdl
+  File ..\Docs\NSISdl\ReadMe.txt
+  File ..\Docs\NSISdl\License.txt
+${MementoSectionEnd}
+
+${MementoSection} "System" SecPluginsSystem
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Plug-ins | System..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath $INSTDIR\Plugins
+  File ..\Plugins\System.dll
+  SetOutPath $INSTDIR\Docs\System
+  File ..\Docs\System\System.html
+  File ..\Docs\System\WhatsNew.txt
+  SetOutPath $INSTDIR\Examples\System
+  File ..\Examples\System\Resource.dll
+  File ..\Examples\System\SysFunc.nsh
+  File ..\Examples\System\System.nsh
+  File ..\Examples\System\System.nsi
+${MementoSectionEnd}
+
+${MementoSection} "StartMenu" SecPluginsStartMenu
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Plug-ins | StartMenu..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath $INSTDIR\Plugins
+  File ..\Plugins\StartMenu.dll
+  SetOutPath $INSTDIR\Docs\StartMenu
+  File ..\Docs\StartMenu\Readme.txt
+  SetOutPath $INSTDIR\Examples\StartMenu
+  File ..\Examples\StartMenu\Example.nsi
+${MementoSectionEnd}
+
+${MementoSection} "UserInfo" SecPluginsUserInfo
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Plug-ins | UserInfo..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath $INSTDIR\Plugins
+  File ..\Plugins\UserInfo.dll
+  SetOutPath $INSTDIR\Examples\UserInfo
+  File ..\Examples\UserInfo\UserInfo.nsi
+${MementoSectionEnd}
+
+${MementoSection} "Dialer" SecPluginsDialer
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Plug-ins | Dialer..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath $INSTDIR\Plugins
+  File ..\Plugins\Dialer.dll
+  SetOutPath $INSTDIR\Docs\Dialer
+  File ..\Docs\Dialer\Dialer.txt
+${MementoSectionEnd}
+
+${MementoSection} "VPatch" SecPluginsVPatch
+
+  SetDetailsPrint textonly
+  DetailPrint "Installing Plug-ins | VPatch..."
+  SetDetailsPrint listonly
+
+  SectionIn 1
+
+  SetOutPath $INSTDIR\Plugins
+  File ..\Plugins\VPatch.dll
+  SetOutPath $INSTDIR\Examples\VPatch
+  File ..\Examples\VPatch\example.nsi
+  File ..\Examples\VPatch\oldfile.txt
+  File ..\Examples\VPatch\newfile.txt
+  File ..\Examples\VPatch\patch.pat
+  SetOutPath $INSTDIR\Docs\VPatch
+  File ..\Docs\VPatch\Readme.html
+  SetOutPath $INSTDIR\Bin
+  File ..\Bin\GenPat.exe
+  SetOutPath $INSTDIR\Include
+  File ..\Include\VPatchLib.nsh
+${MementoSectionEnd}
+
+${MementoSectionDone}
+
+SectionGroupEnd
+
+Section -post
+
+  ; When Modern UI is installed:
+  ; * Always install the English language file
+  ; * Always install default icons / bitmaps
+
+  !insertmacro SectionFlagIsSet ${SecInterfacesModernUI} ${SF_SELECTED} mui nomui
+
+    mui:
+
+    SetDetailsPrint textonly
+    DetailPrint "Configuring Modern UI..."
+    SetDetailsPrint listonly
+
+    !insertmacro SectionFlagIsSet ${SecLangFiles} ${SF_SELECTED} langfiles nolangfiles
+
+      nolangfiles:
+
+      SetOutPath "$INSTDIR\Contrib\Language files"
+      File "..\Contrib\Language files\English.nlf"
+      SetOutPath "$INSTDIR\Contrib\Language files"
+      File "..\Contrib\Language files\English.nsh"
+
+    langfiles:
+
+    !insertmacro SectionFlagIsSet ${SecGraphics} ${SF_SELECTED} graphics nographics
+
+      nographics:
+
+      SetOutPath $INSTDIR\Contrib\Graphics
+      SetOutPath $INSTDIR\Contrib\Graphics\Checks
+      File "..\Contrib\Graphics\Checks\modern.bmp"
+      SetOutPath $INSTDIR\Contrib\Graphics\Icons
+      File "..\Contrib\Graphics\Icons\modern-install.ico"
+      File "..\Contrib\Graphics\Icons\modern-uninstall.ico"
+      SetOutPath $INSTDIR\Contrib\Graphics\Header
+      File "..\Contrib\Graphics\Header\nsis.bmp"
+      SetOutPath $INSTDIR\Contrib\Graphics\Wizard
+      File "..\Contrib\Graphics\Wizard\win.bmp"
+
+    graphics:
+
+  nomui:
+
+  SetDetailsPrint textonly
+  DetailPrint "Creating Registry Keys..."
+  SetDetailsPrint listonly
+
+  SetOutPath $INSTDIR
+
+  WriteRegStr HKLM "Software\NSIS" "" $INSTDIR
+!ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
+  WriteRegDword HKLM "Software\NSIS" "VersionMajor" "${VER_MAJOR}"
+  WriteRegDword HKLM "Software\NSIS" "VersionMinor" "${VER_MINOR}"
+  WriteRegDword HKLM "Software\NSIS" "VersionRevision" "${VER_REVISION}"
+  WriteRegDword HKLM "Software\NSIS" "VersionBuild" "${VER_BUILD}"
+!endif
+
+  WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "UninstallString" '"$INSTDIR\uninst-nsis.exe"'
+  WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "InstallLocation" "$INSTDIR"
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "DisplayName" "Nullsoft Install System"
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "DisplayIcon" "$INSTDIR\NSIS.exe,0"
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "DisplayVersion" "${VERSION}"
+!ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
+  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "VersionMajor" "${VER_MAJOR}"
+  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "VersionMinor" "${VER_MINOR}.${VER_REVISION}"
+!endif
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "URLInfoAbout" "http://nsis.sourceforge.net/"
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "HelpLink" "http://nsis.sourceforge.net/Support"
+  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "NoModify" "1"
+  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "NoRepair" "1"
+
+  WriteUninstaller $INSTDIR\uninst-nsis.exe
+
+  ${MementoSectionSave}
+
+  SetDetailsPrint both
+
+SectionEnd
+
+;--------------------------------
+;Descriptions
+
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "The core files required to use NSIS (compiler etc.)"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecExample} "Example installation scripts that show you how to use NSIS"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} "Adds icons to your start menu and your desktop for easy access"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfaces} "User interface designs that can be used to change the installer look and feel"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesModernUI} "A modern user interface like the wizards of recent Windows versions"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesDefaultUI} "The default NSIS user interface which you can customize to make your own UI"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesTinyUI} "A tiny version of the default user interface"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecTools} "Tools that help you with NSIS development"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsZ2E} "A utility that converts a ZIP file to a NSIS installer"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecGraphics} "Icons, checkbox images and other graphics"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecLangFiles} "Language files used to support multiple languages in an installer"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsPlugins} "Useful plugins that extend NSIS's functionality"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBanner} "Plugin that lets you show a banner before installation starts"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsLangDLL} "Plugin that lets you add a language select dialog to your installer"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsnsExec} "Plugin that executes console programs and prints its output in the NSIS log window or hides it"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSplash} "Splash screen add-on that lets you add a splash screen to an installer"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSplashT} "Splash screen add-on with transparency support that lets you add a splash screen to an installer"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSystem} "Plugin that lets you call Win32 API or external DLLs"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsMath} "Plugin that lets you evaluate complicated mathematical expressions"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsDialer} "Plugin that provides internet connection functions"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsIO} "Plugin that lets you add custom pages to an installer"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsDialogs} "Plugin that lets you add custom pages to an installer"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsStartMenu} "Plugin that lets the user select the start menu folder"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBgImage} "Plugin that lets you show a persistent background image plugin and play sounds"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsUserInfo} "Plugin that that gives you the user name and the user account type"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsNSISDL} "Plugin that lets you create a web based installer"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsVPatch} "Plugin that lets you create patches to upgrade older files"
+!insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+;--------------------------------
+;Installer Functions
+
+Function .onInit
+
+  ${MementoSectionRestore}
+
+FunctionEnd
+
+!ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
+
+Var ReinstallPageCheck
+
+Function PageReinstall
+
+  ReadRegStr $R0 HKLM "Software\NSIS" ""
+
+  ${If} $R0 == ""
+    Abort
+  ${EndIf}
+
+  ReadRegDWORD $R0 HKLM "Software\NSIS" "VersionMajor"
+  ReadRegDWORD $R1 HKLM "Software\NSIS" "VersionMinor"
+  ReadRegDWORD $R2 HKLM "Software\NSIS" "VersionRevision"
+  ReadRegDWORD $R3 HKLM "Software\NSIS" "VersionBuild"
+  StrCpy $R0 $R0.$R1.$R2.$R3
+
+  ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $R0 $R0
+  ${If} $R0 == 0
+    StrCpy $R1 "NSIS ${VERSION} is already installed. Select the operation you want to perform and click Next to continue."
+    StrCpy $R2 "Add/Reinstall components"
+    StrCpy $R3 "Uninstall NSIS"
+    !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform."
+    StrCpy $R0 "2"
+  ${ElseIf} $R0 == 1
+    StrCpy $R1 "An older version of NSIS is installed on your system. It's recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
+    StrCpy $R2 "Uninstall before installing"
+    StrCpy $R3 "Do not uninstall"
+    !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install NSIS."
+    StrCpy $R0 "1"
+  ${ElseIf} $R0 == 2
+    StrCpy $R1 "A newer version of NSIS is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
+    StrCpy $R2 "Uninstall before installing"
+    StrCpy $R3 "Do not uninstall"
+    !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install NSIS."
+    StrCpy $R0 "1"
+  ${Else}
+    Abort
+  ${EndIf}
+
+  nsDialogs::Create 1018
+  Pop $R4
+
+  ${NSD_CreateLabel} 0 0 100% 24u $R1
+  Pop $R1
+
+  ${NSD_CreateRadioButton} 30u 50u -30u 8u $R2
+  Pop $R2
+  ${NSD_OnClick} $R2 PageReinstallUpdateSelection
+
+  ${NSD_CreateRadioButton} 30u 70u -30u 8u $R3
+  Pop $R3
+  ${NSD_OnClick} $R3 PageReinstallUpdateSelection
+
+  ${If} $ReinstallPageCheck != 2
+    SendMessage $R2 ${BM_SETCHECK} ${BST_CHECKED} 0
+  ${Else}
+    SendMessage $R3 ${BM_SETCHECK} ${BST_CHECKED} 0
+  ${EndIf}
+
+  ${NSD_SetFocus} $R2
+
+  nsDialogs::Show
+
+FunctionEnd
+
+Function PageReinstallUpdateSelection
+
+  Pop $R1
+
+  ${NSD_GetState} $R2 $R1
+
+  ${If} $R1 == ${BST_CHECKED}
+    StrCpy $ReinstallPageCheck 1
+  ${Else}
+    StrCpy $ReinstallPageCheck 2
+  ${EndIf}
+
+FunctionEnd
+
+Function PageLeaveReinstall
+
+  ${NSD_GetState} $R2 $R1
+
+  StrCmp $R0 "1" 0 +2
+    StrCmp $R1 "1" reinst_uninstall reinst_done
+
+  StrCmp $R0 "2" 0 +3
+    StrCmp $R1 "1" reinst_done reinst_uninstall
+
+  reinst_uninstall:
+  ReadRegStr $R1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "UninstallString"
+
+  ;Run uninstaller
+  HideWindow
+
+    ClearErrors
+    ExecWait '$R1 _?=$INSTDIR'
+
+    IfErrors no_remove_uninstaller
+    IfFileExists "$INSTDIR\makensis.exe" no_remove_uninstaller
+
+      Delete $R1
+      RMDir $INSTDIR
+
+    no_remove_uninstaller:
+
+  StrCmp $R0 "2" 0 +2
+    Quit
+
+  BringToFront
+
+  reinst_done:
+
+FunctionEnd
+
+!endif # VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
+
+Function ShowReleaseNotes
+  ${If} ${FileExists} $WINDIR\hh.exe
+    StrCpy $0 $WINDIR\hh.exe
+    Exec '"$0" mk:@MSITStore:$INSTDIR\NSIS.chm::/SectionF.1.html'
+  ${Else}
+    SearchPath $0 hh.exe
+    ${If} ${FileExists} $0
+      Exec '"$0" mk:@MSITStore:$INSTDIR\NSIS.chm::/SectionF.1.html'
+    ${Else}
+      ExecShell "open" "http://nsis.sourceforge.net/Docs/AppendixF.html#F.1"
+    ${EndIf}
+  ${EndIf}
+FunctionEnd
+
+;--------------------------------
+;Uninstaller Section
+
+Section Uninstall
+
+  SetDetailsPrint textonly
+  DetailPrint "Uninstalling NSI Development Shell Extensions..."
+  SetDetailsPrint listonly
+
+  IfFileExists $INSTDIR\makensis.exe nsis_installed
+    MessageBox MB_YESNO "It does not appear that NSIS is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?" IDYES nsis_installed
+    Abort "Uninstall aborted by user"
+  nsis_installed:
+
+  SetDetailsPrint textonly
+  DetailPrint "Deleting Registry Keys..."
+  SetDetailsPrint listonly
+
+  ReadRegStr $R0 HKCR ".nsi" ""
+  StrCmp $R0 "NSIS.Script" 0 +2
+    DeleteRegKey HKCR ".nsi"
+
+  ReadRegStr $R0 HKCR ".nsh" ""
+  StrCmp $R0 "NSIS.Header" 0 +2
+    DeleteRegKey HKCR ".nsh"
+
+  DeleteRegKey HKCR "NSIS.Script"
+  DeleteRegKey HKCR "NSIS.Header"
+
+  System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
+
+  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS"
+  DeleteRegKey HKLM "Software\NSIS"
+
+  SetDetailsPrint textonly
+  DetailPrint "Deleting Files..."
+  SetDetailsPrint listonly
+
+  Delete $SMPROGRAMS\NSIS.lnk
+  Delete $DESKTOP\NSIS.lnk
+  Delete $INSTDIR\makensis.exe
+  Delete $INSTDIR\makensisw.exe
+  Delete $INSTDIR\NSIS.exe
+  Delete $INSTDIR\license.txt
+  Delete $INSTDIR\COPYING
+  Delete $INSTDIR\uninst-nsis.exe
+  Delete $INSTDIR\nsisconf.nsi
+  Delete $INSTDIR\nsisconf.nsh
+  Delete $INSTDIR\NSIS.chm
+  RMDir /r $INSTDIR\Bin
+  RMDir /r $INSTDIR\Contrib
+  RMDir /r $INSTDIR\Docs
+  RMDir /r $INSTDIR\Examples
+  RMDir /r $INSTDIR\Include
+  RMDir /r $INSTDIR\Menu
+  RMDir /r $INSTDIR\Plugins
+  RMDir /r $INSTDIR\Stubs
+  RMDir $INSTDIR
+
+  SetDetailsPrint both
+
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/example1.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/example1.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/example1.nsi	(revision 728)
@@ -0,0 +1,40 @@
+; example1.nsi
+;
+; This script is perhaps one of the simplest NSIs you can make. All of the
+; optional settings are left to their default settings. The installer simply 
+; prompts the user asking them where to install, and drops a copy of example1.nsi
+; there. 
+
+;--------------------------------
+
+; The name of the installer
+Name "Example1"
+
+; The file to write
+OutFile "example1.exe"
+
+; The default installation directory
+InstallDir $DESKTOP\Example1
+
+; Request application privileges for Windows Vista
+RequestExecutionLevel user
+
+;--------------------------------
+
+; Pages
+
+Page directory
+Page instfiles
+
+;--------------------------------
+
+; The stuff to install
+Section "" ;No components page, name is not important
+
+  ; Set output path to the installation directory.
+  SetOutPath $INSTDIR
+  
+  ; Put file there
+  File example1.nsi
+  
+SectionEnd ; end the section
Index: tmp/trunk/org.txm.setups/nsis/Examples/example2.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/example2.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/example2.nsi	(revision 728)
@@ -0,0 +1,92 @@
+; example2.nsi
+;
+; This script is based on example1.nsi, but it remember the directory, 
+; has uninstall support and (optionally) installs start menu shortcuts.
+;
+; It will install example2.nsi into a directory that the user selects,
+
+;--------------------------------
+
+; The name of the installer
+Name "Example2"
+
+; The file to write
+OutFile "example2.exe"
+
+; The default installation directory
+InstallDir $PROGRAMFILES\Example2
+
+; Registry key to check for directory (so if you install again, it will 
+; overwrite the old one automatically)
+InstallDirRegKey HKLM "Software\NSIS_Example2" "Install_Dir"
+
+; Request application privileges for Windows Vista
+RequestExecutionLevel admin
+
+;--------------------------------
+
+; Pages
+
+Page components
+Page directory
+Page instfiles
+
+UninstPage uninstConfirm
+UninstPage instfiles
+
+;--------------------------------
+
+; The stuff to install
+Section "Example2 (required)"
+
+  SectionIn RO
+  
+  ; Set output path to the installation directory.
+  SetOutPath $INSTDIR
+  
+  ; Put file there
+  File "example2.nsi"
+  
+  ; Write the installation path into the registry
+  WriteRegStr HKLM SOFTWARE\NSIS_Example2 "Install_Dir" "$INSTDIR"
+  
+  ; Write the uninstall keys for Windows
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2" "DisplayName" "NSIS Example2"
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2" "UninstallString" '"$INSTDIR\uninstall.exe"'
+  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2" "NoModify" 1
+  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2" "NoRepair" 1
+  WriteUninstaller "uninstall.exe"
+  
+SectionEnd
+
+; Optional section (can be disabled by the user)
+Section "Start Menu Shortcuts"
+
+  CreateDirectory "$SMPROGRAMS\Example2"
+  CreateShortCut "$SMPROGRAMS\Example2\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
+  CreateShortCut "$SMPROGRAMS\Example2\Example2 (MakeNSISW).lnk" "$INSTDIR\example2.nsi" "" "$INSTDIR\example2.nsi" 0
+  
+SectionEnd
+
+;--------------------------------
+
+; Uninstaller
+
+Section "Uninstall"
+  
+  ; Remove registry keys
+  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2"
+  DeleteRegKey HKLM SOFTWARE\NSIS_Example2
+
+  ; Remove files and uninstaller
+  Delete $INSTDIR\example2.nsi
+  Delete $INSTDIR\uninstall.exe
+
+  ; Remove shortcuts, if any
+  Delete "$SMPROGRAMS\Example2\*.*"
+
+  ; Remove directories used
+  RMDir "$SMPROGRAMS\Example2"
+  RMDir "$INSTDIR"
+
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/one-section.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/one-section.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/one-section.nsi	(revision 728)
@@ -0,0 +1,79 @@
+; one-section.nsi
+;
+; This example demonstrates how to control section selection.
+; It allows only one of the sections of a group to be selected.
+
+;--------------------------------
+
+; Section define/macro header file
+; See this header file for more info
+
+!include "Sections.nsh"
+
+;--------------------------------
+
+Name "One Section"
+OutFile "one-section.exe"
+RequestExecutionLevel user
+
+;--------------------------------
+
+; Pages
+
+Page components
+
+;--------------------------------
+
+; Sections
+
+Section !Required
+  SectionIn RO
+SectionEnd
+
+Section "Group 1 - Option 1" g1o1
+SectionEnd
+
+Section /o "Group 1 - Option 2" g1o2
+SectionEnd
+
+Section /o "Group 1 - Option 3" g1o3
+SectionEnd
+
+Section "Group 2 - Option 1" g2o1
+SectionEnd
+
+Section /o "Group 2 - Option 2" g2o2
+SectionEnd
+
+Section /o "Group 2 - Option 3" g2o3
+SectionEnd
+
+;--------------------------------
+
+; Functions
+
+; $1 stores the status of group 1
+; $2 stores the status of group 2
+
+Function .onInit
+
+  StrCpy $1 ${g1o1} ; Group 1 - Option 1 is selected by default
+  StrCpy $2 ${g2o1} ; Group 2 - Option 1 is selected by default
+
+FunctionEnd
+
+Function .onSelChange
+
+  !insertmacro StartRadioButtons $1
+    !insertmacro RadioButton ${g1o1}
+    !insertmacro RadioButton ${g1o2}
+    !insertmacro RadioButton ${g1o3}
+  !insertmacro EndRadioButtons
+	
+  !insertmacro StartRadioButtons $2
+    !insertmacro RadioButton ${g2o1}
+    !insertmacro RadioButton ${g2o2}
+    !insertmacro RadioButton ${g2o3}
+  !insertmacro EndRadioButtons
+	
+FunctionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/gfx.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/gfx.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/gfx.nsi	(revision 728)
@@ -0,0 +1,123 @@
+; gfx.nsi
+;
+; This script shows some examples of using all of the new
+; graphic related additions introduced in NSIS 2
+;
+; Written by Amir Szkeley 22nd July 2002
+
+;--------------------------------
+
+!macro BIMAGE IMAGE PARMS
+	Push $0
+	GetTempFileName $0
+	File /oname=$0 "${IMAGE}"
+	SetBrandingImage ${PARMS} $0
+	Delete $0
+	Pop $0
+!macroend
+
+;--------------------------------
+
+Name "Graphical effects"
+
+OutFile "gfx.exe"
+
+; Adds an XP manifest to the installer
+XPStyle on
+
+; Add branding image to the installer (an image placeholder on the side).
+; It is not enough to just add the placeholder, we must set the image too...
+; We will later set the image in every pre-page function.
+; We can also set just one persistent image in .onGUIInit
+AddBrandingImage left 100
+
+; Sets the font of the installer
+SetFont "Comic Sans MS" 8
+
+; Just to make it three pages...
+SubCaption 0 ": Yet another page..."
+SubCaption 2 ": Yet another page..."
+LicenseText "License page"
+LicenseData "gfx.nsi"
+DirText "Lets make a third page!"
+
+; Install dir
+InstallDir "${NSISDIR}\Examples"
+
+; Request application privileges for Windows Vista
+RequestExecutionLevel user
+
+;--------------------------------
+
+; Pages
+Page license licenseImage
+Page custom customPage
+Page directory dirImage
+Page instfiles instImage
+
+;--------------------------------
+
+Section ""
+	; You can also use the BI_NEXT macro here...
+	MessageBox MB_YESNO "We can change the branding image from within a section too!$\nDo you want me to change it?" IDNO done
+		!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Wizard\nsis.bmp" ""
+	done:
+	WriteUninstaller uninst.exe
+SectionEnd
+
+;--------------------------------
+
+Function licenseImage
+	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp" /RESIZETOFIT
+	MessageBox MB_YESNO 'Would you like to skip the license page?' IDNO no
+		Abort
+	no:
+FunctionEnd
+
+Function customPage
+	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp" /RESIZETOFIT
+	MessageBox MB_OK 'This is a nice custom "page" with yet another image :P'
+	#insert install options/start menu/<insert plugin name here> here
+FunctionEnd
+
+Function dirImage
+	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Header\win.bmp" /RESIZETOFIT
+FunctionEnd
+
+Function instImage
+	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Wizard\llama.bmp" /RESIZETOFIT
+FunctionEnd
+
+;--------------------------------
+
+; Uninstall pages
+
+UninstPage uninstConfirm un.uninstImage
+UninstPage custom un.customPage
+UninstPage instfiles un.instImage
+
+Function un.uninstImage
+	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp" /RESIZETOFIT
+FunctionEnd
+
+Function un.customPage
+	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Header\win.bmp" /RESIZETOFIT
+	MessageBox MB_OK 'This is a nice uninstaller custom "page" with yet another image :P'
+	#insert install options/start menu/<insert plugin name here> here
+FunctionEnd
+
+Function un.instImage
+	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Wizard\llama.bmp" /RESIZETOFIT
+FunctionEnd
+
+;--------------------------------
+
+; Uninstaller
+
+; Another page for uninstaller
+UninstallText "Another page..."
+
+Section uninstall
+	MessageBox MB_OK "Bla"
+SectionEnd
+
Index: tmp/trunk/org.txm.setups/nsis/Examples/StrFunc.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/StrFunc.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/StrFunc.nsi	(revision 728)
@@ -0,0 +1,635 @@
+Name "NSIS StrFunc Example"
+OutFile "StrFunc.exe"
+ShowInstDetails show
+ShowUninstDetails show
+XPStyle on
+RequestExecutionLevel user
+
+!include "StrFunc.nsh"
+
+# Declare used functions
+${StrCase}
+${StrClb}
+${StrIOToNSIS}
+${StrLoc}
+${StrNSISToIO}
+${StrRep}
+${StrStr}
+${StrStrAdv}
+${StrTok}
+${StrTrimNewLines}
+${StrSort}
+
+${UnStrCase}
+${UnStrClb}
+${UnStrIOToNSIS}
+${UnStrLoc}
+${UnStrNSISToIO}
+${UnStrRep}
+${UnStrStr}
+${UnStrStrAdv}
+${UnStrTok}
+${UnStrTrimNewLines}
+${UnStrSort}
+
+!macro StackVerificationStart
+  StrCpy $0 S0
+  StrCpy $1 S1
+  StrCpy $2 S2
+  StrCpy $3 S3
+  StrCpy $4 S4
+  StrCpy $5 S5
+  StrCpy $6 S6
+  StrCpy $7 S7
+  StrCpy $8 S8
+  StrCpy $9 S9
+  StrCpy $R0 SR0
+  StrCpy $R1 SR1
+  StrCpy $R2 SR2
+  StrCpy $R3 SR3
+  StrCpy $R4 SR4
+  StrCpy $R5 SR5
+  StrCpy $R6 SR6
+  StrCpy $R7 SR7
+  StrCpy $R8 SR8
+  StrCpy $R9 SR9
+!macroend
+
+!macro StackVerificationEnd
+  ClearErrors
+  ${If} $1 != "S1"
+  ${OrIf} $2 != "S2"
+  ${OrIf} $3 != "S3"
+  ${OrIf} $4 != "S4"
+  ${OrIf} $5 != "S5"
+  ${OrIf} $6 != "S6"
+  ${OrIf} $7 != "S7"
+  ${OrIf} $8 != "S8"
+  ${OrIf} $9 != "S9"
+  ${OrIf} $R0 != "SR0"
+  ${OrIf} $R1 != "SR1"
+  ${OrIf} $R2 != "SR2"
+  ${OrIf} $R3 != "SR3"
+  ${OrIf} $R4 != "SR4"
+  ${OrIf} $R5 != "SR5"
+  ${OrIf} $R6 != "SR6"
+  ${OrIf} $R7 != "SR7"
+  ${OrIf} $R8 != "SR8"
+  ${OrIf} $R9 != "SR9"
+    SetErrors
+  ${EndIf}
+!macroend
+
+Section
+
+  # Test case conversion
+  !insertmacro StackVerificationStart
+  ${StrCase} $0 "This is just an example. A very simple one." ""
+  StrCmp $0 "This is just an example. A very simple one." 0 strcaseerror
+  ${StrCase} $0 "THIS IS JUST AN EXAMPLE. A VERY SIMPLE ONE." "S"
+  StrCmp $0 "This is just an example. A very simple one." 0 strcaseerror
+  ${StrCase} $0 "This is just an example. A very simple one." "L"
+  StrCmp $0 "this is just an example. a very simple one." 0 strcaseerror
+  ${StrCase} $0 "This is just an example. A very simple one." "U"
+  StrCmp $0 "THIS IS JUST AN EXAMPLE. A VERY SIMPLE ONE." 0 strcaseerror
+  ${StrCase} $0 "This is just an example. A very simple one." "T"
+  StrCmp $0 "This Is Just An Example. A Very Simple One." 0 strcaseerror
+  ${StrCase} $0 "This is just an example. A very simple one." "<>"
+  StrCmp $0 "tHIS IS JUST AN EXAMPLE. a VERY SIMPLE ONE." 0 strcaseerror
+  ${StrCase} $0 "123456789!@#%^&*()-_=+[]{};:,./<>?" "S"
+  StrCmp $0 "123456789!@#%^&*()-_=+[]{};:,./<>?" 0 strcaseerror
+  ${StrCase} $0 "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#%^&*()abcdefghijklmnopqrstuvwxyz-_=+[]{};:,./<>?" "<>"
+  StrCmp $0 "123456789abcdefghijklmnopqrstuvwxyz!@#%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ-_=+[]{};:,./<>?" 0 strcaseerror
+  ${StrCase} $0 "what about taking a shower tomorrow? it's late to do so now! try to sleep now. Good Night!" "S"
+  StrCmp $0 "What about taking a shower tomorrow? It's late to do so now! Try to sleep now. Good night!" 0 strcaseerror
+  !insertmacro StackVerificationEnd
+  IfErrors strcaseerror
+
+  DetailPrint "PASSED StrCase test"
+  Goto +2
+strcaseerror:
+  DetailPrint "FAILED StrCase test"
+
+  # Test clipboard function
+  !insertmacro StackVerificationStart
+  ${StrClb} $0 "StrFunc clipboard test" ">"
+  StrCmp $0 "" 0 strclberror
+  ${StrClb} $0 "StrFunc clipboard test #2" "<>"
+  StrCmp $0 "StrFunc clipboard test" 0 strclberror
+  ${StrClb} $0 "" "<"
+  StrCmp $0 "StrFunc clipboard test #2" 0 strclberror
+  ${StrClb} $0 "" ""
+  StrCmp $0 "" 0 strclberror
+  !insertmacro StackVerificationEnd
+  IfErrors strclberror
+
+  DetailPrint "PASSED StrClb test"
+  Goto +2
+strclberror:
+  DetailPrint "FAILED StrClb test"
+
+  # Test IO functions
+  !insertmacro StackVerificationStart
+  !macro testio str
+  ${StrNSISToIO} $0 "${str}"
+  ${StrIOToNSIS} $0 $0
+  StrCmp $0 "${str}" 0 ioerror
+  !macroend
+  !insertmacro testio "$\rtest$\n"
+  !insertmacro testio "test$\n"
+  !insertmacro testio "$\rtest"
+  !insertmacro testio "test"
+  !insertmacro testio "$\r\$\t$\n"
+  !insertmacro testio "$\r \ $\t $\n $$"
+  !insertmacro testio ""
+  !insertmacro testio " "
+  !insertmacro StackVerificationEnd
+  IfErrors ioerror
+
+  DetailPrint "PASSED StrNSISToIO/StrIOToNSIS test"
+  Goto +2
+ioerror:
+  DetailPrint "FAILED StrNSISToIO/StrIOToNSIS test"
+
+  # Test string search functions
+  !insertmacro StackVerificationStart
+  ${StrLoc} $0 "This is just an example" "just" "<"
+  StrCmp $0 "11" 0 strlocerror
+  ${StrLoc} $0 a abc <
+  StrCmp $0 "" 0 strlocerror
+  ${StrLoc} $0 a abc >
+  StrCmp $0 "" 0 strlocerror
+  ${StrLoc} $0 abc a >
+  StrCmp $0 "0" 0 strlocerror
+  ${StrLoc} $0 abc b >
+  StrCmp $0 "1" 0 strlocerror
+  ${StrLoc} $0 abc c >
+  StrCmp $0 "2" 0 strlocerror
+  ${StrLoc} $0 abc a <
+  StrCmp $0 "2" 0 strlocerror
+  ${StrLoc} $0 abc b <
+  StrCmp $0 "1" 0 strlocerror
+  ${StrLoc} $0 abc c <
+  StrCmp $0 "0" 0 strlocerror
+  ${StrLoc} $0 abc d <
+  StrCmp $0 "" 0 strlocerror
+  !insertmacro StackVerificationEnd
+  IfErrors strlocerror
+  
+  DetailPrint "PASSED StrLoc test"
+  Goto +2
+strlocerror:
+  DetailPrint "FAILED StrLoc test"
+
+  # Test string replacement
+  !insertmacro StackVerificationStart
+  ${StrRep} $0 "This is just an example" "an" "one"
+  StrCmp $0 "This is just one example" 0 strreperror
+  ${StrRep} $0 "test... test... 1 2 3..." "test" "testing"
+  StrCmp $0 "testing... testing... 1 2 3..." 0 strreperror
+  ${StrRep} $0 "" "test" "testing"
+  StrCmp $0 "" 0 strreperror
+  ${StrRep} $0 "test" "test" "testing"
+  StrCmp $0 "testing" 0 strreperror
+  ${StrRep} $0 "test" "test" ""
+  StrCmp $0 "" 0 strreperror
+  ${StrRep} $0 "test" "" "abc"
+  StrCmp $0 "test" 0 strreperror
+  ${StrRep} $0 "test" "" ""
+  StrCmp $0 "test" 0 strreperror
+  !insertmacro StackVerificationEnd
+  IfErrors strreperror
+  
+  DetailPrint "PASSED StrRep test"
+  Goto +2
+strreperror:
+  DetailPrint "FAILED StrRep test"
+
+  # Test sorting
+  !insertmacro StackVerificationStart
+  ${StrSort} $0 "This is just an example" "" " just" "ple" "0" "0" "0"
+  StrCmp $0 "This is an exam" 0 strsorterror
+  ${StrSort} $0 "This is just an example" " " "j" " " "0" "" "0"
+  StrCmp $0 "just" 0 strsorterror
+  ${StrSort} $0 "This is just an example" "" "j" "" "0" "1" "0"
+  StrCmp $0 "This is just an example" 0 strsorterror
+  ${StrSort} $0 "This is just an example" " " "us" "" "0" "1" "0"
+  StrCmp $0 "just an example" 0 strsorterror
+  ${StrSort} $0 "This is just an example" "" "u" " " "0" "1" "0"
+  StrCmp $0 "This is just" 0 strsorterror
+  ${StrSort} $0 "This is just an example" " " "just" " " "0" "1" "0"
+  StrCmp $0 "just" 0 strsorterror
+  ${StrSort} $0 "This is just an example" " " "t" " " "0" "1" "0"
+  StrCmp $0 "This" 0 strsorterror
+  ${StrSort} $0 "This is just an example" " " "le" " " "0" "1" "0"
+  StrCmp $0 "example" 0 strsorterror
+  ${StrSort} $0 "This is just an example" " " "le" " " "1" "0" "0"
+  StrCmp $0 " examp" 0 strsorterror
+  ${StrSort} $0 "an error has occurred" " " "e" " " "0" "1" "0"
+  StrCmp $0 "error" 0 strsorterror
+  ${StrSort} $0 "" " " "something" " " "0" "1" "0"
+  StrCmp $0 "" 0 strsorterror
+  ${StrSort} $0 "This is just an example" " " "j" " " "" "" ""
+  StrCmp $0 " just " 0 strsorterror
+  ${StrSort} $0 "This is just an example" " " "j" " " "1" "0" "1"
+  StrCmp $0 " ust " 0 strsorterror
+  ${StrSort} $0 "This is just an example" "" "j" "" "0" "0" "1"
+  StrCmp $0 "This is ust an example" 0 strsorterror
+  ${StrSort} $0 "This is just an example" " " "us" "" "1" "0" "0"
+  StrCmp $0 " jt an example" 0 strsorterror
+  ${StrSort} $0 "This is just an example" "" "u" " " "0" "0" "1"
+  StrCmp $0 "This is jst " 0 strsorterror
+  ${StrSort} $0 "This is just an example" " " "just" " " "1" "0" "1"
+  StrCmp $0 "  " 0 strsorterror
+  ${StrSort} $0 "an error has occurred" " " "e" "h" "1" "0" "0"
+  StrCmp $0 " rror " 0 strsorterror
+  ${StrSort} $0 "" " " "something" " " "1" "0" "1"
+  StrCmp $0 "" 0 strsorterror
+  !insertmacro StackVerificationEnd
+  IfErrors strsorterror
+  
+  DetailPrint "PASSED StrSort test"
+  Goto +2
+strsorterror:
+  DetailPrint "FAILED StrSort test"
+
+  !insertmacro StackVerificationStart
+  ${StrStr} $0 "abcefghijklmnopqrstuvwxyz" "g"
+  StrCmp $0 "ghijklmnopqrstuvwxyz" 0 strstrerror
+  ${StrStr} $0 "abcefghijklmnopqrstuvwxyz" "ga"
+  StrCmp $0 "" 0 strstrerror
+  ${StrStr} $0 "abcefghijklmnopqrstuvwxyz" ""
+  StrCmp $0 "abcefghijklmnopqrstuvwxyz" 0 strstrerror
+  ${StrStr} $0 "a" "abcefghijklmnopqrstuvwxyz"
+  StrCmp $0 "" 0 strstrerror
+  !insertmacro StackVerificationEnd
+  IfErrors strstrerror
+  
+  DetailPrint "PASSED StrStr test"
+  Goto +2
+strstrerror:
+  DetailPrint "FAILED StrStr test"
+
+  !insertmacro StackVerificationStart
+  ${StrStrAdv} $0 "abcabcabc" "a" ">" ">" "1" "0" "0"
+  StrCmp $0 "abcabcabc" 0 strstradverror
+  ${StrStrAdv} $0 "abcabcabc" "a" ">" ">" "1" "1" "0"
+  StrCmp $0 "abcabc" 0 strstradverror
+  ${StrStrAdv} $0 "abcabcabc" "a" ">" ">" "1" "2" "0"
+  StrCmp $0 "abc" 0 strstradverror
+  ${StrStrAdv} $0 "abcabcabc" "a" ">" ">" "1" "3" "0"
+  StrCmp $0 "" 0 strstradverror
+  ${StrStrAdv} $0 "abcabcabc" "abc" ">" "<" "1" "1" "0"
+  StrCmp $0 "abcabc" 0 strstradverror
+  ${StrStrAdv} $0 "abcabcabc" "abc" ">" "<" "0" "1" "0"
+  StrCmp $0 "abc" 0 strstradverror
+  ${StrStrAdv} $0 "abcabcabc" "abc" "<" "<" "1" "0" "0"
+  StrCmp $0 "abcabcabc" 0 strstradverror
+  ${StrStrAdv} $0 "abcabcabc" "abc" "<" "<" "0" "0" "0"
+  StrCmp $0 "abcabc" 0 strstradverror
+  ${StrStrAdv} $0 "abcabcabc" "abc" "<" ">" "0" "0" "0"
+  StrCmp $0 "" 0 strstradverror
+  ${StrStrAdv} $0 "abcabcabc" "abc" "<" ">" "0" "1" "0"
+  StrCmp $0 "abc" 0 strstradverror
+  ${StrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "0" "1"
+  StrCmp $0 "abcabc" 0 strstradverror
+  ${StrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "1" "1"
+  StrCmp $0 "abc" 0 strstradverror
+  ${StrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "2" "1"
+  StrCmp $0 "" 0 strstradverror
+  ${StrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "3" "1"
+  StrCmp $0 "" 0 strstradverror
+  ${StrStrAdv} $0 "ABCabcabc" "abc" ">" "<" "1" "1" "1"
+  StrCmp $0 "ABCabcabc" 0 strstradverror
+  ${StrStrAdv} $0 "ABCabcabc" "abc" ">" "<" "0" "1" "1"
+  StrCmp $0 "ABCabc" 0 strstradverror
+  ${StrStrAdv} $0 "ABCabcabc" "abc" "<" "<" "1" "0" "1"
+  StrCmp $0 "ABCabcabc" 0 strstradverror
+  ${StrStrAdv} $0 "ABCabcabc" "abc" "<" "<" "0" "0" "1"
+  StrCmp $0 "ABCabc" 0 strstradverror
+  ${StrStrAdv} $0 "ABCabcabc" "abc" "<" ">" "0" "0" "1"
+  StrCmp $0 "" 0 strstradverror
+  ${StrStrAdv} $0 "ABCabcabc" "abc" "<" ">" "0" "1" "1"
+  StrCmp $0 "abc" 0 strstradverror
+  !insertmacro StackVerificationEnd
+  IfErrors strstradverror
+  
+  DetailPrint "PASSED StrStrAdv test"
+  Goto +2
+strstradverror:
+  DetailPrint "FAILED StrStrAdv test"
+
+  # Test tokenizer
+  !insertmacro StackVerificationStart
+  ${StrTok} $0 "This is, or is not, just an example" " ," "4" "1"
+  StrCmp $0 "not" 0 strtokerror
+  ${StrTok} $0 "This is, or is not, just an example" " ," "4" "0"
+  StrCmp $0 "is" 0 strtokerror
+  ${StrTok} $0 "This is, or is not, just an example" " ," "152" "0"
+  StrCmp $0 "" 0 strtokerror
+  ${StrTok} $0 "This is, or is not, just an example" " ," "" "0"
+  StrCmp $0 "example" 0 strtokerror
+  ${StrTok} $0 "This is, or is not, just an example" " ," "L" "0"
+  StrCmp $0 "example" 0 strtokerror
+  ${StrTok} $0 "This is, or is not, just an example" " ," "0" "0"
+  StrCmp $0 "This" 0 strtokerror
+  !insertmacro StackVerificationEnd
+  IfErrors strtokerror
+  
+  DetailPrint "PASSED StrTok test"
+  Goto +2
+strtokerror:
+  DetailPrint "FAILED StrTok test"
+
+  # Test trim new lines
+  !insertmacro StackVerificationStart
+  ${StrTrimNewLines} $0 "$\r$\ntest$\r$\ntest$\r$\n"
+  StrCmp $0 "$\r$\ntest$\r$\ntest" 0 strtrimnewlineserror
+  !insertmacro StackVerificationEnd
+  IfErrors strtrimnewlineserror
+
+  DetailPrint "PASSED StrTrimNewLines test"
+  Goto +2
+strtrimnewlineserror:
+  DetailPrint "FAILED StrTrimNewLines test"
+
+  WriteUninstaller $EXEDIR\UnStrFunc.exe
+  
+  Exec $EXEDIR\UnStrFunc.exe
+
+SectionEnd
+
+Section Uninstall
+
+  # Test case conversion
+  !insertmacro StackVerificationStart
+  ${UnStrCase} $0 "This is just an example. A very simple one." ""
+  StrCmp $0 "This is just an example. A very simple one." 0 strcaseerror
+  ${UnStrCase} $0 "THIS IS JUST AN EXAMPLE. A VERY SIMPLE ONE." "S"
+  StrCmp $0 "This is just an example. A very simple one." 0 strcaseerror
+  ${UnStrCase} $0 "This is just an example. A very simple one." "L"
+  StrCmp $0 "this is just an example. a very simple one." 0 strcaseerror
+  ${UnStrCase} $0 "This is just an example. A very simple one." "U"
+  StrCmp $0 "THIS IS JUST AN EXAMPLE. A VERY SIMPLE ONE." 0 strcaseerror
+  ${UnStrCase} $0 "This is just an example. A very simple one." "T"
+  StrCmp $0 "This Is Just An Example. A Very Simple One." 0 strcaseerror
+  ${UnStrCase} $0 "This is just an example. A very simple one." "<>"
+  StrCmp $0 "tHIS IS JUST AN EXAMPLE. a VERY SIMPLE ONE." 0 strcaseerror
+  ${UnStrCase} $0 "123456789!@#%^&*()-_=+[]{};:,./<>?" "S"
+  StrCmp $0 "123456789!@#%^&*()-_=+[]{};:,./<>?" 0 strcaseerror
+  ${UnStrCase} $0 "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#%^&*()abcdefghijklmnopqrstuvwxyz-_=+[]{};:,./<>?" "<>"
+  StrCmp $0 "123456789abcdefghijklmnopqrstuvwxyz!@#%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ-_=+[]{};:,./<>?" 0 strcaseerror
+  ${UnStrCase} $0 "what about taking a shower tomorrow? it's late to do so now! try to sleep now. Good Night!" "S"
+  StrCmp $0 "What about taking a shower tomorrow? It's late to do so now! Try to sleep now. Good night!" 0 strcaseerror
+  !insertmacro StackVerificationEnd
+  IfErrors strcaseerror
+
+  DetailPrint "PASSED StrCase test"
+  Goto +2
+strcaseerror:
+  DetailPrint "FAILED StrCase test"
+
+  # Test clipboard function
+  !insertmacro StackVerificationStart
+  ${UnStrClb} $0 "StrFunc clipboard test" ">"
+  StrCmp $0 "" 0 strclberror
+  ${UnStrClb} $0 "StrFunc clipboard test #2" "<>"
+  StrCmp $0 "StrFunc clipboard test" 0 strclberror
+  ${UnStrClb} $0 "" "<"
+  StrCmp $0 "StrFunc clipboard test #2" 0 strclberror
+  ${UnStrClb} $0 "" ""
+  StrCmp $0 "" 0 strclberror
+  !insertmacro StackVerificationEnd
+  IfErrors strclberror
+
+  DetailPrint "PASSED StrClb test"
+  Goto +2
+strclberror:
+  DetailPrint "FAILED StrClb test"
+
+  # Test IO functions
+  !insertmacro StackVerificationStart
+  !macro untestio str
+  ${UnStrNSISToIO} $0 "${str}"
+  ${UnStrIOToNSIS} $0 $0
+  StrCmp $0 "${str}" 0 ioerror
+  !macroend
+  !insertmacro untestio "$\rtest$\n"
+  !insertmacro untestio "test$\n"
+  !insertmacro untestio "$\rtest"
+  !insertmacro untestio "test"
+  !insertmacro untestio "$\r\$\t$\n"
+  !insertmacro untestio "$\r \ $\t $\n $$"
+  !insertmacro untestio ""
+  !insertmacro untestio " "
+  !insertmacro StackVerificationEnd
+  IfErrors ioerror
+
+  DetailPrint "PASSED StrNSISToIO/StrIOToNSIS test"
+  Goto +2
+ioerror:
+  DetailPrint "FAILED StrNSISToIO/StrIOToNSIS test"
+
+  # Test string search functions
+  !insertmacro StackVerificationStart
+  ${UnStrLoc} $0 "This is just an example" "just" "<"
+  StrCmp $0 "11" 0 strlocerror
+  ${UnStrLoc} $0 a abc <
+  StrCmp $0 "" 0 strlocerror
+  ${UnStrLoc} $0 a abc >
+  StrCmp $0 "" 0 strlocerror
+  ${UnStrLoc} $0 abc a >
+  StrCmp $0 "0" 0 strlocerror
+  ${UnStrLoc} $0 abc b >
+  StrCmp $0 "1" 0 strlocerror
+  ${UnStrLoc} $0 abc c >
+  StrCmp $0 "2" 0 strlocerror
+  ${UnStrLoc} $0 abc a <
+  StrCmp $0 "2" 0 strlocerror
+  ${UnStrLoc} $0 abc b <
+  StrCmp $0 "1" 0 strlocerror
+  ${UnStrLoc} $0 abc c <
+  StrCmp $0 "0" 0 strlocerror
+  ${UnStrLoc} $0 abc d <
+  StrCmp $0 "" 0 strlocerror
+  !insertmacro StackVerificationEnd
+  IfErrors strlocerror
+
+  DetailPrint "PASSED StrLoc test"
+  Goto +2
+strlocerror:
+  DetailPrint "FAILED StrLoc test"
+
+  # Test string replacement
+  !insertmacro StackVerificationStart
+  ${UnStrRep} $0 "This is just an example" "an" "one"
+  StrCmp $0 "This is just one example" 0 strreperror
+  ${UnStrRep} $0 "test... test... 1 2 3..." "test" "testing"
+  StrCmp $0 "testing... testing... 1 2 3..." 0 strreperror
+  ${UnStrRep} $0 "" "test" "testing"
+  StrCmp $0 "" 0 strreperror
+  ${UnStrRep} $0 "test" "test" "testing"
+  StrCmp $0 "testing" 0 strreperror
+  ${UnStrRep} $0 "test" "test" ""
+  StrCmp $0 "" 0 strreperror
+  ${UnStrRep} $0 "test" "" "abc"
+  StrCmp $0 "test" 0 strreperror
+  ${UnStrRep} $0 "test" "" ""
+  StrCmp $0 "test" 0 strreperror
+  !insertmacro StackVerificationEnd
+  IfErrors strreperror
+
+  DetailPrint "PASSED StrRep test"
+  Goto +2
+strreperror:
+  DetailPrint "FAILED StrRep test"
+
+  # Test sorting
+  !insertmacro StackVerificationStart
+  ${UnStrSort} $0 "This is just an example" "" " just" "ple" "0" "0" "0"
+  StrCmp $0 "This is an exam" 0 strsorterror
+  ${UnStrSort} $0 "This is just an example" " " "j" " " "0" "" "0"
+  StrCmp $0 "just" 0 strsorterror
+  ${UnStrSort} $0 "This is just an example" "" "j" "" "0" "1" "0"
+  StrCmp $0 "This is just an example" 0 strsorterror
+  ${UnStrSort} $0 "This is just an example" " " "us" "" "0" "1" "0"
+  StrCmp $0 "just an example" 0 strsorterror
+  ${UnStrSort} $0 "This is just an example" "" "u" " " "0" "1" "0"
+  StrCmp $0 "This is just" 0 strsorterror
+  ${UnStrSort} $0 "This is just an example" " " "just" " " "0" "1" "0"
+  StrCmp $0 "just" 0 strsorterror
+  ${UnStrSort} $0 "This is just an example" " " "t" " " "0" "1" "0"
+  StrCmp $0 "This" 0 strsorterror
+  ${UnStrSort} $0 "This is just an example" " " "le" " " "0" "1" "0"
+  StrCmp $0 "example" 0 strsorterror
+  ${UnStrSort} $0 "This is just an example" " " "le" " " "1" "0" "0"
+  StrCmp $0 " examp" 0 strsorterror
+  ${UnStrSort} $0 "an error has occurred" " " "e" " " "0" "1" "0"
+  StrCmp $0 "error" 0 strsorterror
+  ${UnStrSort} $0 "" " " "something" " " "0" "1" "0"
+  StrCmp $0 "" 0 strsorterror
+  ${UnStrSort} $0 "This is just an example" " " "j" " " "" "" ""
+  StrCmp $0 " just " 0 strsorterror
+  ${UnStrSort} $0 "This is just an example" " " "j" " " "1" "0" "1"
+  StrCmp $0 " ust " 0 strsorterror
+  ${UnStrSort} $0 "This is just an example" "" "j" "" "0" "0" "1"
+  StrCmp $0 "This is ust an example" 0 strsorterror
+  ${UnStrSort} $0 "This is just an example" " " "us" "" "1" "0" "0"
+  StrCmp $0 " jt an example" 0 strsorterror
+  ${UnStrSort} $0 "This is just an example" "" "u" " " "0" "0" "1"
+  StrCmp $0 "This is jst " 0 strsorterror
+  ${UnStrSort} $0 "This is just an example" " " "just" " " "1" "0" "1"
+  StrCmp $0 "  " 0 strsorterror
+  ${UnStrSort} $0 "an error has occurred" " " "e" "h" "1" "0" "0"
+  StrCmp $0 " rror " 0 strsorterror
+  ${UnStrSort} $0 "" " " "something" " " "1" "0" "1"
+  StrCmp $0 "" 0 strsorterror
+  !insertmacro StackVerificationEnd
+  IfErrors strsorterror
+
+  DetailPrint "PASSED StrSort test"
+  Goto +2
+strsorterror:
+  DetailPrint "FAILED StrSort test"
+
+  !insertmacro StackVerificationStart
+  ${UnStrStr} $0 "abcefghijklmnopqrstuvwxyz" "g"
+  StrCmp $0 "ghijklmnopqrstuvwxyz" 0 strstrerror
+  ${UnStrStr} $0 "abcefghijklmnopqrstuvwxyz" "ga"
+  StrCmp $0 "" 0 strstrerror
+  ${UnStrStr} $0 "abcefghijklmnopqrstuvwxyz" ""
+  StrCmp $0 "abcefghijklmnopqrstuvwxyz" 0 strstrerror
+  ${UnStrStr} $0 "a" "abcefghijklmnopqrstuvwxyz"
+  StrCmp $0 "" 0 strstrerror
+  !insertmacro StackVerificationEnd
+  IfErrors strstrerror
+
+  DetailPrint "PASSED StrStr test"
+  Goto +2
+strstrerror:
+  DetailPrint "FAILED StrStr test"
+
+  !insertmacro StackVerificationStart
+  ${UnStrStrAdv} $0 "abcabcabc" "a" ">" ">" "1" "0" "0"
+  StrCmp $0 "abcabcabc" 0 strstradverror
+  ${UnStrStrAdv} $0 "abcabcabc" "a" ">" ">" "1" "1" "0"
+  StrCmp $0 "abcabc" 0 strstradverror
+  ${UnStrStrAdv} $0 "abcabcabc" "a" ">" ">" "1" "2" "0"
+  StrCmp $0 "abc" 0 strstradverror
+  ${UnStrStrAdv} $0 "abcabcabc" "a" ">" ">" "1" "3" "0"
+  StrCmp $0 "" 0 strstradverror
+  ${UnStrStrAdv} $0 "abcabcabc" "abc" ">" "<" "1" "1" "0"
+  StrCmp $0 "abcabc" 0 strstradverror
+  ${UnStrStrAdv} $0 "abcabcabc" "abc" ">" "<" "0" "1" "0"
+  StrCmp $0 "abc" 0 strstradverror
+  ${UnStrStrAdv} $0 "abcabcabc" "abc" "<" "<" "1" "0" "0"
+  StrCmp $0 "abcabcabc" 0 strstradverror
+  ${UnStrStrAdv} $0 "abcabcabc" "abc" "<" "<" "0" "0" "0"
+  StrCmp $0 "abcabc" 0 strstradverror
+  ${UnStrStrAdv} $0 "abcabcabc" "abc" "<" ">" "0" "0" "0"
+  StrCmp $0 "" 0 strstradverror
+  ${UnStrStrAdv} $0 "abcabcabc" "abc" "<" ">" "0" "1" "0"
+  StrCmp $0 "abc" 0 strstradverror
+  ${UnStrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "0" "1"
+  StrCmp $0 "abcabc" 0 strstradverror
+  ${UnStrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "1" "1"
+  StrCmp $0 "abc" 0 strstradverror
+  ${UnStrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "2" "1"
+  StrCmp $0 "" 0 strstradverror
+  ${UnStrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "3" "1"
+  StrCmp $0 "" 0 strstradverror
+  ${UnStrStrAdv} $0 "ABCabcabc" "abc" ">" "<" "1" "1" "1"
+  StrCmp $0 "ABCabcabc" 0 strstradverror
+  ${UnStrStrAdv} $0 "ABCabcabc" "abc" ">" "<" "0" "1" "1"
+  StrCmp $0 "ABCabc" 0 strstradverror
+  ${UnStrStrAdv} $0 "ABCabcabc" "abc" "<" "<" "1" "0" "1"
+  StrCmp $0 "ABCabcabc" 0 strstradverror
+  ${UnStrStrAdv} $0 "ABCabcabc" "abc" "<" "<" "0" "0" "1"
+  StrCmp $0 "ABCabc" 0 strstradverror
+  ${UnStrStrAdv} $0 "ABCabcabc" "abc" "<" ">" "0" "0" "1"
+  StrCmp $0 "" 0 strstradverror
+  ${UnStrStrAdv} $0 "ABCabcabc" "abc" "<" ">" "0" "1" "1"
+  StrCmp $0 "abc" 0 strstradverror
+  !insertmacro StackVerificationEnd
+  IfErrors strstradverror
+
+  DetailPrint "PASSED StrStrAdv test"
+  Goto +2
+strstradverror:
+  DetailPrint "FAILED StrStrAdv test"
+
+  # Test tokenizer
+  !insertmacro StackVerificationStart
+  ${UnStrTok} $0 "This is, or is not, just an example" " ," "4" "1"
+  StrCmp $0 "not" 0 strtokerror
+  ${UnStrTok} $0 "This is, or is not, just an example" " ," "4" "0"
+  StrCmp $0 "is" 0 strtokerror
+  ${UnStrTok} $0 "This is, or is not, just an example" " ," "152" "0"
+  StrCmp $0 "" 0 strtokerror
+  ${UnStrTok} $0 "This is, or is not, just an example" " ," "" "0"
+  StrCmp $0 "example" 0 strtokerror
+  ${UnStrTok} $0 "This is, or is not, just an example" " ," "L" "0"
+  StrCmp $0 "example" 0 strtokerror
+  ${UnStrTok} $0 "This is, or is not, just an example" " ," "0" "0"
+  StrCmp $0 "This" 0 strtokerror
+  !insertmacro StackVerificationEnd
+  IfErrors strtokerror
+
+  DetailPrint "PASSED StrTok test"
+  Goto +2
+strtokerror:
+  DetailPrint "FAILED StrTok test"
+
+  # Test trim new lines
+  !insertmacro StackVerificationStart
+  ${UnStrTrimNewLines} $0 "$\r$\ntest$\r$\ntest$\r$\n"
+  StrCmp $0 "$\r$\ntest$\r$\ntest" 0 strtrimnewlineserror
+  !insertmacro StackVerificationEnd
+  IfErrors strtrimnewlineserror
+
+  DetailPrint "PASSED StrTrimNewLines test"
+  Goto +2
+strtrimnewlineserror:
+  DetailPrint "FAILED StrTrimNewLines test"
+
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/TextFunc.ini
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/TextFunc.ini	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/TextFunc.ini	(revision 728)
@@ -0,0 +1,130 @@
+[Settings]
+NumFields=15
+NextButtonText=&Enter
+
+[Field 1]
+Type=Droplist
+Flags=NOTIFY
+State=1. LineFind
+ListItems=1. LineFind|2. LineRead|3. FileReadFromEnd|4. LineSum|5. FileJoin|6. TextCompare|7. ConfigRead|8. ConfigWrite|9. FileRecode
+Left=44
+Right=139
+Top=9
+Bottom=100
+
+[Field 2]
+Type=FileRequest
+Left=44
+Right=-17
+Top=30
+Bottom=41
+
+[Field 3]
+Type=FileRequest
+Left=44
+Right=-17
+Top=46
+Bottom=57
+
+[Field 4]
+Type=FileRequest
+State=3:-1
+Left=44
+Right=-17
+Top=62
+Bottom=75
+
+[Field 5]
+Type=Droplist
+Flags=NOTIFY
+State=Example1  (delete first two symbols)
+ListItems=Example1  (delete first two symbols)|Example2  (show changed lines)|Example3  (delete lines)|Example4  (insert lines)|Example5  (replace in file - WordFunc.nsh required)|Example6  (line string to cut or delete)|Example7  (read lines)
+Left=44
+Right=-36
+Top=81
+Bottom=155
+
+[Field 6]
+Type=Droplist
+Flags=NOTIFY
+State=Example1  (Different or Equal)
+ListItems=Example1  (Different or Equal)|Example2  (Compare line-by-line - Different)|Example3  (Compare line-by-line - Equal)|Example4  (Compare all lines - Different)|Example5  (Compare all lines - Equal)
+Left=44
+Right=-36
+Top=81
+Bottom=140
+
+[Field 7]
+Type=Droplist
+State=FileReadFromEndCallback
+ListItems=FileReadFromEndCallback
+Left=44
+Right=-36
+Top=81
+Bottom=92
+
+[Field 8]
+Type=Text
+Flags=READONLY
+Left=9
+Right=-36
+Top=108
+Bottom=120
+
+[Field 9]
+Type=Button
+Text=Edit
+Flags=NOTIFY
+Left=234
+Right=256
+Top=81
+Bottom=92
+
+[Field 10]
+Type=Button
+Text=Log
+Flags=NOTIFY|DISABLED
+Left=234
+Right=256
+Top=108
+Bottom=120
+
+[Field 11]
+Type=Label
+Text=InputFile
+Left=10
+Right=43
+Top=32
+Bottom=44
+
+[Field 12]
+Type=Label
+Text=OutputFile
+Left=10
+Right=43
+Top=48
+Bottom=60
+
+[Field 13]
+Type=Label
+Text=Range
+Left=10
+Right=44
+Top=65
+Bottom=75
+
+[Field 14]
+Type=Label
+Text=Function
+Left=10
+Right=43
+Top=81
+Bottom=92
+
+[Field 15]
+Type=Label
+Text=Result:
+Left=10
+Right=229
+Top=97
+Bottom=105

Property changes on: tmp/trunk/org.txm.setups/nsis/Examples/TextFunc.ini
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Examples/waplugin.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/waplugin.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/waplugin.nsi	(revision 728)
@@ -0,0 +1,205 @@
+; waplugin.nsi
+;
+; This script will generate an installer that installs a Winamp 2 plug-in.
+;
+; This installer will automatically alert the user that installation was
+; successful, and ask them whether or not they would like to make the 
+; plug-in the default and run Winamp.
+
+;--------------------------------
+
+; Uncomment the next line to enable auto Winamp download
+; !define WINAMP_AUTOINSTALL
+
+; The name of the installer
+Name "TinyVis Plug-in"
+
+; The file to write
+OutFile "waplugin.exe"
+
+; The default installation directory
+InstallDir $PROGRAMFILES\Winamp
+
+; detect winamp path from uninstall string if available
+InstallDirRegKey HKLM \
+                 "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" \
+                 "UninstallString"
+
+; The text to prompt the user to enter a directory
+DirText "Please select your Winamp path below (you will be able to proceed when Winamp is detected):"
+# currently doesn't work - DirShow hide
+
+; automatically close the installer when done.
+AutoCloseWindow true
+
+; hide the "show details" box
+ShowInstDetails nevershow
+
+; Request application privileges for Windows Vista
+RequestExecutionLevel admin
+
+;--------------------------------
+
+;Pages
+
+Page directory
+Page instfiles
+
+;--------------------------------
+
+; The stuff to install
+
+Section ""
+
+!ifdef WINAMP_AUTOINSTALL
+  Call MakeSureIGotWinamp
+!endif
+
+  Call QueryWinampVisPath
+  SetOutPath $1
+
+  ; File to extract
+  #File "C:\program files\winamp\plugins\vis_nsfs.dll"
+  File /oname=vis_nsfs.dll "${NSISDIR}\Plugins\TypeLib.dll" # dummy plug-in
+
+  ; prompt user, and if they select no, go to NoWinamp
+  MessageBox MB_YESNO|MB_ICONQUESTION \
+             "The plug-in was installed. Would you like to run Winamp now with TinyVis as the default plug-in?" \
+             IDNO NoWinamp
+    WriteINIStr "$INSTDIR\Winamp.ini" "Winamp" "visplugin_name" "vis_nsfs.dll"
+    WriteINIStr "$INSTDIR\Winamp.ini" "Winamp" "visplugin_num" "0"
+    Exec '"$INSTDIR\Winamp.exe"'
+  NoWinamp:
+  
+SectionEnd
+
+;--------------------------------
+
+Function .onVerifyInstDir
+
+!ifndef WINAMP_AUTOINSTALL
+
+  ;Check for Winamp installation
+
+  IfFileExists $INSTDIR\Winamp.exe Good
+    Abort
+  Good:
+
+!endif ; WINAMP_AUTOINSTALL
+
+FunctionEnd
+
+Function QueryWinampVisPath ; sets $1 with vis path
+
+  StrCpy $1 $INSTDIR\Plugins
+  ; use DSPDir instead of VISDir to get DSP plugins directory
+  ReadINIStr $9 $INSTDIR\winamp.ini Winamp VisDir 
+  StrCmp $9 "" End
+  IfFileExists $9 0 End
+    StrCpy $1 $9 ; update dir
+  End:
+  
+FunctionEnd
+
+!ifdef WINAMP_AUTOINSTALL
+
+Function GetWinampInstPath
+
+  Push $0
+  Push $1
+  Push $2
+  ReadRegStr $0 HKLM \
+     "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" \ 
+     "UninstallString"
+  StrCmp $0 "" fin
+
+    StrCpy $1 $0 1 0 ; get firstchar
+    StrCmp $1 '"' "" getparent 
+      ; if first char is ", let's remove "'s first.
+      StrCpy $0 $0 "" 1
+      StrCpy $1 0
+      rqloop:
+        StrCpy $2 $0 1 $1
+        StrCmp $2 '"' rqdone
+        StrCmp $2 "" rqdone
+        IntOp $1 $1 + 1
+        Goto rqloop
+      rqdone:
+      StrCpy $0 $0 $1
+    getparent:
+    ; the uninstall string goes to an EXE, let's get the directory.
+    StrCpy $1 -1
+    gploop:
+      StrCpy $2 $0 1 $1
+      StrCmp $2 "" gpexit
+      StrCmp $2 "\" gpexit
+      IntOp $1 $1 - 1
+      Goto gploop
+    gpexit:
+    StrCpy $0 $0 $1
+
+    StrCmp $0 "" fin
+    IfFileExists $0\winamp.exe fin
+      StrCpy $0 ""
+  fin:
+  Pop $2
+  Pop $1
+  Exch $0
+  
+FunctionEnd
+
+Function MakeSureIGotWinamp
+
+  Call GetWinampInstPath
+  
+  Pop $0
+  StrCmp $0 "" getwinamp
+    Return
+    
+  getwinamp:
+  
+  Call ConnectInternet ;Make an internet connection (if no connection available)
+  
+  StrCpy $2 "$TEMP\Winamp Installer.exe"
+  NSISdl::download http://download.nullsoft.com/winamp/client/winamp281_lite.exe $2
+  Pop $0
+  StrCmp $0 success success
+    SetDetailsView show
+    DetailPrint "download failed: $0"
+    Abort
+  success:
+    ExecWait '"$2" /S'
+    Delete $2
+    Call GetWinampInstPath
+    Pop $0
+    StrCmp $0 "" skip
+    StrCpy $INSTDIR $0
+  skip:
+  
+FunctionEnd
+
+Function ConnectInternet
+
+  Push $R0
+    
+    ClearErrors
+    Dialer::AttemptConnect
+    IfErrors noie3
+    
+    Pop $R0
+    StrCmp $R0 "online" connected
+      MessageBox MB_OK|MB_ICONSTOP "Cannot connect to the internet."
+      Quit
+    
+    noie3:
+  
+    ; IE3 not installed
+    MessageBox MB_OK|MB_ICONINFORMATION "Please connect to the internet now."
+    
+    connected:
+  
+  Pop $R0
+  
+FunctionEnd
+
+!endif ; WINAMP_AUTOINSTALL
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/WordFuncTest.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/WordFuncTest.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/WordFuncTest.nsi	(revision 728)
@@ -0,0 +1,610 @@
+;_____________________________________________________________________________
+;
+;                          Word Functions Test
+;_____________________________________________________________________________
+;
+; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
+
+Name "Word Functions Test"
+OutFile "WordFuncTest.exe"
+Caption "$(^Name)"
+ShowInstDetails show
+XPStyle on
+RequestExecutionLevel user
+
+Var FUNCTION
+Var OUT
+
+!include "WordFunc.nsh"
+
+;############### INSTALL ###############
+
+!define StackVerificationStart `!insertmacro StackVerificationStart`
+!macro StackVerificationStart _FUNCTION
+	StrCpy $FUNCTION ${_FUNCTION}
+	Call StackVerificationStart
+!macroend
+
+!define StackVerificationEnd `!insertmacro StackVerificationEnd`
+!macro StackVerificationEnd
+	Call StackVerificationEnd
+!macroend
+
+Function StackVerificationStart
+	StrCpy $0 !0
+	StrCpy $1 !1
+	StrCpy $2 !2
+	StrCpy $3 !3
+	StrCpy $4 !4
+	StrCpy $5 !5
+	StrCpy $6 !6
+	StrCpy $7 !7
+	StrCpy $8 !8
+	StrCpy $9 !9
+	StrCpy $R0 !R0
+	StrCpy $R1 !R1
+	StrCpy $R2 !R2
+	StrCpy $R3 !R3
+	StrCpy $R4 !R4
+	StrCpy $R5 !R5
+	StrCpy $R6 !R6
+	StrCpy $R7 !R7
+	StrCpy $R8 !R8
+	StrCpy $R9 !R9
+FunctionEnd
+
+Function StackVerificationEnd
+	IfErrors +3
+	DetailPrint 'PASSED $FUNCTION no errors'
+	goto +2
+	DetailPrint 'FAILED   $FUNCTION error'
+
+	StrCmp $0 '!0' 0 error
+	StrCmp $1 '!1' 0 error
+	StrCmp $2 '!2' 0 error
+	StrCmp $3 '!3' 0 error
+	StrCmp $4 '!4' 0 error
+	StrCmp $5 '!5' 0 error
+	StrCmp $6 '!6' 0 error
+	StrCmp $7 '!7' 0 error
+	StrCmp $8 '!8' 0 error
+	StrCmp $9 '!9' 0 error
+	StrCmp $R0 '!R0' 0 error
+	StrCmp $R1 '!R1' 0 error
+	StrCmp $R2 '!R2' 0 error
+	StrCmp $R3 '!R3' 0 error
+	StrCmp $R4 '!R4' 0 error
+	StrCmp $R5 '!R5' 0 error
+	StrCmp $R6 '!R6' 0 error
+	StrCmp $R7 '!R7' 0 error
+	StrCmp $R8 '!R8' 0 error
+	StrCmp $R9 '!R9' 0 error
+	DetailPrint 'PASSED $FUNCTION stack'
+	goto end
+
+	error:
+	DetailPrint 'FAILED   $FUNCTION stack'
+;	MessageBox MB_OKCANCEL '$$0={$0}$\n$$1={$1}$\n$$2={$2}$\n$$3={$3}$\n$$4={$4}$\n$$5={$5}$\n$$6={$6}$\n$$7={$7}$\n$$8={$8}$\n$$9={$9}$\n$$R0={$R0}$\n$$R1={$R1}$\n$$R2={$R2}$\n$$R3={$R3}$\n$$R4={$R4}$\n$$R5={$R5}$\n$$R6={$R6}$\n$$R7={$R7}$\n$$R8={$R8}$\n$$R9={$R9}' IDOK +2
+;	quit
+
+	end:
+FunctionEnd
+
+
+
+Section WordFind
+	${StackVerificationStart} WordFind
+
+	${WordFind} '||io.sys|||Program Files|||WINDOWS' '||' '-02' $OUT
+	StrCmp $OUT '|Program Files' 0 error
+
+	${WordFind} '||io.sys||||Program Files||||WINDOWS' '||' '-2' $OUT
+	StrCmp $OUT 'Program Files' 0 error
+
+	${WordFind} 'C:\io.sys|||logo.sys|||WINDOWS' '||' '-2}' $OUT
+	StrCmp $OUT '|logo.sys|||WINDOWS' 0 error
+
+	${WordFind} 'C:\io.sys|||logo.sys|||WINDOWS' '||' '#' $OUT
+	StrCmp $OUT '3' 0 error
+
+	${WordFind} 'C:\io.sys|||logo.sys|||WINDOWS' '||' '*' $OUT
+	StrCmp $OUT '2' 0 error
+
+	${WordFind} 'C:\io.sys|||Program Files|||WINDOWS' '||' '/|Program Files' $OUT
+	StrCmp $OUT '2' 0 error
+
+	${WordFind} 'C:\io.sys|||logo.sys|||WINDOWS' '||' '+2}}' $OUT
+	StrCmp $OUT '|||WINDOWS' 0 error
+
+	${WordFind} 'C:\io.sys|||logo.sys|||WINDOWS' '||' '+2{}' $OUT
+	StrCmp $OUT 'C:\io.sys|||WINDOWS' 0 error
+
+	${WordFind} 'C:\io.sys|||logo.sys|||WINDOWS' '||' '+2*}' $OUT
+	StrCmp $OUT '|logo.sys|||WINDOWS' 0 error
+
+	${WordFind} 'C:\\Program Files\\NSIS\\NSIS.chm' '\' '-2{*' $OUT
+	StrCmp $OUT 'C:\\Program Files\\NSIS' 0 error
+
+	${WordFind} 'C:\io.sys|||Program Files|||WINDOWS|||' '||' '-1' $OUT
+	StrCmp $OUT '|' 0 error
+
+	${WordFind} '||C:\io.sys|||logo.sys|||WINDOWS||' '||' '-1}' $OUT
+	StrCmp $OUT '' 0 error
+
+	${WordFind} '||C:\io.sys|||logo.sys|||WINDOWS||' '||' '+1{' $OUT
+	StrCmp $OUT '' 0 error
+
+	${WordFind} 'C:\io.sys|||logo.sys' '_' 'E+1' $OUT
+	IfErrors 0 error
+	StrCmp $OUT 1 0 error
+
+	${WordFind} 'C:\io.sys|||logo.sys|||' '\' 'E+3' $OUT
+	IfErrors 0 error
+	StrCmp $OUT 2 0 error
+
+	${WordFind} 'C:\io.sys|||logo.sys' '\' 'E1' $OUT
+	IfErrors 0 error
+	StrCmp $OUT 3 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section WordFindS
+	${StackVerificationStart} WordFindS
+
+	${WordFindS} 'C:\io.sys|||Program Files|||WINDOWS' '||' '/|PROGRAM FILES' $OUT
+	StrCmp $OUT 'C:\io.sys|||Program Files|||WINDOWS' 0 error
+
+	${WordFindS} 'C:\io.sys|||Program Files|||WINDOWS' '||' '/|Program Files' $OUT
+	StrCmp $OUT '2' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section WordFind2X
+	${StackVerificationStart} WordFind2X
+
+	${WordFind2X} '[C:\io.sys];[C:\logo.sys];[C:\WINDOWS]' '[C:\' '];' '+2' $OUT
+	StrCmp $OUT 'logo.sys' 0 error
+
+	${WordFind2X} 'C:\WINDOWS C:\io.sys C:\logo.sys' '\' '.' '-1' $OUT
+	StrCmp $OUT 'logo' 0 error
+
+	${WordFind2X} 'C:\WINDOWS C:\io.sys C:\logo.sys' '\' '.' '-1{{' $OUT
+	StrCmp $OUT 'C:\WINDOWS C:\io.sys C:' 0 error
+
+	${WordFind2X} 'C:\WINDOWS C:\io.sys C:\logo.sys' '\' '.' '-1{}' $OUT
+	StrCmp $OUT 'C:\WINDOWS C:\io.sys C:sys' 0 error
+
+	${WordFind2X} 'C:\WINDOWS C:\io.sys C:\logo.sys' '\' '.' '-1{*' $OUT
+	StrCmp $OUT 'C:\WINDOWS C:\io.sys C:\logo.' 0 error
+
+	${WordFind2X} 'C:\WINDOWS C:\io.sys C:\logo.sys' '\' '.' '/logo' $OUT
+	StrCmp $OUT '2' 0 error
+
+	${WordFind2X} '||a||b||c' '||' '||' 'E+1' $OUT
+	StrCmp $OUT 'a' 0 error
+
+	${WordFind2X} '[io.sys];[C:\logo.sys]' '\' '];' 'E+1' $OUT
+	IfErrors 0 error
+	StrCmp $OUT 1 0 error
+
+	${WordFind2X} '[io.sys];[C:\logo.sys]' '[' '];' 'E+2' $OUT
+	IfErrors 0 error
+	StrCmp $OUT 2 0 error
+
+	${WordFind2X} '[io.sys];[C:\logo.sys]' '\' '];' 'E2' $OUT
+	IfErrors 0 error
+	StrCmp $OUT 3 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section WordFind2XS
+	${StackVerificationStart} WordFind2XS
+
+	${WordFind2XS} 'C:\WINDOWS C:\io.sys C:\logo.sys' '\' '.' '/LOGO' $OUT
+	StrCmp $OUT 'C:\WINDOWS C:\io.sys C:\logo.sys' 0 error
+
+	${WordFind2XS} 'C:\WINDOWS C:\io.sys C:\logo.sys' '\' '.' '/logo' $OUT
+	StrCmp $OUT '2' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section WordFind3X
+	${StackVerificationStart} WordFind3X
+
+	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '+1' $OUT
+	StrCmp $OUT '1.AAB' 0 error
+
+	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '-1' $OUT
+	StrCmp $OUT '2.BAA' 0 error
+
+	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '-1{{' $OUT
+	StrCmp $OUT '[1.AAB];' 0 error
+
+	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '-1{}' $OUT
+	StrCmp $OUT '[1.AAB];[3.BBB];' 0 error
+
+	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '-1{*' $OUT
+	StrCmp $OUT '[1.AAB];[2.BAA];' 0 error
+
+	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '/2.BAA' $OUT
+	StrCmp $OUT '2' 0 error
+
+	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'XX' '];' 'E+1' $OUT
+	IfErrors 0 error
+	StrCmp $OUT '1' 0 error
+
+	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' 'E+3' $OUT
+	IfErrors 0 error
+	StrCmp $OUT '2' 0 error
+
+	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' 'E3' $OUT
+	IfErrors 0 error
+	StrCmp $OUT '3' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section WordFind3XS
+	${StackVerificationStart} WordFind3XS
+
+	${WordFind3XS} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '/2.baa' $OUT
+	StrCmp $OUT '[1.AAB];[2.BAA];[3.BBB];' 0 error
+
+	${WordFind3XS} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '/2.BAA' $OUT
+	StrCmp $OUT '2' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section WordReplace
+	${StackVerificationStart} WordReplace
+
+	${WordReplace} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'SYS' 'bmp' '+2' $OUT
+	StrCmp $OUT 'C:\io.sys C:\logo.bmp C:\WINDOWS' 0 error
+
+	${WordReplace} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'SYS' '' '+' $OUT
+	StrCmp $OUT 'C:\io. C:\logo. C:\WINDOWS' 0 error
+
+	${WordReplace} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'C:\io.sys' '' '+' $OUT
+	StrCmp $OUT ' C:\logo.sys C:\WINDOWS' 0 error
+
+	${WordReplace} 'C:\io.sys      C:\logo.sys   C:\WINDOWS' ' ' ' ' '+1*' $OUT
+	StrCmp $OUT 'C:\io.sys C:\logo.sys   C:\WINDOWS' 0 error
+
+	${WordReplace} 'C:\io.sys C:\logo.sysSYSsys C:\WINDOWS' 'sys' 'bmp' '+*' $OUT
+	StrCmp $OUT 'C:\io.bmp C:\logo.bmp C:\WINDOWS' 0 error
+
+	${WordReplace} 'SYSsysC:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 'sys' '|' '{' $OUT
+	StrCmp $OUT '||C:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 0 error
+
+	${WordReplace} 'SYSsysC:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 'sys' '|' '}' $OUT
+	StrCmp $OUT 'SYSsysC:\io.sys C:\logo.sys C:\WINDOWS|||' 0 error
+
+	${WordReplace} 'SYSsysC:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 'sys' '|' '{}' $OUT
+	StrCmp $OUT '||C:\io.sys C:\logo.sys C:\WINDOWS|||' 0 error
+
+	${WordReplace} 'SYSsysC:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 'sys' '|' '{*' $OUT
+	StrCmp $OUT '|C:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 0 error
+
+	${WordReplace} 'SYSsysC:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 'sys' '|' '}*' $OUT
+	StrCmp $OUT 'SYSsysC:\io.sys C:\logo.sys C:\WINDOWS|' 0 error
+
+	${WordReplace} 'SYSsysC:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 'sys' '|' '{}*' $OUT
+	StrCmp $OUT '|C:\io.sys C:\logo.sys C:\WINDOWS|' 0 error
+
+	${WordReplace} 'sysSYSsysC:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 'sys' '|' '{}*' $OUT
+	StrCmp $OUT '|C:\io.sys C:\logo.sys C:\WINDOWS|' 0 error
+
+	${WordReplace} 'C:\io.sys C:\logo.sys' '#sys' '|sys|' 'E+1' $OUT
+	IfErrors 0 error
+	StrCmp $OUT '1' 0 error
+
+	${WordReplace} 'C:\io.sys C:\logo.sys' '.sys' '|sys|' 'E+3' $OUT
+	IfErrors 0 error
+	StrCmp $OUT '2' 0 error
+
+	${WordReplace} 'C:\io.sys C:\logo.sys' '.sys' '|sys|' 'E3' $OUT
+	IfErrors 0 error
+	StrCmp $OUT '3' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section WordReplaceS
+	${StackVerificationStart} WordReplaceS
+
+	${WordReplaceS} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'SYS' 'bmp' '+2' $OUT
+	StrCmp $OUT 'C:\io.sys C:\logo.sys C:\WINDOWS' 0 error
+
+	${WordReplaceS} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'sys' 'bmp' '+2' $OUT
+	StrCmp $OUT 'C:\io.sys C:\logo.bmp C:\WINDOWS' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section WordAdd
+	${StackVerificationStart} WordAdd
+
+	${WordAdd} 'C:\io.sys C:\WINDOWS' ' ' '+C:\WINDOWS C:\config.sys' $OUT
+	StrCmp $OUT 'C:\io.sys C:\WINDOWS C:\config.sys' 0 error
+
+	${WordAdd} 'C:\io.sys C:\logo.sys C:\WINDOWS' ' ' '-C:\WINDOWS C:\config.sys C:\IO.SYS' $OUT
+	StrCmp $OUT 'C:\logo.sys' 0 error
+
+	${WordAdd} 'C:\io.sys' ' ' '+C:\WINDOWS C:\config.sys C:\IO.SYS' $OUT
+	StrCmp $OUT 'C:\io.sys C:\WINDOWS C:\config.sys' 0 error
+
+	${WordAdd} 'C:\io.sys C:\logo.sys C:\WINDOWS' ' ' '-C:\WINDOWS' $OUT
+	StrCmp $OUT 'C:\io.sys C:\logo.sys' 0 error
+
+	${WordAdd} 'C:\io.sys C:\logo.sys' ' ' '+C:\logo.sys' $OUT
+	StrCmp $OUT 'C:\io.sys C:\logo.sys' 0 error
+
+	${WordAdd} 'C:\io.sys C:\logo.sys' ' ' 'E-' $OUT
+	StrCmp $OUT 'C:\io.sys C:\logo.sys' 0 error
+	IfErrors error
+
+	${WordAdd} 'C:\io.sys C:\logo.sys' '' 'E-C:\logo.sys' $OUT
+	IfErrors 0 error
+	StrCmp $OUT '1' 0 error
+
+	${WordAdd} 'C:\io.sys C:\logo.sys' '' 'EC:\logo.sys' $OUT
+	IfErrors 0 error
+	StrCmp $OUT '3' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section WordAddS
+	${StackVerificationStart} WordAddS
+
+	${WordAddS} 'C:\io.sys C:\WINDOWS' ' ' '+C:\windows C:\config.sys' $OUT
+	StrCmp $OUT 'C:\io.sys C:\WINDOWS C:\windows C:\config.sys' 0 error
+
+	${WordAddS} 'C:\io.sys C:\WINDOWS' ' ' '+C:\WINDOWS C:\config.sys' $OUT
+	StrCmp $OUT 'C:\io.sys C:\WINDOWS C:\config.sys' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section WordInsert
+	${StackVerificationStart} WordInsert
+
+	${WordInsert} 'C:\io.sys C:\WINDOWS' ' ' 'C:\logo.sys' '-2' $OUT
+	StrCmp $OUT 'C:\io.sys C:\logo.sys C:\WINDOWS' 0 error
+
+	${WordInsert} 'C:\io.sys' ' ' 'C:\WINDOWS' '+2' $OUT
+	StrCmp $OUT 'C:\io.sys C:\WINDOWS' 0 error
+
+	${WordInsert} '' ' ' 'C:\WINDOWS' '+1' $OUT
+	StrCmp $OUT 'C:\WINDOWS ' 0 error
+
+	${WordInsert} 'C:\io.sys C:\logo.sys' '' 'C:\logo.sys' 'E+1' $OUT
+	IfErrors 0 error
+	StrCmp $OUT '1' 0 error
+
+	${WordInsert} 'C:\io.sys C:\logo.sys' ' ' 'C:\logo.sys' 'E+4' $OUT
+	IfErrors 0 error
+	StrCmp $OUT '2' 0 error
+
+	${WordInsert} 'C:\io.sys C:\logo.sys' '' 'C:\logo.sys' 'E1' $OUT
+	IfErrors 0 error
+	StrCmp $OUT '3' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section WordInsertS
+	${StackVerificationStart} WordInsertS
+
+	${WordInsertS} 'C:\io.sys x C:\logo.sys' ' X ' 'C:\NTLDR' '+2' $OUT
+	StrCmp $OUT 'C:\io.sys x C:\logo.sys X C:\NTLDR' 0 error
+
+	${WordInsertS} 'C:\io.sys x C:\logo.sys' ' x ' 'C:\NTLDR' '+2' $OUT
+	StrCmp $OUT 'C:\io.sys x C:\NTLDR x C:\logo.sys' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section StrFilter
+	${StackVerificationStart} StrFilter
+
+	${StrFilter} '123abc 456DEF 7890|%#' '+' '' '' $OUT
+	IfErrors error
+	StrCmp $OUT '123ABC 456DEF 7890|%#' 0 error
+
+	${StrFilter} '123abc 456DEF 7890|%#' '-' 'ef' '' $OUT
+	IfErrors error
+	StrCmp $OUT '123abc 456dEF 7890|%#' 0 error
+
+	${StrFilter} '123abc 456DEF 7890|%#' '2' '|%' '' $OUT
+	IfErrors error
+	StrCmp $OUT 'abcDEF|%' 0 error
+
+	${StrFilter} '123abc 456DEF 7890|%#' '13' 'af' '4590' $OUT
+	IfErrors error
+	StrCmp $OUT '123a 6F 78|%#' 0 error
+
+	${StrFilter} '123abc 456DEF 7890|%#' '+12' 'b' 'def' $OUT
+	IfErrors error
+	StrCmp $OUT '123AbC4567890' 0 error
+
+	${StrFilter} '123abc 456DEF 7890|%#' '+12' 'b' 'def' $OUT
+	IfErrors error
+	StrCmp $OUT '123AbC4567890' 0 error
+
+	${StrFilter} '123abc 456DEF 7890|%#' '123' 'b' 'def' $OUT
+	IfErrors 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section StrFilterS
+	${StackVerificationStart} StrFilterS
+
+	${StrFilterS} '123abc 456DEF 7890|%#' '13' 'af' '4590' $OUT
+	IfErrors error
+	StrCmp $OUT '123a 6 78|%#' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section VersionCompare
+	${StackVerificationStart} VersionCompare
+
+	${VersionCompare} '1.1.1.9' '1.1.1.01' $OUT
+	StrCmp $OUT '1' 0 error
+
+	${VersionCompare} '1.1.1.1' '1.1.1.10' $OUT
+	StrCmp $OUT '2' 0 error
+
+	${VersionCompare} '91.1.1.1' '101.1.1.9' $OUT
+	StrCmp $OUT '2' 0 error
+
+	${VersionCompare} '1.1.1.1' '1.1.1.1' $OUT
+	StrCmp $OUT '0' 0 error
+
+	${VersionCompare} '1.1.1.9' '1.1.1.10' $OUT
+	StrCmp $OUT '2' 0 error
+
+	${VersionCompare} '1.1.1.0' '1.1.1' $OUT
+	StrCmp $OUT '0' 0 error
+
+	${VersionCompare} '1.1.0.0' '1.1' $OUT
+	StrCmp $OUT '0' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section VersionConvert
+	${StackVerificationStart} VersionConvert
+
+	${VersionConvert} '9.0a' '' $OUT
+	StrCmp $OUT '9.0.01' 0 error
+
+	${VersionConvert} '9.0c' '' $OUT
+	StrCmp $OUT '9.0.03' 0 error
+
+	${VersionConvert} '0.15c-9m' '' $OUT
+	StrCmp $OUT '0.15.03.9.13' 0 error
+
+	${VersionConvert} '0.15c+' 'abcdefghijklmnopqrstuvwxyz+' $OUT
+	StrCmp $OUT '0.15.0327' 0 error
+
+	${VersionConvert} '0.0xa12.x.ax|.|.|x|a|.3|a.4.||5.|' '' $OUT
+	StrCmp $OUT '0.0.2401.12.24.0124.24.01.3.01.4.5' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section WriteUninstaller
+	goto +2
+	WriteUninstaller '$EXEDIR\un.WordFuncTest.exe'
+SectionEnd
+
+
+
+;############### UNINSTALL ###############
+
+Section un.Uninstall
+	${WordFind} 'C:\io.sys C:\Program Files C:\WINDOWS' ' C:\' '-02' $OUT
+	${WordFindS} 'C:\io.sys C:\Program Files C:\WINDOWS' ' C:\' '-02' $OUT
+	${WordFind2X} '[C:\io.sys];[C:\logo.sys];[C:\WINDOWS]' '[C:\' '];' '+2' $OUT
+	${WordFind2XS} '[C:\io.sys];[C:\logo.sys];[C:\WINDOWS]' '[C:\' '];' '+2' $OUT
+	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '+1' $OUT
+	${WordFind3XS} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '+1' $OUT
+	${WordReplace} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'SYS' 'bmp' '+2' $OUT
+	${WordReplaceS} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'SYS' 'bmp' '+2' $OUT
+	${WordAdd} 'C:\io.sys C:\WINDOWS' ' ' '+C:\WINDOWS C:\config.sys' $OUT
+	${WordAddS} 'C:\io.sys C:\WINDOWS' ' ' '+C:\WINDOWS C:\config.sys' $OUT
+	${WordInsert} 'C:\io.sys C:\WINDOWS' ' ' 'C:\logo.sys' '-2' $OUT
+	${WordInsertS} 'C:\io.sys C:\WINDOWS' ' ' 'C:\logo.sys' '-2' $OUT
+	${StrFilter} '123abc 456DEF 7890|%#' '+' '' '' $OUT
+	${StrFilterS} '123abc 456DEF 7890|%#' '+' '' '' $OUT
+	${VersionCompare} '1.1.1.9' '1.1.1.01' $OUT
+	${VersionConvert} '9.0a' '' $OUT
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/WordFunc.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/WordFunc.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/WordFunc.nsi	(revision 728)
@@ -0,0 +1,535 @@
+;_____________________________________________________________________________
+;
+;                          Word Functions
+;_____________________________________________________________________________
+;
+; 2005 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
+
+Name "Word Functions"
+OutFile "WordFunc.exe"
+Caption "$(^Name)"
+XPStyle on
+RequestExecutionLevel user
+
+Var INI
+Var HWND
+Var STATE
+
+!include "WinMessages.nsh"
+!include "WordFunc.nsh"
+
+Page Custom ShowCustom LeaveCustom
+
+Function ShowCustom
+	InstallOptions::initDialog "$INI"
+	Pop $hwnd
+	InstallOptions::show
+	Pop $0
+FunctionEnd
+
+Function LeaveCustom
+	ReadINIStr $0 $INI "Settings" "State"
+	StrCmp $0 0 Enter
+
+	GetDlgItem $1 $HWND 1202
+	EnableWindow $1 1
+	GetDlgItem $1 $HWND 1203
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1204
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1206
+	EnableWindow $1 1
+	GetDlgItem $1 $HWND 1205
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1206
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+
+	ReadINIStr $0 $INI "Field 1" "State"
+	StrCmp $0 "1. WordFind        (Find word by number)" 0 WordFind2Send
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:|C:\"
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:-4"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Word #"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result (Word):"
+	goto WordFindSend
+
+	WordFind2Send:
+	StrCmp $0 "                           (Delimiter exclude)" 0 WordFind3Send
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:|C:\"
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:E-2{"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Word #"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result (Before{ or }after delimiter):"
+	goto WordFindSend
+
+	WordFind3Send:
+	StrCmp $0 "                           (Sum of words)" 0 WordFind4Send
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:|C:\"
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:#"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Option"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result (Sum of words):"
+	goto WordFindSend
+
+	WordFind4Send:
+	StrCmp $0 "                           (Sum of delimiters)" 0 WordFind5Send
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:|"
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:E*"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Option"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result (Sum of delimiters):"
+	goto WordFindSend
+
+	WordFind5Send:
+	StrCmp $0 "                           (Find word number)" 0 WordFind6Send
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:|C:\"
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:/Program Files"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:/Word"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result (Word #):"
+	goto WordFindSend
+
+	WordFind6Send:
+	StrCmp $0 "                           ( }} )" 0 WordFind7Send
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:|C:\"
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:E+2}}"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Word #"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result (Before{{ or }}after word):"
+	goto WordFindSend
+
+	WordFind7Send:
+	StrCmp $0 "                           ( {} )" 0 WordFind8Send
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:|C:\"
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:+2{}"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Word #"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result (Without word):"
+	goto WordFindSend
+
+	WordFind8Send:
+	StrCmp $0 "                           ( *} )" 0 WordFind2XSend
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:|C:\"
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:E+2*}"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Word #"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result (Before{* or *}after word with word):"
+	goto WordFindSend
+
+	WordFind2XSend:
+	StrCmp $0 "2. WordFind2X" 0 WordReplace1Send
+	GetDlgItem $1 $HWND 1201
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:[C:\io.sys];[C:\logo.sys];[C:\WINDOWS]"
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:[C:\"
+	GetDlgItem $1 $HWND 1203
+	EnableWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:];"
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:E+2"
+	GetDlgItem $1 $HWND 1207
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:String"
+	GetDlgItem $1 $HWND 1208
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Delimiter1"
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Delimiter2"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Word #"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result (Word):"
+	abort
+
+	WordReplace1Send:
+	StrCmp $0 "3. WordReplace (Replace)" 0 WordReplace2Send
+	GetDlgItem $1 $HWND 1201
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:C:\io.sys|C:\logo.sys|C:\WINDOWS"
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:SYS"
+	GetDlgItem $1 $HWND 1203
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:bmp"
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:+2"
+	goto WordReplaceSend
+
+	WordReplace2Send:
+	StrCmp $0 "                           (Delete)" 0 WordReplace3Send
+	GetDlgItem $1 $HWND 1201
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:C:\io.sys|C:\logo.sys|C:\WINDOWS"
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:SYS"
+	GetDlgItem $1 $HWND 1203
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:E+"
+	goto WordReplaceSend
+
+	WordReplace3Send:
+	StrCmp $0 "                           (Multiple-replace)" 0 WordAdd1Send
+	GetDlgItem $1 $HWND 1201
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:C:\io.sys||||||C:\logo.sys|||C:\WINDOWS"
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:|"
+	GetDlgItem $1 $HWND 1203
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:|"
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:+1*"
+	goto WordReplaceSend
+
+	WordAdd1Send:
+	StrCmp $0 "4. WordAdd        (Add)" 0 WordAdd2Send
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:+C:\WINDOWS|C:\config.sys|C:\IO.SYS"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result (String1 + String2):"
+	goto WordAddSend
+
+	WordAdd2Send:
+	StrCmp $0 "                           (Delete) " 0 WordInsertSend
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:E-C:\WINDOWS|C:\config.sys|C:\IO.SYS"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result (String1 - String2):"
+	goto WordAddSend
+
+	WordInsertSend:
+	StrCmp $0 "5. WordInsert" 0 StrFilter1Send
+	GetDlgItem $1 $HWND 1201
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:C:\io.sys|C:\WINDOWS"
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:|"
+	GetDlgItem $1 $HWND 1203
+	EnableWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:C:\logo.sys"
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:E+2"
+	GetDlgItem $1 $HWND 1207
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:String"
+	GetDlgItem $1 $HWND 1208
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Delimiter"
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Word"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Word #"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result:"
+	abort
+
+	StrFilter1Send:
+	StrCmp $0 "6. StrFilter           (UpperCase)" 0 StrFilter2Send
+	GetDlgItem $1 $HWND 1201
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:123abc 456DEF 7890|%#"
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:+"
+	GetDlgItem $1 $HWND 1203
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result (String in uppercase):"
+	goto StrFilterSend
+
+	StrFilter2Send:
+	StrCmp $0 "                           (LowerCase)" 0 StrFilter3Send
+	GetDlgItem $1 $HWND 1201
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:123abc 456DEF 7890|%#"
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:-"
+	GetDlgItem $1 $HWND 1203
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:ef"
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result (String in lowercase except EF):"
+	goto StrFilterSend
+
+	StrFilter3Send:
+	StrCmp $0 "                           (Filter)" 0 VersionCompareSend
+	GetDlgItem $1 $HWND 1201
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:123abc 456DEF 7890|%#"
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:+12"
+	GetDlgItem $1 $HWND 1203
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:b"
+	GetDlgItem $1 $HWND 1204
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:def"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result (String Digits + Letters + b - def):"
+	goto StrFilterSend
+
+	VersionCompareSend:
+	StrCmp $0 "7. VersionCompare" 0 VersionConvertSend
+	GetDlgItem $1 $HWND 1201
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:1.1.1.9"
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:1.1.1.01"
+	GetDlgItem $1 $HWND 1203
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1204
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1206
+	EnableWindow $1 0
+	GetDlgItem $1 $HWND 1207
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Version1"
+	GetDlgItem $1 $HWND 1208
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Version2"
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result (0-equal 1-newer 2-older):"
+	abort
+
+	VersionConvertSend:
+	StrCmp $0 "8. VersionConvert" 0 Abort
+	GetDlgItem $1 $HWND 1201
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:9.0c"
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1203
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1204
+	ShowWindow $1 0
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1206
+	EnableWindow $1 0
+	GetDlgItem $1 $HWND 1207
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Version"
+	GetDlgItem $1 $HWND 1208
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:CharList"
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result (numerical version format):"
+	abort
+
+	Abort:
+	Abort
+
+	WordFindSend:
+	GetDlgItem $1 $HWND 1203
+	EnableWindow $1 0
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1201
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:C:\io.sys|C:\logo.sys|C:\Program Files|C:\WINDOWS"
+	GetDlgItem $1 $HWND 1207
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:String"
+	GetDlgItem $1 $HWND 1208
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Delimiter"
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	Abort
+
+	WordReplaceSend:
+	GetDlgItem $1 $HWND 1203
+	EnableWindow $1 1
+	GetDlgItem $1 $HWND 1207
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:String"
+	GetDlgItem $1 $HWND 1208
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Replace it"
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:         with"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Word #"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Result:"
+	Abort
+
+	WordAddSend:
+	GetDlgItem $1 $HWND 1203
+	EnableWindow $1 0
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1201
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:C:\io.sys|C:\logo.sys|C:\WINDOWS"
+	GetDlgItem $1 $HWND 1202
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:|"
+	GetDlgItem $1 $HWND 1207
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:String1"
+	GetDlgItem $1 $HWND 1208
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Delimiter"
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:String2"
+	Abort
+
+	StrFilterSend:
+	GetDlgItem $1 $HWND 1203
+	EnableWindow $1 1
+	GetDlgItem $1 $HWND 1206
+	EnableWindow $1 0
+	GetDlgItem $1 $HWND 1207
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:String"
+	GetDlgItem $1 $HWND 1208
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Filter"
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Include"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Exclude"
+	Abort
+
+;=Enter=
+	Enter:
+	StrCpy $0 ''
+	ReadINIStr $STATE $INI "Field 1" "State"
+	ReadINIStr $R1 $INI "Field 2" "State"
+	ReadINIStr $R2 $INI "Field 3" "State"
+	ReadINIStr $R3 $INI "Field 4" "State"
+	ReadINIStr $R4 $INI "Field 5" "State"
+
+	StrCmp $STATE "1. WordFind        (Find word by number)" WordFind
+	StrCmp $STATE "                           (Delimiter exclude)" WordFind
+	StrCmp $STATE "                           (Find in string)" WordFind
+	StrCmp $STATE "                           (Sum of words)" WordFind
+	StrCmp $STATE "                           (Sum of delimiters)" WordFind
+	StrCmp $STATE "                           (Find word number)" WordFind
+	StrCmp $STATE "                           ( }} )" WordFind
+	StrCmp $STATE "                           ( {} )" WordFind
+	StrCmp $STATE "                           ( *} )" WordFind
+	StrCmp $STATE "2. WordFind2X" WordFind2X
+	StrCmp $STATE "3. WordReplace (Replace)" WordReplace
+	StrCmp $STATE "                           (Delete)" WordReplace
+	StrCmp $STATE "                           (Multiple-replace)" WordReplace
+	StrCmp $STATE "4. WordAdd        (Add)" WordAdd
+	StrCmp $STATE "                           (Delete) " WordAdd
+	StrCmp $STATE "5. WordInsert" WordInsert
+	StrCmp $STATE "6. StrFilter           (UpperCase)" StrFilter
+	StrCmp $STATE "                           (LowerCase)" StrFilter
+	StrCmp $STATE "                           (Filter)" StrFilter
+	StrCmp $STATE "7. VersionCompare" VersionCompare
+	StrCmp $STATE "8. VersionConvert" VersionConvert
+	Abort
+
+	WordFind:
+	${WordFind} "$R1" "$R2" "$R4" $R0
+	IfErrors 0 Send
+	StrCpy $0 $R0
+	StrCmp $R0 3 0 +3
+	StrCpy $3 '"+1" "-1" "+1}" "+1{" "#" "/word"'
+	goto error3
+	StrCmp $R0 2 0 error1
+	StrCpy $R4 $R4 '' 1
+	StrCpy $1 $R4 1
+	StrCmp $1 / 0 error2
+	StrCpy $R4 $R4 '' 1
+	StrCpy $R0 '"$R4" no such word.'
+	goto Send
+
+	WordFind2X:
+	${WordFind2X} "$R1" "$R2" "$R3" "$R4" $R0
+	IfErrors 0 Send
+	StrCpy $0 $R0
+	StrCmp $R0 3 0 +3
+	StrCpy $3 '"+1" "-1"'
+	goto error3
+	StrCmp $R0 2 +3
+	StrCpy $R0 '"$R2...$R3" no words found.'
+	goto Send
+	StrCpy $R4 $R4 '' 1
+	StrCpy $1 $R4 1
+	StrCmp $1 / 0 +2
+	StrCpy $R4 $R4 '' 1
+	StrCpy $R0 '"$R4" no such word.'
+	goto Send
+
+	WordReplace:
+	${WordReplace} "$R1" "$R2" "$R3" "$R4" $R0
+	IfErrors 0 Send
+	StrCpy $0 $R0
+	StrCmp $R0 3 0 +3
+	StrCpy $3 '"+1" "+1*" "+" "+*" "{}"'
+	goto error3
+	StrCmp $R0 2 0 error1
+	StrCpy $R4 $R4 '' 1
+	goto error2
+
+	WordAdd:
+	${WordAdd} "$R1" "$R2" "$R4" $R0
+	IfErrors 0 Send
+	StrCpy $0 $R0
+	StrCmp $R0 3 0 error1empty
+	StrCpy $3 '"+text" "-text"'
+	goto error3
+
+	WordInsert:
+	${WordInsert} "$R1" "$R2" "$R3" "$R4" $R0
+	IfErrors 0 Send
+	StrCpy $0 $R0
+	StrCmp $R0 3 0 +3
+	StrCpy $3 '"+1" "-1"'
+	goto error3
+	StrCmp $R0 2 0 error1empty
+	StrCpy $R4 $R4 '' 1
+	goto error2
+
+	StrFilter:
+	${StrFilter} "$R1" "$R2" "$R3" "$R4" $R0
+	IfErrors 0 Send
+	StrCpy $R0 'Syntax error'
+	goto Send
+
+	VersionCompare:
+	${VersionCompare} "$R1" "$R2" $R0
+	goto Send
+
+	VersionConvert:
+	${VersionConvert} "$R1" "$R2" $R0
+	goto Send
+
+	error3:
+	StrCpy $R0 '"$R4" syntax error ($3)'
+	goto Send
+	error2:
+	StrCpy $R0 '"$R4" no such word number'
+	goto Send
+	error1empty:
+	StrCpy $R0 '"$R2" delimiter is empty'
+	goto Send
+	error1:
+	StrCpy $R0 '"$R2" delimiter not found in string'
+	goto Send
+
+	Send:
+	GetDlgItem $1 $HWND 1205
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$R0"
+	GetDlgItem $1 $HWND 1206
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$0"
+	abort
+FunctionEnd
+
+Function .onInit
+	InitPluginsDir
+	GetTempFileName $INI $PLUGINSDIR
+	File /oname=$INI "WordFunc.ini"
+FunctionEnd
+
+Page instfiles
+
+Section "Empty"
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/FileFunc.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/FileFunc.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/FileFunc.nsi	(revision 728)
@@ -0,0 +1,732 @@
+;_____________________________________________________________________________
+;
+;                          File Functions
+;_____________________________________________________________________________
+;
+; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
+
+Name "File Functions"
+OutFile "FileFunc.exe"
+Caption "$(^Name)"
+XPStyle on
+RequestExecutionLevel user
+
+!include "WinMessages.nsh"
+!include "FileFunc.nsh"
+
+Var INI
+Var HWND
+Var STATE
+Var FUNCTION
+Var LOCATE1
+Var LOCATE2
+Var GETSIZE1
+Var GETSIZE2
+Var GETSIZE3
+Var GETSIZE4
+Var GETSIZE5
+Var GETSIZE6
+Var DRIVESPACE1
+Var DRIVESPACE2
+Var GETDRIVES1
+Var GETTIME1
+Var GETTIME2
+Var GETFILEATTRIBUTES1
+Var GETFILEATTRIBUTES2
+Var GETFILEVERSION1
+Var GETOPTIONS1
+Var GETOPTIONS2
+Var GETROOT1
+Var GETPARENT1
+Var GETFILENAME1
+Var GETBASENAME1
+Var GETFILEEXT1
+Var BANNERTRIMPATH1
+Var BANNERTRIMPATH2
+Var DIRSTATE1
+
+Page Custom ShowCustom LeaveCustom
+
+Function ShowCustom
+	InstallOptions::initDialog "$INI"
+	Pop $hwnd
+	GetDlgItem $1 $HWND 1201
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1202
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1206
+	EnableWindow $1 0
+	SendMessage $1 ${WM_ENABLE} 1 0
+	StrCpy $LOCATE1 $DOCUMENTS
+	StrCpy $LOCATE2 '/L=FD /M=*.* /S=0B /G=1 /B=0'
+	StrCpy $GETSIZE1 '$WINDIR'
+	StrCpy $GETSIZE2 '/M=Explorer.exe /S=0K /G=0'
+	StrCpy $GETSIZE3 '$PROGRAMFILES\Common Files'
+	StrCpy $GETSIZE4 '/S=0M'
+	StrCpy $GETSIZE5 '$WINDIR'
+	StrCpy $GETSIZE6 '/G=0'
+	StrCpy $DRIVESPACE1 'C:\'
+	StrCpy $DRIVESPACE2 '/D=F /S=M'
+	StrCpy $GETDRIVES1 'FDD+CDROM'
+	StrCpy $GETTIME1 '$WINDIR\Explorer.exe'
+	StrCpy $GETTIME2 'C'
+	StrCpy $GETFILEATTRIBUTES1 'C:\IO.SYS'
+	StrCpy $GETFILEATTRIBUTES2 'ALL'
+	StrCpy $GETFILEVERSION1 '$WINDIR\Explorer.exe'
+	StrCpy $GETOPTIONS1 '/SILENT=yes /INSTDIR="$PROGRAMFILES\Common Files"'
+	StrCpy $GETOPTIONS2 '/INSTDIR='
+	StrCpy $GETROOT1 'C:\path\file.dll'
+	StrCpy $GETPARENT1 'C:\path\file.dll'
+	StrCpy $GETFILENAME1 'C:\path\file.dll'
+	StrCpy $GETBASENAME1 'C:\path\file.dll'
+	StrCpy $GETFILEEXT1 'C:\path\file.dll'
+	StrCpy $BANNERTRIMPATH1 'C:\Server\Documents\Terminal\license.htm'
+	StrCpy $BANNERTRIMPATH2 '34A'
+	StrCpy $DIRSTATE1 '$TEMP'
+
+	GetDlgItem $1 $HWND 1203
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$LOCATE1"
+	GetDlgItem $1 $HWND 1205
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$LOCATE2"
+	InstallOptions::show
+	Pop $0
+FunctionEnd
+
+Function LeaveCustom
+	ReadINIStr $STATE $INI "Field 1" "State"
+	ReadINIStr $R1 $INI "Field 2" "State"
+	ReadINIStr $R2 $INI "Field 3" "State"
+	ReadINIStr $R3 $INI "Field 4" "State"
+	ReadINIStr $R4 $INI "Field 5" "State"
+	ReadINIStr $0 $INI "Settings" "State"
+	StrCmp $0 6 view
+	StrCmp $0 0 Enter
+	goto main
+
+	view:
+	StrCpy $0 '$$'
+	StrCpy $1 'n'
+	StrCpy $2 'r'
+	StrCmp $R4 "LocateCallback" 0 +3
+	StrCpy $R0 `Function LocateCallback$\r$\n	MessageBox MB_OKCANCEL '$0$$R9    "path\name"=[$$R9]$0\$1$0$$R8    "path"          =[$$R8]$0\$1$0$$R7    "name"        =[$$R7]$0\$1$0$$R6    "size"           =[$$R6]' IDOK +2$\r$\n	StrCpy $$R0 StopLocate$\r$\n$\r$\n	Push $$R0$\r$\nFunctionEnd`
+	goto send
+	StrCmp $R4 "GetDrivesCallback" 0 error
+	StrCpy $R0 `Function GetDrivesCallback$\r$\n	MessageBox MB_OKCANCEL '$0$$9    "drive letter"=[$$9]$0\$1$0$$8    "drive type" =[$$8]' IDOK +2$\r$\n	StrCpy $$R0 StopGetDrives$\r$\n	StrCpy $$R5 '$$R5$$9  [$$8 Drive]$$\$2$$\$1'$\r$\n$\r$\n	Push $$R0$\r$\nFunctionEnd`
+	goto send
+
+	main:
+	StrCmp $FUNCTION '' DefaultSend
+	StrCmp $FUNCTION Locate 0 +4
+	StrCpy $LOCATE1 $R2
+	StrCpy $LOCATE2 $R3
+	goto DefaultSend
+	StrCmp $FUNCTION GetSize1 0 +4
+	StrCpy $GETSIZE1 $R2
+	StrCpy $GETSIZE2 $R3
+	goto DefaultSend
+	StrCmp $FUNCTION GetSize2 0 +4
+	StrCpy $GETSIZE3 $R2
+	StrCpy $GETSIZE4 $R3
+	goto DefaultSend
+	StrCmp $FUNCTION GetSize3 0 +4
+	StrCpy $GETSIZE5 $R2
+	StrCpy $GETSIZE6 $R3
+	goto DefaultSend
+	StrCmp $FUNCTION DriveSpace 0 +4
+	StrCpy $DRIVESPACE1 $R1
+	StrCpy $DRIVESPACE2 $R3
+	goto DefaultSend
+	StrCmp $FUNCTION GetDrives 0 +3
+	StrCpy $GETDRIVES1 $R1
+	goto DefaultSend
+	StrCmp $FUNCTION GetTime 0 +4
+	StrCpy $GETTIME1 $R1
+	StrCpy $GETTIME2 $R3
+	goto DefaultSend
+	StrCmp $FUNCTION GetFileAttributes 0 +4
+	StrCpy $GETFILEATTRIBUTES1 $R1
+	StrCpy $GETFILEATTRIBUTES2 $R3
+	goto DefaultSend
+	StrCmp $FUNCTION GetFileVersion 0 +3
+	StrCpy $GETFILEVERSION1 $R1
+	goto DefaultSend
+	StrCmp $FUNCTION GetOptions 0 +4
+	StrCpy $GETOPTIONS1 $R1
+	StrCpy $GETOPTIONS2 $R3
+	goto DefaultSend
+	StrCmp $FUNCTION GetRoot 0 +3
+	StrCpy $GETROOT1 $R1
+	goto DefaultSend
+	StrCmp $FUNCTION GetParent 0 +3
+	StrCpy $GETPARENT1 $R1
+	goto DefaultSend
+	StrCmp $FUNCTION GetFileName 0 +3
+	StrCpy $GETFILENAME1 $R1
+	goto DefaultSend
+	StrCmp $FUNCTION GetBaseName 0 +3
+	StrCpy $GETBASENAME1 $R1
+	goto DefaultSend
+	StrCmp $FUNCTION GetFileExt 0 +3
+	StrCpy $GETFILEEXT1 $R1
+	goto DefaultSend
+	StrCmp $FUNCTION BannerTrimPath 0 +4
+	StrCpy $BANNERTRIMPATH1 $R1
+	StrCpy $BANNERTRIMPATH2 $R3
+	goto DefaultSend
+	StrCmp $FUNCTION DirState 0 +2
+	StrCpy $DIRSTATE1 $R2
+
+	DefaultSend:
+	GetDlgItem $1 $HWND 1201
+	EnableWindow $1 1
+	ShowWindow $1 0
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1202
+	EnableWindow $1 1
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1203
+	EnableWindow $1 1
+	ShowWindow $1 0
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1204
+	EnableWindow $1 1
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1205
+	EnableWindow $1 1
+	GetDlgItem $1 $HWND 1206
+	ShowWindow $1 0
+	EnableWindow $1 0
+	GetDlgItem $1 $HWND 1207
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1208
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+
+	ReadINIStr $0 $INI "Field 1" "State"
+	StrCmp $0 "  1. Locate" 0 GetSize1Send
+	StrCpy $FUNCTION Locate
+	GetDlgItem $1 $HWND 1203
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$LOCATE1"
+	GetDlgItem $1 $HWND 1204
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$LOCATE2"
+	GetDlgItem $1 $HWND 1206
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:LocateCallback"
+	GetDlgItem $1 $HWND 1207
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Path"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Options"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Function"
+	abort
+
+	GetSize1Send:
+	StrCmp $0 "  2. GetSize                 (file)" 0 GetSize2Send
+	StrCpy $FUNCTION 'GetSize1'
+	GetDlgItem $1 $HWND 1203
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETSIZE1"
+	GetDlgItem $1 $HWND 1204
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETSIZE2"
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:File"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Options"
+	Abort
+
+	GetSize2Send:
+	StrCmp $0 "                                   (directory)" 0 GetSize3Send
+	StrCpy $FUNCTION 'GetSize2'
+	GetDlgItem $1 $HWND 1203
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETSIZE3"
+	GetDlgItem $1 $HWND 1204
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETSIZE4"
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Directory"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Options"
+	Abort
+
+	GetSize3Send:
+	StrCmp $0 "                                   (no size, no subdir)" 0 DriveSpaceSend
+	StrCpy $FUNCTION 'GetSize3'
+	GetDlgItem $1 $HWND 1203
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETSIZE5"
+	GetDlgItem $1 $HWND 1204
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETSIZE6"
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Directory"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Options"
+	Abort
+
+	DriveSpaceSend:
+	StrCmp $0 "  3. DriveSpace" 0 GetDrivesSend
+	StrCpy $FUNCTION DriveSpace
+	GetDlgItem $1 $HWND 1201
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$DRIVESPACE1"
+	GetDlgItem $1 $HWND 1202
+	ShowWindow $1 1
+	EnableWindow $1 0
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$DRIVESPACE2"
+	GetDlgItem $1 $HWND 1206
+	ShowWindow $1 0
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:"
+	GetDlgItem $1 $HWND 1207
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Drive"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Options"
+	abort
+
+	GetDrivesSend:
+	StrCmp $0 "  4. GetDrives             (by type)" 0 GetDrives2Send
+	StrCpy $FUNCTION GetDrives
+	GetDlgItem $1 $HWND 1201
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETDRIVES1"
+	GetDlgItem $1 $HWND 1202
+	ShowWindow $1 1
+	EnableWindow $1 0
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1206
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:GetDrivesCallback"
+	GetDlgItem $1 $HWND 1207
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Option"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Function"
+	abort
+
+	GetDrives2Send:
+	StrCmp $0 "                                   (all by letter)" 0 GetTime1Send
+	StrCpy $FUNCTION ''
+	GetDlgItem $1 $HWND 1201
+	ShowWindow $1 1
+	EnableWindow $1 0
+	SendMessage $1 ${WM_ENABLE} 1 0
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:ALL"
+	GetDlgItem $1 $HWND 1202
+	ShowWindow $1 1
+	EnableWindow $1 0
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1206
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:GetDrivesCallback"
+	GetDlgItem $1 $HWND 1207
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Option"
+	GetDlgItem $1 $HWND 1211
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Function"
+	abort
+
+	GetTime1Send:
+	StrCmp $0 "  5. GetTime                (local time)" 0 GetTime2Send
+	StrCpy $FUNCTION ''
+	GetDlgItem $1 $HWND 1201
+	ShowWindow $1 1
+	EnableWindow $1 0
+	SendMessage $1 ${WM_ENABLE} 1 0
+	GetDlgItem $1 $HWND 1202
+	ShowWindow $1 1
+	EnableWindow $1 0
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 1
+	EnableWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:L"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Option"
+	Abort
+
+	GetTime2Send:
+	StrCmp $0 "                                   (file time)" 0 GetFileAttributesSend
+	StrCpy $FUNCTION GetTime
+	GetDlgItem $1 $HWND 1201
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETTIME1"
+	GetDlgItem $1 $HWND 1202
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETTIME2"
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:File"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Option"
+	Abort
+
+	GetFileAttributesSend:
+	StrCmp $0 "  6. GetFileAttributes" 0 GetFileVersionSend
+	StrCpy $FUNCTION GetFileAttributes
+	GetDlgItem $1 $HWND 1201
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETFILEATTRIBUTES1"
+	GetDlgItem $1 $HWND 1202
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETFILEATTRIBUTES2"
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Path"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Attrib"
+	Abort
+
+	GetFileVersionSend:
+	StrCmp $0 "  7. GetFileVersion" 0 GetCmdSend
+	StrCpy $FUNCTION GetFileVersion
+	GetDlgItem $1 $HWND 1201
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETFILEVERSION1"
+	GetDlgItem $1 $HWND 1202
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:File"
+	Abort
+
+	GetCmdSend:
+	StrCmp $0 "  8. GetExeName" +3
+	StrCmp $0 "  9. GetExePath" +2
+	StrCmp $0 "10. GetParameters" 0 GetOptionsSend
+	StrCpy $FUNCTION ''
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 0
+	Abort
+
+	GetOptionsSend:
+	StrCmp $0 "11. GetOptions" 0 GetRootSend
+	StrCpy $FUNCTION GetOptions
+	GetDlgItem $1 $HWND 1201
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETOPTIONS1"
+	GetDlgItem $1 $HWND 1202
+	ShowWindow $1 1
+	EnableWindow $1 0
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETOPTIONS2"
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Parameters"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Option"
+	Abort
+
+	GetRootSend:
+	StrCmp $0 "12. GetRoot" 0 GetParentSend
+	StrCpy $FUNCTION GetRoot
+	GetDlgItem $1 $HWND 1201
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETROOT1"
+	GetDlgItem $1 $HWND 1202
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:FullPath"
+	Abort
+
+	GetParentSend:
+	StrCmp $0 "13. GetParent" 0 GetFileNameSend
+	StrCpy $FUNCTION GetParent
+	GetDlgItem $1 $HWND 1201
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETPARENT1"
+	GetDlgItem $1 $HWND 1202
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:PathString"
+	Abort
+
+	GetFileNameSend:
+	StrCmp $0 "14. GetFileName" 0 GetBaseNameSend
+	StrCpy $FUNCTION GetFileName
+	GetDlgItem $1 $HWND 1201
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETFILENAME1"
+	GetDlgItem $1 $HWND 1202
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:PathString"
+	Abort
+
+	GetBaseNameSend:
+	StrCmp $0 "15. GetBaseName" 0 GetFileExtSend
+	StrCpy $FUNCTION GetBaseName
+	GetDlgItem $1 $HWND 1201
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETBASENAME1"
+	GetDlgItem $1 $HWND 1202
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:FileString"
+	Abort
+
+	GetFileExtSend:
+	StrCmp $0 "16. GetFileExt" 0 BannerTrimPathSend
+	StrCpy $FUNCTION GetFileExt
+	GetDlgItem $1 $HWND 1201
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$GETFILEEXT1"
+	GetDlgItem $1 $HWND 1202
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:FileString"
+	Abort
+
+	BannerTrimPathSend:
+	StrCmp $0 "17. BannerTrimPath" 0 DirStateSend
+	StrCpy $FUNCTION BannerTrimPath
+	GetDlgItem $1 $HWND 1201
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$BANNERTRIMPATH1"
+	GetDlgItem $1 $HWND 1202
+	ShowWindow $1 1
+	EnableWindow $1 0
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$BANNERTRIMPATH2"
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:PathString"
+	GetDlgItem $1 $HWND 1210
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Option"
+	Abort
+
+	DirStateSend:
+	StrCmp $0 "18. DirState" 0 RefreshShellIconsSend
+	StrCpy $FUNCTION DirState
+	GetDlgItem $1 $HWND 1203
+	ShowWindow $1 1
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$DIRSTATE1"
+	GetDlgItem $1 $HWND 1204
+	ShowWindow $1 1
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 0
+	GetDlgItem $1 $HWND 1209
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:Directory"
+	Abort
+
+	RefreshShellIconsSend:
+	StrCmp $0 "19. RefreshShellIcons" 0 Abort
+	StrCpy $FUNCTION ''
+	GetDlgItem $1 $HWND 1205
+	ShowWindow $1 0
+
+	Abort:
+	Abort
+
+;=Enter=
+	Enter:
+	StrCpy $R0 ''
+	StrCpy $R5 ''
+
+	StrCmp $STATE "  1. Locate" Locate
+	StrCmp $STATE "  2. GetSize                 (file)" GetSize
+	StrCmp $STATE "                                   (directory)" GetSize
+	StrCmp $STATE "                                   (no size, no subdir)" GetSize
+	StrCmp $STATE "  3. DriveSpace" DriveSpace
+	StrCmp $STATE "  4. GetDrives             (by type)" GetDrives
+	StrCmp $STATE "                                   (all by letter)" GetDrives
+	StrCmp $STATE "  5. GetTime                (local time)" GetTime
+	StrCmp $STATE "                                   (file time)" GetTime
+	StrCmp $STATE "  6. GetFileAttributes" GetFileAttributes
+	StrCmp $STATE "  7. GetFileVersion" GetFileVersion
+	StrCmp $STATE "  8. GetExeName" GetExeName
+	StrCmp $STATE "  9. GetExePath" GetExePath
+	StrCmp $STATE "10. GetParameters" GetParameters
+	StrCmp $STATE "11. GetOptions" GetOptions
+	StrCmp $STATE "12. GetRoot" GetRoot
+	StrCmp $STATE "13. GetParent" GetParent
+	StrCmp $STATE "14. GetFileName" GetFileName
+	StrCmp $STATE "15. GetBaseName" GetBaseName
+	StrCmp $STATE "16. GetFileExt" GetFileExt
+	StrCmp $STATE "17. BannerTrimPath" BannerTrimPath
+	StrCmp $STATE "18. DirState" DirState
+	StrCmp $STATE "19. RefreshShellIcons" RefreshShellIcons
+	Abort
+
+	Locate:
+	${Locate} "$R2" "$R3" "LocateCallback"
+	IfErrors error
+	StrCmp $R0 StopLocate 0 +3
+	StrCpy $R0 'stopped'
+	goto send
+	StrCpy $R0 'done'
+	goto send
+
+	GetSize:
+	${GetSize} "$R2" "$R3" $0 $1 $2
+	IfErrors error
+	StrCpy $R0 "Size=$0$\r$\nFiles=$1$\r$\nFolders=$2"
+	goto send
+
+	DriveSpace:
+	${DriveSpace} "$R1" "$R3" $0
+	IfErrors error
+	StrCpy $R0 "$0"
+	goto send
+
+	GetDrives:
+	${GetDrives} "$R1" "GetDrivesCallback"
+	StrCmp $R0 StopGetDrives 0 +3
+	StrCpy $R0 '$R5stopped'
+	goto send
+	StrCpy $R0 '$R5done'
+	goto send
+
+	GetTime:
+	${GetTime} "$R1" "$R3" $0 $1 $2 $3 $4 $5 $6
+	IfErrors error
+	StrCpy $R0 'Date=$0/$1/$2 ($3)$\r$\nTime=$4:$5:$6'
+	goto send
+
+	GetFileAttributes:
+	${GetFileAttributes} "$R1" "$R3" $0
+	IfErrors error
+	StrCpy $R0 '$0'
+	goto send
+
+	GetFileVersion:
+	${GetFileVersion} "$R1" $0
+	IfErrors error
+	StrCpy $R0  '$0'
+	goto send
+
+	GetExeName:
+	${GetExeName} $0
+	StrCpy $R0 '$0'
+	goto send
+
+	GetExePath:
+	${GetExePath} $0
+	StrCpy $R0 '$0'
+	goto send
+
+	GetParameters:
+	${GetParameters} $0
+	StrCpy $R0 '$0'
+	StrCmp $R0 '' 0 send
+	StrCpy $R0 'no parameters'
+	goto send
+
+	GetOptions:
+	${GetOptions} "$R1" "$R3" $0
+	IfErrors error
+	StrCpy $R0  '$0'
+	goto send
+
+	GetRoot:
+	${GetRoot} "$R1" $0
+	StrCpy $R0  '$0'
+	goto send
+
+	GetParent:
+	${GetParent} "$R1" $0
+	StrCpy $R0  '$0'
+	goto send
+
+	GetFileName:
+	${GetFileName} "$R1" $0
+	StrCpy $R0  '$0'
+	goto send
+
+	GetBaseName:
+	${GetBaseName} "$R1" $0
+	StrCpy $R0  '$0'
+	goto send
+
+	GetFileExt:
+	${GetFileExt} "$R1" $0
+	StrCpy $R0  '$0'
+	goto send
+
+	BannerTrimPath:
+	${BannerTrimPath} "$R1" "$R3" $0
+	StrCpy $R0  '$0'
+	goto send
+
+	DirState:
+	${DirState} "$R2" $0
+	StrCpy $R0  '$0'
+	goto send
+
+	RefreshShellIcons:
+	${RefreshShellIcons}
+	StrCpy $R0 'done'
+	goto send
+
+	error:
+	StrCpy $R0 'error'
+
+	send:
+	GetDlgItem $1 $HWND 1208
+	SendMessage $1 ${WM_SETTEXT} 1 "STR:$R0"
+
+	abort
+FunctionEnd
+
+Function LocateCallback
+	MessageBox MB_OKCANCEL '$$R9    "path\name"=[$R9]$\n$$R8    "path"          =[$R8]$\n$$R7    "name"        =[$R7]$\n$$R6    "size"           =[$R6]' IDOK +2
+	StrCpy $R0 StopLocate
+
+	Push $R0
+FunctionEnd
+
+Function GetDrivesCallback
+	MessageBox MB_OKCANCEL '$$9    "drive letter"=[$9]$\n$$8    "drive type" =[$8]' IDOK +2
+	StrCpy $R0 StopGetDrives
+	StrCpy $R5 '$R5$9  [$8 Drive]$\r$\n'
+
+	Push $R0
+FunctionEnd
+
+Function .onInit
+	InitPluginsDir
+	GetTempFileName $INI $PLUGINSDIR
+	File /oname=$INI "FileFunc.ini"
+FunctionEnd
+
+Page instfiles
+
+Section "Empty"
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/FileFuncTest.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/FileFuncTest.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/FileFuncTest.nsi	(revision 728)
@@ -0,0 +1,572 @@
+;_____________________________________________________________________________
+;
+;                          File Functions Test
+;_____________________________________________________________________________
+;
+; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
+
+Name "File Functions Test"
+OutFile "FileFuncTest.exe"
+Caption "$(^Name)"
+ShowInstDetails show
+XPStyle on
+RequestExecutionLevel user
+
+Var FUNCTION
+Var OUT1
+Var OUT2
+Var OUT3
+Var OUT4
+Var OUT5
+Var OUT6
+Var OUT7
+
+!include "FileFunc.nsh"
+!include "LogicLib.nsh"
+
+;############### INSTALL ###############
+
+!define StackVerificationStart `!insertmacro StackVerificationStart`
+!macro StackVerificationStart _FUNCTION
+	StrCpy $FUNCTION ${_FUNCTION}
+	Call StackVerificationStart
+!macroend
+
+!define StackVerificationEnd `!insertmacro StackVerificationEnd`
+!macro StackVerificationEnd
+	Call StackVerificationEnd
+!macroend
+
+Function StackVerificationStart
+	StrCpy $0 !0
+	StrCpy $1 !1
+	StrCpy $2 !2
+	StrCpy $3 !3
+	StrCpy $4 !4
+	StrCpy $5 !5
+	StrCpy $6 !6
+	StrCpy $7 !7
+	StrCpy $8 !8
+	StrCpy $9 !9
+	StrCpy $R0 !R0
+	StrCpy $R1 !R1
+	StrCpy $R2 !R2
+	StrCpy $R3 !R3
+	StrCpy $R4 !R4
+	StrCpy $R5 !R5
+	StrCpy $R6 !R6
+	StrCpy $R7 !R7
+	StrCpy $R8 !R8
+	StrCpy $R9 !R9
+FunctionEnd
+
+Function StackVerificationEnd
+	IfErrors +3
+	DetailPrint 'PASSED $FUNCTION no errors'
+	goto +2
+	DetailPrint 'FAILED   $FUNCTION error'
+
+	StrCmp $0 '!0' 0 error
+	StrCmp $1 '!1' 0 error
+	StrCmp $2 '!2' 0 error
+	StrCmp $3 '!3' 0 error
+	StrCmp $4 '!4' 0 error
+	StrCmp $5 '!5' 0 error
+	StrCmp $6 '!6' 0 error
+	StrCmp $7 '!7' 0 error
+	StrCmp $8 '!8' 0 error
+	StrCmp $9 '!9' 0 error
+	StrCmp $R0 '!R0' 0 error
+	StrCmp $R1 '!R1' 0 error
+	StrCmp $R2 '!R2' 0 error
+	StrCmp $R3 '!R3' 0 error
+	StrCmp $R4 '!R4' 0 error
+	StrCmp $R5 '!R5' 0 error
+	StrCmp $R6 '!R6' 0 error
+	StrCmp $R7 '!R7' 0 error
+	StrCmp $R8 '!R8' 0 error
+	StrCmp $R9 '!R9' 0 error
+	DetailPrint 'PASSED $FUNCTION stack'
+	goto end
+
+	error:
+	DetailPrint 'FAILED   $FUNCTION stack'
+;	MessageBox MB_OKCANCEL '$$0={$0}$\n$$1={$1}$\n$$2={$2}$\n$$3={$3}$\n$$4={$4}$\n$$5={$5}$\n$$6={$6}$\n$$7={$7}$\n$$8={$8}$\n$$9={$9}$\n$$R0={$R0}$\n$$R1={$R1}$\n$$R2={$R2}$\n$$R3={$R3}$\n$$R4={$R4}$\n$$R5={$R5}$\n$$R6={$R6}$\n$$R7={$R7}$\n$$R8={$R8}$\n$$R9={$R9}' IDOK +2
+;	quit
+
+	end:
+FunctionEnd
+
+
+
+Section Locate
+	${StackVerificationStart} Locate
+
+	${Locate} '$DOCUMENTS' '/L=FD /M=*.* /S=0B /G=0' 'LocateCallback'
+
+	${StackVerificationEnd}
+SectionEnd
+
+Function LocateCallback
+;	MessageBox MB_YESNO '$$0={$0}$\n$$1={$1}$\n$$2={$2}$\n$$3={$3}$\n$$4={$4}$\n$$5={$5}$\n$$6={$6}$\n$$7={$7}$\n$$8={$8}$\n$$9={$9}$\n$$R0={$R0}$\n$$R1={$R1}$\n$$R2={$R2}$\n$$R3={$R3}$\n$$R4={$R4}$\n$$R5={$R5}$\n$$R6={$R6}$\n$$R7={$R7}$\n$$R8={$R8}$\n$$R9={$R9}$\n$\nContinue?' IDYES +2
+;	StrCpy $0 StopLocate
+
+	Push $0
+FunctionEnd
+
+
+Section GetSize
+	${StackVerificationStart} GetSize
+
+	${GetSize} '$WINDIR' '/M=Explorer.exe /S=0K /G=0' $OUT1 $OUT2 $OUT3
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section DriveSpace
+	${StackVerificationStart} DriveSpace
+
+	${DriveSpace} 'C:\' '/D=F /S=M' $OUT1
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section GetDrives
+	${StackVerificationStart} GetDrives
+
+	${GetDrives} 'FDD+CDROM' 'GetDrivesCallback'
+
+	${StackVerificationEnd}
+SectionEnd
+
+Function GetDrivesCallback
+;	MessageBox MB_YESNO '$$0={$0}$\n$$1={$1}$\n$$2={$2}$\n$$3={$3}$\n$$4={$4}$\n$$5={$5}$\n$$6={$6}$\n$$7={$7}$\n$$8={$8}$\n$$9={$9}$\n$$R0={$R0}$\n$$R1={$R1}$\n$$R2={$R2}$\n$$R3={$R3}$\n$$R4={$R4}$\n$$R5={$R5}$\n$$R6={$R6}$\n$$R7={$R7}$\n$$R8={$R8}$\n$$R9={$R9}$\n$\nContinue?' IDYES +2
+;	StrCpy $0 StopGetDrives
+
+	Push $0
+FunctionEnd
+
+
+Section GetTime
+	${StackVerificationStart} GetTime
+
+	${GetTime} '' 'L' $OUT1 $OUT2 $OUT3 $OUT4 $OUT5 $OUT6 $OUT7
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section GetFileAttributes
+	${StackVerificationStart} GetFileAttributes
+
+	${GetFileAttributes} '$WINDIR\explorer.exe' 'ALL' $OUT1
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section GetFileVersion
+	${StackVerificationStart} GetFileVersion
+
+	${GetFileVersion} '$WINDIR\explorer.exe' $OUT1
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section GetExeName
+	${StackVerificationStart} GetExeName
+
+	${GetExeName} $OUT1
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section GetExePath
+	${StackVerificationStart} GetExePath
+
+	${GetExePath} $OUT1
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section GetParameters
+	${StackVerificationStart} GetParameters
+
+	# basic stuff
+
+	StrCpy $CMDLINE '"$PROGRAMFILES\Something\Hello.exe"'
+	${GetParameters} $OUT1
+	StrCpy $CMDLINE '"$PROGRAMFILES\Something\Hello.exe" test'
+	${GetParameters} $OUT2
+	StrCpy $CMDLINE '"$PROGRAMFILES\Something\Hello.exe" "test"'
+	${GetParameters} $OUT3
+	StrCpy $CMDLINE 'C:\Hello.exe'
+	${GetParameters} $OUT4
+	StrCpy $CMDLINE 'C:\Hello.exe test'
+	${GetParameters} $OUT5
+	StrCpy $CMDLINE 'C:\Hello.exe "test"'
+	${GetParameters} $OUT6
+	StrCpy $CMDLINE 'C:\Hello.exe       test test  '
+	${GetParameters} $OUT7
+
+	${If} $OUT1 != ""
+	${OrIf} $OUT2 != "test"
+	${OrIf} $OUT3 != '"test"'
+	${OrIf} $OUT4 != ""
+	${OrIf} $OUT5 != "test"
+	${OrIf} $OUT6 != '"test"'
+	${OrIf} $OUT7 != 'test test'
+		SetErrors
+	${EndIf}
+
+	# some corner cases
+
+	StrCpy $CMDLINE ''
+	${GetParameters} $OUT1
+	StrCpy $CMDLINE '"'
+	${GetParameters} $OUT2
+	StrCpy $CMDLINE '""'
+	${GetParameters} $OUT3
+	StrCpy $CMDLINE '"" test'
+	${GetParameters} $OUT4
+	StrCpy $CMDLINE ' test'
+	${GetParameters} $OUT5
+	StrCpy $CMDLINE '  test' # left over bug(?) from old GetParameters
+	                         # it starts looking for ' ' from the third char
+	${GetParameters} $OUT6
+	StrCpy $CMDLINE ' '
+	${GetParameters} $OUT7
+
+	${If} $OUT1 != ""
+	${OrIf} $OUT2 != ""
+	${OrIf} $OUT3 != ""
+	${OrIf} $OUT4 != ""
+	${OrIf} $OUT5 != ""
+	${OrIf} $OUT6 != ""
+	${OrIf} $OUT7 != ""
+		SetErrors
+	${EndIf}
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section GetOptions
+	${StackVerificationStart} GetOptions
+
+	${GetOptions} '/INSTDIR=C:\Program Files\Common Files /SILENT=yes' '/INSTDIR=' $OUT1
+	StrCmp $OUT1 'C:\Program Files\Common Files' 0 error
+
+	${GetOptions} '-TMP=temp.tmp -INSTDIR="C:/Program Files/Common Files" -SILENT=yes' '-INSTDIR=' $OUT1
+	StrCmp $OUT1 'C:/Program Files/Common Files' 0 error
+
+	${GetOptions} "/INSTDIR='C:/Program Files/Common Files' /SILENT=yes" '/INSTDIR=' $OUT1
+	StrCmp $OUT1 'C:/Program Files/Common Files' 0 error
+
+	StrCpy $OUT1 '/INSTDIR=`C:/Program Files/Common Files` /SILENT=yes'
+	${GetOptions} '$OUT1' '/INSTDIR=' $OUT1
+	StrCmp $OUT1 'C:/Program Files/Common Files' 0 error
+
+	${GetOptions} '/SILENT=yes /INSTDIR=C:\Program Files\Common Files' '/INSTDIR=' $OUT1
+	StrCmp $OUT1 'C:\Program Files\Common Files' 0 error
+
+	${GetOptions} "/INSTDIR=common directory: 'C:\Program Files\Common Files' /SILENT=yes" '/INSTDIR=' $OUT1
+	StrCmp $OUT1 "common directory: 'C:\Program Files\Common Files'" 0 error
+
+	${GetOptions} '/INSTDIR=WxxxW /SILENT=yes' '/INSTDIR=' $OUT1
+	StrCmp $OUT1 'WxxxW' 0 error
+
+	${GetOptions} "/Prm='/D=True' /D=1" '/D=' $OUT1
+	StrCmp $OUT1 "1" 0 error
+
+	${GetOptions} "/D=1 /Prm='/D=True'" '/Prm=' $OUT1
+	StrCmp $OUT1 "/D=True" 0 error
+
+	${GetOptions} `/D=1 /Prm='/D="True" /S="/Temp"'` '/Prm=' $OUT1
+	StrCmp $OUT1 '/D="True" /S="/Temp"' 0 error
+
+	${GetOptions} `/INSTDIR='"C:/Program Files/Common Files"' /SILENT=yes` '/INSTDIR=' $OUT1
+	StrCmp $OUT1 '"C:/Program Files/Common Files"' 0 error
+
+	${GetOptions} `/INSTDIR='"C:/Program Files/Common Files"' /SILENT=yes` '/INSTDIR*=' $OUT1
+	IfErrors 0 error
+	StrCmp $OUT1 '' 0 error
+
+	${GetOptions} `/INSTDIR="C:/Program Files/Common Files" /SILENT=yes` '' $OUT1
+	IfErrors 0 error
+	StrCmp $OUT1 '' 0 error
+
+	${GetOptionsS} '/INSTDIR=C:\Program Files\Common Files /SILENT' '/SILENT' $OUT1
+	IfErrors error
+	StrCmp $OUT1 '' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section GetOptionsS
+	${StackVerificationStart} GetOptionsS
+
+	${GetOptionsS} '/INSTDIR=C:\Program Files\Common Files /SILENT=yes' '/INSTDIR=' $OUT1
+	IfErrors error
+	StrCmp $OUT1 'C:\Program Files\Common Files' 0 error
+
+	${GetOptionsS} '/INSTDIR=C:\Program Files\Common Files /SILENT=yes' '/Instdir=' $OUT1
+	IfErrors 0 error
+	StrCmp $OUT1 '' 0 error
+
+	${GetOptionsS} '/INSTDIR=C:\Program Files\Common Files /SILENT' '/SILENT' $OUT1
+	IfErrors error
+	StrCmp $OUT1 '' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section GetRoot
+	${StackVerificationStart} GetRoot
+
+	${GetRoot} 'C:\Program Files\NSIS' $OUT1
+	StrCmp $OUT1 'C:' 0 error
+
+	${GetRoot} '\\SuperPimp\NSIS\Source\exehead\Ui.c' $OUT1
+	StrCmp $OUT1 '\\SuperPimp\NSIS' 0 error
+
+	${GetRoot} '\\Program Files\NSIS' $OUT1
+	StrCmp $OUT1 '\\Program Files\NSIS' 0 error
+
+	${GetRoot} '\\Program Files\NSIS\' $OUT1
+	StrCmp $OUT1 '\\Program Files\NSIS' 0 error
+
+	${GetRoot} '\\Program Files\NSIS\Source\exehead\Ui.c' $OUT1
+	StrCmp $OUT1 '\\Program Files\NSIS' 0 error
+
+	${GetRoot} '\Program Files\NSIS' $OUT1
+	StrCmp $OUT1 '' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section GetParent
+	${StackVerificationStart} GetParent
+
+	${GetParent} 'C:\Program Files\Winamp\uninstwa.exe' $OUT1
+	StrCmp $OUT1 'C:\Program Files\Winamp' 0 error
+
+	${GetParent} 'C:\Program Files\Winamp\plugins' $OUT1
+	StrCmp $OUT1 'C:\Program Files\Winamp' 0 error
+
+	${GetParent} 'C:\Program Files\Winamp\plugins\' $OUT1
+	StrCmp $OUT1 'C:\Program Files\Winamp' 0 error
+
+	${GetParent} 'C:\' $OUT1
+	StrCmp $OUT1 '' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section GetFileName
+	${StackVerificationStart} GetFileName
+
+	${GetFileName} 'C:\Program Files\Winamp\uninstwa.exe' $OUT1
+	StrCmp $OUT1 'uninstwa.exe' 0 error
+
+	${GetFileName} 'uninstwa.exe' $OUT1
+	StrCmp $OUT1 'uninstwa.exe' 0 error
+
+	${GetFileName} 'C:\Program Files\Winamp\plugins' $OUT1
+	StrCmp $OUT1 'plugins' 0 error
+
+	${GetFileName} 'C:\Program Files\Winamp\plugins\' $OUT1
+	StrCmp $OUT1 'plugins' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section GetBaseName
+	${StackVerificationStart} GetBaseName
+
+	${GetBaseName} 'C:\Program Files\Winamp\uninstwa.exe' $OUT1
+	StrCmp $OUT1 'uninstwa' 0 error
+
+	${GetBaseName} 'uninstwa.exe' $OUT1
+	StrCmp $OUT1 'uninstwa' 0 error
+
+	${GetBaseName} 'C:\Program Files\Winamp\plugins' $OUT1
+	StrCmp $OUT1 'plugins' 0 error
+
+	${GetBaseName} 'C:\Program Files\Winamp\plugins\' $OUT1
+	StrCmp $OUT1 '' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section GetFileExt
+	${StackVerificationStart} GetFileExt
+
+	${GetFileExt} 'C:\Program Files\Winamp\uninstwa.exe' $OUT1
+	StrCmp $OUT1 'exe' 0 error
+
+	${GetFileExt} 'uninstwa.exe' $OUT1
+	StrCmp $OUT1 'exe' 0 error
+
+	${GetFileExt} 'C:\Program Files\Winamp\plugins' $OUT1
+	StrCmp $OUT1 '' 0 error
+
+	${GetFileExt} 'C:\Program Files\Winamp\plugins\' $OUT1
+	StrCmp $OUT1 '' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section BannerTrimPath
+	${StackVerificationStart} BannerTrimPath
+
+	${BannerTrimPath} 'C:\Server\Documents\Terminal\license.htm' '35A' $OUT1
+	StrCmp $OUT1 'C:\Server\...\Terminal\license.htm' 0 error
+
+	${BannerTrimPath} 'C:\12\3456\789' '3A' $OUT1
+	StrCmp $OUT1 '' 0 error
+
+	${BannerTrimPath} 'C:\12\3456\789' '4A' $OUT1
+	StrCmp $OUT1 'C...' 0 error
+
+	${BannerTrimPath} 'C:\12\3456\789' '11A' $OUT1
+	StrCmp $OUT1 'C:\12\...' 0 error
+
+	${BannerTrimPath} 'C:\12\3456\789' '13A' $OUT1
+	StrCmp $OUT1 'C:\12\...\789' 0 error
+
+	${BannerTrimPath} 'C:\12\3456\789' '14A' $OUT1
+	StrCmp $OUT1 'C:\12\3456\789' 0 error
+
+	${BannerTrimPath} 'C:\12\3456\789' '14A' $OUT1
+	StrCmp $OUT1 'C:\12\3456\789' 0 error
+
+	${BannerTrimPath} 'C:\12\3456\789' '11B' $OUT1
+	StrCmp $OUT1 'C:\12\...' 0 error
+
+	${BannerTrimPath} 'C:\12\3456\789' '5B' $OUT1
+	StrCmp $OUT1 'C:...' 0 error
+
+	${BannerTrimPath} 'C:\12\3456\789' '5B' $OUT1
+	StrCmp $OUT1 'C:...' 0 error
+
+	${BannerTrimPath} 'C:\12\3456\789' '11C' $OUT1
+	StrCmp $OUT1 'C:\12\34...' 0 error
+
+	${BannerTrimPath} 'C:\12\3456\789' '9D' $OUT1
+	StrCmp $OUT1 'C:\12\...' 0 error
+
+	${BannerTrimPath} 'C:\12\3456\789' '10D' $OUT1
+	StrCmp $OUT1 'C:\...\789' 0 error
+
+	${BannerTrimPath} 'C:\12\3456\789' '11D' $OUT1
+	StrCmp $OUT1 'C:\1...\789' 0 error
+
+	${BannerTrimPath} '123456789' '5D' $OUT1
+	StrCmp $OUT1 '12...' 0 error
+
+	goto +2
+	error:
+	SetErrors
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section DirState
+	${StackVerificationStart} DirState
+
+	${DirState} '$TEMP' $OUT1
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section RefreshShellIcons
+	${StackVerificationStart} RefreshShellIcons
+
+	${RefreshShellIcons}
+
+	${StackVerificationEnd}
+SectionEnd
+
+
+Section WriteUninstaller
+	goto +2
+	WriteUninstaller '$EXEDIR\un.FileFuncTest.exe'
+SectionEnd
+
+
+
+;############### UNINSTALL ###############
+
+Section un.Uninstall
+	${Locate} '$DOCUMENTS' '/L=FD /M=*.* /S=0B /G=0' 'un.LocateCallback'
+	${GetSize} '$WINDIR' '/M=Explorer.exe /S=0K /G=0' $OUT1 $OUT2 $OUT3
+	${DriveSpace} 'C:\' '/D=F /S=M' $OUT1
+	${GetDrives} 'FDD+CDROM' 'un.GetDrivesCallback'
+	${GetTime} '' 'L' $OUT1 $OUT2 $OUT3 $OUT4 $OUT5 $OUT6 $OUT7
+	${GetFileAttributes} '$WINDIR\explorer.exe' 'ALL' $OUT1
+	${GetFileVersion} '$WINDIR\explorer.exe' $OUT1
+	${GetExeName} $OUT1
+	${GetExePath} $OUT1
+	${GetParameters} $OUT1
+	${GetOptions} '/INSTDIR=C:\Program Files\Common Files /SILENT=yes' '/INSTDIR=' $OUT1
+	${GetOptionsS} '/INSTDIR=C:\Program Files\Common Files /SILENT=yes' '/INSTDIR=' $OUT1
+	${GetRoot} 'C:\Program Files\NSIS' $OUT1
+	${GetParent} 'C:\Program Files\Winamp\uninstwa.exe' $OUT1
+	${GetFileName} 'C:\Program Files\Winamp\uninstwa.exe' $OUT1
+	${GetBaseName} 'C:\Program Files\Winamp\uninstwa.exe' $OUT1
+	${GetFileExt} 'C:\Program Files\Winamp\uninstwa.exe' $OUT1
+	${BannerTrimPath} 'C:\Server\Documents\Terminal\license.htm' '35A' $OUT1
+	${DirState} '$TEMP' $OUT1
+	${RefreshShellIcons}
+SectionEnd
+
+Function un.LocateCallback
+	Push $0
+FunctionEnd
+
+Function un.GetDrivesCallback
+	Push $0
+FunctionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/System/System.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/System/System.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/System/System.nsi	(revision 728)
@@ -0,0 +1,136 @@
+; This is just an example of System Plugin
+; 
+; (c) brainsucker, 2002
+; (r) BSForce
+
+Name "System Plugin Example"
+OutFile "System.exe"
+
+!include "SysFunc.nsh"
+
+Section "ThisNameIsIgnoredSoWhyBother?"
+     SetOutPath $TEMP
+
+     ; ----- Sample 1 ----- Message box with custom icon -----
+
+     ; there are no default beeps for custom message boxes, use sysMessageBeep
+     ; in case you need it (see next message box example)
+     !insertmacro smMessageBox "i 0" "Message box with custom icon!" "System Example 1a" ${MB_OK} "i 103"
+     ; i 0 - installer exe as module
+     ; i 103 - icon ID
+
+     ; The same example but using icon from resource.dll.
+     ; You could use this dll for storing your resources, just replace FAR icon
+     ; with something you really need.   
+     File "Resource.dll"
+     System::Call '${sysMessageBeep} (${MB_ICONHAND})'  ; custom beep
+     !insertmacro smMessageBox "`$TEMP\resource.dll`" "Message box with custom icon from resource.dll!" "System Example 1b" ${MB_OKCANCEL} "i 103"
+     Delete $TEMP\resource.dll
+
+     ; ----- Sample 2 ----- Fixed disks size/space -----
+
+     StrCpy $7 '               Disk,                Size,                Free,                Free for user:$\n$\n'
+
+     ; Memory for paths   
+     System::Alloc 1024
+     Pop $1
+     ; Get drives   
+     System::Call '${sysGetLogicalDriveStrings}(1024, r1)'
+enumok:
+     ; One more drive?   
+     System::Call '${syslstrlen}(i r1) .r2'
+     IntCmp $2 0 enumex
+
+     ; Is it DRIVE_FIXED?
+     System::Call '${sysGetDriveType} (i r1) .r3'
+     StrCmp $3 ${DRIVE_FIXED} 0 enumnext
+
+     ; Drive space   
+     System::Call '${sysGetDiskFreeSpaceEx}(i r1, .r3, .r4, .r5)'
+
+     ; Pretty KBs will be saved on stack
+     System::Int64Op $3 / 1048576
+     System::Int64Op $5 / 1048576
+     System::Int64Op $4 / 1048576
+
+     ; Get pretty drive path string   
+     System::Call '*$1(&t1024 .r6)'
+     System::Call '${syswsprintf} (.r7, "%s%20s    %20s mb    %20s mb    %20s mb$\n", tr7, tr6, ts, ts, ts)'
+
+enumnext:
+     ; Next drive path       
+     IntOp $1 $1 + $2
+     IntOp $1 $1 + 1
+     goto enumok   
+enumex: ; End of drives or user cancel
+     ; Free memory for paths   
+     System::Free $1   
+
+     ; Message box      
+     System::Call '${sysMessageBox}($HWNDPARENT, s, "System Example 2", ${MB_OKCANCEL})' "$7"
+
+     ; ----- Sample 3 ----- Direct proc defenition -----
+
+     ; Direct specification demo
+     System::Call 'user32::MessageBoxA(i $HWNDPARENT, t "Just direct MessageBoxA specification demo ;)", t "System Example 3", i ${MB_OK}) i.s'
+     Pop $0
+
+     ; ----- Sample 4 ----- Int64, mixed definition demo -----
+
+     ; Long int demo
+     StrCpy $2 "12312312"
+     StrCpy $3 "12345678903"
+     System::Int64Op $2 "*" $3
+     Pop $4
+
+     ; Cdecl demo (uses 3 defenitions (simple example))
+     System::Call "${syswsprintf}(.R1, s,,, t, ir0) .R0 (,,tr2,tr3,$4_)" "Int64 ops and strange defenition demo, %s x %s == %s, and previous msgbox result = %d"
+     MessageBox MB_OKCANCEL "Cool: '$R1'"
+
+     ; ----- Sample 5 ----- Small structure example -----
+
+     ; Create & Fill structure
+     System::Call "*(i 123123123, &t10 'Hello', &i1 0x123dd, &i2 0xffeeddccaa) i.s"
+     Pop $1
+     ; Read data from structure   
+     System::Call "*$1(i .r2, &t10 .r3, &i1 .r4, &i2 .r5, &l0 .r6)"
+     ; Show data and delete structure
+     MessageBox MB_OK "Structure example: $\nint == $2 $\nstring == $3 $\nbyte == $4 $\nshort == $5 $\nsize == $6"
+     System::Free $1
+
+     ; ----- Sample 6 ----- systemGetFileSysTime demo -----
+     Call       GetInstallerExeName
+     pop        $0
+
+     !insertmacro smGetFileSysTime $0
+     System::Call '*$R0${stSYSTEMTIME}(.r1, .r2, .r3, .r4, .r5, .r6, .r7, .r8)'
+ 
+     MessageBox MB_OK "GetFileSysTime example: file '$0', year $1, month $2, dow $3, day $4, hour $5, min $6, sec $7, ms $8"     
+
+     ; free memory from SYSTEMTIME
+     System::Free $R0   
+
+     ; ----- Sample 7 ----- systemSplash -> Callbacks demonstration -----
+
+     ; Logo
+     File /oname=spltmp.bmp "${NSISDIR}\Contrib\Graphics\Header\orange-nsis.bmp"
+;     File /oname=spltmp.wav "d:\Windows\Media\tada.wav"
+
+     ; I. systemSplash variant
+     !insertmacro smSystemSplash 2000 "$TEMP\spltmp"
+
+     ; II. Splash Plugin variant
+;    splash::show 2000 $TEMP\spltmp
+;    Pop $R0 ; $R0 has '1' if the user closed the splash screen early,
+
+     ; remove logo
+     Delete $TEMP\spltmp.bmp
+;     Delete $TEMP\spltmp.wav
+
+     ; Display splash result
+     pop $0
+     MessageBox MB_OK "Splash (callbacks) demo result $R0"
+
+SectionEnd 
+
+; eof
Index: tmp/trunk/org.txm.setups/nsis/Examples/System/Resource.dll
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Examples/System/Resource.dll
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Examples/System/SysFunc.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/System/SysFunc.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/System/SysFunc.nsh	(revision 728)
@@ -0,0 +1,398 @@
+; Some useful functions based on System plugin
+; 
+; (c) brainsucker, 2002
+; (r) BSForce
+
+; Check for double includes
+!ifndef SysFunc.NSH.Included
+!define SysFunc.NSH.Included
+
+!include "${NSISDIR}\Examples\System\System.nsh"
+
+!verbose 3      ; For WinMessages especially
+  !include "WinMessages.nsh"
+!verbose 4
+
+; ================= GetInstallerExeName implementation =================
+
+; Adopted Get Parameter function -> now it gets full installer.exe path
+; input - nothing, output -> full path at the top of the stack
+Function GetInstallerExeName
+   Push $R0
+   Push $R1
+   Push $R2
+   StrCpy $R0 $CMDLINE 1
+   StrCpy $R1 '"'
+   StrCpy $R2 1
+   StrCmp $R0 '"' loop
+     StrCpy $R1 ' ' ; we're scanning for a space instead of a quote
+   loop:
+     StrCpy $R0 $CMDLINE 1 $R2
+     StrCmp $R0 $R1 loop2
+     StrCmp $R0 "" loop2
+     IntOp $R2 $R2 + 1
+     Goto loop
+   loop2:
+
+   ; Ok, have we found last exename character or string end?
+   StrCmp $R0 "" "" +2
+        IntOp $R2 $R2 - 1       ; last exename char
+   StrCmp $R1 ' ' +3    ; was first character the '"', or something other?
+        StrCpy $R1 1    ; it was quote
+        Goto +2
+        StrCpy $R1 0    
+   IntOp $R2 $R2 - $R1
+   StrCpy $R0 $CMDLINE $R2 $R1  
+
+   SearchPath $R0 $R0      ; expand file name to full path
+
+   Pop $R2
+   Pop $R1
+   Exch $R0
+FunctionEnd
+
+; ================= systemGetFileSysTime implementation =================
+
+!macro smGetFileSysTime FILENAME
+        Push ${FILENAME}
+        Call systemGetFileSysTime
+        Pop  $R0
+!macroend
+
+; -----------------------------------------------------------------
+; systemGetFileSysTime (params on stack):
+;       FILENAME        -       name of file to get file time
+; returns to stack (SYSTEMTIME struct addr)
+; -----------------------------------------------------------------
+
+; uses original method from NSIS
+Function systemGetFileSysTime
+    System::Store "s r1"
+
+    StrCpy $R0 0     
+
+    ; create WIN32_FIND_DATA struct
+    System::Call '*${stWIN32_FIND_DATA} .r2'
+
+    ; Find file info
+    System::Call '${sysFindFirstFile}(r1, r2) .r3'
+
+    ; ok?
+    IntCmp $3 ${INVALID_HANDLE_VALUE} sgfst_exit
+
+    ; close file search
+    System::Call '${sysFindClose}(r3)'
+
+    ; Create systemtime struct for local time
+    System::Call '*${stSYSTEMTIME} .R0'
+
+    ; Get File time
+    System::Call '*$2${stWIN32_FIND_DATA} (,,, .r3)'
+
+    ; Convert file time (UTC) to local file time
+    System::Call '${sysFileTimeToLocalFileTime}(r3, .r1)'
+
+    ; Convert file time to system time
+    System::Call '${sysFileTimeToSystemTime}(r1, R0)'
+
+sgfst_exit:
+    ; free used memory for WIN32_FIND_DATA struct
+    System::Free $2    
+
+    System::Store "P0 l"
+FunctionEnd
+
+; ================= systemMessageBox implementation =================
+
+; return to $R0
+!macro smMessageBox MODULE MSG CAPTION STYLE ICON
+     Push "${ICON}"
+     Push "${STYLE}"
+     Push "${CAPTION}"
+     Push "${MSG}"
+     Push "${MODULE}"
+     Call systemMessageBox
+     Pop $R0
+!macroend
+
+; -----------------------------------------------------------------
+; systemMessageBox (params on stack):
+;       Module: either handle ("i HANDLE", HANDLE could be 0) or "modulename" 
+;       Msg: text of message
+;       Caption: caption of message box window
+;       Style: style, buttons etc
+;       Icon: either icon handle ("i HANDLE") or resource name 
+; returns to stack
+; -----------------------------------------------------------------
+Function systemMessageBox
+     System::Store "s r2r3r4r5r6"
+
+     ; may be Module is module handle?
+     StrCpy $1 $2
+     IntCmp $1 0 0 smbnext smbnext
+
+	 ; Get module handle
+	 System::Call '${sysGetModuleHandle}($2) .r1'
+	 IntCmp $1 0 loadlib libnotloaded libnotloaded
+
+loadlib:
+     ; Load module and get handle
+     System::Call '${sysLoadLibrary}($2) .r1'
+     IntCmp $1 0 0 smbnext smbnext
+
+libnotloaded:
+	 ; Indicate that LoadLibrary wasn't used
+	 StrCpy $2 1
+
+smbnext:
+     ; Create MSGBOXPARAMS structure
+     System::Call '*${stMSGBOXPARAMS}(, $HWNDPARENT, r1, r3, r4, "$5|${MB_USERICON}", $6, _) .r0'
+     ; call MessageBoxIndirect
+     System::Call '${sysMessageBoxIndirect}(r0) .R0'
+     ; free MSGBOXPARAMS structure
+
+     System::Free $0
+
+     ; have we used load library at start?
+     IntCmp $2 0 0 smbskipfree smbskipfree
+     ; No, then free the module
+     System::Call '${sysFreeLibrary}(r1)'
+
+smbskipfree:
+     System::Store "P0 l"   
+FunctionEnd
+
+; ================= systemSplash implementation =================
+
+; returns to $R0
+!macro smSystemSplash DELAY FILE
+    Push ${FILE}
+    Push ${DELAY}
+    call systemSplash
+    Pop $R0    
+!macroend
+
+; -----------------------------------------------------------------
+; systemSplash (params on stack):
+;       Delay - time in ms to show the splash
+;       File - bitmap (& audio) file name (without extension)
+; returns to stack
+; -----------------------------------------------------------------
+
+Function _systemSplashWndCB
+   ; Callback receives 4 values
+   System::Store "s r2r5r7r9"
+
+   ; Message branching
+   IntCmp $5 ${WM_CLOSE} m_Close
+   IntCmp $5 ${WM_TIMER} m_Timer
+   IntCmp $5 ${WM_LBUTTONDOWN} m_Lbtn
+   IntCmp $5 ${WM_CREATE} m_Create
+   IntCmp $5 ${WM_PAINT} m_Paint
+   goto default
+
+m_Create:
+   ; Create structures
+   System::Call "*${stRECT} (_) .R8"
+   System::Call "*${stBITMAP} (_, &l0 .R7) .R9"
+
+   ; Get bitmap info
+   System::Call "${sysGetObject} (r6, R7, R9)" 
+   
+   ; Get desktop info
+   System::Call "${sysSystemParametersInfo} (${SPI_GETWORKAREA}, 0, R8, 0)" 
+
+   ; Style (callbacked)
+   System::Call "${sysSetWindowLong} (r2, ${GWL_STYLE}, 0) .s" 
+   !insertmacro SINGLE_CALLBACK 5 $R7 1 _systemSplashWndCB
+
+   ; Calculate and set window pos
+
+   ; Get bmWidth(R2) and bmHeight(R3)
+   System::Call "*$R9${stBITMAP} (,.R2,.R3)"
+   ; Get left(R4), top(R5), right(R6), bottom(R7)
+   System::Call "*$R8${stRECT} (.R4,.R5,.R6,.R7)"
+
+   ; Left pos
+   IntOp $R0 $R6 - $R4
+   IntOp $R0 $R0 - $R2
+   IntOp $R0 $R0 / 2
+   IntOp $R0 $R0 + $R4
+
+   ; Top pos
+   IntOp $R1 $R7 - $R5
+   IntOp $R1 $R1 - $R3
+   IntOp $R1 $R1 / 2
+   IntOp $R1 $R1 + $R5
+
+   System::Call "${sysSetWindowPos} (r2, 0, R0, R1, R2, R3, ${SWP_NOZORDER}) .s" 
+   !insertmacro SINGLE_CALLBACK 6 $R7 1 _systemSplashWndCB
+
+   ; Show window
+   System::Call "${sysShowWindow} (r2, ${SW_SHOW}) .s" 
+   !insertmacro SINGLE_CALLBACK 7 $R7 1 _systemSplashWndCB
+
+   ; Set Timer
+   System::Call "${sysSetTimer} (r2, 1, r8,)"
+
+   ; Free used memory
+   System::Free $R8
+   System::Free $R9
+
+   StrCpy $R0 0
+   goto exit
+
+m_Paint:
+   ; Create structures
+   System::Call "*${stRECT} (_) .R8"
+   System::Call "*${stPAINTSTRUCT} (_) .R9"
+
+   ; Begin Paint
+   System::Call "${sysBeginPaint} (r2, R9) .R7"
+
+   ; CreateCompatibleDC
+   System::Call "${sysCreateCompatibleDC} (R7) .R6"
+
+   ; GetClientRect
+   System::Call "${sysGetClientRect} (r2, R8)"
+  
+   ; Select new bitmap
+   System::Call "${sysSelectObject} (R6, r6) .R5"
+
+   ; Get left(R0), top(R1), right(R2), bottom(R3)
+   System::Call "*$R8${stRECT} (.R0,.R1,.R2,.R3)"
+     
+   ; width=right-left  
+   IntOp $R2 $R2 - $R0
+   ; height=bottom-top
+   IntOp $R3 $R3 - $R1
+
+   System::Call "${sysBitBlt} (R7, R0, R1, R2, R3, R6, 0, 0, ${SRCCOPY})" 
+
+   ; Select old bitmap
+   System::Call "${sysSelectObject} (R6, R5)"
+   
+   ; Delete compatible DC
+   System::Call "${sysDeleteDC} (R6)"
+
+   ; End Paint
+   System::Call "${sysEndPaint} (r2, R9)"
+
+   ; Free used memory
+   System::Free $R8
+   System::Free $R9
+
+   StrCpy $R0 0
+   goto exit
+
+m_Timer:
+m_Lbtn:
+   StrCpy $4 0
+   IntCmp $5 ${WM_TIMER} destroy
+        StrCpy $4 1
+
+destroy:
+   System::Call "${sysDestroyWindow} (r2) .s"
+   !insertmacro SINGLE_CALLBACK 12 $R4 1 _systemSplashWndCB
+
+default:
+   ; Default
+   System::Call "${sysDefWindowProc} (r2, r5, r7, r9) .s"
+   !insertmacro SINGLE_CALLBACK 14 $R0 1 _systemSplashWndCB
+   goto exit
+
+m_Close:
+   StrCpy $R0 0
+   goto exit
+
+exit:
+   ; Restore
+   System::Store "p4P0 l R0r4"
+
+   ; Return from callback
+   System::Call "$3" $R0
+FunctionEnd
+
+Function systemSplash
+
+   ; Save registers and get input 
+   System::Store "s r8r9"
+
+   ; Get module instance
+   System::Call "${sysGetModuleHandle} (i) .r7"
+
+   ; Get arrow cursor
+   System::Call "${sysLoadCursor} (0, i ${IDC_ARROW}) .R9" 
+
+   ; Get callback
+   System::Get "${sysWNDPROC}"
+   Pop $3
+
+   ; Create window class
+   System::Call "*${stWNDCLASS} (0,r3,0,0,r7,0,R9,0,i 0,'_sp') .R9"
+
+   ; Register window class
+   System::Call "${sysRegisterClass} (R9) .R9"
+   IntCmp $R9 0 errorexit ; Class registered ok?
+
+   ; Load Image (LR_CREATEDIBSECTION|LR_LOADFROMFILE = 0x2010)
+   System::Call '${sysLoadImage} (, s, ${IMAGE_BITMAP}, 0, 0, ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) .r6' "$9.bmp"
+   IntCmp $6 0 errorexit        ; Image loaded ok?
+
+   ; Start the sound (SND_ASYNC|SND_FILENAME|SND_NODEFAULT = 0x20003)
+   System::Call "${sysPlaySound} (s,,${SND_ASYNC}|${SND_FILENAME}|${SND_NODEFAULT})" "$9.wav" 
+
+   ; Create window
+   System::Call "${sysCreateWindowEx} (${WS_EX_TOOLWINDOW}, s, s,,,,,, $HWNDPARENT,,r7,) .s" "_sp" "_sp" 
+   !insertmacro SINGLE_CALLBACK 1 $5 1 _systemSplashWndCB
+
+   ; Create MSG struct
+   System::Call "*${stMSG} (_) i.R9"
+
+   ; -------------------------
+repeat:
+        ; Check for window
+        System::Call "${sysIsWindow} (r5) .s"
+        !insertmacro SINGLE_CALLBACK 2 $R8 1 _systemSplashWndCB
+        IntCmp $R8 0 finish
+
+        ; Get message
+        System::Call "${sysGetMessage} (R9, r5,_) .s"
+        !insertmacro SINGLE_CALLBACK 3 $R8 1 _systemSplashWndCB
+        IntCmp $R8 0 finish
+
+        ; Dispatch message
+        System::Call "${sysDispatchMessage} (R9) .s"
+        !insertmacro SINGLE_CALLBACK 4 $R8 1 _systemSplashWndCB
+
+        ; Repeat dispatch cycle
+        goto repeat
+   ; -------------------------
+
+finish:
+   ; Stop the sound
+   System::Call "${sysPlaySound} (i 0, i 0, i 0)"
+
+   ; Delete bitmap object
+   System::Call "${sysDeleteObject} (r6)"
+
+   ; Delete the callback queue
+   System::Free $3
+
+   ; Dialog return
+   StrCpy $R0 $4
+   goto exit
+
+; Exit in case of error
+errorexit:
+   StrCpy $R0 -1
+   goto exit
+
+exit:
+   ; Restore register and put output
+   System::Store "P0 l"
+FunctionEnd
+
+!verbose 4
+
+!endif
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/System/System.nsh
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/System/System.nsh	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/System/System.nsh	(revision 728)
@@ -0,0 +1,472 @@
+; Some useful functions, structures, constants
+; 
+; (c) brainsucker, 2002
+; (r) BSForce
+
+; Check for double includes
+!ifndef System.NSH.Included
+!define System.NSH.Included
+
+!verbose 3
+
+; ------------- Functions --------------
+
+; LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+!define sysWNDPROC "(i.s, i.s, i.s, i.s) iss"
+
+; LRESULT DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
+!define sysDefWindowProc "user32::DefWindowProcA(i, i, i, i) i"
+
+!define sysMessageBox "user32::MessageBoxA(i, t, t, i) i"
+
+!define sysMessageBeep "user32::MessageBeep(i) i"
+
+!define sysMessageBoxIndirect 'user32::MessageBoxIndirectA(i) i'
+
+; HMODULE GetModuleHandle(LPCTSTR lpModuleName); 
+!define sysGetModuleHandle "kernel32::GetModuleHandleA(t) i"
+
+; HMODULE LoadLibrary(LPCTSTR lpFileName);
+!define sysLoadLibrary "kernel32::LoadLibraryA(t) i"
+
+; BOOL FreeLibrary(HMODULE hModule);
+!define sysFreeLibrary "kernel32::FreeLibrary(i) i"
+
+; HCURSOR LoadCursor(HINSTANCE hInstance, LPCTSTR lpCursorName);
+!define sysLoadCursor "user32::LoadCursorA(i, t) i"
+
+; ATOM RegisterClass(CONST WNDCLASS *lpWndClass);
+!define sysRegisterClass "user32::RegisterClassA(i) i"
+
+; HANDLE LoadImage(HINSTANCE hinst, LPCTSTR lpszName, UINT uType,
+;       int cxDesired, int cyDesired, UINT fuLoad);
+!define sysLoadImage "user32::LoadImageA(i, t, i, i, i, i) i"
+
+; BOOL PlaySound(LPCSTR pszSound, HMODULE hmod, DWORD fdwSound);
+!define sysPlaySound "winmm.dll::PlaySoundA(t, i, i) i"
+
+; HWND CreateWindowEx(DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName,
+;       DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent,
+;       HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam);
+!define sysCreateWindowEx "user32::CreateWindowExA(i, t, t, i, i, i, i, i, i, i, i, i) i"
+
+; BOOL IsWindow(HWND hWnd);
+!define sysIsWindow "user32::IsWindow(i) i"
+
+; LONG SetWindowLong(HWND hWnd, int nIndex, LONG dwNewLong);
+!define sysSetWindowLong "user32::SetWindowLongA(i, i, i) i"
+
+; BOOL SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags);
+!define sysSetWindowPos "user32::SetWindowPos(i, i, i, i, i, i, i) i"
+
+; BOOL ShowWindow(HWND hWnd, int nCmdShow);
+!define sysShowWindow "user32::ShowWindow(i, i) i"
+
+; BOOL DestroyWindow(HWND hWnd);
+!define sysDestroyWindow "user32::DestroyWindow(i) i"
+
+; BOOL GetClientRect(HWND hWnd, LPRECT lpRect);
+!define sysGetClientRect "user32::GetClientRect(i, i) i"
+
+; BOOL GetMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax);
+!define sysGetMessage "user32::GetMessageA(i, i, i, i) i"
+
+; LRESULT DispatchMessage(CONST MSG *lpmsg);
+!define sysDispatchMessage "user32::DispatchMessageA(i) i"
+
+; BOOL DeleteObject(HGDIOBJ hObject);
+!define sysDeleteObject "gdi32::DeleteObject(i) i"
+
+; int GetObject(HGDIOBJ hgdiobj, int cbBuffer, LPVOID lpvObject);
+!define sysGetObject "gdi32::GetObjectA(i, i, i) i"
+
+; HGDIOBJ SelectObject(HDC hdc, HGDIOBJ hgdiobj);
+!define sysSelectObject "gdi32::SelectObject(i, i) i"
+
+; HDC CreateCompatibleDC(HDC hdc);
+!define sysCreateCompatibleDC "gdi32::CreateCompatibleDC(i) i"
+
+; BOOL DeleteDC(HDC hdc);
+!define sysDeleteDC "gdi32::DeleteDC(i) i"
+
+; BOOL BitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, 
+;       HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop);
+!define sysBitBlt "gdi32::BitBlt(i, i, i, i, i, i, i, i, i) i"
+
+; proposed by abgandar
+; int AddFontResource(LPCTSTR lpszFilename);
+!define sysAddFontResource "gdi32::AddFontResourceA(t) i"
+
+; HDC BeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint);
+!define sysBeginPaint "user32::BeginPaint(i, i) i"
+
+; BOOL EndPaint(HWND hWnd, CONST PAINTSTRUCT *lpPaint);
+!define sysEndPaint "user32::EndPaint(i, i) i"
+
+; BOOL SystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);
+!define sysSystemParametersInfo "user32::SystemParametersInfoA(i, i, i, i) i"
+
+; UINT_PTR SetTimer(HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc);
+!define sysSetTimer "user32::SetTimer(i, i, i, k) i"
+
+!define sysGetLogicalDriveStrings 'kernel32::GetLogicalDriveStringsA(i, i) i'
+
+!define sysGetDiskFreeSpaceEx 'kernel32::GetDiskFreeSpaceExA(t, *l, *l, *l) i'
+
+; UINT GetDriveType(LPCTSTR lpRootPathName);
+!define sysGetDriveType 'kernel32::GetDriveTypeA(t) i'
+
+; HANDLE FindFirstFile(LPCTSTR lpFileName,LPWIN32_FIND_DATA lpFindFileData);
+!define sysFindFirstFile 'kernel32::FindFirstFileA(t, i) i'
+
+; BOOL FindClose(HANDLE hFindFile);
+!define sysFindClose 'kernel32::FindClose(i) i'
+
+; BOOL FileTimeToSystemTime(CONST FILETIME *lpFileTime, 
+; LPSYSTEMTIME lpSystemTime);
+!define sysFileTimeToSystemTime 'kernel32::FileTimeToSystemTime(*l, i) i'
+
+; BOOL FileTimeToLocalFileTime(
+;       CONST FILETIME *lpFileTime, 
+;       LPFILETIME lpLocalFileTime);
+!define sysFileTimeToLocalFileTime 'kernel32::FileTimeToLocalFileTime(*l, *l) i'
+
+; BOOL SystemTimeToTzSpecificLocalTime(LPTIME_ZONE_INFORMATION lpTimeZone, 
+; LPSYSTEMTIME lpUniversalTime, LPSYSTEMTIME lpLocalTime);
+!define sysSystemTimeToTzSpecificLocalTime 'kernel32::SystemTimeToTzSpecificLocalTime(i, i, i) i'
+
+!define syslstrlen 'kernel32::lstrlenA(t) i'
+
+; int wsprintf(LPTSTR lpOut, LPCTSTR lpFmt, ...);
+!define syswsprintf "user32::wsprintfA(t, t) i ? c" 
+
+; ------------- Structures --------------
+
+; typedef struct _WNDCLASS { 
+;               UINT       style; 
+;               WNDPROC    lpfnWndProc; 
+;               int        cbClsExtra; 
+;               int        cbWndExtra; 
+;               HINSTANCE  hInstance; 
+;               HICON      hIcon; 
+;               HCURSOR    hCursor; 
+;               HBRUSH     hbrBackground;
+;               LPCTSTR    lpszMenuName; 
+;               LPCTSTR    lpszClassName; 
+; } WNDCLASS, *PWNDCLASS; 
+!define stWNDCLASS "(i, k, i, i, i, i, i, i, t, t) i"
+
+; typedef struct tagMSG {
+;   HWND   hwnd; 
+;   UINT   message; 
+;   WPARAM wParam; 
+;   LPARAM lParam; 
+;   DWORD  time; 
+;   POINT  pt;  -> will be presented as two separate px and py
+; } MSG, *PMSG;
+!define stMSG "(i, i, i, i, i, i, i) i"
+
+; typedef struct tagBITMAP {
+;   LONG   bmType; 
+;   LONG   bmWidth; 
+;   LONG   bmHeight; 
+;   LONG   bmWidthBytes; 
+;   WORD   bmPlanes; 
+;   WORD   bmBitsPixel; 
+;   LPVOID bmBits; 
+; } BITMAP, *PBITMAP; 
+!define stBITMAP "(i, i, i, i, i, i, i) i"
+
+; typedef struct _RECT { 
+;   LONG left; 
+;   LONG top; 
+;   LONG right; 
+;   LONG bottom; 
+; } RECT, *PRECT; 
+!define stRECT "(i, i, i, i) i"
+
+; typedef struct tagPAINTSTRUCT { 
+;   HDC  hdc; 
+;   BOOL fErase; 
+;   RECT rcPaint; (rcl, rct, rcr, rcb)
+;   BOOL fRestore; 
+;   BOOL fIncUpdate; 
+;   BYTE rgbReserved[32]; 
+; } PAINTSTRUCT, *PPAINTSTRUCT; 
+!define stPAINTSTRUCT "(i, i, i, i, i, i, i, i, &v32) i"
+
+; typedef struct { 
+;  UINT      cbSize; 
+;  HWND      hwndOwner; 
+;  HINSTANCE hInstance; 
+;  LPCTSTR   lpszText; 
+;  LPCTSTR   lpszCaption; 
+;  DWORD     dwStyle; 
+;  LPCTSTR   lpszIcon; 
+;  DWORD_PTR dwContextHelpId; 
+;  MSGBOXCALLBACK lpfnMsgBoxCallback; 
+;  DWORD     dwLanguageId; 
+; } MSGBOXPARAMS, *PMSGBOXPARAMS; 
+!define stMSGBOXPARAMS '(&l4, i, i, t, t, i, t, i, k, i) i'
+
+; typedef struct _SYSTEMTIME { 
+;    WORD wYear; 
+;    WORD wMonth; 
+;    WORD wDayOfWeek; 
+;    WORD wDay; 
+;    WORD wHour; 
+;    WORD wMinute; 
+;    WORD wSecond; 
+;    WORD wMilliseconds; 
+; } SYSTEMTIME, *PSYSTEMTIME; 
+!define stSYSTEMTIME '(&i2, &i2, &i2, &i2, &i2, &i2, &i2, &i2) i'
+
+; Maximal windows path
+!define MAX_PATH          260
+
+; typedef struct _WIN32_FIND_DATA {
+;  DWORD    dwFileAttributes; 
+;  FILETIME ftCreationTime; 
+;  FILETIME ftLastAccessTime; 
+;  FILETIME ftLastWriteTime; 
+;  DWORD    nFileSizeHigh; 
+;  DWORD    nFileSizeLow; 
+;  DWORD    dwReserved0; 
+;  DWORD    dwReserved1; 
+;  TCHAR    cFileName[ MAX_PATH ]; 
+;  TCHAR    cAlternateFileName[ 14 ]; 
+; } WIN32_FIND_DATA, *PWIN32_FIND_DATA; 
+!define stWIN32_FIND_DATA '(i, l, l, l, i, i, i, i, &t${MAX_PATH}, &t14) i'
+
+; ------------- Constants --------------
+
+; == Other ==
+!define INVALID_HANDLE_VALUE -1
+
+; == Cursors ==
+
+!define IDC_ARROW           32512
+!define IDC_IBEAM           32513
+!define IDC_WAIT            32514
+!define IDC_CROSS           32515
+!define IDC_UPARROW         32516
+!define IDC_SIZE            32640  
+!define IDC_ICON            32641  
+!define IDC_SIZENWSE        32642
+!define IDC_SIZENESW        32643
+!define IDC_SIZEWE          32644
+!define IDC_SIZENS          32645
+!define IDC_SIZEALL         32646
+!define IDC_NO              32648 
+!define IDC_HAND            32649
+!define IDC_APPSTARTING     32650 
+!define IDC_HELP            32651
+
+; == Images ==
+
+!define IMAGE_BITMAP        0
+!define IMAGE_ICON          1
+!define IMAGE_CURSOR        2
+!define IMAGE_ENHMETAFILE   3
+
+!define LR_DEFAULTCOLOR     0x0000
+!define LR_MONOCHROME       0x0001
+!define LR_COLOR            0x0002
+!define LR_COPYRETURNORG    0x0004
+!define LR_COPYDELETEORG    0x0008
+!define LR_LOADFROMFILE     0x0010
+!define LR_LOADTRANSPARENT  0x0020
+!define LR_DEFAULTSIZE      0x0040
+!define LR_VGACOLOR         0x0080
+!define LR_LOADMAP3DCOLORS  0x1000
+!define LR_CREATEDIBSECTION 0x2000
+!define LR_COPYFROMRESOURCE 0x4000
+!define LR_SHARED           0x8000
+
+; == Sounds ==
+
+!define SND_SYNC            0x0000  
+!define SND_ASYNC           0x0001  
+!define SND_NODEFAULT       0x0002  
+!define SND_MEMORY          0x0004  
+!define SND_LOOP            0x0008  
+!define SND_NOSTOP          0x0010  
+
+!define SND_NOWAIT      0x00002000
+!define SND_ALIAS       0x00010000 
+!define SND_ALIAS_ID    0x00110000 
+!define SND_FILENAME    0x00020000
+!define SND_RESOURCE    0x00040004 
+!define SND_PURGE           0x0040  
+!define SND_APPLICATION     0x0080  
+
+; == Windows ==
+
+!define WS_OVERLAPPED       0x00000000
+!define WS_POPUP            0x80000000
+!define WS_CHILD            0x40000000
+!define WS_MINIMIZE         0x20000000
+!define WS_VISIBLE          0x10000000
+!define WS_DISABLED         0x08000000
+!define WS_CLIPSIBLINGS     0x04000000
+!define WS_CLIPCHILDREN     0x02000000
+!define WS_MAXIMIZE         0x01000000
+!define WS_CAPTION          0x00C00000    
+!define WS_BORDER           0x00800000
+!define WS_DLGFRAME         0x00400000
+!define WS_VSCROLL          0x00200000
+!define WS_HSCROLL          0x00100000
+!define WS_SYSMENU          0x00080000
+!define WS_THICKFRAME       0x00040000
+!define WS_GROUP            0x00020000
+!define WS_TABSTOP          0x00010000
+!define WS_MINIMIZEBOX      0x00020000
+!define WS_MAXIMIZEBOX      0x00010000
+!define WS_TILED            ${WS_OVERLAPPED}
+!define WS_ICONIC           ${WS_MINIMIZE}
+!define WS_SIZEBOX          ${WS_THICKFRAME}
+!define WS_OVERLAPPEDWINDOW 0x00CF0000
+!define WS_TILEDWINDOW      ${WS_OVERLAPPEDWINDOW}
+!define WS_POPUPWINDOW      0x80880000
+!define WS_CHILDWINDOW      ${WS_CHILD}
+!define WS_EX_DLGMODALFRAME     0x00000001
+!define WS_EX_NOPARENTNOTIFY    0x00000004
+!define WS_EX_TOPMOST           0x00000008
+!define WS_EX_ACCEPTFILES       0x00000010
+!define WS_EX_TRANSPARENT       0x00000020
+!define WS_EX_MDICHILD          0x00000040
+!define WS_EX_TOOLWINDOW        0x00000080
+!define WS_EX_WINDOWEDGE        0x00000100
+!define WS_EX_CLIENTEDGE        0x00000200
+!define WS_EX_CONTEXTHELP       0x00000400
+!define WS_EX_RIGHT             0x00001000
+!define WS_EX_LEFT              0x00000000
+!define WS_EX_RTLREADING        0x00002000
+!define WS_EX_LTRREADING        0x00000000
+!define WS_EX_LEFTSCROLLBAR     0x00004000
+!define WS_EX_RIGHTSCROLLBAR    0x00000000
+!define WS_EX_CONTROLPARENT     0x00010000
+!define WS_EX_STATICEDGE        0x00020000
+!define WS_EX_APPWINDOW         0x00040000
+!define WS_EX_OVERLAPPEDWINDOW  0x00000300
+!define WS_EX_PALETTEWINDOW     0x00000188
+!define WS_EX_LAYERED           0x00080000
+!define WS_EX_NOINHERITLAYOUT   0x00100000 
+!define WS_EX_LAYOUTRTL         0x00400000 
+!define WS_EX_COMPOSITED        0x02000000
+!define WS_EX_NOACTIVATE        0x08000000
+
+
+; == System Parameters Info ==
+
+!define SPI_GETWORKAREA             0x0030
+
+; == Window Long Offsets ==
+
+!define GWL_WNDPROC         -4
+!define GWL_HINSTANCE       -6
+!define GWL_HWNDPARENT      -8
+!define GWL_STYLE           -16
+!define GWL_EXSTYLE         -20
+!define GWL_USERDATA        -21
+!define GWL_ID              -12
+
+; == Window swap ==
+
+!define SWP_NOSIZE          0x0001
+!define SWP_NOMOVE          0x0002
+!define SWP_NOZORDER        0x0004
+!define SWP_NOREDRAW        0x0008
+!define SWP_NOACTIVATE      0x0010
+!define SWP_FRAMECHANGED    0x0020  
+!define SWP_SHOWWINDOW      0x0040
+!define SWP_HIDEWINDOW      0x0080
+!define SWP_NOCOPYBITS      0x0100
+!define SWP_NOOWNERZORDER   0x0200  
+!define SWP_NOSENDCHANGING  0x0400  
+
+!define SWP_DRAWFRAME       ${SWP_FRAMECHANGED}
+!define SWP_NOREPOSITION    ${SWP_NOOWNERZORDER}
+!define SWP_DEFERERASE      0x2000
+!define SWP_ASYNCWINDOWPOS  0x4000
+
+; == Bit Copy ==
+
+!define SRCCOPY             0x00CC0020 
+!define SRCPAINT            0x00EE0086 
+!define SRCAND              0x008800C6 
+!define SRCINVERT           0x00660046 
+!define SRCERASE            0x00440328 
+!define NOTSRCCOPY          0x00330008 
+!define NOTSRCERASE         0x001100A6 
+!define MERGECOPY           0x00C000CA 
+!define MERGEPAINT          0x00BB0226 
+!define PATCOPY             0x00F00021 
+!define PATPAINT            0x00FB0A09 
+!define PATINVERT           0x005A0049 
+!define DSTINVERT           0x00550009 
+!define BLACKNESS           0x00000042 
+!define WHITENESS           0x00FF0062 
+
+; == Message Box ==
+
+!define MB_OK                       0x00000000
+!define MB_OKCANCEL                 0x00000001
+!define MB_ABORTRETRYIGNORE         0x00000002
+!define MB_YESNOCANCEL              0x00000003
+!define MB_YESNO                    0x00000004
+!define MB_RETRYCANCEL              0x00000005
+!define MB_CANCELTRYCONTINUE        0x00000006
+!define MB_ICONHAND                 0x00000010
+!define MB_ICONQUESTION             0x00000020
+!define MB_ICONEXCLAMATION          0x00000030
+!define MB_ICONASTERISK             0x00000040
+!define MB_USERICON                 0x00000080
+!define MB_ICONWARNING              ${MB_ICONEXCLAMATION}
+!define MB_ICONERROR                ${MB_ICONHAND}
+
+!define MB_ICONINFORMATION          ${MB_ICONASTERISK}
+!define MB_ICONSTOP                 ${MB_ICONHAND}
+
+!define MB_DEFBUTTON1               0x00000000
+!define MB_DEFBUTTON2               0x00000100
+!define MB_DEFBUTTON3               0x00000200
+!define MB_DEFBUTTON4               0x00000300
+
+!define MB_APPLMODAL                0x00000000
+!define MB_SYSTEMMODAL              0x00001000
+!define MB_TASKMODAL                0x00002000
+!define MB_HELP                     0x00004000
+
+!define MB_NOFOCUS                  0x00008000
+!define MB_SETFOREGROUND            0x00010000
+!define MB_DEFAULT_DESKTOP_ONLY     0x00020000
+
+!define MB_TOPMOST                  0x00040000
+!define MB_RIGHT                    0x00080000
+!define MB_RTLREADING               0x00100000
+
+; == Drive type constants ==
+
+!define DRIVE_UNKNOWN     0
+!define DRIVE_NO_ROOT_DIR 1
+!define DRIVE_REMOVABLE   2
+!define DRIVE_FIXED       3
+!define DRIVE_REMOTE      4
+!define DRIVE_CDROM       5
+!define DRIVE_RAMDISK     6
+
+; == Callbacks ==
+
+!macro SINGLE_CALLBACK CHKN RES INDEX FUNC
+CheckCB_${CHKN}:
+        Pop ${RES}
+        StrCmp ${RES} "callback${INDEX}" 0 ExitCB_${CHKN}
+        Call ${FUNC}
+        Goto CheckCB_${CHKN}
+ExitCB_${CHKN}:
+!macroend
+
+!verbose 4
+
+!endif
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/nsExec/test.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/nsExec/test.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/nsExec/test.nsi	(revision 728)
@@ -0,0 +1,31 @@
+Name "nsExec Test"
+
+OutFile "nsExec Test.exe"
+
+ShowInstDetails show
+
+Section "Silent MakeNSIS"
+	nsExec::Exec '"${NSISDIR}\makensis.exe"'
+	Pop $0 # return value/error/timeout
+	DetailPrint ""
+	DetailPrint "       Return value: $0"
+	DetailPrint ""
+SectionEnd
+
+Section "MakeNSIS commands help"
+	nsExec::ExecToLog '"${NSISDIR}\makensis.exe" /CMDHELP'
+	Pop $0 # return value/error/timeout
+	DetailPrint ""
+	DetailPrint "       Return value: $0"
+	DetailPrint ""
+SectionEnd
+
+Section "Output to variable"
+	nsExec::ExecToStack '"${NSISDIR}\makensis.exe" /VERSION'
+	Pop $0 # return value/error/timeout
+	Pop $1 # printed text, up to ${NSIS_MAX_STRLEN}
+	DetailPrint '"${NSISDIR}\makensis.exe" /VERSION printed: $1'
+	DetailPrint ""
+	DetailPrint "       Return value: $0"
+	DetailPrint ""
+SectionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/primes.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/primes.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/primes.nsi	(revision 728)
@@ -0,0 +1,70 @@
+; primes.nsi
+;
+; This is an example of the possibities of the NSIS Script language.
+; It calculates prime numbers.
+
+;--------------------------------
+
+Name "primes"
+AllowRootDirInstall true
+OutFile "primes.exe"
+Caption "Prime number generator"
+ShowInstDetails show
+AllowRootDirInstall true
+InstallDir "$EXEDIR"
+RequestExecutionLevel user
+
+DirText "Select a directory to write primes.txt. $_CLICK"
+
+;--------------------------------
+
+;Pages
+
+Page directory
+Page instfiles
+
+;--------------------------------
+
+Section ""
+  SetOutPath $INSTDIR
+  Call DoPrimes 
+SectionEnd
+
+;--------------------------------
+
+Function DoPrimes
+
+; we put this in here so it doesn't update the progress bar (faster)
+
+!define PPOS $0 ; position in prime searching
+!define PDIV $1 ; divisor
+!define PMOD $2 ; the result of the modulus
+!define PCNT $3 ; count of how many we've printed
+  FileOpen $9 $INSTDIR\primes.txt w
+
+  DetailPrint "2 is prime!"
+  FileWrite $9 "2 is prime!$\r$\n"
+  DetailPrint "3 is prime!"
+  FileWrite $9 "3 is prime!$\r$\n"
+  Strcpy ${PPOS} 3
+  Strcpy ${PCNT} 2
+outerloop:
+   StrCpy ${PDIV} 3
+   innerloop:
+     IntOp ${PMOD} ${PPOS} % ${PDIV}
+     IntCmp ${PMOD} 0 notprime
+     IntOp ${PDIV} ${PDIV} + 2
+     IntCmp ${PDIV} ${PPOS} 0 innerloop 0
+       DetailPrint "${PPOS} is prime!"
+       FileWrite $9 "${PPOS} is prime!$\r$\n"
+       IntOp ${PCNT} ${PCNT} + 1
+       IntCmp ${PCNT} 100 0 innerloop
+       StrCpy ${PCNT} 0
+       MessageBox MB_YESNO "Process more?" IDNO stop
+     notprime:
+       IntOp ${PPOS} ${PPOS} + 2
+     Goto outerloop
+   stop:
+  FileClose $9
+  
+FunctionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/Math/math.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Math/math.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Math/math.nsi	(revision 728)
@@ -0,0 +1,33 @@
+; This is just an example of Math plugin
+; 
+; (c) brainsucker, 2002
+; (r) BSForce
+
+Name "Math Plugin Example"
+OutFile "math.exe"
+ShowInstDetails show
+XPStyle on
+
+Section "ThisNameIsIgnoredSoWhyBother?"
+    Math::Script 'SaR(s,fa,ra, i,f,r,e,p) (i=0;#{i<l(fa),e=l(f=fa[i]);r=ra[i];p=0;#{p<l(s),#[s[p,p+e-1]==f,s=(s[,p-1])+r+(s[p+e,]);p+=l(r), p++]}; i++}; s);'
+    Math::Script "TQ(s) (s = s(NS); #[s[0]=='$\"',s=s[1,]]; #[s[-1]=='$\"',s=s[,-2]]; NS = s)"
+    Math::Script "P(s,e, p,i) (p=-1;i=0; #{(i<l(s))&&(p<0), #[s[i,i+l(e)-1]==e, p=i]; i++}; p)"
+    Math::Script "DL(s) (s=s(NS); p=P(s,'\r\n'); #[p>=0, (NS=s[p+4,]; NS=#[p>0,s[,p-1],'']), (NS='';NS=s)])"
+
+    Math::Script "a = 'Hello \r\n World \r\n!!!'; a = SaR(a,{'\r','\n'},{'$\r','$\n'}); R0 = a"
+    Math::Script "NS = '$\"In quotes$\"'; TQ(); R1=NS; R3=P(s(R1),'qu')"
+    Math::Script "NS = 'No quotes'; TQ(); R2=NS"
+    Math::Script "NS='123\r\n456\r\n789'; DL(); R4=NS; DL(); R5=NS; DL(); R6=NS; R7=NS"
+
+
+    DetailPrint "'$R0'"
+    DetailPrint "'$R1'"
+    DetailPrint "'$R2'"
+    DetailPrint "'$R3'"
+    DetailPrint "'$R4'"
+    DetailPrint "'$R5'"
+    DetailPrint "'$R6'"
+    DetailPrint "'$R7'"
+SectionEnd 
+
+; eof
Index: tmp/trunk/org.txm.setups/nsis/Examples/Math/mathtest.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Math/mathtest.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Math/mathtest.nsi	(revision 728)
@@ -0,0 +1,171 @@
+;NSIS Modern User Interface version 1.65
+;InstallOptions Example Script
+;Written by Joost Verburg
+
+  !define MUI_BUTTONTEXT_NEXT      "Execute"
+
+;---------------------
+;Include Modern UI
+
+  !include "MUI.nsh"
+
+;--------------------------------
+;Product Info
+
+Name "Math::Script Test"
+
+;--------------------------------
+;Configuration
+
+  ;General
+  OutFile "MathTest.exe"
+
+;--------------------------------
+;Variables
+
+  Var TEMP1
+  Var TEMP2
+  Var TEMP3
+
+;--------------------------------
+;Pages
+
+  !insertmacro MUI_PAGE_LICENSE "mathtest.txt"
+  Page custom ScriptPageEnter
+  Page instfiles
+ 
+;--------------------------------
+;Modern UI Configuration
+
+;  !define MUI_ABORTWARNING
+  
+;--------------------------------
+;Languages
+ 
+  !insertmacro MUI_LANGUAGE "English"
+
+;--------------------------------
+;Reserve Files
+  
+  ;Things that need to be extracted on first (keep these lines before any File command!)
+  ;Only for BZIP2 compression
+  
+  ReserveFile "MathTest.ini"
+  !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
+
+;--------------------------------
+;Installer Functions
+
+LangString SCRIPTSAMPLE0 ${LANG_ENGLISH} "r0 = 'Hello'; r1 = 'Math::Script'\r\nr0 += ' from the ' + r1 + '!'; r1=''"
+LangString SCRIPTSAMPLE1 ${LANG_ENGLISH} "a =0; b=1.0\r\n#{a++ < 100, b *= a}\r\nr0 = a; R0 = b; R1 = ff(b, 15)\r\nr1 = (a-1) + '! = ' + b"
+LangString SCRIPTSAMPLE2 ${LANG_ENGLISH} 'pi=3.14159; \r\nangle = pi/4;\r\ntext = "x = " + ff(angle,16+3) \r\nr0 = text +=  ", sin x = " + sin(angle)'
+LangString SCRIPTSAMPLE3 ${LANG_ENGLISH} "v1 = 123.456;  v2 = 123456789.1011\r\nr0 = v1; r1 = v2\r\nr2 = ff(v1, 3); r3 = ff(v2, 3); r4 = ff(v1, 3+16); r5 = ff(v2, 3+16)\r\nr6 = ff(v1, 3+32); r7 = ff(v2, 3+32); r8 = ff(v1, 3+32+64); r9 = ff(v2, 3+32+64)\r\n"
+LangString SCRIPTSAMPLE4 ${LANG_ENGLISH} "a = 10000; b = 0; #{--a > 0, b+= a}; r0 = a; r1 = b\r\nz = 1.55; r2 = #[z > 1.5, 'Its greater', 'Its lower']\r\nz = 1.45; r3 = #[z > 1.5, 'Its greater', 'Its lower']"
+LangString SCRIPTSAMPLE5 ${LANG_ENGLISH} 'r0 = "123a123"\r\nr1 = r0; \r\nr2 = s(r0); r3 = f(r0); r4 = i(r0); r5 = l(r0)' 
+
+Function .onInit
+
+  ;Extract InstallOptions INI files
+  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "MathTest.ini"
+
+  Strcpy "$TEMP1" "$(SCRIPTSAMPLE0)"
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "MathTest.ini" "Field 2" "State" $TEMP1
+  
+FunctionEnd
+
+LangString TEXT_IO_TITLE ${LANG_ENGLISH} "MathTest Script Page"
+LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "Try your scripting capapibilites or test one of sample scripts"
+
+
+Function DumpVariables
+  Strcpy "$TEMP1" "$$0='$0'\r\n$$1='$1'\r\n$$2='$2'\r\n$$3='$3'\r\n$$4='$4'\r\n$$5='$5'\r\n$$6='$6'\r\n$$7='$7'\r\n$$8='$8'\r\n$$9='$9'"
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "MathTest.ini" "Field 3" "State" $TEMP1  
+  Strcpy "$TEMP1" "$$R0='$R0'\r\n$$R1='$R1'\r\n$$R2='$R2'\r\n$$R3='$R3'\r\n$$R4='$R4'\r\n$$R5='$R5'\r\n$$R6='$R6'\r\n$$R7='$R7'\r\n$$R8='$R8'\r\n$$R9='$R9'"
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "MathTest.ini" "Field 4" "State" $TEMP1  
+FunctionEnd
+
+Function ClearVariables
+  Math::Script "r0=r1=r2=r3=r4=r5=r6=r7=r8=r9=R0=R1=R2=R3=R4=R5=R6=R7=R8=R9=''"
+FunctionEnd
+
+Function GetLine
+  push $TEMP1
+  Math::Script "mtsDL()"
+  pop $TEMP2
+  pop $TEMP1
+FunctionEnd
+
+Function ExecuteScript
+  !insertmacro MUI_INSTALLOPTIONS_READ $TEMP1 "MathTest.ini" "Field 2" "State" 
+
+  Math::Script "mtsTQ(s) (s = s(NS); #[s[0]=='$\"',s=s[1,]]; #[s[-1]=='$\"',s=s[,-2]]; NS = s)"
+  Math::Script "mtsP(s,e, p,i) (p=-1;i=0; #{(i<l(s))&&(p<0), #[s[i,i+l(e)-1]==e, p=i]; i++}; p)"
+  Math::Script "mtsDL(s) (s=s(NS); p=mtsP(s,'\r\n'); #[p>=0, (NS=s[p+4,]; NS=#[p>0,s[,p-1],'']), (NS='';NS=s)])"
+
+  push  $TEMP1
+  ; remove ""
+  Math::Script "mtsTQ()"
+  pop   $TEMP1
+
+  ; script at $TEMP1
+Go:
+   StrLen $TEMP3 $TEMP1
+   IntCmp $TEMP3 0 End
+   ; get single line to $TEMP2
+   Call GetLine
+;   MessageBox MB_OK "'$TEMP2'      '$TEMP1'"
+   Math::Script "$TEMP2"
+   goto Go
+End:
+   Math::Script ""
+FunctionEnd
+
+Function ScriptPageEnter
+      
+  !insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
+
+Again:
+  Call ClearVariables
+  Call ExecuteScript
+  Call DumpVariables
+
+  !insertmacro MUI_INSTALLOPTIONS_DISPLAY_RETURN "mathtest.ini"
+  pop $TEMP3
+
+  !insertmacro MUI_INSTALLOPTIONS_READ $TEMP1 "MathTest.ini" "Field 5" "State"
+  IntCmp $TEMP1 1 Test
+
+  Strcpy "$TEMP2" "$(SCRIPTSAMPLE1)"
+  !insertmacro MUI_INSTALLOPTIONS_READ $TEMP1 "MathTest.ini" "Field 6" "State"
+  IntCmp $TEMP1 1 Write
+
+  Strcpy "$TEMP2" "$(SCRIPTSAMPLE2)"
+  !insertmacro MUI_INSTALLOPTIONS_READ $TEMP1 "MathTest.ini" "Field 7" "State"
+  IntCmp $TEMP1 1 Write
+
+  Strcpy "$TEMP2" "$(SCRIPTSAMPLE3)"
+  !insertmacro MUI_INSTALLOPTIONS_READ $TEMP1 "MathTest.ini" "Field 8" "State"
+  IntCmp $TEMP1 1 Write
+
+  Strcpy "$TEMP2" "$(SCRIPTSAMPLE4)"
+  !insertmacro MUI_INSTALLOPTIONS_READ $TEMP1 "MathTest.ini" "Field 9" "State"
+  IntCmp $TEMP1 1 Write
+
+  Strcpy "$TEMP2" "$(SCRIPTSAMPLE5)"
+
+Write:
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "MathTest.ini" "Field 2" "State" "$TEMP2"
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "MathTest.ini" "Field 5" "State" "1"
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "MathTest.ini" "Field 6" "State" "0"
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "MathTest.ini" "Field 7" "State" "0"
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "MathTest.ini" "Field 8" "State" "0"
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "MathTest.ini" "Field 9" "State" "0"
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "MathTest.ini" "Field 10" "State" "0"
+
+Test:
+  Strcmp $TEMP3 "success" Again
+
+FunctionEnd
+
+Section "Dummy Section" SecDummy  
+SectionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/Math/mathtest.ini
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Math/mathtest.ini	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Math/mathtest.ini	(revision 728)
@@ -0,0 +1,101 @@
+[Settings]
+NumFields=10
+NextButtonText=Execute
+CancelButtonText=Quit
+BackButtonText=Readme
+
+[Field 1]
+Type=label
+Text=Enter your script here:
+Left=0
+Right=-1
+Top=0
+Bottom=8
+
+[Field 2]
+Type=text
+Left=0
+Right=-1
+Top=9
+Bottom=55
+flags=MULTILINE|WANTRETURN|HSCROLL
+State=""
+
+[Field 3]
+Type=text
+Left=53
+Right=175
+Top=56
+Bottom=140
+flags=MULTILINE|READONLY
+State=""
+
+[Field 4]
+Type=text
+Left=175
+Right=-1
+Top=56
+Bottom=140
+flags=MULTILINE|READONLY
+State=""
+
+[Field 5]
+Type=RadioButton
+Left=0
+Right=-1
+Top=70
+Bottom=80
+flags=GROUP
+Text="Your script"
+State=1
+
+[Field 6]
+Type=RadioButton
+Left=0
+Right=-1
+Top=80
+Bottom=90
+flags=
+Text="Sample 1"
+State=0
+
+[Field 7]
+Type=RadioButton
+Left=0
+Right=-1
+Top=90
+Bottom=100
+flags=
+Text="Sample 2"
+State=0
+
+[Field 8]
+Type=RadioButton
+Left=0
+Right=-1
+Top=100
+Bottom=110
+flags=
+Text="Sample 3"
+State=0
+
+[Field 9]
+Type=RadioButton
+Left=0
+Right=-1
+Top=110
+Bottom=120
+flags=
+Text="Sample 4"
+State=0
+
+[Field 10]
+Type=RadioButton
+Left=0
+Right=-1
+Top=120
+Bottom=130
+flags=
+Text="Sample 5"
+State=0
+

Property changes on: tmp/trunk/org.txm.setups/nsis/Examples/Math/mathtest.ini
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Examples/Math/mathtest.txt
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Math/mathtest.txt	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Math/mathtest.txt	(revision 728)
@@ -0,0 +1,7 @@
+Math Tester.
+
+This demo allows you to test your Math::Script expressions without need to compile anything. Just enter your expressions into multiline editbox (every single line is a separate call to Math::Script) or select one of sample expressions and press Execute.
+
+Every call to Math::Script can accept up to 1kb of script, but this demo is limited to the summ of 1 kb at all lines. And... watch your scripts. No.... Watch your errors at scripts!
+
+(c) Brainsucker, 2003.

Property changes on: tmp/trunk/org.txm.setups/nsis/Examples/Math/mathtest.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/nsis/Examples/rtest.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/rtest.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/rtest.nsi	(revision 728)
@@ -0,0 +1,93 @@
+; rtest.nsi
+;
+; This script tests some advanced NSIS functions.
+
+;--------------------------------
+
+Name "rtest"
+OutFile "rtest.exe"
+
+ComponentText "Select tests!"
+ShowInstDetails show
+
+RequestExecutionLevel user
+
+;--------------------------------
+
+Section "Test 1"
+
+  StrCpy $R0 "a"
+  
+  GetFunctionAddress $R1 test1
+  Call $R1
+  
+  StrCmp $R0 "a182345678" success
+  
+  DetailPrint "Test 1 failed (output: $R0)"
+  Goto end
+  
+  success:
+  DetailPrint "Test 1 succeeded (output: $R0)"
+  
+  end:
+  
+SectionEnd
+
+Function test1
+
+  GetLabelAddress $9 skip
+  
+  IntOp $9 $9 - 1
+  StrCpy $R0 $R01
+  
+  Call $9
+  
+  StrCpy $R0 $R02
+  StrCpy $R0 $R03
+  StrCpy $R0 $R04
+  StrCpy $R0 $R05
+  StrCpy $R0 $R06
+  StrCpy $R0 $R07
+  StrCpy $R0 $R08
+  
+  skip:
+  
+FunctionEnd
+
+;--------------------------------
+
+Section "Test 2"
+
+  StrCpy $R0 "0"
+  StrCpy $R1 "11"
+  
+  Call test2
+  
+  StrCmp $R1 "11,10,9,8,7,6,5,4,3,2,1" success
+  
+  DetailPrint "Test 2 failed (output: $R1)"
+  Goto end
+  
+  success:
+  DetailPrint "Test 2 succeeded (output: $R1)"
+  
+  end:
+
+SectionEnd
+
+Function test2
+
+  IntOp $R0 $R0 + 1
+  IntCmp $R0 10 done
+  
+  Push $R0
+  
+  GetFunctionAddress $R2 test2
+  Call $R2
+  
+  Pop $R0
+  
+  done:
+  StrCpy $R1 "$R1,$R0"
+  
+FunctionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/Splash/Example.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Splash/Example.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Splash/Example.nsi	(revision 728)
@@ -0,0 +1,21 @@
+Name "Splash.dll test"
+
+OutFile "Splash Test.exe"
+
+XPStyle on
+
+Function .onInit
+	# the plugins dir is automatically deleted when the installer exits
+	InitPluginsDir
+	File /oname=$PLUGINSDIR\splash.bmp "${NSISDIR}\Contrib\Graphics\Wizard\orange-nsis.bmp"
+	#optional
+	#File /oname=$PLUGINSDIR\splash.wav "C:\myprog\sound.wav"
+
+	splash::show 1000 $PLUGINSDIR\splash
+
+	Pop $0 ; $0 has '1' if the user closed the splash screen early,
+			; '0' if everything closed normally, and '-1' if some error occurred.
+FunctionEnd
+
+Section
+SectionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/BgImage/Example.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/BgImage/Example.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/BgImage/Example.nsi	(revision 728)
@@ -0,0 +1,100 @@
+Name "BgImage.dll test"
+
+OutFile "BgImage Test.exe"
+
+XPStyle on
+
+!define DEBUG
+!macro GetReturnValue
+!ifdef DEBUG
+	Pop $R9
+	StrCmp $R9 success +2
+		DetailPrint "Error: $R9"
+!endif
+!macroend
+
+Function .onGUIInit
+	# the plugins dir is automatically deleted when the installer exits
+	InitPluginsDir
+	# lets extract some bitmaps...
+	File /oname=$PLUGINSDIR\1.bmp "${NSISDIR}\Contrib\Graphics\Wizard\llama.bmp"
+	File /oname=$PLUGINSDIR\2.bmp "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp"
+
+!ifdef DEBUG
+	# turn return values on if in debug mode
+	BgImage::SetReturn on
+!endif
+
+	# set the initial background for images to be drawn on
+	# we will use a gradient from drak green to dark red
+	BgImage::SetBg /GRADIENT 0 0x80 0 0x80 0 0
+	!insertmacro GetReturnValue
+	# add an image @ (150,0)
+	BgImage::AddImage $PLUGINSDIR\2.bmp 150 0
+	!insertmacro GetReturnValue
+	# add the same image only transparent (magenta wiped) @ (150,16)
+	BgImage::AddImage /TRANSPARENT 255 0 255 $PLUGINSDIR\2.bmp 150 16
+	!insertmacro GetReturnValue
+	# create the font for the following text
+	CreateFont $R0 "Comic Sans MS" 50 700
+	# add a blue shadow for the text
+	BgImage::AddText "Testing 1... 2... 3..." $R0 0 0 255 48 48 798 198
+	!insertmacro GetReturnValue
+	# add a green shadow for the text
+	BgImage::AddText "Testing 1... 2... 3..." $R0 0 255 0 52 52 802 202
+	!insertmacro GetReturnValue
+	# add the text
+	BgImage::AddText "Testing 1... 2... 3..." $R0 255 0 0 50 50 800 200
+	!insertmacro GetReturnValue
+	# show our creation to the world!
+	BgImage::Redraw
+	# Refresh doesn't return any value
+	
+FunctionEnd
+
+ShowInstDetails show
+
+Section
+	# play some sounds
+	FindFirst $0 $1 $WINDIR\Media\*.wav
+	StrCmp $0 "" skipSound
+		moreSounds:
+		StrCmp $1 "" noMoreSounds
+			BgImage::Sound /WAIT $WINDIR\Media\$1
+			# Sound doesn't return any value either
+			MessageBox MB_YESNO "Another sound?" IDNO noMoreSounds
+				FindNext $0 $1
+				Goto moreSounds
+
+	noMoreSounds:
+		FindClose $0
+	skipSound:
+
+	# change the background image to Mike, tiled
+	BgImage::SetBg /TILED $PLUGINSDIR\1.bmp
+	!insertmacro GetReturnValue
+	# we have to redraw to reflect the changes
+	BgImage::Redraw
+
+	MessageBox MB_OK "Mike the llama"
+
+	# clear everything
+	BgImage::Clear
+	# Clear doesn't return any value
+	# set another gradient
+	BgImage::SetBg /GRADIENT 0xFF 0xFA 0xBA 0xAA 0xA5 0x65
+	!insertmacro GetReturnValue
+	# add some text
+	BgImage::AddText "A Desert for Mike" $R0 0 0 0 50 50 800 150
+	!insertmacro GetReturnValue
+	# add mike as an image
+	BgImage::AddImage $PLUGINSDIR\1.bmp 50 150
+	!insertmacro GetReturnValue
+	# again, we have to call redraw to reflect changes
+	BgImage::Redraw
+SectionEnd
+
+Function .onGUIEnd
+	BgImage::Destroy
+	# Destroy doesn't return any value
+FunctionEnd
\ No newline at end of file
Index: tmp/trunk/org.txm.setups/nsis/Examples/Memento.nsi
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Memento.nsi	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Memento.nsi	(revision 728)
@@ -0,0 +1,79 @@
+!include LogicLib.nsh
+!include Memento.nsh
+
+Name Memento
+OutFile Memento.exe
+
+XPStyle on
+
+ShowInstDetails show
+
+Page components
+Page instfiles
+
+RequestExecutionLevel user
+
+# settings
+
+!define MEMENTO_REGISTRY_ROOT HKCU
+!define MEMENTO_REGISTRY_KEY "Software\NSIS\Memento Test"
+
+# restore
+
+Function .onInit
+
+  ${If} ${Cmd} `MessageBox MB_YESNO "Would you like to load an example state?" IDYES`
+    
+	DeleteRegKey  HKCU "Software\NSIS\Memento Test"
+
+	WriteRegStr   HKCU "Software\NSIS\Memento Test" MementoSectionUsed ""
+	WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_horse   1
+	WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_chicken 1
+	WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_donkey  0
+	WriteRegDWORD HKCU "Software\NSIS\Memento Test" MementoSection_sec_croc    0
+
+  ${EndIf}
+
+  ${MementoSectionRestore}
+
+FunctionEnd
+
+# sections
+
+${MementoSection} horse sec_horse
+${MementoSectionEnd}
+
+${MementoSection} donkey sec_donkey
+${MementoSectionEnd}
+
+${MementoSection} chicken sec_chicken
+${MementoSectionEnd}
+
+SectionGroup /e group
+
+  SectionGroup /e group
+
+    ${MementoSection} croc sec_croc
+    ${MementoSectionEnd}
+
+    ${MementoSection} cow sec_cow
+    ${MementoSectionEnd}
+
+  SectionGroupEnd
+
+SectionGroupEnd
+
+${MementoUnselectedSection} dinosaur sec_dinosaur
+${MementoSectionEnd}
+
+# done...
+
+${MementoSectionDone}
+
+# save
+
+Function .onInstSuccess
+
+  ${MementoSectionSave}
+
+FunctionEnd
Index: tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll.dsw
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll.dsw	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll.dsw	(revision 728)
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "exdll"=.\exdll.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
Index: tmp/trunk/org.txm.setups/nsis/Examples/Plugin/extdll.inc
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Plugin/extdll.inc	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Plugin/extdll.inc	(revision 728)
@@ -0,0 +1,145 @@
+;################################################################
+; ExtDLL header for MASM32
+;
+; Author: Ramon
+;
+; Obs: This header must be included after windows.inc and kernel32.inc
+;      because it need the prototypes for lstrcpy, lstrcpyn, 
+;      GlobalAlloc and GlobalFree
+;
+;################################################################
+stack_t struct
+  next dd ?
+  text dd ? ; 1 DUP(?) ; this should be the length of string_size
+stack_t ends
+
+.const
+; For page showing plug-ins
+WM_NOTIFY_OUTER_NEXT   equ (WM_USER+0x8)
+WM_NOTIFY_CUSTOM_READY equ (WM_USER+0xd)
+NOTIFY_BYE_BYE         equ 'x'
+
+INST_0 EQU 0         ; $0
+INST_1 EQU 1         ; $1
+INST_2 EQU 2         ; $2
+INST_3 EQU 3         ; $3
+INST_4 EQU 4         ; $4
+INST_5 EQU 5         ; $5
+INST_6 EQU 6         ; $6
+INST_7 EQU 7         ; $7
+INST_8 EQU 8         ; $8
+INST_9 EQU 9         ; $9
+INST_R0 EQU 10        ; $R0
+INST_R1 EQU 11        ; $R1
+INST_R2 EQU 12        ; $R2
+INST_R3 EQU 13        ; $R3
+INST_R4 EQU 14        ; $R4
+INST_R5 EQU 15        ; $R5
+INST_R6 EQU 16        ; $R6
+INST_R7 EQU 17        ; $R7
+INST_R8 EQU 18        ; $R8
+INST_R9 EQU 19        ; $R9
+INST_CMDLINE EQU 20   ; $CMDLINE
+INST_INSTDIR EQU 21   ; $INSTDIR
+INST_OUTDIR EQU 22    ; $OUTDIR
+INST_EXEDIR EQU 23    ; $EXEDIR
+INST_LANG EQU 24      ; $LANGUAGE
+__INST_LAST EQU 25
+
+.data?
+g_stringsize dd ?
+g_stacktop dd ?
+g_variables dd ?
+
+m2m MACRO M1, M2
+      push M2
+      pop  M1
+ENDM
+
+EXDLL_INIT MACRO
+      m2m g_stringsize, string_size
+      m2m g_stacktop, stacktop
+      m2m g_variables, variables
+ENDM
+
+.code
+
+; utility functions (not required but often useful)
+popstring proc uses edi pStr:DWORD
+
+  LOCAL th:DWORD
+
+  mov edi, g_stacktop
+  cmp edi, 0
+  jz  STACK_ERR
+  mov edi, [edi]
+  cmp edi, 0
+  jz  STACK_ERR
+
+  ASSUME edi:PTR stack_t
+  invoke lstrcpy, pStr, ADDR [edi].text
+  mov th , edi
+  mov edi, [edi].next
+  mov eax, g_stacktop
+  mov [eax], edi
+  invoke GlobalFree, th
+  ASSUME edi:PTR NOTHING
+  mov eax, 0
+  ret
+  
+STACK_ERR:
+  mov eax, 1
+  ret
+
+popstring endp
+
+pushstring proc uses edi pStr:DWORD
+
+  cmp g_stacktop, 0
+  jz  STACK_ERR
+
+  mov eax, sizeof stack_t
+  add eax, g_stringsize
+  invoke GlobalAlloc, GPTR, eax
+
+  mov edi, eax
+  assume edi:PTR stack_t
+
+  invoke lstrcpyn, ADDR [edi].text, pStr, g_stringsize
+  mov eax, g_stacktop
+  push DWORD PTR[eax]
+  mov [eax], edi
+  pop eax
+  ;lea edi, [edi].next ; Not needed [edi].next == edi
+  mov DWORD PTR[edi], eax
+  ASSUME edi:PTR NOTHING
+
+STACK_ERR:
+  ret
+
+pushstring endp
+
+getuservariable proc varnum:DWORD
+
+  .if varnum < 0 || varnum >= __INST_LAST
+    xor eax, eax
+  .else
+    mov eax, varnum
+    imul eax, g_stringsize
+    add eax, g_variables
+  .endif
+  ret
+
+getuservariable endp
+
+setuservariable proc varnum:DWORD, var:DWORD
+
+  .if (var != NULL && varnum >= 0 && varnum < __INST_LAST)
+    mov eax, varnum
+    imul eax, g_stringsize
+    add eax, g_variables
+    invoke lstrcpy, eax, var
+  .endif
+  ret
+
+setuservariable endp
Index: tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll_with_unit.dpr
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll_with_unit.dpr	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll_with_unit.dpr	(revision 728)
@@ -0,0 +1,31 @@
+{
+  NSIS ExDLL2 example
+  Original is ExDLL
+  (C) 2001 - Peter Windridge
+
+  Changed with delphi unit nsis.pas
+  by bernhard mayer
+
+  Tested in Delphi 7.0
+}
+
+library exdll;
+
+uses
+  nsis, windows;
+
+procedure ex_dll(const hwndParent: HWND; const string_size: integer; const variables: PChar; const stacktop: pointer); cdecl;
+begin
+  // set up global variables
+  Init(hwndParent, string_size, variables, stacktop);
+
+  NSISDialog(GetUserVariable(INST_0), 'The value of $0', MB_OK);
+  NSISDialog(PopString, 'pop', MB_OK);
+  PushString('Hello, this is a push');
+  SetUserVariable(INST_0, 'This is user var $0');
+end;
+
+exports ex_dll;
+
+begin
+end.
Index: tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll.c
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll.c	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll.c	(revision 728)
@@ -0,0 +1,38 @@
+#include <windows.h>
+#include <nsis/pluginapi.h> // nsis plugin
+
+HINSTANCE g_hInstance;
+
+HWND g_hwndParent;
+
+void __declspec(dllexport) myFunction(HWND hwndParent, int string_size, 
+                                      char *variables, stack_t **stacktop,
+                                      extra_parameters *extra)
+{
+  g_hwndParent=hwndParent;
+
+  EXDLL_INIT();
+
+
+  // note if you want parameters from the stack, pop them off in order.
+  // i.e. if you are called via exdll::myFunction file.dat poop.dat
+  // calling popstring() the first time would give you file.dat,
+  // and the second time would give you poop.dat. 
+  // you should empty the stack of your parameters, and ONLY your
+  // parameters.
+
+  // do your stuff here
+  {
+    char buf[1024];
+    wsprintf(buf,"$0=%s\n",getuservariable(INST_0));
+    MessageBox(g_hwndParent,buf,0,MB_OK);
+  }
+}
+
+
+
+BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
+{
+  g_hInstance=hInst;
+	return TRUE;
+}
Index: tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll-vs2008.vcproj
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll-vs2008.vcproj	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll-vs2008.vcproj	(revision 728)
@@ -0,0 +1,264 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9,00"
+	Name="exdll"
+	ProjectGUID="{5E3E2AFD-1D6B-4997-A9B5-8ECBC8F6C31A}"
+	RootNamespace="exdll"
+	TargetFrameworkVersion="0"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/exdll.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="1"
+				InlineFunctionExpansion="0"
+				AdditionalIncludeDirectories="."
+				PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL;EXDLL_EXPORTS;NSISCALL=__stdcall"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\Release/exdll.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib nsis\pluginapi.lib"
+				OutputFile=".\Release/exdll.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				IgnoreAllDefaultLibraries="true"
+				IgnoreDefaultLibraryNames="libc.lib"
+				ProgramDatabaseFile=".\Release/exdll.pdb"
+				OptimizeForWindows98="1"
+				EntryPointSymbol="DllMain"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				ImportLibrary=".\Release/exdll.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Release/exdll.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/exdll.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="."
+				PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL;EXDLL_EXPORTS;NSISCALL=__stdcall"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				BufferSecurityCheck="false"
+				PrecompiledHeaderFile=".\Debug/exdll.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib nsis\pluginapi.lib"
+				OutputFile=".\Debug/exdll.dll"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				IgnoreAllDefaultLibraries="true"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/exdll.pdb"
+				EntryPointSymbol="DllMain"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				ImportLibrary=".\Debug/exdll.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Debug/exdll.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="exdll.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="nsis\pluginapi.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll.dpr
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll.dpr	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll.dpr	(revision 728)
@@ -0,0 +1,118 @@
+{
+  NSIS ExDLL example
+  (C) 2001 - Peter Windridge
+
+  Fixed and formatted by Brett Dever
+  http://editor.nfscheats.com/
+
+  Tested in Delphi 7.0
+}
+
+library exdll;
+
+uses Windows;
+
+type
+  VarConstants = (
+    INST_0,
+    INST_1,       // $1
+    INST_2,       // $2
+    INST_3,       // $3
+    INST_4,       // $4
+    INST_5,       // $5
+    INST_6,       // $6
+    INST_7,       // $7
+    INST_8,       // $8
+    INST_9,       // $9
+    INST_R0,      // $R0
+    INST_R1,      // $R1
+    INST_R2,      // $R2
+    INST_R3,      // $R3
+    INST_R4,      // $R4
+    INST_R5,      // $R5
+    INST_R6,      // $R6
+    INST_R7,      // $R7
+    INST_R8,      // $R8
+    INST_R9,      // $R9
+    INST_CMDLINE, // $CMDLINE
+    INST_INSTDIR, // $INSTDIR
+    INST_OUTDIR,  // $OUTDIR
+    INST_EXEDIR,  // $EXEDIR
+    INST_LANG,    // $LANGUAGE
+    __INST_LAST
+    );
+  TVariableList = INST_0..__INST_LAST;
+  pstack_t = ^stack_t;
+  stack_t = record
+    next: pstack_t;
+    text: PChar;
+  end;
+
+var
+  g_stringsize: integer;
+  g_stacktop: ^pstack_t;
+  g_variables: PChar;
+  g_hwndParent: HWND;
+
+function PopString(): string;
+var
+  th: pstack_t;
+begin
+  if integer(g_stacktop^) <> 0 then begin
+    th := g_stacktop^;
+    Result := PChar(@th.text);
+    g_stacktop^ := th.next;
+    GlobalFree(HGLOBAL(th));
+  end;
+end;
+
+procedure PushString(const str: string='');
+var
+  th: pstack_t;
+begin
+  if integer(g_stacktop) <> 0 then begin
+    th := pstack_t(GlobalAlloc(GPTR, SizeOf(stack_t) + g_stringsize));
+    lstrcpyn(@th.text, PChar(str), g_stringsize);
+    th.next := g_stacktop^;
+    g_stacktop^ := th;
+  end;
+end;
+
+function GetUserVariable(const varnum: TVariableList): string;
+begin
+  if (integer(varnum) >= 0) and (integer(varnum) < integer(__INST_LAST)) then
+    Result := g_variables + integer(varnum) * g_stringsize
+  else
+    Result := '';
+end;
+
+procedure SetUserVariable(const varnum: TVariableList; const value: string);
+begin
+  if (value <> '') and (integer(varnum) >= 0) and (integer(varnum) < integer(__INST_LAST)) then
+    lstrcpy(g_variables + integer(varnum) * g_stringsize, PChar(value))
+end;
+
+procedure NSISDialog(const text, caption: string; const buttons: integer);
+begin
+  MessageBox(g_hwndParent, PChar(text), PChar(caption), buttons);
+end;
+
+procedure ex_dll(const hwndParent: HWND; const string_size: integer; const variables: PChar; const stacktop: pointer); cdecl;
+begin
+  // setup global variables
+  g_stringsize := string_size;
+  g_hwndParent := hwndParent;
+  g_stacktop := stacktop;
+  g_variables := variables;
+  // end global variable setup
+
+  NSISDialog(GetUserVariable(INST_0), 'The value of $0', MB_OK);
+  NSISDialog(PopString, 'pop', MB_OK);
+  PushString('Hello, this is a push');
+  SetUserVariable(INST_0, 'This is user var $0');
+end;
+
+exports ex_dll;
+
+begin
+end.
Index: tmp/trunk/org.txm.setups/nsis/Examples/Plugin/nsis/pluginapi.lib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/trunk/org.txm.setups/nsis/Examples/Plugin/nsis/pluginapi.lib
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/trunk/org.txm.setups/nsis/Examples/Plugin/nsis/pluginapi.h
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Plugin/nsis/pluginapi.h	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Plugin/nsis/pluginapi.h	(revision 728)
@@ -0,0 +1,74 @@
+#ifndef ___NSIS_PLUGIN__H___
+#define ___NSIS_PLUGIN__H___
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "api.h"
+
+#ifndef NSISCALL
+#  define NSISCALL __stdcall
+#endif
+
+#define EXDLL_INIT()           {  \
+        g_stringsize=string_size; \
+        g_stacktop=stacktop;      \
+        g_variables=variables; }
+
+typedef struct _stack_t {
+  struct _stack_t *next;
+  char text[1]; // this should be the length of string_size
+} stack_t;
+
+enum
+{
+INST_0,         // $0
+INST_1,         // $1
+INST_2,         // $2
+INST_3,         // $3
+INST_4,         // $4
+INST_5,         // $5
+INST_6,         // $6
+INST_7,         // $7
+INST_8,         // $8
+INST_9,         // $9
+INST_R0,        // $R0
+INST_R1,        // $R1
+INST_R2,        // $R2
+INST_R3,        // $R3
+INST_R4,        // $R4
+INST_R5,        // $R5
+INST_R6,        // $R6
+INST_R7,        // $R7
+INST_R8,        // $R8
+INST_R9,        // $R9
+INST_CMDLINE,   // $CMDLINE
+INST_INSTDIR,   // $INSTDIR
+INST_OUTDIR,    // $OUTDIR
+INST_EXEDIR,    // $EXEDIR
+INST_LANG,      // $LANGUAGE
+__INST_LAST
+};
+
+extern unsigned int g_stringsize;
+extern stack_t **g_stacktop;
+extern char *g_variables;
+
+int NSISCALL popstring(char *str); // 0 on success, 1 on empty stack
+int NSISCALL popstringn(char *str, int maxlen); // with length limit, pass 0 for g_stringsize
+int NSISCALL popint(); // pops an integer
+int NSISCALL popint_or(); // with support for or'ing (2|4|8)
+int NSISCALL myatoi(const char *s); // converts a string to an integer
+unsigned NSISCALL myatou(const char *s); // converts a string to an unsigned integer, decimal only
+int NSISCALL myatoi_or(const char *s); // with support for or'ing (2|4|8)
+void NSISCALL pushstring(const char *str);
+void NSISCALL pushint(int value);
+char * NSISCALL getuservariable(const int varnum);
+void NSISCALL setuservariable(const int varnum, const char *var);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif//!___NSIS_PLUGIN__H___
Index: tmp/trunk/org.txm.setups/nsis/Examples/Plugin/nsis/api.h
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Plugin/nsis/api.h	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Plugin/nsis/api.h	(revision 728)
@@ -0,0 +1,83 @@
+/*
+ * apih
+ * 
+ * This file is a part of NSIS.
+ * 
+ * Copyright (C) 1999-2015 Nullsoft and Contributors
+ * 
+ * Licensed under the zlib/libpng license (the "License");
+ * you may not use this file except in compliance with the License.
+ * 
+ * Licence details can be found in the file COPYING.
+ * 
+ * This software is provided 'as-is', without any express or implied
+ * warranty.
+ */
+
+#ifndef _NSIS_EXEHEAD_API_H_
+#define _NSIS_EXEHEAD_API_H_
+
+// Starting with NSIS 2.42, you can check the version of the plugin API in exec_flags->plugin_api_version
+// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x))
+// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {}
+
+#define NSISPIAPIVER_1_0 0x00010000
+#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0
+
+// NSIS Plug-In Callback Messages
+enum NSPIM 
+{
+	NSPIM_UNLOAD,    // This is the last message a plugin gets, do final cleanup
+	NSPIM_GUIUNLOAD, // Called after .onGUIEnd
+};
+
+// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback()
+// Return NULL for unknown messages
+// Should always be __cdecl for future expansion possibilities
+typedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);
+
+// extra_parameters data structures containing other interesting stuff
+// but the stack, variables and HWND passed on to plug-ins.
+typedef struct
+{
+  int autoclose;
+  int all_user_var;
+  int exec_error;
+  int abort;
+  int exec_reboot; // NSIS_SUPPORT_REBOOT
+  int reboot_called; // NSIS_SUPPORT_REBOOT
+  int XXX_cur_insttype; // depreacted
+  int plugin_api_version; // see NSISPIAPIVER_CURR
+                          // used to be XXX_insttype_changed
+  int silent; // NSIS_CONFIG_SILENT_SUPPORT
+  int instdir_error;
+  int rtl;
+  int errlvl;
+  int alter_reg_view;
+  int status_update;
+} exec_flags_t;
+
+#ifndef NSISCALL
+#  define NSISCALL __stdcall
+#endif
+
+typedef struct {
+  exec_flags_t *exec_flags;
+  int (NSISCALL *ExecuteCodeSegment)(int, HWND);
+  void (NSISCALL *validate_filename)(char *);
+  int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors
+} extra_parameters;
+
+// Definitions for page showing plug-ins
+// See Ui.c to understand better how they're used
+
+// sent to the outer window to tell it to go to the next inner window
+#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)
+
+// custom pages should send this message to let NSIS know they're ready
+#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)
+
+// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning
+#define NOTIFY_BYE_BYE 'x'
+
+#endif /* _PLUGIN_H_ */
Index: tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll.dsp
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll.dsp	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll.dsp	(revision 728)
@@ -0,0 +1,112 @@
+# Microsoft Developer Studio Project File - Name="exdll" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=exdll - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "exdll.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "exdll.mak" CFG="exdll - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "exdll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "exdll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "exdll - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXDLL_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXDLL_EXPORTS" /D NSISCALL=__stdcall /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib nsis\pluginapi.lib /nologo /entry:"DllMain" /dll /machine:I386 /nodefaultlib /out:"../../Plugins/exdll.dll" /opt:nowin98
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "exdll - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXDLL_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXDLL_EXPORTS" /D NSISCALL=__stdcall /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib nsis\pluginapi.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "exdll - Win32 Release"
+# Name "exdll - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\exdll.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\nsis\pluginapi.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
Index: tmp/trunk/org.txm.setups/nsis/Examples/Plugin/nsis.pas
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Plugin/nsis.pas	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Plugin/nsis.pas	(revision 728)
@@ -0,0 +1,201 @@
+{
+    Original Code from
+    (C) 2001 - Peter Windridge
+
+    Code in separate unit and some changes
+    2003 by Bernhard Mayer
+
+    Fixed and formatted by Brett Dever
+    http://editor.nfscheats.com/
+
+    simply include this unit in your plugin project and export
+    functions as needed
+}
+
+unit nsis;
+
+interface
+
+uses
+  windows, CommCtrl, SysUtils;
+
+type
+  VarConstants = (
+    INST_0,       // $0
+    INST_1,       // $1
+    INST_2,       // $2
+    INST_3,       // $3
+    INST_4,       // $4
+    INST_5,       // $5
+    INST_6,       // $6
+    INST_7,       // $7
+    INST_8,       // $8
+    INST_9,       // $9
+    INST_R0,      // $R0
+    INST_R1,      // $R1
+    INST_R2,      // $R2
+    INST_R3,      // $R3
+    INST_R4,      // $R4
+    INST_R5,      // $R5
+    INST_R6,      // $R6
+    INST_R7,      // $R7
+    INST_R8,      // $R8
+    INST_R9,      // $R9
+    INST_CMDLINE, // $CMDLINE
+    INST_INSTDIR, // $INSTDIR
+    INST_OUTDIR,  // $OUTDIR
+    INST_EXEDIR,  // $EXEDIR
+    INST_LANG,    // $LANGUAGE
+    __INST_LAST
+    );
+  TVariableList = INST_0..__INST_LAST;
+
+  TExecuteCodeSegment = function (const funct_id: Integer; const parent: HWND): Integer;  stdcall;
+  Tvalidate_filename = procedure (const filename: PChar); cdecl;
+  TRegisterPluginCallback = function (const unknow: Integer; const uknown2: Integer): Integer; cdecl;
+
+  pexec_flags_t = ^exec_flags_t;
+  exec_flags_t = record
+    autoclose: Integer;
+    all_user_var: Integer;
+    exec_error: Integer;
+    abort: Integer;
+    exec_reboot: Integer;
+    reboot_called: Integer;
+    XXX_cur_insttype: Integer;
+    plugin_api_version: Integer;
+    silent: Integer;
+    instdir_error: Integer;
+    rtl: Integer;
+    errlvl: Integer;
+    alter_reg_view: Integer;
+    status_update: Integer;
+  end;
+
+  pextrap_t = ^extrap_t;
+  extrap_t = record
+    exec_flags: Pointer; // exec_flags_t;
+    exec_code_segment: Pointer; //  TFarProc;
+    validate_filename: Pointer; // Tvalidate_filename;
+    RegisterPluginCallback: Pointer; //TRegisterPluginCallback;
+  end;
+
+  pstack_t = ^stack_t;
+  stack_t = record
+    next: pstack_t;
+    text: PChar;
+  end;
+
+var
+  g_stringsize: integer;
+  g_stacktop: ^pstack_t;
+  g_variables: PChar;
+  g_hwndParent: HWND;
+  g_hwndList: HWND;
+  g_hwndLogList: HWND;
+
+  g_extraparameters: pextrap_t;
+  func : TExecuteCodeSegment;
+  extrap : extrap_t;
+
+procedure Init(const hwndParent: HWND; const string_size: integer; const variables: PChar; const stacktop: pointer; const extraparameters: pointer = nil);
+
+function LogMessage(Msg : String): BOOL;
+function Call(NSIS_func : String) : Integer;
+function PopString(): string;
+procedure PushString(const str: string='');
+function GetUserVariable(const varnum: TVariableList): string;
+procedure SetUserVariable(const varnum: TVariableList; const value: string);
+procedure NSISDialog(const text, caption: string; const buttons: integer);
+
+implementation
+
+procedure Init(const hwndParent: HWND; const string_size: integer; const variables: PChar; const stacktop: pointer; const extraparameters: pointer = nil);
+begin
+  g_stringsize := string_size;
+  g_hwndParent := hwndParent;
+  g_stacktop   := stacktop;
+  g_variables  := variables;
+  g_hwndList := 0;
+  g_hwndList := FindWindowEx(FindWindowEx(g_hwndParent, 0, '#32770', nil), 0,'SysListView32', nil);
+  g_extraparameters := extraparameters;
+  extrap := g_extraparameters^;
+end;
+
+function Call(NSIS_func : String) : Integer;
+var
+  NSISFun: Integer; //The ID of nsis function
+begin
+  Result := 0;
+  NSISFun := StrToIntDef(NSIS_func, 0);
+  if (NSISFun <> 0) and (g_extraparameters <> nil) then
+    begin
+    @func := extrap.exec_code_segment;
+    NSISFun := NSISFun - 1;
+    Result := func(NSISFun, g_hwndParent);
+    end;
+end;
+
+function LogMessage(Msg : String): BOOL;
+var
+  ItemCount : Integer;
+  item: TLVItem;
+begin
+  Result := FAlse;
+  if g_hwndList = 0 then exit;
+  FillChar( item, sizeof(item), 0 );
+  ItemCount := SendMessage(g_hwndList, LVM_GETITEMCOUNT, 0, 0);
+  item.iItem := ItemCount;
+  item.mask := LVIF_TEXT;
+  item.pszText := PAnsiChar(Msg);
+  ListView_InsertItem(g_hwndList, item );
+  ListView_EnsureVisible(g_hwndList, ItemCount, TRUE);
+end;
+
+function PopString(): string;
+var
+  th: pstack_t;
+begin
+  if integer(g_stacktop^) <> 0 then begin
+    th := g_stacktop^;
+    Result := PChar(@th.text);
+    g_stacktop^ := th.next;
+    GlobalFree(HGLOBAL(th));
+  end;
+end;
+
+procedure PushString(const str: string='');
+var
+  th: pstack_t;
+begin
+  if integer(g_stacktop) <> 0 then begin
+    th := pstack_t(GlobalAlloc(GPTR, SizeOf(stack_t) + g_stringsize));
+    lstrcpyn(@th.text, PChar(str), g_stringsize);
+    th.next := g_stacktop^;
+    g_stacktop^ := th;
+  end;
+end;
+
+function GetUserVariable(const varnum: TVariableList): string;
+begin
+  if (integer(varnum) >= 0) and (integer(varnum) < integer(__INST_LAST)) then
+    Result := g_variables + integer(varnum) * g_stringsize
+  else
+    Result := '';
+end;
+
+procedure SetUserVariable(const varnum: TVariableList; const value: string);
+begin
+  if (value <> '') and (integer(varnum) >= 0) and (integer(varnum) < integer(__INST_LAST)) then
+    lstrcpy(g_variables + integer(varnum) * g_stringsize, PChar(value))
+end;
+
+procedure NSISDialog(const text, caption: string; const buttons: integer);
+begin
+  MessageBox(g_hwndParent, PChar(text), PChar(caption), buttons);
+end;
+
+begin
+
+end.
+
Index: tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll-vs2008.sln
===================================================================
--- tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll-vs2008.sln	(revision 0)
+++ tmp/trunk/org.txm.setups/nsis/Examples/Plugin/exdll-vs2008.sln	(revision 728)
@@ -0,0 +1,20 @@
+ï»¿
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "exdll", "exdll.vcproj", "{5E3E2AFD-1D6B-4997-A9B5-8ECBC8F6C31A}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{5E3E2AFD-1D6B-4997-A9B5-8ECBC8F6C31A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5E3E2AFD-1D6B-4997-A9B5-8ECBC8F6C31A}.Debug|Win32.Build.0 = Debug|Win32
+		{5E3E2AFD-1D6B-4997-A9B5-8ECBC8F6C31A}.Release|Win32.ActiveCfg = Release|Win32
+		{5E3E2AFD-1D6B-4997-A9B5-8ECBC8F6C31A}.Release|Win32.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: tmp/trunk/org.txm.setups/BuildPortals.sh
===================================================================
--- tmp/trunk/org.txm.setups/BuildPortals.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/BuildPortals.sh	(revision 728)
@@ -0,0 +1,99 @@
+version="0.6.1"
+STEP=$1
+
+outdir="TXM_Portal_${version}"
+rm -rf "$outdir"
+mkdir "$outdir"
+if [ $? != 0 ]; then
+	echo "** Portals.sh : failed to create dir $outdir"
+	exit 1;
+fi
+
+# copy debian shared files: INSTALL, LICENCE, ...
+cp -r shared/portals/* "$outdir"
+if [ $? != 0 ]; then
+	echo "** Portals.sh : failed to copy shared files in dir $outdir"
+	exit 1;
+fi
+
+# get manuals from SVN
+svn update "$HOME/SVN/TXMSVN/trunk/doc" &&
+cp "$HOME/SVN/TXMSVN/trunk/doc/admin manuals//Manuel du portail TXM 0.6.1 - admin.pdf" "$outdir/doc" &&
+cp "$HOME/SVN/TXMSVN/trunk/doc/dev manuals/Manuel de reference TXMWEB Dev 0.3_FR.pdf" "$outdir/doc"
+if [ $? != 0 ]; then
+	echo "** Portals.sh : failed to copy documentation"
+	exit 1;
+fi
+
+# build txm.war
+pwd
+currentdir=`pwd`
+WARDIR="$HOME/workspace079/org.txm.web/war"
+cd $WARDIR &&
+rm -f txm.war &&
+./buildWar.sh "txm" &&
+cd $currentdir
+if [ $? != 0 ]; then
+	echo "** Portals.sh : failed to build txm.war file"
+	exit 1;
+fi
+
+pwd
+# copy war build
+cp -r "$WARDIR/txm.war" "$outdir"
+if [ $? != 0 ]; then
+	echo "** Portals.sh : failed to copy war file in dir $outdir"
+	exit 1;
+fi
+
+# remove temporary and SVN files
+echo " cleaning TXM_Portal_${version} directory"
+bash directoryCleaner.sh "TXM_Portal_${version}"
+
+# copy .TXMWEB configuration directory (must be done after temp file cleaning)
+# remove test files and personnal path
+echo "copying '.TXMWEB/war' directories"
+mkdir "$outdir/.TXMWEB"
+cp -r "$HOME/.TXMWEB/war" "$outdir/.TXMWEB/txm"
+if [ $? != 0 ]; then
+	echo "** Portals.sh : failed to copy war file in dir $outdir"
+	exit 1;
+fi
+
+# remove all references to $HOME
+echo "remove all references to $HOME"
+find $outdir/.TXMWEB/* -type f -exec sed -i "s#$HOME#<user_home>#g" {} \;
+if [ $? != 0 ]; then
+	echo "** Portals.sh : failed to replace $HOME references in $outdir/.TXMWEB/*"
+	exit 1;
+fi
+
+# erase SMTP setup in txmweb.conf
+echo "erase SMTP setup in $outdir/.TXMWEB/txm/txmweb.conf"
+find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.host=.*#mail.host=#g" {} \; && 
+find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.user=.*#mail.user=#g" {} \; && 
+find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.default.from=.*#mail.default.from=#g" {} \; && 
+find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.default.reply=.*#mail.default.reply=#g" {} \; && 
+find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.password=.*#mail.password=#g" {} \; &&
+find $outdir/.TXMWEB/txm/txmweb.conf -type f -exec sed -i "s#mail.contact=.*#mail.contact=#g" {} \; &&  
+
+if [ $? != 0 ]; then
+	echo "** Portals.sh : failed to remove all references to the SMTP setup in $outdir/.TXMWEB/txm/txmweb.conf"
+	exit 1;
+fi
+
+# build
+echo "building 'TXM_Portal_${version}.zip' file"
+zip -9 -r -q "TXM_Portal_${version}.zip" "TXM_Portal_${version}"
+if [ $? != 0 ]; then
+	echo "** Portals.sh : failed to zip $outdir"
+	exit 1;
+fi
+
+# send to shared files
+echo "Sending to ensldfs.ens-lyon.fr/services//Laboratoires/labo_ana_corpus/Projets/TextomÃ©trie/Logiciel/TXM"
+smbclient -A auth.txt "//ensldfs.ens-lyon.fr/services" -c "cd \"/Laboratoires/labo_ana_corpus/Projets/TextomÃ©trie/Logiciel/TXM\" ; put TXM_Portal_${version}.zip ; exit"
+if [ $? != 0 ]; then
+	echo "** Portals.sh : failed to send TXM_Portal_${version}.zip to labo_ana_corpus"
+	exit 1;
+fi

Property changes on: tmp/trunk/org.txm.setups/BuildPortals.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/setSetupsVersion.sh
===================================================================
--- tmp/trunk/org.txm.setups/setSetupsVersion.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/setSetupsVersion.sh	(revision 728)
@@ -0,0 +1,73 @@
+
+#set setups version
+VERSION=`cat VERSION`
+echo "setting setups version in ..."
+
+# set Linux setup version
+
+echo "shared/debian/DEBIAN/config"
+find "shared/debian/DEBIAN/config" -type f -exec sed -i "s/^db_title \"TXM .*$/db_title \"TXM $VERSION installer\"/g" {} \;
+if [ $? != 0 ]; then
+	echo "** setting setups vesion failed at linux setup : config"
+	exit 1;
+fi
+
+echo "shared/debian/DEBIAN/control"
+find "shared/debian/DEBIAN/control" -type f -exec sed -i "s/^Version: .*$/Version: $VERSION/g" {} \;
+if [ $? != 0 ]; then
+	echo "** setting setups vesion failed at linux setup : control"
+	exit 1;
+fi
+
+find "shared/debian/DEBIAN/control" -type f -exec sed -i "s/^Description: TXM [^ ]* : /Description: TXM $VERSION : /g" {} \;
+if [ $? != 0 ]; then
+	echo "** setting setups vesion failed at linux setup : control2"
+	exit 1;
+fi
+
+echo "shared/debian/usr/share/applications/TXM.desktop"
+find "shared/debian/usr/share/applications/TXM.desktop" -type f -exec sed -i "s/^Name=TXM .*$/Name=TXM $VERSION/g" {} \;
+if [ $? != 0 ]; then
+	echo "** setting setups vesion failed at linux setup : TXM.desktop"
+	exit 1;
+fi
+find "shared/debian/usr/share/applications/TXM.desktop" -type f -exec sed -i "s/^Version=.*$/Version=$VERSION/g" {} \;
+if [ $? != 0 ]; then
+	echo "** setting setups vesion failed at linux setup : TXM.desktop"
+	exit 1;
+fi
+
+echo "shared/debian/usr/share/applications/TXM debug.desktop"
+find "shared/debian/usr/share/applications/TXM debug.desktop" -type f -exec sed -i "s/^Name=TXM .*$/Name=TXM $VERSION Debug/g" {} \;
+if [ $? != 0 ]; then
+	echo "** setting setups vesion failed at linux setup : TXM debug.desktop"
+	exit 1;
+fi
+find "shared/debian/usr/share/applications/TXM debug.desktop" -type f -exec sed -i "s/^Version=.*$/Version=$VERSION/g" {} \;
+if [ $? != 0 ]; then
+	echo "** setting setups vesion failed at linux setup : TXM debug.desktop"
+	exit 1;
+fi
+
+# set MacOSX setup version
+
+echo "shared/mac/BUILDPKG.pmdoc/index.xml $VERSION"
+find "shared/mac/BUILDPKG.pmdoc/index.xml" -type f -exec sed -i "s#<title>TXM .\..\..</title>#<title>TXM $VERSION</title>#g" {} \;
+if [ $? != 0 ]; then
+	echo "** setting setups vesion failed at macosx setup 1"
+	exit 1;
+fi
+
+# set Windows setup version
+
+echo "shared/win/txm.nsi"
+find "shared/win/txm.nsi" -type f -exec sed -i "s/^Name \"TXM .*$/Name \"TXM $VERSION\"/g" {} \;
+if [ $? != 0 ]; then
+	echo "** setting setups vesion failed at windows setup 1"
+	exit 1;
+fi
+find "shared/win/txm.nsi" -type f -exec sed -i "s/^OutFile \"TXM_.*$/OutFile \"TXM_${VERSION}_Win64_installer.exe\"/g" {} \;
+if [ $? != 0 ]; then
+	echo "** setting setups vesion failed at windows setup 2"
+	exit 1;
+fi

Property changes on: tmp/trunk/org.txm.setups/setSetupsVersion.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/.settings/org.eclipse.core.resources.prefs
===================================================================
--- tmp/trunk/org.txm.setups/.settings/org.eclipse.core.resources.prefs	(revision 0)
+++ tmp/trunk/org.txm.setups/.settings/org.eclipse.core.resources.prefs	(revision 728)
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding//shared/win/txm.nsi=UTF-8

Property changes on: tmp/trunk/org.txm.setups/.settings/org.eclipse.core.resources.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/BuildMacOSXIntel.sh
===================================================================
--- tmp/trunk/org.txm.setups/BuildMacOSXIntel.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/BuildMacOSXIntel.sh	(revision 728)
@@ -0,0 +1,107 @@
+version=`cat VERSION`
+STEP=$1
+
+rm -f "TXM_${version}_MacOSX.tar.gz"
+rm -rf "TXM_${version}_MacOSX"
+mkdir "TXM_${version}_MacOSX"
+
+# ensure INSTALL CLEAN file rights
+chmod 775 shared/mac/INSTALL shared/mac/CLEAN
+if [ $? != 0 ]; then
+	echo "** $APP: failed to set rights of INSTALL CLEAN files "
+	exit 1;
+fi
+
+echo " copy mac shared files: R"
+rsync -r  --exclude '.svn' shared/mac/* "TXM_${version}_MacOSX"
+if [ $? != 0 ]; then
+	echo "** MacOSXIntel.sh : failed to copy Mac shared files"
+	exit 1;
+fi
+
+echo " copy shared files: css, xsl, scripts, samples..."
+rsync -r  --exclude '.svn' shared/all/* "TXM_${version}_MacOSX/Applications/TXM"
+if [ $? != 0 ]; then
+	echo "** MacOSXIntel.sh : failed to copy shared files"
+	exit 1;
+fi
+
+echo "convert licence files encoding to MacRoman"
+iconv -f utf8 -t MAC shared/all/license_agreement_fr.txt > "TXM_${version}_MacOSX/Applications/TXM/license_agreement_fr.txt"
+iconv -f utf8 -t MAC shared/all/license_agreement.txt > "TXM_${version}_MacOSX/Applications/TXM/license_agreement.txt"
+iconv -f utf8 -t MAC shared/all/LICENSE_FR.TXT > "TXM_${version}_MacOSX/Applications/TXM/LICENSE_FR.TXT"
+iconv -f utf8 -t MAC shared/all/LICENSE.TXT > "TXM_${version}_MacOSX/Applications/TXM/LICENSE.TXT"
+
+echo "remove parasite settings"
+rm -f "exportRCP/macosx.cocoa.x86_64/TXM/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
+rm -f "exportRCP/macosx.cocoa.x86_64/TXM/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
+if [ $? != 0 ]; then
+	echo "** $APP: failed to remove p2 preferences"
+	exit 1;
+fi
+
+echo "copy eclipse build files"
+rsync -r  --exclude '.svn' "../../CQP.macosx/res/macosx"/* "TXM_${version}_MacOSX/Applications/TXM/cwb/bin" &&
+chmod -R +x "TXM_${version}_MacOSX/Applications/TXM/cwb/bin"
+if [ $? != 0 ]; then
+	echo "** MacOSXIntel.sh : failed to copy CQP.macosx plugin files"
+	exit 1;
+fi
+
+echo " copy eclipse arch dependent build"
+rsync -r  --exclude '.svn' "exportRCP/macosx.cocoa.x86_64/TXM" "TXM_${version}_MacOSX/Applications/TXM"
+if [ $? != 0 ]; then
+	echo "** MacOSXIntel.sh : failed to binaries files"
+	exit 1;
+fi
+
+chmod +x "TXM_${version}_MacOSX/INSTALL" &&
+chmod +x "TXM_${version}_MacOSX/CLEAN"
+if [ $? != 0 ]; then
+	echo "** MacOSXIntel.sh : failed to chmod +x INSTALL & CLEAN files"
+	exit 1;
+fi
+
+mv "TXM_${version}_MacOSX/Applications/TXM/TXM.app" "TXM_${version}_MacOSX/Applications/TXM/.main.app"
+if [ $? != 0 ]; then
+	echo "** MacOSXIntel.sh : failed to hide TXM.app"
+	exit 1;
+fi
+
+#echo "set LSUIElement to 1"
+#find ./TXM_${version}_MacOSX/Applications/TXM/.main.app/Contents/Info.plist -type f -exec sed -i 's/<dict>/<dict><key>LSUIElement<\/key><string>1<\/string>/g' {} \;
+#if [ $? != 0 ]; then
+#	echo "** MacOSXIntel.sh : failed to fix Info.plist"
+#	exit 1;
+#fi
+
+echo " clean"
+bash directoryCleaner.sh "TXM_${version}_MacOSX"
+if [ $? != 0 ]; then
+	echo "** $APP: failed to clean mac setup TXM_${version}_MacOSX"
+	exit 1;
+fi
+
+echo "Tar gz TXM_${version}_MacOSX"
+tar -zcf "TXM_${version}_MacOSX.tar.gz" TXM_${version}_MacOSX
+if [ $? != 0 ]; then
+	echo "** MacOSXIntel.sh : failed to tar gz TXM_${version}_MacOSX"
+	exit 1;
+fi
+
+if [ "$STEP" = "" ] ; then
+	echo "Local test: The archive is not sent to shared files."
+else
+	echo "Sending to ensldfs.ens-lyon.fr/services/labo_ana_corpus/PartageTemp"
+	smbclient -A auth.txt "//ensldfs.ens-lyon.fr/services" -c "cd \"/Laboratoires/labo_ana_corpus/Projets/TextomÃ©trie/Logiciel/TXM/$STEP\" ; put TXM_${version}_MacOSX.zip ; exit"
+	if [ $? != 0 ]; then
+		echo "** MacOSXIntel.sh : failed to send TXM_${version}_MacOSX to labo_ana_corpus"
+		exit 1;
+	fi
+fi
+
+#cp "TXM_${version}_MacOSX.tar.gz" /run/user/1001/gvfs/smb-share\:server\=ensldfs.ens-lyon.fr\,share\=services\,user\=$USER/Laboratoires/labo_ana_corpus/PartageTemp
+#if [ $? != 0 ]; then
+#	echo "** $APP: TXM_${version}_MacOSX.tar.gz not copied PartageTemp"
+#	exit 1;
+#fi
Index: tmp/trunk/org.txm.setups/.project
===================================================================
--- tmp/trunk/org.txm.setups/.project	(revision 0)
+++ tmp/trunk/org.txm.setups/.project	(revision 728)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.setups</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>

Property changes on: tmp/trunk/org.txm.setups/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/trunk/org.txm.setups/PublishMacros.sh
===================================================================
--- tmp/trunk/org.txm.setups/PublishMacros.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/PublishMacros.sh	(revision 728)
@@ -0,0 +1,35 @@
+SF_USER=mdecorde
+DISTANTMACRODIR="/home/frs/project/t/tx/txm/software/TXM Macros"
+SERVER="frs.sourceforge.net"
+GROUP="txm"
+
+TOOLBOXDIRECTORY="$HOME/workspace079/org.txm.toolbox"
+MACRODIR="$TOOLBOXDIRECTORY/src/groovy/org/txm/macro"
+
+echo "Sending all macros files to SF 'TXM Macros' directory..."
+
+echo "making SF directories..."
+for dir in `ls $MACRODIR`; do
+	echo " making $dir directory"
+	echo "put TXM_${VERSION}_Linux64.deb" > tmp_ftp
+	echo "exit" >> tmp_ftp
+	#sftp -b tmp "${SF_USER},${GROUP}@{$SERVER}:${DISTANTMACRODIR}"
+done
+
+for dir in `ls $MACRODIR`; do
+	echo " sending $dir directory to SF..."
+	#echo "put TXM_${VERSION}_Linux64.deb" > tmp_ftp
+	#echo "exit" >> tmp_ftp
+	#sftp -b tmp "${SF_USER},${GROUP}@${SERVER}:${DISTANTMACRODIR}"
+	
+	#scp -rq "$MACRODIR/$dir" ${SF_USER},${GROUP}@${SERVER}:${DISTANTMACRODIR}
+
+	if [ $? != 0 ]; then
+		echo "** PublichMacro.sh : failed to send $dir"
+		rm tmp
+		exit 1;
+	fi
+done
+
+# cleaning
+rm -f tmp_ftp

Property changes on: tmp/trunk/org.txm.setups/PublishMacros.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/VERSION
===================================================================
--- tmp/trunk/org.txm.setups/VERSION	(revision 0)
+++ tmp/trunk/org.txm.setups/VERSION	(revision 728)
@@ -0,0 +1 @@
+0.8.0
Index: tmp/trunk/org.txm.setups/PublishTESTPluginUpdateSite.sh
===================================================================
--- tmp/trunk/org.txm.setups/PublishTESTPluginUpdateSite.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/PublishTESTPluginUpdateSite.sh	(revision 728)
@@ -0,0 +1,34 @@
+# this script needs that you create a public key for SF
+echo "Sending RCP plugins to update site..."
+SF_USER=mdecorde
+UPDATESITE="/home/mdecorde/TEMP/updates/plugins"
+
+if [ "$1" = "" ]; then
+	echo "uploading to default repository"
+elif [[ $1 =~ alpha|beta ]]; then
+	echo "uploading to the '$1' repository"
+else
+	echo "$1: invalid parameter"
+	exit 1;
+fi
+
+# renaming repository
+cd "../../TXM plugins.site"
+if [ $? != 0 ]; then
+	echo "** updateTESTPluginsUpdateSites.sh : failed to find ../../TXM plugins.site"
+	exit 1;
+fi
+
+mkdir "$UPDATESITE$1"
+rm -rf "$UPDATESITE$1"
+
+mkdir "${UPDATESITE}$1" && 
+mkdir "${UPDATESITE}$1/plugins" && 
+mkdir "${UPDATESITE}$1/features" && 
+cp -r * "${UPDATESITE}$1"
+
+if [ $? != 0 ]; then
+	echo "** updateTESTPluginsUpdateSites.sh : failed to update"
+	exit 1;
+fi
+

Property changes on: tmp/trunk/org.txm.setups/PublishTESTPluginUpdateSite.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/PublishPluginUpdateSite.sh
===================================================================
--- tmp/trunk/org.txm.setups/PublishPluginUpdateSite.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/PublishPluginUpdateSite.sh	(revision 728)
@@ -0,0 +1,45 @@
+# this script needs that you create a public key for SF
+echo "Sending RCP plugins to update site..."
+UPDATESITE="/var/lib/tomcat6/webapps/updates/plugins$1"
+SERVER="txm.ish-lyon.cnrs.fr"
+USER="txm"
+
+if [ "$1" = "" ]; then
+	echo "uploading to default repository"
+elif [ $1 = "alpha" ]; then
+	echo "uploading to the '$1' repository"
+elif [ $1 = "beta" ]; then
+	echo "uploading to the '$1' repository"
+elif [ $1 = "dev" ]; then
+	echo "uploading to the '$1' repository"
+else
+	echo "'$1': invalid parameter"
+	exit 1;
+fi
+
+# moving to src plugin site
+if [ "$1" = "" ]; then
+	cd "../../TXMStablePlugins.site"
+elif [ $1 = "alpha" ]; then
+	cd "../../TXMAlphaPlugins.site"
+elif [ $1 = "beta" ]; then
+	cd "../../TXMBetaPlugins.site"
+elif [ $1 = "dev" ]; then
+	cd "../../TXMDevPlugins.site"
+else
+	echo "$1: invalid parameter2"
+	exit 1;
+fi
+
+if [ $? != 0 ]; then
+	echo "** updatePluginsUpdateSites.sh : failed to find ../../TXM plugins.site"
+	exit 1;
+fi
+
+# DO IT !
+echo "Sending plugins..."
+scp -r * $USER@$SERVER:$UPDATESITE
+if [ $? != 0 ]; then
+	echo "** updateTXMUpdateSites.sh : failed to update"
+	exit 1;
+fi

Property changes on: tmp/trunk/org.txm.setups/PublishPluginUpdateSite.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/PublishSDKToSourceforge.sh
===================================================================
--- tmp/trunk/org.txm.setups/PublishSDKToSourceforge.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/PublishSDKToSourceforge.sh	(revision 728)
@@ -0,0 +1,14 @@
+VERSION=`cat VERSION`
+SF_USER=mdecorde
+
+echo "Send TXM_SDK_${VERSION}.tar.gz"
+cd ~/SDK/
+echo "put TXM_SDK_${VERSION}.tar.gz" > tmp
+echo "exit" >> tmp
+sftp -b tmp "${SF_USER},txm@frs.sourceforge.net:/home/frs/project/t/tx/txm/software/TXM SDK/${VERSION}"
+if [ $? != 0 ]; then
+	echo "** sendSetupsToSF.sh : failed to send SDK: TXM_SDK_${VERSION}.tar.gz"
+	rm tmp
+	exit 1;
+fi
+rm tmp

Property changes on: tmp/trunk/org.txm.setups/PublishSDKToSourceforge.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/PublishSetupsToSourceforge.sh
===================================================================
--- tmp/trunk/org.txm.setups/PublishSetupsToSourceforge.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/PublishSetupsToSourceforge.sh	(revision 728)
@@ -0,0 +1,73 @@
+#this script needs that you create a public key for SF
+echo "Sending setups..."
+VERSION=`cat VERSION`
+TOSEND=$1
+SF_USER=mdecorde
+
+echo "Send REAMDE.md file"
+cp "annonces/readme.md/${VERSION}_en.md" "README.md"
+if [ $? != 0 ]; then
+	echo "** sendSetupsToSF.sh : no README file found at 'annonces/readme.md/${VERSION}_en.md'"
+	exit 1;
+fi
+echo "put README.md" > tmp
+echo "exit" >> tmp
+sftp -b tmp "${SF_USER},txm@frs.sourceforge.net:/home/frs/project/t/tx/txm/software/TXM/${VERSION}"
+if [ $? != 0 ]; then
+	echo "** sendSetupsToSF.sh : failed to send README.md"
+	exit 1;
+fi
+rm "README.md"
+
+echo "Linux: TXM_${VERSION}_Linux32.deb"
+echo "put TXM_${VERSION}_Linux32.deb" > tmp
+echo "exit" >> tmp
+sftp -b tmp "${SF_USER},txm@frs.sourceforge.net:/home/frs/project/t/tx/txm/software/TXM/${VERSION}"
+if [ $? != 0 ]; then
+	echo "** sendSetupsToSF.sh : failed to Linux: TXM_${VERSION}_Linux32.deb"
+	rm tmp
+	exit 1;
+fi
+
+echo "Linux: TXM_${VERSION}_Linux64.deb"
+echo "put TXM_${VERSION}_Linux64.deb" > tmp
+echo "exit" >> tmp
+sftp -b tmp "${SF_USER},txm@frs.sourceforge.net:/home/frs/project/t/tx/txm/software/TXM/${VERSION}"
+if [ $? != 0 ]; then
+	echo "** sendSetupsToSF.sh : failed to TXM_${VERSION}_Linux64.deb"
+	rm tmp
+	exit 1;
+fi
+
+echo "Win: TXM_${VERSION}_Win32.exe"
+echo "put TXM_${VERSION}_Win32.exe" > tmp
+echo "exit" >> tmp
+sftp -b tmp "${SF_USER},txm@frs.sourceforge.net:/home/frs/project/t/tx/txm/software/TXM/${VERSION}"
+echo $?
+if [ $? != 0 ]; then
+	echo "** sendSetupsToSF.sh : failed to TXM_${VERSION}_Win32.exe"
+	rm tmp
+	exit 1;
+fi
+
+echo "Win: TXM_${VERSION}_Win64.exe"
+echo "put TXM_${VERSION}_Win64.exe" > tmp
+echo "exit" >> tmp
+sftp -b tmp "${SF_USER},txm@frs.sourceforge.net:/home/frs/project/t/tx/txm/software/TXM/${VERSION}"
+if [ $? != 0 ]; then
+	echo "** sendSetupsToSF.sh : failed to TXM_${VERSION}_Win64.exe"
+	rm tmp
+	exit 1;
+fi
+
+echo "Mac: TXM_${VERSION}_MacOSX.pkg"
+echo "put TXM_${VERSION}_MacOSX.pkg" > tmp
+echo "exit" >> tmp
+sftp -b tmp "${SF_USER},txm@frs.sourceforge.net:/home/frs/project/t/tx/txm/software/TXM/${VERSION}"
+if [ $? != 0 ]; then
+	echo "** sendSetupsToSF.sh : failed to TXM_${VERSION}_MacOSX.pkg"
+	rm tmp
+	exit 1;
+fi
+
+rm tmp

Property changes on: tmp/trunk/org.txm.setups/PublishSetupsToSourceforge.sh
___________________________________________________________________
Added: svn:executable
   + *

Index: tmp/trunk/org.txm.setups/extractJREToSetups.sh
===================================================================
--- tmp/trunk/org.txm.setups/extractJREToSetups.sh	(revision 0)
+++ tmp/trunk/org.txm.setups/extractJREToSetups.sh	(revision 728)
@@ -0,0 +1,13 @@
+JREDIR=~/workspace079/JREPOURTXM
+
+echo "extracting Linux 64bit JRE..."
+tar -xzf $JREDIR/jre\ linux\ 64bit.tar.gz
+rm -rf archs/debian/64bit/usr/lib/TXM/jre/*
+mv -f jre archs/debian/64bit/usr/lib/TXM
+
+echo "extracting Windows 64bit JRE..."
+unzip -q $JREDIR/jre\ win\ 64bit.zip
+rm -rf archs/win/64bit/TXM/jre/*
+mv -f jre archs/win/64bit/TXM/
+
+echo "extracting MacOSX JRE... Oh no, it must be done on a Mac!"

Property changes on: tmp/trunk/org.txm.setups/extractJREToSetups.sh
___________________________________________________________________
Added: svn:executable
   + *

