Révision 2342

tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 2342)
1924 1924
	 * @return the full path
1925 1925
	 */
1926 1926
	public String getFullPathSimpleName() {
1927
		return getFullPathSimpleName(true);
1928
	}
1929
	
1930
	/**
1931
	 * Gets a string representing the concatenation of the simple names of the branch of this result.
1932
	 * 
1933
	 * @param showTypes display the result type as well
1934
	 * @return the full path
1935
	 */
1936
	public String getFullPathSimpleName(boolean showTypes) {
1927 1937

  
1928 1938
		// fill the branch
1929 1939
		List<TXMResult> branch = new ArrayList<TXMResult>();
......
1936 1946
		// create the reversed string
1937 1947
		StringBuilder b = new StringBuilder();
1938 1948
		for (int i = branch.size() - 1; i >= 0; i--) {
1939
			b.append("[" + branch.get(i).getClass().getSimpleName() + ": \"" + branch.get(i).getSimpleName() + "\"] / "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
1949
			if (showTypes) {
1950
				b.append("[\"" + branch.get(i).getClass().getSimpleName() + ": \"" + branch.get(i).getSimpleName() + "\"] / "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
1951
			} else {
1952
				b.append("[\"" + branch.get(i).getSimpleName() + "\"] / "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
1953
			}
1940 1954
		}
1941 1955
		b.deleteCharAt(b.length() - 3);
1942 1956
		b.deleteCharAt(b.length() - 2);
tmp/org.txm.core/res/org/txm/xml/xsl/txm-front-teitxm2xmlw.xsl (revision 2342)
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="tei edate" version="2.0">
5
  
6
<!--
7
Copyright © 2019 ENS de Lyon, CNRS, University of Franche-Comté
8
Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
9
@author Alexei Lavrentiev
10
-->
11
  
12
  <!-- This stylesheet converts TEI-TXM files to the format compatible with 
13
    XML TEI Zero (XTZ) and XML/w import modules.
14
    All annotations encoded as txm:ana elements are converted to attributes of
15
    w elements. Customize the annotationsToKeep parameter to select the annotations 
16
    to keep.
17
  -->
18
  
19
                
20
                
21
                <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="yes"/>
22
                
23
                <xsl:strip-space elements="*"/>
24
                
25
                                
26
                <!-- provide the names of annotations to keep in the form of a regular expression, e.g. pos|lemma -->
27
                <xsl:param name="annotationsToKeep">.*</xsl:param>
28
                
29
                <xsl:variable name="filename">
30
                                <xsl:analyze-string select="document-uri(.)" regex="/([^/.]+)\.[^/.]*$">
31
                                                <xsl:matching-substring>
32
                                                                <xsl:value-of select="regex-group(1)"/>
33
                                                </xsl:matching-substring>
34
                                </xsl:analyze-string>
35
                </xsl:variable>
36
                               
37
<!--                <xsl:variable name="filedir">
38
                                <xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)$">
39
                                                <xsl:matching-substring>
40
                                                                <xsl:value-of select="regex-group(1)"/>
41
                                                </xsl:matching-substring>
42
                                </xsl:analyze-string>
43
                </xsl:variable>-->
44
                
45
                
46
                
47
                
48
                <xsl:template match="*">
49
                                <xsl:choose>
50
                                                <xsl:when test="namespace-uri()=''">
51
                                                                <xsl:element namespace="http://www.tei-c.org/ns/1.0" name="{local-name(.)}">
52
                                                                                <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
53
                                                                </xsl:element>
54
                                                </xsl:when>
55
                                                <xsl:otherwise>
56
                                                                <xsl:copy>
57
                                                                                <xsl:apply-templates select="*|@*|processing-instruction()|comment()|text()"/>
58
                                                                </xsl:copy>
59
                                                </xsl:otherwise>
60
                                </xsl:choose>
61
                </xsl:template>
62
                
63
                <xsl:template match="@*|processing-instruction()|comment()">
64
                                <xsl:copy/>
65
                </xsl:template>
66
                
67
                <xsl:template match="text()">
68
                                <xsl:value-of select="normalize-space(.)"/>
69
                </xsl:template>
70
                
71
                <xsl:template match="tei:w">
72
                                <xsl:element name="w" namespace="http://www.tei-c.org/ns/1.0">
73
                                                <xsl:for-each select="descendant::txm:ana[matches(@type,concat('^#(',$annotationsToKeep,')$'))]">
74
                                                                <xsl:attribute name="{substring(@type,2)}"><xsl:value-of select="normalize-space(.)"/></xsl:attribute>
75
                                                </xsl:for-each>
76
                                                <xsl:attribute name="xml:id"><xsl:value-of select="@*[local-name()='id'][1]"/></xsl:attribute>
77
                                                <!-- decomment the line below to keep the attributes of words from XML-TEI TXM file -->
78
                                                <!--<xsl:copy-of select="@*"/>-->
79
                                                <xsl:apply-templates select="txm:form"/>
80
                                </xsl:element>
81
                </xsl:template>
82
                
83
                <xsl:template match="txm:form">
84
                                <xsl:apply-templates/>
85
                </xsl:template>
86
                
87
</xsl:stylesheet>
0 88

  

Formats disponibles : Unified diff