Bonjour,
je sais que la question a déjà été posée mais j'ai essayé les solution proposée mais ca ne marche pas.
Voilà, lorsque je veux récupérer mon document XML, responseXML.documentElement = null
responseXML existe bien ([object]) mais est complètement vide.
Voilà comment je construis et envoie mon XML :
note : responseText est correctement rempli.
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 StringBuilder strXML = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); strXML.Append("<selectChoice>"); strXML.Append("<selectElement>"); strXML.Append("<formName>"+strForm+"</formName>"); strXML.Append("<formElem>" + strElem + "</formElem>"); strXML.Append("</selectElement>"); if (listExperts.Length > 0) { strXML.Append("<entry>"); strXML.Append("<optionText>Choisissez un expert</optionText>"); strXML.Append("<optionValue>-1</optionValue>"); strXML.Append("</entry>"); foreach (SCollaborateur c in listExperts) //Mon objet collaborateur { strXML.Append("<entry>"); strXML.Append("<optionText>" + c.FullName + "</optionText>"); strXML.Append("<optionValue>" + c.Id + "</optionValue>"); strXML.Append("</entry>"); } } else { strXML.Append("<entry>"); strXML.Append("<optionText>Il y a pas experts</optionText>"); strXML.Append("<optionValue>-1</optionValue>"); strXML.Append("</entry>"); } strXML.Append("</selectChoice>"); Response.AddHeader("Content-Type","text/xml"); Response.Write(strXML.ToString());
Partager