1
我具有位於所指定的URL,它包括概率的沉澱的節點,其具有其架構實例聲明(多個)允許它們的nillable幾個「值」元素的XML文件。但是,php中的attributes()函數並不顯示此元素的XSI聲明。使用PHP,如何訪問由XML模式聲明聲明的XML元素的屬性?
$feedURL= "http://forecast.weather.gov/MapClick.php?lat=32.78520&lon=-79.99400&FcstType=dwml";
// read feed into SimpleXML object
$wxml = simplexml_load_file($feedURL);
echo $wxml->data->parameters->{'probability-of-precipitation'}->value[0]->attributes();
是否可以打印'XSI屬性'? 謝謝
對XML命名空間和前綴的W3C詳解於:http://www.w3schools.com/XML/xml_namespaces.asp – user377241