IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

jQuery Discussion :

interprétation xml moche


Sujet :

jQuery

  1. #1
    Membre éclairé
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    442
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2011
    Messages : 442
    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 : 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
    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 : Sélectionner tout - Visualiser dans une fenêtre à part
    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 : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    success: function(data) {console.log($(data).find("D"))},//renvoie []
    success: function(data) {console.log($(data).find("multistatus"))},//renvoie []
    Help me !!!

    Merci

  2. #2
    Membre éclairé
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    442
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2011
    Messages : 442
    Par défaut
    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é.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Comment interpréter XML et lire les attributs
    Par yvon_huynh dans le forum XML/XSL et SOAP
    Réponses: 0
    Dernier message: 15/02/2015, 13h29
  2. Interprétation XML : caractères spéciaux?
    Par oclone dans le forum XML/XSL et SOAP
    Réponses: 1
    Dernier message: 14/07/2010, 10h11
  3. [XSLT] Interpréter XML + XSL sans navigateur
    Par dolteki dans le forum XSL/XSLT/XPATH
    Réponses: 4
    Dernier message: 09/12/2009, 10h09
  4. Interprétation XML dans un JTextPane
    Par Djakisback dans le forum AWT/Swing
    Réponses: 9
    Dernier message: 22/05/2006, 03h31
  5. [Applet][XML] Ne pas interpréter les caractères spéciaux
    Par leminipouce dans le forum Format d'échange (XML, JSON...)
    Réponses: 4
    Dernier message: 28/07/2005, 16h15

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo