Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > JavaScript > Bibliothèques & Frameworks > jQuery
jQuery Forum d'entraide sur le framework jQuery. Avant de poster : Tutoriels jQuery, FAQ jQuery, Tous les tutoriels JavaScript, Toutes les FAQ JavaScript
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 16/08/2011, 18h39   #1
Membre habitué
 
Homme
Étudiant
Inscription : mai 2011
Messages : 226
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : mai 2011
Messages : 226
Points : 126
Points : 126
Par défaut interprétation xml moche

Bonjour,

A la suite d'une requête de type PROPFIND, je récupère un xml tout moche que je n'arrive pas à parser :

Code :
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<D:multistatus xmlns:D="DAV:">
        <D:response xmlns:lp1="DAV:" xmlns:lp2="http://apache.org/dav/props/">
            <D:href>/dav/storage/www.ungproject.com/</D:href>
            <D:propstat>
                <D:prop>
                    <lp1:resourcetype>
                        <D:collection></D:collection>
                    </lp1:resourcetype>
                    <lp1:creationdate>2011-08-16T09:01:53Z</lp1:creationdate>
                    <lp1:getlastmodified>Tue, 16 Aug 2011 09:01:53 GMT</lp1:getlastmodified>
                    <lp1:getetag>"111e80-1000-4aa9ba18b716d"</lp1:getetag>
                    <D:supportedlock>
                        <D:lockentry>
                            <D:lockscope>
                                <D:exclusive></D:exclusive>
                            </D:lockscope>
                            <D:locktype>
                                <D:write></D:write>
                            </D:locktype>
                        </D:lockentry>
                        <D:lockentry>
                            <D:lockscope>
                                <D:shared></D:shared>
                            </D:lockscope>
                            <D:locktype>
                                <D:write></D:write>
                            </D:locktype>
                        </D:lockentry>
                    </D:supportedlock>
                    <D:lockdiscovery></D:lockdiscovery>
                    <D:getcontenttype>httpd/unix-directory</D:getcontenttype>
                </D:prop>
                <D:status>HTTP/1.1 200 OK</D:status>
            </D:propstat>
        </D:response>
        <D:response xmlns:lp1="DAV:" xmlns:lp2="http://apache.org/dav/props/">
            <D:href>/dav/storage/www.ungproject.com/1313168464706</D:href>
            <D:propstat>
                <D:prop>
                    <lp1:resourcetype></lp1:resourcetype>
                    <lp1:creationdate>2011-08-12T17:00:56Z</lp1:creationdate>
                    <lp1:getcontentlength>208</lp1:getcontentlength>
                    <lp1:getlastmodified>Fri, 12 Aug 2011 17:00:56 GMT</lp1:getlastmodified>
                    <lp1:getetag>"11253b-d0-4aa51db5ab821"</lp1:getetag>
                    <lp2:executable>F</lp2:executable>
                    <D:supportedlock>
                        <D:lockentry>
                            <D:lockscope>
                                <D:exclusive></D:exclusive>
                            </D:lockscope>
                            <D:locktype>
                                <D:write></D:write>
                            </D:locktype>
                        </D:lockentry>
                        <D:lockentry>
                            <D:lockscope>
                                <D:shared></D:shared>
                            </D:lockscope>
                            <D:locktype>
                                <D:write></D:write>
                            </D:locktype>
                        </D:lockentry>
                    </D:supportedlock>
                    <D:lockdiscovery></D:lockdiscovery>
                </D:prop>
                <D:status>HTTP/1.1 200 OK</D:status>
            </D:propstat>
        </D:response>
        <D:response xmlns:lp1="DAV:" xmlns:lp2="http://apache.org/dav/props/">
            <D:href>/dav/storage/www.ungproject.com/1313168465680</D:href>
            <D:propstat>
                <D:prop>
                    <lp1:resourcetype></lp1:resourcetype>
                    <lp1:creationdate>2011-08-12T17:04:23Z</lp1:creationdate>
                    <lp1:getcontentlength>355</lp1:getcontentlength>
                    <lp1:getlastmodified>Fri, 12 Aug 2011 17:04:23 GMT</lp1:getlastmodified>
                    <lp1:getetag>"112526-163-4aa51e7bcc361"</lp1:getetag>
                    <lp2:executable>F</lp2:executable>
                    <D:supportedlock>
                        <D:lockentry>
                            <D:lockscope>
                                <D:exclusive></D:exclusive>
                            </D:lockscope>
                            <D:locktype>
                                <D:write></D:write>
                            </D:locktype>
                        </D:lockentry>
                        <D:lockentry>
                            <D:lockscope>
                                <D:shared></D:shared>
                            </D:lockscope>
                            <D:locktype>
                                <D:write></D:write>
                            </D:locktype>
                        </D:lockentry>
                    </D:supportedlock>
                    <D:lockdiscovery></D:lockdiscovery>
                </D:prop>
                <D:status>HTTP/1.1 200 OK</D:status>
            </D:propstat>
        </D:response>
        <D:response xmlns:lp1="DAV:" xmlns:lp2="http://apache.org/dav/props/">
            <D:href>/dav/storage/www.ungproject.com/1313168467756</D:href>
            <D:propstat>
                <D:prop>
                    <lp1:resourcetype></lp1:resourcetype>
                    <lp1:creationdate>2011-08-12T17:01:39Z</lp1:creationdate>
                    <lp1:getcontentlength>394</lp1:getcontentlength>
                    <lp1:getlastmodified>Fri, 12 Aug 2011 17:01:39 GMT</lp1:getlastmodified>
                    <lp1:getetag>"11252b-18a-4aa51ddeae881"</lp1:getetag>
                    <lp2:executable>F</lp2:executable>
                    <D:supportedlock>
                        <D:lockentry>
                            <D:lockscope>
                                <D:exclusive></D:exclusive>
                            </D:lockscope>
                            <D:locktype>
                                <D:write></D:write>
                            </D:locktype>
                        </D:lockentry>
                        <D:lockentry>
                            <D:lockscope>
                                <D:shared></D:shared>
                            </D:lockscope>
                            <D:locktype>
                                <D:write></D:write>
                            </D:locktype>
                        </D:lockentry>
                    </D:supportedlock>
                    <D:lockdiscovery></D:lockdiscovery>
                </D:prop>
                <D:status>HTTP/1.1 200 OK</D:status>
            </D:propstat>
        </D:response>
(j'en ai mis qu'une partie)

Si vous avez une idée, n'hésitez pas. Je vous montre ce que j'ai essayé :

Code :
1
2
3
4
5
6
7
    $.ajax({
        url: "http://.../folder",
        type: "PROPFIND",
        dataType: "xml",
        headers: {Depth: "1"},
        success: function(data) {console.log($(data).find("D:multistatus"))},//renvoie []
    });
Les lignes suivantes donnent le même résultat :

Code :
1
2
success: function(data) {console.log($(data).find("D"))},//renvoie []
success: function(data) {console.log($(data).find("multistatus"))},//renvoie []
Help me !!!

Merci
Sharcoux est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 17/08/2011, 10h21   #2
Membre habitué
 
Homme
Étudiant
Inscription : mai 2011
Messages : 226
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : mai 2011
Messages : 226
Points : 126
Points : 126
Il semblerait qu'il s'agisse d'un problème de name space. La syntaxe $("D\\:balise") semble permettre l'accès aux balises. Si quelqu'un en sait plus là-dessus, je suis intéressé.
Sharcoux est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 06h44.


 
 
 
 
Partenaires

Hébergement Web