1
這裏是我的飼料:XML飼料獲取打印值
<entry>
<id>http://api.visitmix.com/OData.svc/Sessions(guid'816995df-b09a-447a-9391-019512f643a0')</id>
<title type="text">Building Web Applications with Microsoft SQL Azure</title>
<summary type="text">SQL Azure provides a highly available and scalable relational database engine in the cloud. In this demo-intensive and interactive session, learn how to quickly build web applications with SQL Azure Databases and familiar web technologies. We demonstrate how you can quickly provision, build and populate a new SQL Azure database directly from your web browser. Also, see firsthand several new enhancements we are adding to SQL Azure based on the feedback we’ve received from the community since launching the service earlier this year.</summary>
<published>2010-01-25T00:00:00-05:00</published>
<updated>2010-03-05T01:07:05-05:00</updated>
<author>
<name />
</author>
<link rel="edit" title="Session" href="Sessions(guid'816995df-b09a-447a-9391-019512f643a0')" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Speakers" type="application/atom+xml;type=feed" title="Speakers" href="Sessions(guid'816995df-b09a-447a-9391-019512f643a0')/Speakers">
<m:inline>
<feed>
<title type="text">Speakers</title>
<id>http://api.visitmix.com/OData.svc/Sessions(guid'816995df-b09a-447a-9391-019512f643a0')/Speakers</id>
<updated>2010-03-25T11:56:06Z</updated>
<link rel="self" title="Speakers" href="Sessions(guid'816995df-b09a-447a-9391-019512f643a0')/Speakers" />
<entry>
<id>http://api.visitmix.com/OData.svc/Speakers(guid'3395ee85-d994-423c-a726-76b60a896d2a')</id>
<title type="text">David-Robinson</title>
<summary type="text"></summary>
<updated>2010-03-25T11:56:06Z</updated>
<author>
<name>David Robinson</name>
</author>
<link rel="edit-media" title="Speaker" href="Speakers(guid'3395ee85-d994-423c-a726-76b60a896d2a')/$value" />
<link rel="edit" title="Speaker" href="Speakers(guid'3395ee85-d994-423c-a726-76b60a896d2a')" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Sessions" type="application/atom+xml;type=feed" title="Sessions" href="Speakers(guid'3395ee85-d994-423c-a726-76b60a896d2a')/Sessions" />
<category term="EventModel.Speaker" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="image/jpeg" src="http://live.visitmix.com/Content/images/speakers/lrg/default.jpg" />
<m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
<d:SpeakerID m:type="Edm.Guid">3395ee85-d994-423c-a726-76b60a896d2a</d:SpeakerID>
<d:SpeakerFirstName>David</d:SpeakerFirstName>
<d:SpeakerLastName>Robinson</d:SpeakerLastName>
<d:LargeImage m:null="true"></d:LargeImage>
<d:SmallImage m:null="true"></d:SmallImage>
<d:Twitter m:null="true"></d:Twitter>
</m:properties>
</entry>
</feed>
</m:inline>
</link>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Tags" type="application/atom+xml;type=feed" title="Tags" href="Sessions(guid'816995df-b09a-447a-9391-019512f643a0')/Tags" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Files" type="application/atom+xml;type=feed" title="Files" href="Sessions(guid'816995df-b09a-447a-9391-019512f643a0')/Files" />
<category term="EventModel.Session" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:SessionID m:type="Edm.Guid">816995df-b09a-447a-9391-019512f643a0</d:SessionID>
<d:Location>Breakers L</d:Location>
<d:Type>Seminar</d:Type>
<d:Code>SVC07</d:Code>
<d:StartTime m:type="Edm.DateTime">2010-03-17T12:00:00</d:StartTime>
<d:EndTime m:type="Edm.DateTime">2010-03-17T13:00:00</d:EndTime>
<d:Slug>SVC07</d:Slug>
<d:CreatedDate m:type="Edm.DateTime">2010-01-26T18:14:24.687</d:CreatedDate>
<d:SourceID m:type="Edm.Guid">cddca9b7-6830-4d06-af93-5fd87afb67b0</d:SourceID>
</m:properties>
</content>
</entry>
我想打印:
- 課程名稱(構建Web應用程序與Microsoft SQL Azure的)
- 的作者(大衛羅賓遜)
- 位置(斷路器L)
- 並顯示揚聲器圖像(http://live.visitmix.com/Content/images/speakers/lrg/default.jpg)
我假設我可以使用filegetcontents
,然後轉換爲simplexmlstring
,但我不知道如何獲得我想要的更深的項目,如作者和圖像。
我可以使用CURL來獲取URL字符串嗎? – CLiown 2010-03-25 12:24:54
你可以使用幾乎任何你想要的*(取決於你的服務器的配置,當然)*:curl可以,但是,如果啓用了allow_url_fopen,你也可以直接使用'simplexml_load_file(' http:// ...')' – 2010-03-25 12:26:03
m:前綴最有可能綁定到uri「http://schemas.microsoft.com/ado/2007/08/dataservices/metadata」,但是danit要麼不選擇發佈「真正的」,完整的飼料或得到了一個破碎的,刪節的版本... ...在某處 – VolkerK 2010-03-25 12:33:11