How to use jQuery for XML parsing with namespaces

后端 未结 20 1761
隐瞒了意图╮
隐瞒了意图╮ 2020-11-22 10:17

I\'m new to jQuery and would like to parse an XML document.

I\'m able to parse regular XML with the default namespaces but with XML such as:



        
20条回答
  •  清歌不尽
    2020-11-22 10:43

    I have spent several hours on this reading about plugins and all sorts of solutions with no luck.

    ArnisAndy posted a link to a jQuery discussion, where this answer is offered and I can confirm that this works for me in Chrome(v18.0), FireFox(v11.0), IE(v9.08) and Safari (v5.1.5) using jQuery (v1.7.2).

    I am trying to scrape a WordPress feed where content is named and this is what worked for me:

    content: $this.find("content\\:encoded, encoded").text()
    

提交回复
热议问题