开发者

How do I get minidom to ignore namespaces?

开发者 https://www.devze.com 2022-12-24 16:09 出处:网络
I am using minidom in Python and I\'d开发者_运维技巧 like getElementsByTagName() to match elements purely by tag-name and ignore any namespaces. The documents are being parsed by minidom.parseString()

I am using minidom in Python and I'd开发者_运维技巧 like getElementsByTagName() to match elements purely by tag-name and ignore any namespaces. The documents are being parsed by minidom.parseString(). Is it possible?


getElementsByTagName does match elements purely by tagName.

Do you mean you want to match purely on localName? ie. the part of the tag name after the : (if any)? If so use the DOM Level 2 Core method getElementsByTagNameNS:

els= document.getElementsByTagNameNS('*', 'tag')
0

精彩评论

暂无评论...
验证码 换一张
取 消