关于jQuery解析XML的问题

 $.ajax({
         url: "http://xml.weather.yahoo.com/forecastrss?p=CHXX0008&u=f",
         dataType: 'xml',
         type: 'GET',
         timeout: 2000,
         error: function(xml){
            alert("加载XML文件出错!");
         },
         success: function(xml){
                 $(xml).find("yweather:location").each(function(){
                     $("#show2").text(
                     $(this).attr("city")
                     );
                 });
         }
    });

对雅虎天气API返回的XML格式解析

感觉问题是这边的
 $("#show2").text(
                 $(this).attr("city")
                 );

如果直接输出  <title>Yahoo! Weather - Beijing, CH</title>  里面的可以
但是 <yweather:location city="Beijing" region="" country="CH"/>  输出属性“city”就不行

想问一下是什么问题,大神求指导,小白一枚

find() 方法获得当前元素集合中每个元素的后代,通过选择器、jQuery 对象或元素来筛选。
你返回的XML没有子节点,所以find查到的是空集合;
此外返回节点yweather:location中有jQuery的选择器的保留字符":",如果你的xml数据的有子节点,则需要对冒号转义。示例代码:

  var xml = '<t><yweather:location city="Beijing" region="" country="CH"/></t>';
  var list = $(xml).find("yweather\\:location ");
  alert("list length:"+list.length+","+$(list[0]).attr("city"));

我测试了,这行$(xml).find("yweather:location")的遍历结果为空。
如果改成$(xml).first("yweather:location")就能查到到值了。
看了下find的用法,为什么用find查不到节点呢?还需要仔细研究下jQuery的遍历。
http://www.w3school.com.cn/jquery/jquery_ref_traversing.asp

看看循XML的环子节点呢?

要转义:,[,],#这种选择器关键字,而且你请求的地址是跨域的,没多大意义,发布网站就会拒绝访问了

 $(xml).find("yweather\\:location").each(function(){