How to use jQuery for XML parsing with namespaces

后端 未结 20 1473
隐瞒了意图╮
隐瞒了意图╮ 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:19

    As of beginning of 2016, for me the following syntax works with jQuery 1.12.0:

    • IE 11 (11.0.9600.18204, Update 11.0.28, KB3134815): .find("z\\:row")
    • Firefox 44.0.2: .find("z\\:row")
    • Chrome 44.0.2403.89m: .find("row")

    The syntax .find("[nodeName=z:row]") doesn't work in any of the browsers mentioned above. I found no way to apply a namespace in Chrome.

    Putting it all together, the following syntax works in all of the browsers mentioned above: .find("row,z\\:row")

提交回复
热议问题