Bonjour,
j'ai un document txt et je veux créer un fichier xml mais j'ai pas pu récupérer des valeurs.
voici une partie de mon doc txt
(آذار)
الشهر السادس من الشهور السريانية يقابله مارس من الشهور الرومية الميلادية
( الآذريون )
نبات زهري خريفي زهره أصفر أو أحمر ذهبي في وسطه خمل أسود و هو من فصيلة المركبات الأنبوبية من جنس كاندولا
je veux cette resultat:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
<LexicalEntry>
    <Lemma>
      <Feat att="writtenForm" val=" آذار" />
    </Lemma>
    <WordForm>
      <Feat att="writtenForm" val=" آذار" />
    </WordForm>
    <Sense>
      <Definition>
        <Feat att="text" val=" الشهر السادس من الشهور السريانية يقابله مارس من الشهور الرومية الميلادية
" />
      </Definition>
    </Sense>
  </LexicalEntry>
  <LexicalEntry>
    <Lemma>
      <Feat att="writtenForm" val=" الآذريون " />
    </Lemma>
    <WordForm>
      <Feat att="writtenForm" val=" الآذريون " />
    </WordForm>
    <Sense>
      <Definition>
        <Feat att="text" val=" نبات زهري خريفي زهره أصفر أو أحمر ذهبي في وسطه خمل أسود و هو من فصيلة المركبات الأنبوبية من جنس كاندولا
" />
      </Definition>
    </Sense>
  </LexicalEntry>
  <LexicalEntry>
j'ai pas pu recuperer valeur de la balise definition
voici mon code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
 
 public void corpus()
 
	{ 
		try
		   {
		    	InputStream ips=new FileInputStream("t.txt"); 
		    	 System.out.println("ssss");
		    	InputStreamReader ipsr=new InputStreamReader(ips);
			    BufferedReader br=new BufferedReader(ipsr);
			    while ((ligne=br.readLine())!=null)
 			     {   
 				   try
 	        	     { 
 			    		lemme=ligne.substring(ligne.indexOf("(")+1, ligne.indexOf(")")-1);
 			            System.out.println("lemmme   "+lemme);
 			    	    StringTokenizer st = new StringTokenizer(ligne,"()");
 			             while (st.hasMoreTokens())
 			              {
 			        	   sens=st.nextToken();
 			        		System.out.println("defintion  "+sens);
 			        		fichierxml( lemme, sens);
 			              }
 			          }
 			        	catch (StringIndexOutOfBoundsException e){}
 			        	catch(NoSuchElementException e){}
			    }}
		  catch (Exception e)
		   {
		   System.out.println(e.toString());
		   }
	}
	public void fichierxml(String lemme,String sens)
	{
		Element lexical = new Element("LexicalEntry");
	    racine.addContent(lexical);
 
	    Element lemma = new Element("Lemma");
	    lexical.addContent(lemma);
        Element feat=new Element("Feat");
        Attribute att = new Attribute("att","writtenForm");
        feat.setAttribute(att);
        Attribute val = new Attribute("val",lemme);
        feat.setAttribute(val);
        lemma.addContent(feat);
 
        Element WordForm = new Element("WordForm");
	    lexical.addContent(WordForm);
        Element feat1=new Element("Feat");
        Attribute att1 = new Attribute("att","writtenForm");
        feat1.setAttribute(att1);
        Attribute val1 = new Attribute("val",lemme);
        feat1.setAttribute(val1);
        WordForm.addContent(feat1);
 
        Element Sense = new Element("Sense");
	    lexical.addContent(Sense);
	    Element Definition = new Element("Definition");
	    Sense.addContent(Definition);
        Element feat2=new Element("Feat");
        Attribute att2 = new Attribute("att","text");
        feat2.setAttribute(att2);
        Attribute val2 = new Attribute("val",sens);
        feat2.setAttribute(val2);
        Definition.addContent(feat2);
	}
svp j'ai besoin d'aide.uuuuurgent