开发者

PHP DOMDocument to parse xml structure with non-alphabetical characters in tags?

开发者 https://www.devze.com 2023-03-20 16:49 出处:网络
The XML I am trying to parse has structure similar to this - where there are col开发者_运维百科on\'s in te tag: <person:type>mean</person:type>

The XML I am trying to parse has structure similar to this - where there are col开发者_运维百科on's in te tag: <person:type>mean</person:type>

Can PHP DomDocument parse such a structure? The usual getElementByTagName does not seem to work


Sort of, you really want getElementsByTagNameNS. At the beginning of the document, you might notice something like xmlns:person="http://foo.bar.com". That URL would be the first parameter of the method, 'type' would be the second.

0

精彩评论

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