2008年4月18日 星期五

lab 24: XSLT Part II

1. Register and Download Xray, an XML, XSLT editor and processor.

2. Given the
Listing 1. An XML document representing the results of a soccer tournament

Listing 2. A basic style sheet for the soccer results

use the XSLT as in the Listing 2 to transform the XML file as in the Listing 1.

3. View the formatted HTML file.

4. Given the
Listing 1. An XML document representing the results of a soccer tournament
Listing 3. A style sheet that computes team standings


compute the team standings in a table.

5. View the formatted HTML file.

lab 23: Lab XML & XSLT

1. Register and Download Xray, an XML, XSLT editor and processor.


2. Given the the XML file and XSLT file ,
use Xray to do the transformation of the XML into HTML.
You have to replace [ with <.

3. View the formatted HTML file.


2008年4月17日 星期四

Homework 4-11-2008

1. What does a CGI output contain in the HTTP header? Hint: Such as Content-type. More details in Appendix A of Textbook.

ANS:

CGI的工作方式,從Web伺服器的角度看,是在特定的位置(比如,http://www.example.com/wiki.cgi)定義了可以運行CGI程序。當收到一個匹配URL的請求,相應的程序就會被調用,並將客戶端發送的數據作為輸入。程序的輸出會由Web伺服器收集,並加上合適的頭,再發送回客戶端。
例如: 論壇認證 討論版 計數器 E-mail 意見回覆 等等


2. If you want to upload an mp3 file, should you use the GET or POST method? Why?

ANS:

POST .methodPOST 方法是將資料包裝在 HTTP 標頭內傳送給 Web server;而 GET 方法則是將資料直接加在 URI 之後。使用 GET method 所能傳遞的資料有限(連同 URI 共255字元),在需要上傳大量資料或檔案時,需使用 POST method。

2008年4月11日 星期五

Lab 22: Form and Action, Part II

Hand code a HTML or use Nvu to edit an HTML so that the webpage can send a request to Google like
http://maps.google.com/maps?q=24.9586,+121.24114

Use Form CGI that includes action, input, and submit.





Try a few different coordinates.

Lab 21: Form and Action

"logic will get you from A to B - imagination will take you anywhere"

How to use Form to invoke a remote service through CGI.

1. Copy the search box of
this search page,
inlcuding radio buttons, text input, and submit button.
2. Open your Nvu HTML editor.
3. Open a new empty HTML file.
4. Paste the search box into this new file.

5. Use Nvu to add a Form to this search box. Do not hand code the HTML. Just fill the blank in the Form dialog.

6. In the form dialog, set Action="http://google.com/search" and name of Form as "f" and method as "get"
(See Hint if it does not work.)


7. Run your HTML by Firefox. What do you get?

正常顯示
8. Set method as "post"




9. Run your HTML by Firefox. What do you get?

錯誤

2008年4月10日 星期四

Homework 3-28-2008

1 根據無障礙網頁設計原則

  • 為什麼不要開出新視窗?
ANS: 在一般的瀏覽器中."上一頁"功能是大家熟悉不過的小動作.可是對身障者來說卻是一種 辨識的困難.雖然 JAWS 會在連結開出新視窗時唸出「 New browser window 」,但 仍然容易在它唸出鏈結文字和新頁面內容之間被漏掉.Lillian 從中獲益了。因為她的 Internet Explorer 視窗總是最大化(這樣她纔看得見),所以新視窗開啟的時候也會 預設變成最大化。除此之外 Windows XP 還會把同一個應用程式的多個視窗群組整理 在工作列上,所以在視覺上就更難發現有新視窗被開出來了。突然之間,「上一頁」 按鈕莫名其妙地失效了,而 Lillian 完全不知道為什麼會這樣。如果妳預期她會很高興 地閱讀連結後的內容,倒是可以略過這個問題。
  • 為什麼要使用貼切的網頁標頭? 而不是留白?
ANS: 貼切的網頁標題可以讓身障者馬上了解該網頁的大致內容.而不必閱讀整個網頁.省下 不少時間
  • 定義快速鍵有什麼好處?
ANS: 並不是每個人都可以自在的使用滑鼠.由accesskey可以滿足只有鍵盤使用的人

2. According to Section 2.1 of Textbook, some websites are powered by databases in the back end and some are not. What are the purposes of using databases?

ANS:
資料庫(database)可以將用戶資料作分類存放,減少資料的重複性和不一致性,讓它作有 效的存取,並且也能增加資料的安全性。
對於網頁的互動有相當大的功用,不僅減少人力,資料的更新也具有即時性。
  • 減少資料重複(Reduced Redundancy)
  • 整合資料(Integrated data)
  • 完整性(Integrity)
  • 資料的共通性
  • 可保護資料的安全及隱私
3. Problem 1 & Problem 3 of Textbook on Page 55.

Q1:WEB技術演進是要解決什麼問題?

ANS:
Web 技術的演進主要是增進使用者(用戶端)的便利性、多樣性。
舉例來說,起先時期的網頁為靜態網頁,但由於靜態網頁的變化性太小,無法提供像現今即 時新聞、線上交易等功能。
因此,才有動態網頁的技術出現。但最初的動態網頁技術主要是以程序(Process)為主體,所 以當同一個伺服器(Server)同時處理過多使用者的要求,就會導致網路速度變慢。
目前 Web技術就以執行緒(Thread) 來代替程序(Process)解決速度上的問題。

Q2:程序(Process) 和執行緒(Thread) 對網站性能有什麼不同的影響?

ANS:以程序為主體的動態網頁,在處理每一位用戶端的要求時,就要重新執行一次程式,結束後 就關閉,因此當網站的使用者變多的時候,網站的速度就會變慢。

以執行緒(Thread)為主的動態網頁,因為當使用者連到該網站的伺服器(Server)時,程式已 經開啟(常駐程式),每一個動作皆以執行緒來執行,因此網站的速度會大大的提升。

4. Reading Assignments:XML (Page 187-188 on the Textbook)