Bonjour,

Je doit réaliser un page me sortant a partir d'une BDD des résultats du style :
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
 
<?xml version="1.0" encoding="UTF-8" ?>
<a:feed xmlns:a="http://www.w3.org/2005/Atom" xmlns="http://www.w3.org/1999/xhtml">
  <a:title type="xhtml">
    <div>
      <span class="flux">FLUX XML</span>
    </div>
  </a:title>
  <a:id>http://LIENVERS LE XML</a:id>
  <a:updated>2012-09-13T12:01:51Z</a:updated>
  <a:author>
    <a:name>RESULTAT XML</a:name>
  </a:author>
  <a:entry>
    <a:title type="xhtml">
    	<div class="enveloppe">
    	    ....      	
    	</div> 
    </a:title>
  </a:entry>
</a:feed>
....
Pour tester, j'ai fait cela en utisant Zend :
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
 
		$this->getResponse()->clearHeaders();
		$this->getResponse()->setHeader('Content-Type', 'text/xml');
 
		// Instance de la class DomDocument
		$doc = new DOMDocument();
 
		// Definition de la version et l'encodage
		$doc->version = '1.0';
		$doc->encoding = 'utf-8';
 
		// Ajout d'un commentaire a la racine
		$comment_elt = $doc->createComment('Créé par Prénom NOM (email)');
		$doc->appendChild($comment_elt);
 
		// Ajout la balise 'note' a la racine
		$note_elt = $doc->createElement('note');
		$doc->appendChild($note_elt);
 
		// Creation des elements 'to' 'from' 'heading' 'body'
		$to_elt      = $doc->createElement('to', 'Nicolas');
		$from_elt    = $doc->createElement('from', 'Carla');
		$heading_elt = $doc->createElement('heading', 'Rappel');
 
		// Pas de contenu pour l'instant pour cet element car on desir y mettre une balise CDATA
		$body_elt = $doc->createElement('body');
 
		// Specifier que les elements to/from/heading/body sont dans 'note'
		$note_elt->appendChild($to_elt);
		$note_elt->appendChild($from_elt);
		$note_elt->appendChild($heading_elt);
		$note_elt->appendChild($body_elt);
 
		// Creation d'une section CDATA
		$body_cdata_elt = $doc->createCDATASection("N'oublie pas tes talonnettes");
 
		// Placement de cette section entre les balises <body> et </body>
		$body_elt->appendChild($body_cdata_elt);
 
		// Rendre Joli ;)
		$doc->formatOutput = true;
 
		// Afficher le document XML
		$this->view->xml = $doc->saveXML();
J'obtient dans le navigateur, c'est qu'un exemple pour voir :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
 
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<!-- Créé par Prénom NOM (email) -->
<note>
<to>Nicolas</to>
<from>Carla</from>
<heading>Rappel</heading>
<body>
<![CDATA[ N'oublie pas tes talonnettes ]]>
</body>
</note>
Es-ce normal que j'obtienne : This XML file does not appear to have any style information associated with it. The document tree is shown below.

au dessus ?

Merci