Login Register

dojo.query

Hello There!

Getting XML using AJAX.

<?xml version="1.0" encoding="UTF-8"?>

<response>

 <action-response action-name="load" code="0">

   <axex>

   <tick value="1" text="10"/>

   <tick value="2" text="11"/>

   <tick value="3" text="12"/>

   <tick value="4" text="13"/>

   <tick value="5" text="14"/>

   <tick value="6" text="15"/>

  </axex>

   </action-response>

</response>

Trying to parse it in such case:

dojo.query("action-response", response).forEach(function(action, index){
    var code = dojo.attr(action, "code");
    var actionName = dojo.attr(action, "action-name");
   
    if (actionName == 'load') {
        if (code >= 0) {
            dojo.query("axex tick", action).forEach(function(tickx, index2){
             ... do something
            });
        }
    }
});

In IE6 or IE7 it breaks down in line with inner dojo.query.
In FF it works fine.

The error is "object doesn't support this method" in dojo.js _zip function.

What's wrong with this?

Thanks to everybody!

dojo.query does not support XML natively.

...sometimes it works and sometimes it does not but the main thing is that it was designed to iterate over an HTML DOM and not a pure XML one. If you're looking to get info out of an XML document, you're better off (at this point) doing it the old-fashioned way.

Thank's for the comments.

Thank's for the comments. I'm clear with this. I will use the old style.