我试图解析的XML结构类似于此-在标签中有冒号:<person:type>mean</person:type>
可以PHP DomDocument解析这样的结构?通常的getElementByTagName似乎不起作用
差不多,你真的想要getElementsByTagNameNS
。在文档的开头,您可能会注意到类似xmlns:person="http://foo.bar.com"
的东西。该URL将是方法的第一个参数,'type'将是第二个。
我试图解析的XML结构类似于此-在标签中有冒号:<person:type>mean</person:type>
可以PHP DomDocument解析这样的结构?通常的getElementByTagName似乎不起作用
差不多,你真的想要getElementsByTagNameNS
。在文档的开头,您可能会注意到类似xmlns:person="http://foo.bar.com"
的东西。该URL将是方法的第一个参数,'type'将是第二个。