Révision 728

tmp/trunk/org.txm.setups/PublishTESTTXMUpdateSite.sh (revision 728)
1
#./updateTESTTXMUpdateSite.sh dev && ./updateTESTTXMUpdateSite.sh alpha && ./updateTESTTXMUpdateSite.sh beta && ./updateTESTTXMUpdateSite.sh
2

  
3
echo "Sending RCP export to TEST update site..."
4

  
5
UPDATESITE="/home/mdecorde/TEMP/updates"
6

  
7
if [ "$1" = "" ]; then
8
	echo "uploading to default test repository"
9
elif [[ $1 =~ alpha|beta|dev ]]; then
10
	echo "uploading to the '$1' test repository"
11
else
12
	echo "$1: invalid parameter"
13
	exit 1;
14
fi
15

  
16
#moving to repository
17
cd "exportRCP/repository"
18
if [ $? != 0 ]; then
19
	echo "** updateTESTTXMUpdateSites.sh : failed to find exportRCP/repository"
20
	exit 1;
21
fi
22

  
23
mkdir "$UPDATESITE"
24
rm -rf "$UPDATESITE/TXM$1"
25

  
26
mkdir "$UPDATESITE/TXM$1" && 
27
mkdir "$UPDATESITE/TXM$1/plugins" && 
28
mkdir "$UPDATESITE/TXM$1/binary" && 
29
mkdir "$UPDATESITE/TXM$1/features" && 
30
cp -r * "$UPDATESITE/TXM$1"
31

  
32
if [ $? != 0 ]; then
33
	echo "** updateTESTTXMUpdateSites.sh : failed to update"
34
	exit 1;
35
fi
36

  
0 37

  
tmp/trunk/org.txm.setups/PublishTXMUpdateSite.sh (revision 728)
1
#!/bin/bash
2

  
3
echo "Sending RCP export to update site..."
4

  
5
UPDATESITE="$HOME/workspace079/org.txm.setups/exportRCP/repository"
6
# UPDATE THIS MOUNT PATH TO YOURS
7
SERVERPATH="/run/user/1001/gvfs/sftp:host=vm-web-preprod.pun.ens-lyon.fr,user=mdecorde"
8
DISTANTPATH="$SERVERPATH/textometrie/dist/main/"
9

  
10
if [ "$1" = "" ] ; then
11
	echo "You need to specify the update site level to update"
12
	exit 1
13
elif [[ $1 =~ alpha|beta|dev ]] ; then
14
	echo "Uploading to the '$1' dist/main repository"
15
	DISTANTPATH="$SERVERPATH/textometrie/dist/main/"
16
else
17
	echo "Uploading to the '$1' project update site repository"
18
	DISTANTPATH="$SERVERPATH/textometrie/dist/"
19
fi
20

  
21
if [ ! -d "$UPDATESITE" ]; then
22
	echo "** $UPDATESITE is missing."
23
	exit 1;
24
fi
25

  
26
# DO IT !
27
echo "ls" > pushFilesToPreprod.ftp
28
echo "exit" > pushFilesToPreprod.ftp
29

  
30
echo "Remove old files"
31
rm -rf "$DISTANTPATH$1/"*
32
if [ $? != 0 ]; then
33
    echo "Could not delete files of $DISTANTPATH$1";
34
    exit 1 ;
35
fi
36

  
37
echo "Copy new files"
38
mkdir "$DISTANTPATH"
39
mkdir "$DISTANTPATH$1"
40
cp -rf "$UPDATESITE/"* "$DISTANTPATH$1"
41
if [ $? != 0 ]; then
42
    echo "Could not copy files of $UPDATESITE to $DISTANTPATH$1";
43
    exit 1 ;
44
fi
45

  
46
echo "Rename commandes-succes.txt file"
47
mv "$SERVERPATH/commandes-succes.txt" "$SERVERPATH/commandes.txt"
48
if [ $? != 0 ]; then
49
    echo "Could not rename commandes-succes.txt file";
50
    exit 1 ;
51
fi
52

  
53
echo "$1 update site updated"
0 54

  
tmp/trunk/org.txm.setups/BuildAll.sh (revision 728)
1
#echo "get scripts"
2
sh getSharedFiles.sh
3
if [ $? != 0 ]; then
4
	echo "** Failed to get shared files"
5
	exit 1;
6
fi
7

  
8
echo "Linux64"
9
sh Linux64bit.sh
10
if [ $? != 0 ]; then
11
	echo "** Failed to get build Linux64"
12
	exit 1;
13
fi
14

  
15
echo "MacOSX"
16
sh MacOSXIntel.sh
17
if [ $? != 0 ]; then
18
	echo "** Failed to get build Mac OS X"
19
	exit 1;
20
fi
21

  
22
echo "Win64"
23
sh Win64bit.sh
24
if [ $? != 0 ]; then
25
	echo "** Failed to get build Win64"
26
	exit 1;
27
fi
28

  
29
#play end.wav
0 30

  
tmp/trunk/org.txm.setups/BuildLinux64bit.sh (revision 728)
1
VERSION=`cat VERSION`
2
STEP=$1
3
ARCH="64"
4
ARCHCODE="x86_64"
5
APP="TXM_${VERSION}_Linux${ARCH}"
6

  
7
rm -rf "$APP"
8
mkdir "$APP"
9

  
10
echo purge | sudo debconf-communicate txm
11
echo purge | sudo debconf-communicate TXM
12

  
13
# ensure postinst preinst ... rights
14
chmod 644 shared/debian/DEBIAN/templates &&
15
chmod 755 shared/debian/DEBIAN/config &&
16
chmod 755 shared/debian/DEBIAN/postinst &&
17
chmod 755 shared/debian/DEBIAN/postrm &&
18
chmod 755 shared/debian/DEBIAN/preinst &&
19
chmod 755 shared/debian/usr/bin/TXM*
20
if [ $? != 0 ]; then
21
	echo "** $APP: failed to set rights of postinst preinst ... files "
22
	exit 1;
23
fi
24

  
25
# ensure JRE files are here
26
if [ ! -d "shared/debian/usr/lib/TXM/jre/bin" ]; then
27
	echo "** $APP: JRE files are missing."
28
	exit 1;
29
fi
30

  
31
# copy debian shared files: INSTALL, R libs...
32
rsync -r  --exclude '.svn' shared/debian/* "$APP"
33
if [ $? != 0 ]; then
34
	echo "** $APP: failed to get 'debian' shared files"
35
	exit 1;
36
fi
37

  
38
# copy shared files: css, xsl, scripts, samples...
39
rsync -r  --exclude '.svn' shared/all/* "$APP/usr/lib/TXM"
40
if [ $? != 0 ]; then
41
	echo "** $APP: failed to get shared files"
42
	exit 1;
43
fi
44

  
45
# remove old profile that can contains unwanted repositories
46
rm -f "exportRCP/linux.gtk.${ARCHCODE}/TXM/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
47
rm -f "exportRCP/linux.gtk.${ARCHCODE}/TXM/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
48
if [ $? != 0 ]; then
49
	echo "** $APP: failed to remove p2 preferences"
50
	exit 1;
51
fi
52

  
53
# copy eclise arch dependent build
54
rsync -r  --exclude '.svn' "exportRCP/linux.gtk.${ARCHCODE}/TXM" "$APP/usr/lib"
55
if [ $? != 0 ]; then
56
	echo "** $APP: failed to get ${ARCH}bit binaries linux $ARCHCODE files"
57
	exit 1;
58
fi
59

  
60
echo " clean"
61
bash directoryCleaner.sh "$APP"
62
if [ $? != 0 ]; then
63
	echo "** $APP: failed to clean debian package $APP"
64
	exit 1;
65
fi
66

  
67
# update po files
68
echo "update po files"
69
cd "$APP/DEBIAN"
70
debconf-updatepo
71
cd "../.."
72

  
73
# build
74
sudo fakeroot dpkg-deb --build "$APP"
75
if [ $? != 0 ]; then
76
	echo "** $APP: failed to build debian package $APP"
77
	exit 1;
78
fi
79

  
80
rm -f "${APP}_installer.deb"
81
mv $APP.deb ${APP}_installer.deb
82

  
0 83

  
tmp/trunk/org.txm.setups/getSharedFiles.sh (revision 728)
1
TOOLBOXDIRECTORY="$HOME/workspace079/org.txm.toolbox"
2
SVNDIR="$HOME/SVN"
3
SVNDOCTRUNK="$SVNDIR/TXMSVN/trunk/doc"
4
SHARED="./shared"
5
SHAREDALL="$SHARED/all"
6
SCRIPTCOPYDIR="$SHAREDALL/scripts"
7

  
8
echo "reset the shared/all directory..."
9
rm -rf "$SHAREDALL" &&
10
svn update
11

  
12
if [ ! -d "$SCRIPTCOPYDIR" ]; then
13
	echo "** Scripts copy: failed to reset the shared/all directory."
14
	exit 1;
15
fi
16

  
17
IMPORTERPACKAGE=/src/groovy/org/txm/importer
18
ALCESTE=$IMPORTERPACKAGE/alceste/alcesteLoader.groovy
19
DISCOURS=$IMPORTERPACKAGE/discours/discoursLoader.groovy
20
BFM=$IMPORTERPACKAGE/bfm/bfmLoader.groovy
21
FRANTEXT=$IMPORTERPACKAGE/frantext/frantextLoader.groovy
22
HYPERBASE=$IMPORTERPACKAGE/hyperbase/hyperbaseLoader.groovy
23
TXT=$IMPORTERPACKAGE/txt/txtLoader.groovy
24
XML=$IMPORTERPACKAGE/xml/xmlLoader.groovy
25
FACTIVA=$IMPORTERPACKAGE/factiva/factivaLoader.groovy
26
FACTIVATXT=$IMPORTERPACKAGE/factiva/factivamailLoader.groovy
27
XMLTXM=$IMPORTERPACKAGE/xmltxm/xmltxmLoader.groovy
28
TRANSCRIBER=$IMPORTERPACKAGE/transcriber/transcriberLoader.groovy
29
TMX=$IMPORTERPACKAGE/tmx/tmxLoader.groovy
30
DOC=$IMPORTERPACKAGE/doc/docLoader.groovy
31
WTC=$IMPORTERPACKAGE/wtc/wtcLoader.groovy
32
#LIMSI=$IMPORTERPACKAGE/limsi/limsiLoader.groovy
33

  
34
echo $SCRIPTCOPYDIR
35

  
36
mkdir "$SCRIPTCOPYDIR/import/"
37
# get all xxxxLoader.groovy sccripts
38
cp -v "$TOOLBOXDIRECTORY$ALCESTE" "$SCRIPTCOPYDIR/import/" && \
39
cp -v "$TOOLBOXDIRECTORY$DISCOURS" "$SCRIPTCOPYDIR/import/" && \
40
cp -v "$TOOLBOXDIRECTORY$BFM" "$SCRIPTCOPYDIR/import/" && \
41
cp -v "$TOOLBOXDIRECTORY$FRANTEXT" "$SCRIPTCOPYDIR/import/" && \
42
cp -v "$TOOLBOXDIRECTORY$HYPERBASE" "$SCRIPTCOPYDIR/import/" && \
43
cp -v "$TOOLBOXDIRECTORY$TXT" "$SCRIPTCOPYDIR/import/" && \
44
cp -v "$TOOLBOXDIRECTORY$XML" "$SCRIPTCOPYDIR/import/" && \
45
cp -v "$TOOLBOXDIRECTORY$FACTIVA" "$SCRIPTCOPYDIR/import/" && \
46
cp -v "$TOOLBOXDIRECTORY$FACTIVATXT" "$SCRIPTCOPYDIR/import/" && \
47
cp -v "$TOOLBOXDIRECTORY$XMLTXM" "$SCRIPTCOPYDIR/import/" && \
48
cp -v "$TOOLBOXDIRECTORY$TRANSCRIBER" "$SCRIPTCOPYDIR/import/" && \
49
cp -v "$TOOLBOXDIRECTORY$DOC" "$SCRIPTCOPYDIR/import/" && \
50
cp -v "$TOOLBOXDIRECTORY$TMX" "$SCRIPTCOPYDIR/import/" && \
51
cp -v "$TOOLBOXDIRECTORY$WTC" "$SCRIPTCOPYDIR/import/"
52
#cp -v "$TOOLBOXDIRECTORY$LIMSI" "$SCRIPTCOPYDIR/import/"
53

  
54
if [ $? != 0 ]; then
55
	echo "** Loader scripts copy: copy failed"
56
	exit 1;
57
fi
58

  
59
#copy Macros
60
mkdir "$SCRIPTCOPYDIR/macro/"
61
mkdir "$SCRIPTCOPYDIR/macro/org/"
62
mkdir "$SCRIPTCOPYDIR/macro/org/txm/"
63
#mkdir "$SCRIPTCOPYDIR/macro/org/txm/annotation/"
64

  
65
rsync -r --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/macro/" "$SCRIPTCOPYDIR/macro/org/txm/macro" &&
66
#rsync -r --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/importer/europress/" "$SCRIPTCOPYDIR/macro" &&
67
#rsync -r --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/annotation/" "$SCRIPTCOPYDIR/macro/org/txm/annotation" &&
68
#rsync -r --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/importer/transcription/" "$SCRIPTCOPYDIR/macro/org/txm/importer/transcription"
69
if [ $? != 0 ]; then
70
	echo "** Macros copy failed"
71
	exit 1;
72
fi
73

  
74
#copy Groovy samples scripts
75
mkdir "$SCRIPTCOPYDIR/samples/groovy"
76
mkdir "$SCRIPTCOPYDIR/samples/groovy/org" &&
77
mkdir "$SCRIPTCOPYDIR/samples/groovy/org/txm" &&
78
mkdir "$SCRIPTCOPYDIR/samples/groovy/org/txm/export" &&
79
mkdir "$SCRIPTCOPYDIR/samples/groovy/org/txm/functions" && 
80
mkdir "$SCRIPTCOPYDIR/samples/groovy/org/txm/importer" &&
81
mkdir "$SCRIPTCOPYDIR/samples/groovy/org/txm/sw" &&
82
#mkdir "$SCRIPTCOPYDIR/samples/groovy/org/txm/tal" &&
83
rsync -r  --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/export"/* "$SCRIPTCOPYDIR/samples/groovy/org/txm/export" && 
84
rsync -r  --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/functions"/* "$SCRIPTCOPYDIR/samples/groovy/org/txm/functions" &&
85
rsync -r  --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/importer"/* "$SCRIPTCOPYDIR/samples/groovy/org/txm/importer" &&
86
rsync -r  --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/sw"/* "$SCRIPTCOPYDIR/samples/groovy/org/txm/sw" &&
87
rsync -r  --exclude '.svn' "$TOOLBOXDIRECTORY/src/groovy/org/txm/tal"/* "$SCRIPTCOPYDIR/samples/groovy/org/txm/tal" &&
88
if [ $? != 0 ]; then
89
	echo "** Groovy samples copy failed"
90
	exit 1;
91
fi
92

  
93
#copy R samples scripts
94
rsync -r  --exclude '.svn' "$TOOLBOXDIRECTORY/src/R/"* "$SCRIPTCOPYDIR/samples/R"
95
if [ $? != 0 ]; then
96
	echo "** R samples copy failed"
97
	exit 1;
98
fi
99

  
100
# copy XSL files
101
rsync -r  --exclude '.svn' "$TOOLBOXDIRECTORY/res/org/txm/xml/xsl/"* "$SHAREDALL/xsl"
102
if [ $? != 0 ]; then
103
	echo "** Loader xsl copy: copy failed"
104
	exit 1;
105
fi
106

  
107
# copy CSS files
108

  
109
rsync -r --exclude '.svn' "$TOOLBOXDIRECTORY/res/org/txm/css/txm.css" "$SHAREDALL/css/" &&
110
rsync -r --exclude '.svn' "$TOOLBOXDIRECTORY/res/org/txm/css/tmx.css" "$SHAREDALL/css/" &&  
111
rsync -r --exclude '.svn' "$TOOLBOXDIRECTORY/res/org/txm/css/doc.css" "$SHAREDALL/css/" && 
112
rsync -r --exclude '.svn' "$TOOLBOXDIRECTORY/res/org/txm/css/transcriber.css" "$SHAREDALL/css/"
113
if [ $? != 0 ]; then
114
	echo "** css copy failed"
115
	exit 1;
116
fi
117

  
118
# copy TXM documentation files files
119
svn update "${SVNDOCTRUNK}"
120
cp -f "${SVNDOCTRUNK}/user manuals/txm-manual-fr.pdf" "$SHAREDALL/doc/Manuel de TXM 0.7 FR.pdf"
121
if [ $? != 0 ]; then
122
	echo "** TXM REFMAN copy failed"
123
	exit 1;
124
fi
125

  
126
chmod -R +r "$SHAREDALL"/*
127
find "$SHAREDALL" -type d -exec chmod +rx {} \;
128

  
129
# remove dev scripts
130
rm -f "$SCRIPTCOPYDIR/samples/groovy/ReleaseFunctionsValidation.groovy"
131
rm -f "$SCRIPTCOPYDIR/samples/groovy/ReleaseLoadersValidation.groovy"
132
rm -rf "$SCRIPTCOPYDIR/samples/groovy/org/txm/setup"
133
rm -rf "$SCRIPTCOPYDIR/samples/groovy/org/txm/i18n"
134
rm -rf "$SCRIPTCOPYDIR/samples/groovy/org/txm/svn"
135
rm -f "$SCRIPTCOPYDIR/samples/groovy/org/txm/AntTest.groovy"
136
rm -f "$SCRIPTCOPYDIR/samples/groovy/org/txm/Build.java"
137
rm -f "$SCRIPTCOPYDIR/samples/groovy/org/txm/Build2.java"
138
rm -f "$SCRIPTCOPYDIR/samples/groovy/org/txm/Build3.groovy"
139

  
140
echo "** Shared files copy: success !"
0 141

  
tmp/trunk/org.txm.setups/md2html2mail.sh (revision 728)
1
#!/bin/bash
2
VERSION=`cat VERSION`
3
root="annonces"
4

  
5
function toHTML {
6
	source=$1
7
	output=$2
8
	title=$3
9

  
10
	rm $output
11
	echo '<?xml version="1.0" encoding="UTF-8"?>' >> "$output"
12
	echo "<!DOCTYPE html>" >> "$output"
13
	echo "<html>" >> "$output"
14
	echo " <head>" >> "$output"
15
	echo '  <meta charset="utf-8" />' >> "$output"
16
	echo "  <title>title</title>" >> "$output"
17
	echo " </head>" >> "$output"
18
	echo " <body>" >> "$output"
19
	echo "  <h1>$title</h1>" >> "$output"
20
	markdown $source >> "$output"
21
	echo " </body>" >> "$output"
22
	echo "</html>" >> "$output"
23
}
24

  
25
source="${root}/mail.md/${VERSION}_fr.md"
26
output="${root}/welcome.html/welcome_${VERSION}_fr.html"
27
toHTML $source $output "Bienvenue dans TXM $VERSION"
28

  
29
source="${root}/readme.md/${VERSION}beta_fr.md"
30
output="${root}/welcome.html/welcome_${VERSION}beta_fr.html"
31
toHTML $source $output "Bienvenue dans TXM $VERSION beta"
32
rm $output
33

  
34
source="${root}/readme.md/${VERSION}_en.md"
35
output="${root}/welcome.html/welcome_${VERSION}_en.html"
36
toHTML $source $output "Welcome in TXM $VERSION"
37
     
38
source="${root}/readme.md/${VERSION}beta_en.md"
39
output="${root}/welcome.html/welcome_${VERSION}beta_en.html"
40
toHTML $source $output "Welcome in TXM $VERSION beta"
41

  
42
source="${root}/readme.md/${VERSION}_ru.md"
43
output="${root}/welcome.html/welcome_${VERSION}_ru.html"
44
toHTML $source $output "Welcome in TXM $VERSION"
45

  
46
groovy MD2Mail.groovy
0 47

  
tmp/trunk/org.txm.setups/SetupMessages_en.properties (revision 728)
1
# EN EN EN EN EN
2
# Message pour lance le desinstalleur de TXM
3
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.
4

  
5
# pas montré pour Windows, puisque déjà desinstallé.
6
InfosTitle=For your information
7
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.
8

  
9
# message pour Windows si l'architecture de l'OS et de TXM ne correspondent pas
10
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?
11
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?
12

  
13
#Page d'accueil
14
WelcomeTitle=Welcome to TXM setup
15
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'.
16

  
17
# pas montré pour windows, puisque R est livré avec
18
InstallRLibrariesTitle=Option - install needed R packages automatically: 'RSvgDevice', 'Rserve', 'rgl', 'factomineR' et 'textometrieR'.
19
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)
20

  
21
#différent pour chaque OS puisque contient des détails techniques
22
FinishTitle=Installation done
23
FinishTextWindows=The installation is done. A 'TXM' entry has been added to the 'Start' menu.
24
FinishTextLinux=The installation is done. A 'TXM' entry has been added to the dashboard.
25
FinishTextMac=You can start TXM with the 'TXM.app' file found in the "Applications" / "TXM" directory.
26

  
27
#install TreeTagger
28
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.
0 29

  
tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teiperseus-xmlw.xsl (revision 728)
1
<?xml version="1.0"?>
2
<xsl:stylesheet
3
  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
4
  xmlns:edate="http://exslt.org/dates-and-times"
5
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
6
  exclude-result-prefixes="tei edate xd" version="2.0">
7
  
8
  <xsl:import href="txm-filter-teip5-xmlw-preserve.xsl"/>
9
  <xd:doc type="stylesheet">
10
    <xd:short>
11
      A stylesheet to prepare PERSEUS XML-TEI texts to TXM import.
12
    </xd:short>
13
    <xd:detail>
14
      This stylesheet is free software; you can redistribute it and/or
15
      modify it under the terms of the GNU Lesser General Public
16
      License as published by the Free Software Foundation; either
17
      version 3 of the License, or (at your option) any later version.
18
      
19
      This stylesheet is distributed in the hope that it will be useful,
20
      but WITHOUT ANY WARRANTY; without even the implied warranty of
21
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22
      Lesser General Public License for more details.
23
      
24
      You should have received a copy of GNU Lesser Public License with
25
      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
26
    </xd:detail>
27
    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
28
    <xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
29
  </xd:doc>
30
  
31

  
32
  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
33
  
34
  <xsl:template match="//tei:text">
35
    <xsl:copy>
36
      <xsl:copy-of select="@*"/>
37
      <xsl:attribute name="author"><xsl:value-of select="//tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:author"/></xsl:attribute>
38
      <xsl:attribute name="title"><xsl:value-of select="//tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='work']"/></xsl:attribute>
39
      <xsl:attribute name="editor"><xsl:value-of select="//tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:editor"/></xsl:attribute>
40
      <xsl:apply-templates/>
41
    </xsl:copy>
42
  </xsl:template>
43
  
44
<xsl:template match="//tei:sp">
45
  <div3 type="sp" xmlns="http://www.tei-c.org/ns/1.0">
46
    <xsl:apply-templates/>    
47
  </div3>
48
</xsl:template>  
49

  
50
<xsl:template match="//tei:speaker">
51
  <head><xsl:apply-templates/></head>
52
</xsl:template>
53
  
54
  <xsl:template match="//tei:bibl">
55
    <note type="bibl" xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates/></note>
56
  </xsl:template>
57
</xsl:stylesheet>
0 58

  
tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teibrown-xmlw.xsl (revision 728)
1
<?xml version="1.0"?>
2
<xsl:stylesheet
3
  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
4
  xmlns:edate="http://exslt.org/dates-and-times"
5
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
6
  exclude-result-prefixes="tei edate xd" version="2.0">
7
  
8
  <xd:doc type="stylesheet">
9
    <xd:short>
10
      This stylesheet prepares XML-TEI P5 files of the Brown corpus
11
      for TXM import with xml/w+csv module.
12
      Specify the location of this file on your system in the "Front
13
      XSLT" import option.
14
    </xd:short>
15
    <xd:detail>
16
      This stylesheet is free software; you can redistribute it and/or
17
      modify it under the terms of the GNU Lesser General Public
18
      License as published by the Free Software Foundation; either
19
      version 3 of the License, or (at your option) any later version.
20
      
21
      This stylesheet is distributed in the hope that it will be useful,
22
      but WITHOUT ANY WARRANTY; without even the implied warranty of
23
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24
      Lesser General Public License for more details.
25
      
26
      You should have received a copy of GNU Lesser Public License with
27
      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
28
    </xd:detail>
29
    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
30
    <xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
31
  </xd:doc>
32
  
33

  
34
  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
35
  
36
  
37
<!--  <xsl:template match="/">
38
      <xsl:apply-templates/>  
39
  </xsl:template>
40
-->
41
  
42
  <xsl:template match="*">
43
        <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="{local-name(.)}">
44
          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
45
        </xsl:element>
46
  </xsl:template>
47

  
48
  <xsl:template match="@*|comment()">
49
    <xsl:copy/>
50
  </xsl:template>
51

  
52
  <xsl:template match="text()">
53
    <xsl:analyze-string select="." regex="&amp;|&lt;|&gt;|--|\*(\w+)">
54
      <xsl:matching-substring>
55
        <xsl:choose>
56
          <xsl:when test="matches(.,'&amp;')">
57
            <expan xmlns="http://www.tei-c.org/ns/1.0">and</expan>
58
          </xsl:when>
59
          <xsl:when test="matches(.,'&lt;')">
60
            <xsl:text>[</xsl:text>
61
          </xsl:when>
62
          <xsl:when test="matches(.,'&gt;')">
63
            <xsl:text>]</xsl:text>
64
          </xsl:when>          
65
          <xsl:when test="matches(.,'--')">
66
            <!-- double dash provokes malformed xml in the notes in the notes placed in xml comments by the tokenizer -->
67
            <xsl:text> - </xsl:text>
68
          </xsl:when>
69
          <xsl:otherwise>
70
            <xsl:value-of select="."/>
71
          </xsl:otherwise>
72
        </xsl:choose>
73
      </xsl:matching-substring>
74
      <xsl:non-matching-substring>         
75
            <xsl:value-of select="."/>
76
      </xsl:non-matching-substring>      
77
    </xsl:analyze-string>
78
  </xsl:template>
79
  
80

  
81
  <xsl:template match="processing-instruction()"/>
82

  
83
<!-- teiHeader deleted for the xml/w import module -->
84
  
85
  <xsl:template match="tei:teiHeader">    
86
      <!--<xsl:copy-of select="."/>-->    
87
  </xsl:template>
88
	
89
	<xsl:template match="tei:text">
90
		<xsl:copy>
91
		<xsl:apply-templates select="@*"/>
92
		<xsl:attribute name="type">
93
			<xsl:choose>
94
				<xsl:when test="@decls='A'">PRESS: REPORTAGE</xsl:when>
95
				<xsl:when test="@decls='B'">PRESS: EDITORIAL</xsl:when>
96
				<xsl:when test="@decls='C'">PRESS: REVIEWS</xsl:when>
97
				<xsl:when test="@decls='D'">RELIGION</xsl:when>
98
				<xsl:when test="@decls='E'">SKILL AND HOBBIES</xsl:when>
99
				<xsl:when test="@decls='F'">POPULAR LORE</xsl:when>
100
				<xsl:when test="@decls='G'">BELLES-LETTRES</xsl:when>
101
				<xsl:when test="@decls='H'">MISCELLANEOUS: GOVERNMENT AND HOUSE ORGANS</xsl:when>
102
				<xsl:when test="@decls='J'">LEARNED</xsl:when>
103
				<xsl:when test="@decls='K'">FICTION: GENERAL</xsl:when>
104
				<xsl:when test="@decls='L'">FICTION: MYSTERY</xsl:when>
105
				<xsl:when test="@decls='M'">FICTION: SCIENCE</xsl:when>
106
				<xsl:when test="@decls='N'">FICTION: ADVENTURE</xsl:when>
107
				<xsl:when test="@decls='P'">FICTION: ROMANCE</xsl:when>
108
				<xsl:when test="@decls='R'">HUMOR</xsl:when>				
109
			</xsl:choose>
110
		</xsl:attribute>
111
		<xsl:apply-templates/>
112
		</xsl:copy>
113
	</xsl:template>
114

  
115
<xsl:template match="@type|@pos">
116
	<xsl:attribute name="type">
117
		<xsl:value-of select="translate(.,' *','_')"></xsl:value-of>
118
	</xsl:attribute>
119
</xsl:template>
120
	
121
	<xsl:template match="tei:mw">
122
		<w xmlns="http://www.tei-c.org/ns/1.0">
123
			<xsl:apply-templates select="@*"/>
124
			<xsl:apply-templates/>
125
		</w>
126
	</xsl:template>
127
	
128
	<xsl:template match="tei:c[@type='pct']">
129
		<w xmlns="http://www.tei-c.org/ns/1.0">
130
			<xsl:apply-templates select="@*"/>
131
			<xsl:apply-templates/>
132
		</w>			
133
	</xsl:template>
134

  
135
</xsl:stylesheet>
0 136

  
tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teifrantext-xmlw.xsl (revision 728)
1
<?xml version="1.0"?>
2
<xsl:stylesheet
3
  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
4
  xmlns:edate="http://exslt.org/dates-and-times"
5
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
6
  exclude-result-prefixes="tei edate xd" version="2.0">
7
  
8
  <xsl:import href="txm-filter-teip5-xmlw-preserve.xsl"/>
9
  
10
  <xd:doc type="stylesheet">
11
    <xd:short>
12
      Feuille de style de préparation des fichiers TEI de la Revue
13
      Discours à l'importation TXM dans un format xml simple. 
14
    </xd:short>
15
    <xd:detail>
16
      This stylesheet is free software; you can redistribute it and/or
17
      modify it under the terms of the GNU Lesser General Public
18
      License as published by the Free Software Foundation; either
19
      version 3 of the License, or (at your option) any later version.
20
      
21
      This stylesheet is distributed in the hope that it will be useful,
22
      but WITHOUT ANY WARRANTY; without even the implied warranty of
23
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24
      Lesser General Public License for more details.
25
      
26
      You should have received a copy of GNU Lesser Public License with
27
      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
28
    </xd:detail>
29
    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
30
    <xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
31
  </xd:doc>
32
  
33
  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
34

  
35
  <!--<xsl:variable name="langue"><xsl:value-of select="lower-case(//tei:teiHeader[1]/tei:profileDesc[1]/tei:langUsage[1]/tei:language[1])"/></xsl:variable>-->
36

  
37
<!-- 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 -->
38
  
39
  <xsl:template match="text()">
40
    <xsl:analyze-string select="." regex="&amp;lt;|&amp;gt;|&amp;|&lt;|&gt;|--|\*(\w+)">
41
      <xsl:matching-substring>
42
        <xsl:choose>
43
          <xsl:when test="matches(.,'&amp;lt;')">
44
            <xsl:text>‹</xsl:text>
45
          </xsl:when>
46
          <xsl:when test="matches(.,'&amp;gt;')">
47
            <xsl:text>›</xsl:text>
48
          </xsl:when>
49
          <!--          <xsl:when test="matches(.,'&amp;')">
50
            <!-\-<expan xmlns="http://www.tei-c.org/ns/1.0">and</expan>-\->
51
          	<xsl:text>&amp;amp;</xsl:text>
52
          </xsl:when>-->
53
          <xsl:when test="matches(.,'&lt;')">
54
            <xsl:text>‹</xsl:text>
55
          </xsl:when>
56
          <xsl:when test="matches(.,'&gt;')">
57
            <xsl:text>›</xsl:text>
58
          </xsl:when>
59
          <!-- pose problème si se trouve dans les notes transformés en commentaires xml par le tokeniseur -->
60
          <xsl:when test="matches(.,'--')">
61
            <xsl:text> - </xsl:text>
62
          </xsl:when>
63
          <!-- spécial Frantext!!! -->
64
          <xsl:when test="matches(.,'\*(\w+)')">
65
            <w xmlns="http://www.tei-c.org/ns/1.0" type="maj"><xsl:value-of select="regex-group(1)"/></w>
66
          </xsl:when>
67
          <xsl:otherwise>
68
            <xsl:value-of select="."/>
69
          </xsl:otherwise>
70
        </xsl:choose>
71
      </xsl:matching-substring>
72
      <xsl:non-matching-substring>         
73
        <xsl:value-of select="."/>
74
      </xsl:non-matching-substring>      
75
    </xsl:analyze-string>
76
  </xsl:template>
77
  
78
  <xsl:template match="tei:text">
79
    <xsl:copy>
80
      <xsl:apply-templates/>
81
    </xsl:copy>
82
  </xsl:template>
83
  
84
<xsl:template match="tei:div">
85
  <xsl:copy>
86
    <xsl:attribute name="n"><xsl:value-of select="count(preceding-sibling::tei:div) + 1"/></xsl:attribute>
87
    <xsl:apply-templates select="@*"/>
88
    <xsl:apply-templates/>
89
  </xsl:copy>
90
</xsl:template>
91
  
92
</xsl:stylesheet>
0 93

  
tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-corpusakkadien-xmlw_syllabes.xsl (revision 728)
1
<?xml version="1.0"?>
2
<xsl:stylesheet
3
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
5
 version="2.0">
6
  
7
  <xd:doc type="stylesheet">
8
    <xd:short>
9
      Cette feuille de style permet de préparer les transcriptions de tablettes
10
      d'argile (projet UMR PROCLAC) à l'import XML/W + CSV de TXM en tokenisant
11
      le corpus au niveau des syllabes.
12
      Les propriétés de mots sont projetées vers les propriétés des syllabes (line,
13
      lemma, pos).
14
      Les propriétés unclear et supplied prennent la valeur "yes" si la syllabe se
15
      trouve à l'intérieur de la balise correspondante.
16
    </xd:short>
17
    <xd:detail>
18
      This stylesheet is free software; you can redistribute it and/or
19
      modify it under the terms of the GNU Lesser General Public
20
      License as published by the Free Software Foundation; either
21
      version 3 of the License, or (at your option) any later version.
22
      
23
      This stylesheet is distributed in the hope that it will be useful,
24
      but WITHOUT ANY WARRANTY; without even the implied warranty of
25
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
26
      Lesser General Public License for more details.
27
      
28
      You should have received a copy of GNU Lesser Public License with
29
      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
30
    </xd:detail>
31
    <xd:author>Alexei Lavrentiev, alexei.lavrentev@ens-lyon.fr</xd:author>
32
    <xd:copyright>2014-2015, CNRS / ICAR (équipe CACTUS)</xd:copyright>
33
  </xd:doc>
34
  
35
  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
36
  
37
  <xsl:template match="*">
38
  	<xsl:copy>
39
  		<xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>	
40
  	</xsl:copy>
41
  </xsl:template>
42

  
43
  <xsl:template match="@*|comment()">
44
    <xsl:copy/>
45
  </xsl:template>
46
	
47
	<xsl:template match="processing-instruction()"/>
48
  
49
  <xsl:template match="*[local-name()='teiHeader']"/>
50
  
51
  <xsl:template match="*[local-name()='w']//text()">
52
    <xsl:variable name="line"><xsl:value-of select="ancestor::*[local-name()='w']/@line"/></xsl:variable>
53
    <xsl:variable name="lemma"><xsl:value-of select="ancestor::*[local-name()='w']/@lemma"/></xsl:variable>
54
    <xsl:variable name="pos"><xsl:value-of select="ancestor::*[local-name()='w']/@pos"/></xsl:variable>
55
    <xsl:variable name="word-form"><xsl:value-of select="ancestor::*[local-name()='w']"/></xsl:variable>
56
    <xsl:variable name="unclear">
57
      <xsl:choose>
58
        <xsl:when test="ancestor::*[local-name()='unclear']">yes</xsl:when>
59
        <xsl:otherwise>no</xsl:otherwise>
60
      </xsl:choose>
61
    </xsl:variable>
62
    <xsl:variable name="supplied">
63
      <xsl:choose>
64
        <xsl:when test="ancestor::*[local-name()='supplied']">yes</xsl:when>
65
        <xsl:otherwise>no</xsl:otherwise>
66
      </xsl:choose>
67
    </xsl:variable>
68
    
69
    <xsl:analyze-string select="." regex="[-.]|\([^\)]*\)">
70
      <xsl:matching-substring>
71
        <w line="{$line}" lemma="{$lemma}" pos="{$pos}" word-form="{$word-form}" supplied="{$supplied}" unclear="{$unclear}"><xsl:value-of select="."/></w>
72
      </xsl:matching-substring>
73
      <xsl:non-matching-substring>
74
        <w line="{$line}" lemma="{$lemma}" pos="{$pos}" word-form="{$word-form}" supplied="{$supplied}" unclear="{$unclear}"><xsl:value-of select="."/></w>
75
      </xsl:non-matching-substring>
76
    </xsl:analyze-string>    
77
  </xsl:template>
78

  
79
<xsl:template match="text()[not(ancestor::*[local-name()='w'])]">
80
  <xsl:analyze-string select="." regex="\[…\]">
81
    <xsl:matching-substring>
82
      <w line="¤" lemma="¤" pos="¤" word-form="¤" supplied="¤" unclear="¤"><xsl:value-of select="."/></w>
83
    </xsl:matching-substring>
84
    <xsl:non-matching-substring><xsl:comment><xsl:copy-of select="."/></xsl:comment></xsl:non-matching-substring>
85
  </xsl:analyze-string>
86
</xsl:template>
87

  
88
  <xsl:template match="*[local-name()='w']">
89
  <word>
90
    <xsl:apply-templates select="@*"/>
91
    <xsl:attribute name="no-supplied">
92
      <xsl:choose>
93
        <xsl:when test="ancestor::*[local-name()='supplied']">¤</xsl:when>
94
        <xsl:otherwise><xsl:apply-templates mode="nosupplied"/></xsl:otherwise>
95
      </xsl:choose>
96
    </xsl:attribute>
97
    <xsl:attribute name="no-unclear">
98
      <xsl:choose>
99
        <xsl:when test="ancestor::*[local-name()='supplied'] or ancestor::*[local-name()='unclear']">¤</xsl:when>
100
        <xsl:otherwise><xsl:apply-templates mode="nounclear"/></xsl:otherwise>
101
      </xsl:choose>
102
    </xsl:attribute>    
103
    <xsl:apply-templates/>
104
  </word>
105
</xsl:template>
106

  
107

  
108
</xsl:stylesheet>
0 109

  
tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-perseustreebank-xmlw.xsl (revision 728)
1
<?xml version="1.0"?>
2
<xsl:stylesheet
3
  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
4
  xmlns:edate="http://exslt.org/dates-and-times"
5
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
7
  xmlns:treebank="http://nlp.perseus.tufts.edu/syntax/treebank/1.5"
8
  exclude-result-prefixes="edate xd xsi treebank" version="2.0">
9
  
10
  
11
  <xd:doc type="stylesheet">
12
    <xd:short>
13
      A stylesheet to prepare PERSEUS Treebank XML texts to TXM XML/w import.
14
    </xd:short>
15
    <xd:detail>
16
      This stylesheet is free software; you can redistribute it and/or
17
      modify it under the terms of the GNU Lesser General Public
18
      License as published by the Free Software Foundation; either
19
      version 3 of the License, or (at your option) any later version.
20
      
21
      This stylesheet is distributed in the hope that it will be useful,
22
      but WITHOUT ANY WARRANTY; without even the implied warranty of
23
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24
      Lesser General Public License for more details.
25
      
26
      You should have received a copy of GNU Lesser Public License with
27
      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
28
    </xd:detail>
29
    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
30
    <xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
31
  </xd:doc>
32
  
33

  
34
  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
35
  
36
  <xsl:template match="*">
37
    <xsl:copy>
38
      <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>	
39
    </xsl:copy>
40
  </xsl:template>
41
  
42
  <xsl:template match="@*|comment()">
43
    <xsl:copy/>
44
  </xsl:template>
45
  
46
  <xsl:template match="processing-instruction()"/>
47
  
48
  <xsl:template match="text()"><xsl:value-of select="."/></xsl:template>
49
  
50
<xsl:template match="treebank">
51
  <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)}">
52
    <xsl:apply-templates select="descendant::sentence"/>
53
  </text>
54
</xsl:template>
55

  
56
<xsl:template match="annotator"/>
57
  
58
<xsl:template match="sentence">
59
  <xsl:copy>
60
    <xsl:apply-templates select="@*"/>
61
    <xsl:attribute name="annotator"><xsl:value-of select="child::annotator"/></xsl:attribute>
62
    <xsl:apply-templates/>
63
  </xsl:copy>
64
</xsl:template>
65
  
66
  <xsl:template match="word">
67
    <w>
68
      <xsl:apply-templates select="@*[not(name()='form')]"/>
69
      <xsl:value-of select="@form"></xsl:value-of>
70
    </w>
71
  </xsl:template>
72

  
73
</xsl:stylesheet>
0 74

  
tmp/trunk/org.txm.setups/shared/all/xsl/txm-filter-teip5-teibfm.xsl (revision 728)
1
<?xml version="1.0"?>
2
<xsl:stylesheet
3
  xmlns:xd="http://www.pnp-software.com/XSLTdoc"
4
  xmlns:edate="http://exslt.org/dates-and-times"
5
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0"
6
  exclude-result-prefixes="tei edate xd" version="2.0">
7
  
8
  <xd:doc type="stylesheet">
9
    <xd:short>
10
      Feuille de style de préparation de fichiers TEI P5 à l'importation 
11
      dans TXM. Permet de simplifier la structure du document afin
12
      d'optimiser les index CWB
13
    </xd:short>
14
    <xd:detail>
15
      This stylesheet is free software; you can redistribute it and/or
16
      modify it under the terms of the GNU Lesser General Public
17
      License as published by the Free Software Foundation; either
18
      version 3 of the License, or (at your option) any later version.
19
      
20
      This stylesheet is distributed in the hope that it will be useful,
21
      but WITHOUT ANY WARRANTY; without even the implied warranty of
22
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23
      Lesser General Public License for more details.
24
      
25
      You should have received a copy of GNU Lesser Public License with
26
      this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
27
    </xd:detail>
28
    <xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
29
    <xd:copyright>2012, CNRS / ICAR (ICAR3 LinCoBaTO)</xd:copyright>
30
  </xd:doc>
31
  
32

  
33
  <xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no"/>
34
  
35
  <!--
36
    Modifications par AL le  2012-01-25
37
    g dépalacé de "deleteAll" vers "deleteTag"
38
    classe de balise "name" créée
39
    (geogName, placeName, persName et name)
40
  -->
41
  
42
  <!-- 
43
    Modifications par LBe le 2012-02-17
44
    Transformation automatique des esperluettes dans les métadonnées
45
    Suppression des balises label et heraldry
46
    Signed n'est plus transformé en ab
47
    opener est transformé en ab
48
    L'institution et le dépôt sont récupérés pour le lieu de conservation
49
  -->
50
  
51
  <!-- Modifications par AL le 2012-02-20
52
    rolename -> roleName
53
    suppression des balises surname et forename
54
  -->
55
  
56
  <!-- Modifications par LBe le 2012-03-09
57
    Automatisation du nommage des sorties
58
  -->
59
  
60
  <!-- Listes des balises par type de traitement (les templates sont plus bas) -->
61
  
62
  <!-- balises à supprimer avec leur contenu -->
63
  <xsl:template match="tei:figDesc|tei:figure|tei:fw|tei:g
64
    |tei:space|tei:titlePage ">
65
    <xsl:call-template name="deleteAll"/>
66
  </xsl:template>
67
  
68
  <!-- balises à supprimer, contenu à conserver -->  
69
  <xsl:template match="tei:add|tei:app
70
    |tei:caesura|tei:castItem|tei:castGroup[ancestor::tei:castList]
71
    |tei:castList[ancestor::tei:p]|tei:cell|tei:choice|tei:cit|tei:corr|tei:date|tei:ex
72
    |tei:forename|tei:g|tei:head[parent::tei:list]|tei:heraldry|tei:hi|tei:item|tei:label|tei:lem
73
    |tei:list[ancestor::tei:p|ancestor::tei:ab]|tei:lg[child::tei:lg|ancestor::tei:sp]
74
    |tei:p[ancestor::tei:sp]|tei:performance
75
    |tei:ref|tei:reg|tei:role|tei:roleDesc
76
    |tei:row|tei:salute|tei:signed[ancestor::tei:closer]|tei:speaker|tei:stage[ancestor::tei:p|ancestor::tei:ab]
77
    |tei:surname|tei:table[ancestor::tei:p]|tei:subst|tei:term|tei:unclear">
78
    <xsl:call-template name="deleteTag"/>
79
  </xsl:template>
80
  
81
  <!-- balises à transformer en notes-->
82
  <xsl:template match="tei:abbr[parent::tei:choice and not(ancestor::tei:note)]
83
    |tei:bibl[not(ancestor::tei:note)]
84
    |tei:del
85
    |tei:orig[parent::tei:choice and not(ancestor::tei:note)]    
86
    |tei:rdg[parent::tei:app and not(ancestor::tei:note)]
87
    |tei:sic[parent::tei:choice and not(ancestor::tei:note)]
88
    |tei:surplus[not(ancestor::tei:w)]">
89
    <xsl:call-template name="makeNote"/>
90
  </xsl:template>
91
  
92
  <!-- balises de noms à indexer -->
93
  
94
  <xsl:template match="tei:name
95
    |tei:geogName
96
    |tei:persName
97
    |tei:placeName
98
    |tei:roleName
99
    |tei:orgName">
100
    <xsl:call-template name="makeName"/>
101
  </xsl:template>
102
  
103
  <!-- à transformer en W -->
104
  
105
  <xsl:template match="tei:abbr[not(parent::tei:choice)]
106
    |tei:expan
107
    |tei:num[matches(.,'.')]">
108
    <xsl:call-template name="makeWord"/>
109
  </xsl:template>
110
  
111
  <!-- à transformer en AB typé -->
112
  
113
  <xsl:template match="tei:byline|tei:lg[not(child::tei:lg or ancestor::tei:sp)]|tei:list[not(ancestor::tei:p|ancestor::tei:ab)]
114
    |tei:closer|tei:opener|tei:sp|tei:castGroup[not(ancestor::tei:castList)]|tei:castList[not(ancestor::tei:p)]
115
    |tei:signed[not(ancestor::tei:closer)]
116
    |tei:stage[not(ancestor::tei:p|ancestor::tei:ab)]
117
    |tei:table[not(ancestor::tei:p)]
118
    |tei:trailer">
119
    <xsl:call-template name="makeAb"/>
120
  </xsl:template>
121
  
122
  <!-- à transformer en DIV typé -->
123
  
124
  <xsl:template match="tei:set">
125
    <xsl:call-template name="makeDiv"/>
126
  </xsl:template>
127

  
128
<!-- Partie générale : on copie les éléments, les attributs, le texte, les commentaires, on supprime mes prrocessing intstructions -->
129

  
130
<!--  <xsl:template match="/">
131
      <xsl:apply-templates/>  
132
  </xsl:template>
133
-->
134
  
135
  <xsl:template match="*">    
136
    <xsl:choose>
137
      <xsl:when test="namespace-uri()=''">
138
        <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="{local-name(.)}">
139
          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
140
        </xsl:element>
141
      </xsl:when>
142
      <xsl:otherwise>
143
        <xsl:copy>
144
          <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
145
        </xsl:copy>
146
      </xsl:otherwise>
147
    </xsl:choose>  
148
  </xsl:template>
149

  
150
  <xsl:template match="@*|comment()">
151
    <xsl:copy/>
152
  </xsl:template>
153

  
154
  <xsl:template match="text()">
155
    <xsl:analyze-string select="." regex="&amp;|&lt;|&gt;|--|\*(\w+)">
156
      <xsl:matching-substring>
157
        <xsl:choose>
158
          <xsl:when test="matches(.,'&amp;')">
159
            <expan xmlns="http://www.tei-c.org/ns/1.0">et</expan>
160
          </xsl:when>
161
          <xsl:when test="matches(.,'&lt;')">
162
            <xsl:text>[</xsl:text>
163
          </xsl:when>
164
          <xsl:when test="matches(.,'&gt;')">
165
            <xsl:text>]</xsl:text>
166
          </xsl:when>
167
          <!-- pose problème si se trouve dans les notes transformés en commentaires xml par le tokeniseur -->
168
          <xsl:when test="matches(.,'--')">
169
            <xsl:text> - </xsl:text>
170
          </xsl:when>
171
<!--          <!-\- Spécial FRANTEXT -\->
172
          <xsl:when test="matches(.,'\*(\w+)')">
173
            <name xmlns="http://www.tei-c.org/ns/1.0" type="maj"><xsl:value-of select="regex-group(1)"/></name>        		
174
          </xsl:when>          -->
175
          <xsl:otherwise>
176
            <xsl:value-of select="."/>
177
          </xsl:otherwise>
178
        </xsl:choose>
179
      </xsl:matching-substring>
180
      <xsl:non-matching-substring>         
181
        <xsl:value-of select="."/>
182
      </xsl:non-matching-substring>      
183
    </xsl:analyze-string>
184
  </xsl:template>
185
  
186

  
187
  <xsl:template match="processing-instruction()"/>
188

  
189
<!-- On ne touche pas au teiHeader -->
190
  
191
  <xsl:template match="tei:teiHeader">    
192
      <xsl:copy-of select="."/>    
193
  </xsl:template>
194

  
195
<!-- On supprime les balises et tout ce qu'elles contiennent pour les éléments hors texte à ignorer lors de l'import -->
196
  
197
  <xsl:template name="deleteAll"/>
198

  
199
<!-- On supprime les balises non essentielles pour l'exploitation textométrique et susceptibles de poser des problèmes au tokeniseur,
200
  mais on garde leur contenu qui fait partie du matériau textuel -->
201
  
202
  <xsl:template name="deleteTag">
203
    <xsl:apply-templates/>
204
  </xsl:template>
205

  
206
<!-- on met en note les éléments hors texte qu'on aimerait garder pour l'édition, etc. -->
207
  
208
  <xsl:template name="makeNote">
209
    <note type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
210
      <xsl:apply-templates select="text()"/>
211
    </note>
212
  </xsl:template>
213
  
214
<!-- On supprime toutes les balises à l'intérieur des notes-->
215
  <xsl:template match="tei:note">
216
    <xsl:copy>
217
      <xsl:apply-templates select="text()"/>
218
    </xsl:copy>
219
  </xsl:template>
220

  
221
<!-- On transforme en DIV typés les balises de niveau de division textuelle (pouvant contenir des p) -->
222

  
223
  <xsl:template name="makeDiv">
224
    <div type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
225
      <xsl:copy-of select="@*"/>
226
      <xsl:apply-templates/>
227
    </div>
228
  </xsl:template>  
229

  
230
<!-- On transforme en bloc anonyme les balises de niveau équivalent au paragraphe -->
231

  
232
  <xsl:template name="makeAb">
233
    <ab type="{local-name()}" xmlns="http://www.tei-c.org/ns/1.0">
234
      <xsl:copy-of select="@*"/>
235
      <xsl:apply-templates/>
236
    </ab>
237
  </xsl:template>
238

  
239
  <!-- on pré-tokenise les éléments équivalents à un mot -->
240
  
241
  <xsl:template name="makeWord">
242
    <xsl:variable name="wordType">
243
      <xsl:choose>
244
        <xsl:when test="@type">
245
          <xsl:value-of select="concat(local-name(),'-',@type)"/>
246
        </xsl:when>
247
        <xsl:otherwise>
248
          <xsl:value-of select="local-name()"></xsl:value-of>
249
        </xsl:otherwise>
250
      </xsl:choose>
251
    </xsl:variable>
252
    <xsl:choose>
253
      <xsl:when test="descendant::tei:w or ancestor::tei:w">
254
<!--            <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="seg">
255
              <xsl:attribute name="type"><xsl:value-of select="local-name(.)"/></xsl:attribute>
256
              <xsl:apply-templates select="*|@*[not(name()='type')]|processing-instruction()|comment()|text()"/>
257
            </xsl:element>
258
-->
259
        <xsl:apply-templates/> <!-- on supprime ces balises pour éviter la réduplication des mots-->
260
      </xsl:when>
261
      <xsl:otherwise>
262
        <w type="{$wordType}" xmlns="http://www.tei-c.org/ns/1.0"><xsl:apply-templates/></w>
263
      </xsl:otherwise>
264
    </xsl:choose>    
265
  </xsl:template>  
266

  
267
<xsl:template name="makeName">
268
  <xsl:variable name="nameType">
269
    <xsl:choose>
270
      <xsl:when test="@type">
271
        <xsl:choose>
272
          <xsl:when test="local-name()='name'"><xsl:value-of select='@type'/></xsl:when>
273
          <xsl:otherwise><xsl:value-of select="concat(local-name(),'-',@type)"/></xsl:otherwise>
274
        </xsl:choose>
275
      </xsl:when>
276
      <xsl:otherwise>
277
        <xsl:value-of select="local-name()"></xsl:value-of>
278
      </xsl:otherwise>
279
    </xsl:choose>
280
  </xsl:variable>
281
  <name type="{$nameType}" xmlns="http://www.tei-c.org/ns/1.0">
282
    <xsl:apply-templates/>
283
  </name>
284
</xsl:template>
285

  
286
<!-- les l sont transformés en lb -->
287
  
288
  <xsl:template match="tei:l">
289
    <lb xmlns="http://www.tei-c.org/ns/1.0">
290
      <xsl:if test="@n">
291
        <xsl:attribute name="n"><xsl:value-of select="@n"/></xsl:attribute>
292
      </xsl:if>
293
    </lb>
294
    <xsl:apply-templates/>
295
  </xsl:template>
296
  
297

  
298
<!-- On met la ponctuation forte à l'extérieur de la balise foreign :
299
Cet élément sera toujours à l'intérieur d'une phrase. Attention au risque
300
de perdre les balises éventuelles à l'intérieur-->
301
  
302
  <xsl:template
303
    match="tei:foreign[not(contains(@rend,'multi_s'))][matches(.,'[.!?]')]">
304
    <xsl:variable name="lang">
305
      <xsl:choose>
306
        <xsl:when test="@lang"><xsl:value-of select="@lang"/></xsl:when>
307
        <xsl:when test="@xml:lang"><xsl:value-of select="@xml:lang"/></xsl:when>
308
        <xsl:otherwise>xx</xsl:otherwise>
309
      </xsl:choose>
310
    </xsl:variable>
311
    <xsl:for-each select="child::node()">
312
      <xsl:choose>
313
        <xsl:when test="self::text()">
314
          <xsl:analyze-string select="." regex="([^.!?]*)([.?!]+)">
315
            <xsl:matching-substring>
316
              <xsl:element name="foreign" namespace="http://www.tei-c.org/ns/1.0">
317
                <xsl:attribute name="lang"><xsl:value-of select="$lang"/></xsl:attribute>
318
                <xsl:analyze-string select="regex-group(1)" regex="&amp;">
319
                  <xsl:matching-substring><expan xmlns="http://www.tei-c.org/ns/1.0">et</expan></xsl:matching-substring>
320
                  <xsl:non-matching-substring>         
321
                    <xsl:value-of select="."/>
322
                  </xsl:non-matching-substring>      
323
                </xsl:analyze-string>
324
              </xsl:element>
325
              <xsl:value-of select="regex-group(2)"/>
326
              <xsl:text> </xsl:text>
327
            </xsl:matching-substring>
328
            <xsl:non-matching-substring>
329
              <xsl:analyze-string select="." regex="&amp;">
330
                <xsl:matching-substring><expan xmlns="http://www.tei-c.org/ns/1.0">et</expan></xsl:matching-substring>
331
                <xsl:non-matching-substring>         
332
                  <xsl:value-of select="."/>
333
                </xsl:non-matching-substring>      
334
              </xsl:analyze-string>              
335
            </xsl:non-matching-substring>
336
          </xsl:analyze-string>          
337
        </xsl:when>
338
        <xsl:when test="self::*[not(descendant::text())]">
339
          <xsl:apply-templates/>
340
        </xsl:when>
341
        <xsl:otherwise>
342
          <xsl:element name="foreign" namespace="http://www.tei-c.org/ns/1.0">
343
            <xsl:attribute name="lang"><xsl:value-of select="$lang"/></xsl:attribute>
344
            <xsl:apply-templates select="."/>          
345
          </xsl:element>
346
        </xsl:otherwise>
347
      </xsl:choose>
348
    </xsl:for-each>
349
  </xsl:template>
350
  
351
  
352
  <xsl:template name="persname">
353
      <xsl:choose>
354
         <xsl:when test="tei:surname"><xsl:value-of select="tei:forename"/>&#160;<xsl:value-of select="tei:surname"/></xsl:when>
355
         <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
356
      </xsl:choose>
357
   </xsl:template>
358
  
359
  
360
<!--  <!-\- traitement spécifique anciennes étiquettes bfm -\->
361
  <xsl:template match="tei:w/@type[contains(.,'_')]">
362
    <xsl:attribute name="type"><xsl:value-of select="substring-before(.,'_')"/></xsl:attribute>
363
  </xsl:template>
364
-->
365
</xsl:stylesheet>
0 366

  
tmp/trunk/org.txm.setups/shared/all/xsl/txm-edition-xtz-corpusakkadien-translit.xsl (revision 728)
1
<?xml version="1.0"?>
2
<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
3
	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"
4
	exclude-result-prefixes="#all" version="2.0">
5
	
6
	<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"/>
7
	
8
	<xsl:strip-space elements="*"/>
9
	
10
	<xsl:param name="editionpagetag">pb</xsl:param>
11
	
12
	<xsl:param name="textcontainer">text</xsl:param>
13
	
14
	<!--<xsl:param name="frontmatter"></xsl:param>
15
	
16
	<xsl:param name="backmatter">back</xsl:param>-->
17
	
18
	<xsl:variable name="inputtype">
19
		<xsl:choose>
20
			<xsl:when test="//tei:w//txm:form">xmltxm</xsl:when>
21
			<xsl:otherwise>xmlw</xsl:otherwise>
22
		</xsl:choose>
23
	</xsl:variable>
24
	
25
	<xsl:template match="/">
26
		<html>
27
			<head>
28
				<title><xsl:value-of select="//tei:text[1]/@id"/></title>
29
				<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
30
			</head>
31
			<body>
32
				<a class="txm-page" title="1"/>
33
				<div class="metadata-page">
34
					<h1><xsl:value-of select="//tei:text[1]/@id"></xsl:value-of></h1>
35
					<br/>
36
					<table>
37
						<xsl:for-each select="//tei:text[1]/@*">
38
							<tr>
39
								<td><xsl:value-of select="name()"/></td>
40
								<td><xsl:value-of select="."/></td>
41
							</tr>
42
						</xsl:for-each>
43
					</table>
44
					<br/>
45
					<br/>
46
				</div>
47
				<xsl:apply-templates select="descendant::*[local-name()=$textcontainer]"/>
48
				
49
				
50
			</body>
51
		</html>
52
	</xsl:template>
53
	
54
	<xsl:template match="//*[local-name()=$textcontainer]">
55
		<xsl:variable name="pbcount"></xsl:variable>
56
		
57
		<div class="text" style="margin-left:60px;">
58
			<xsl:apply-templates/>
59
		</div>
60
	</xsl:template>
61
	
62
		
63
	
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff