Re: [問題] database與xml
※ 引述《Arton0306 (Ar藤)》之銘言:
: 我搞不太清楚有資料庫
: 為什麼還要用xml去產生html
: 一般動態網頁都將資料存在database
: 接著再讀取 動態形成一html檔傳到client端
: 那xml的作用是??
為了取得資料的時候,也同時取得規格,
簡單來說,他也是一種資料的呈現方式,而不是用來取代資料庫的。
html
xml
html看成xml會不會讓你比較能理解這概念?
(事實上真的是,不過不嚴謹而已,
我們習慣說嚴謹遵循xml格式的html為xhtml。)
所謂的meta language 都有這樣的成份。
比方說像rss就是個經典的例子,以我的ppolis rss來說。
<channel>
<title>Tony1223(Rover) 的最新PPolis好友動態</title>
<link>http://ppolis.tw</link>
<description>PPolis 好友最新動態</description>
<language>zh-tw</language>
<ttl>60</ttl>
<image>
<url>http://ppolis.tw/images/logo.gif</url>
<link>http://ppolis.tw</link>
<title>ppolis</title>
</image>
<item>
<title>nchild 更新個人描述</title>
<link>http://ppolis.tw/user/nchild</link>
</item>
</channel>
裡面就有定義channel, 標題,對應到的網頁超連結,
以及我的rss icon圖片,跟rss的內容(item)。
所有rss reader只要遵照這個模式去做parse就好了,
這也是網路上逐漸流行的模式。
或者像 youtube api的模式,
http://0rz.tw/a94i2 (說明文件),
他的評論取得就是用 xml 的方式定義。
http://gdata.youtube.com/feeds/api/videos/VIDEO_ID/comments
for example
http://gdata.youtube.com/feeds/api/videos/WX3R-cHMOQg/comments
總之,meta language 都具有表示結構與表示語意的兩種特性。
--
What do you want to have ? / What do you have?
從書本中,你可以發現我的各種興趣。
從CD中,你可以瞭解我所喜歡的偶像明星。
或許從文字你很難以瞭解一個人,但從物品可以。
My PPolis , My past. http://ppolis.tw/user/Tony
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.134.27.68
→
06/25 01:15, , 1F
06/25 01:15, 1F
→
06/25 01:19, , 2F
06/25 01:19, 2F
→
06/25 01:44, , 3F
06/25 01:44, 3F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):