我无法从:
名称旁边带有符号的标签中检索数据。拥有来自元素的avail
属性和来自.domain:name
domain:reason
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
<response>
<result code="1000">
<msg>Command completed successfully</msg>
</result>
<resData>
<domain:chkData xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd">
<domain:cd>
<domain:name avail="1">sdfgsdf.gr</domain:name>
<domain:reason>Available Domain Name</domain:reason>
</domain:cd>
</domain:chkData>
</resData>
<extension>
<extdomain:resData xmlns:extdomain="urn:ics-forth:params:xml:ns:extdomain-1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ics-forth:params:xml:ns:extdomain-1.1 extdomain-1.1.xsd">
<extdomain:comment ref="sdfgsdf.gr">The Domain Name can be provisioned.</extdomain:comment>
</extdomain:resData>
</extension>
<trID>
<clTRID>ABC:cs-foh:10782</clTRID>
<svTRID>212-123-176-gr</svTRID>
</trID>
</response>
</epp>
附录
如果我运行这个
function iterate($xml , $space = '') {
foreach($xml->children() as $child){
echo $space.$child->getName();
echo "<br />";
iterate( $child , $space.'--' );
}
}
我得到这个结果。
response
--result
----msg
--resData
--extension
--trID
----clTRID
----svTRID
为什么domain:tags
不被视为元素?