Witam,
mam xml'a jako stringa (w formacie ATOM). Oto jego fragment:
...
<entry m:etag=\"W/"X'0000000000000CB7'"\">
<id>https://.................................DataService.svc/Countrys(2)</id>
<title type=\"text\">France</title>
<updated>2013-01-18T12:42:43Z</updated>
<author>
<name />
</author>
<link rel=\"edit\" title=\"Country\" href=\"Countrys(2)\" />
<link rel=\"http://schemas.microsoft.com/ado/2007/08/dataservices/related/AccountId\" type=\"application/atom+xml;type=entry\" title=\"AccountId\" href=\"Countrys(2)/AccountId\" />
<link rel=\"http://schemas.microsoft.com/ado/2007/08/dataservices/related/Visitor1\" type=\"application/atom+xml;type=entry\" title=\"Visitor1\" href=\"Countrys(2)/Visitor1\" />
<category term=\"............................\" scheme=\"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme\" />
<content type=\"application/xml\">
<m:properties>
<d:Id m:type=\"Edm.Int32\">2</d:Id>
<d:ConcurrencyCheck m:type=\"Edm.Binary\">AAAAAAAADLc=</d:ConcurrencyCheck>
<d:countryCode>FR</d:countryCode>
<d:country>France</d:country>
</m:properties>
</content>
</entry>
...
Robię z tego stringa obiekt XML za pomocą:
$xml = simplexml_load_string($moj_string);
Parsuje się ok bo mogę pobrać z jakiegokolwiek 'entry' wartości typu: title, updated itp na przykład poprzez:
$xml->entry[1]->updated
Nie mogę sobie jednak poradzić z pobraniem wartości:
<d:country>France</d:country>
Uprzejmie proszę o pomoc. Z góry dziękuję.
Pozdr
Piotr
Ten post edytował piotras 18.01.2013, 15:56:10