2012年12月17日 星期一

Lab 35 XML (2)


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.
(archive)

3. View the formatted HTML file.

Results of Group A

Brazil versus Scotland

Played on 10-Jun-1998
Result: Brazil2, Scotland1

Morocco versus Norway

Played on 10-Jun-1998
Result: Morocco2, Norway2

Scotland versus Norway

Played on 16-Jun-1998
Result: Scotland1, Norway1

Brazil versus Morocco

Played on 16-Jun-1998
Result: Brazil3, Morocco0

Brazil versus Norway

Played on 23-Jun-1998
Result: Brazil1, Norway2

Scotland versus Morocco

Played on 23-Jun-1998
Result: Scotland0, Morocco3


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.

Results of Group A

TeamPlayedWonDrawnLostForAgainst
Brazil320163
Scotland301226
Morocco311155
Norway312054



Q:請描述至少一個你做這個lab所遇到的問題,並且你是如何解決這個問題的。

DEBUG程式碼花了一點時間

Lab 36 Syndication with RSS 2.0


Lab 34 XML


1. Register and Download Xray, an XML, XSLT editor and processor.
    (安裝X-Ray需要權限)

    (助教碎碎念:若無法順利安裝在點)

2. Before you do this lab,all the first you must know is 
   

XML-可延伸標記式語言英語eXtensible Markup Language,簡稱:XML),是一種標記式語言。標記指電腦所能理解的訊息符號,透過此種標記,電腦之間可以處理包含各種訊息的文章等。如何定義這些標記,既可以選擇國際通用的標記式語言,比如HTML,也可以使用像XML這樣由相關人士自由決定的標記式語言,這就是語言的可延伸性。XML是從標準通用標記式語言(SGML)中簡化修改出來的。它主要用到的有可延伸標記式語言、可延伸樣式語言(XSL)、XBRLXPath等。



XSL-可擴展樣式語言(extensible stylesheet language,簡稱XSL),是一種為[可擴展置標語言](XML)提供表達形式而設計的語言。
由於可擴展置標語言的擴展性使之沒有關於顯示格式的標識,可擴展樣式語言可以選擇和過濾可擴展置標語言中的數據,並將其轉換為HTML或者PDF等其他格式文件。
資料來源:維基百科


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

4. View the formatted HTML file.

Current conditions

  • Temperature 76°F
  • Wind 5mph
  • Lab 33 Speed Test


    測試中原大學與中央大學對外頻寬速度。

    Tool: Speedtest
    cycu proxy: proxy.cycu.edu.tw:3128
    ncu proxy.csie.ncu.edu.tw:3128
    no proxy







    Lab 32 Programming in DOM (II)

    1. Open KompoZer
    2. Based on the code as in

    http://www.scottandrew.com/weblog/articles/dom_4 ,
    write a code so that when you push a button, you generate the table of 9*9 products. (九九乘法表)

    Hint: The javascript code should be enclosed by script tags.

    Q:請描述至少一個你做這個lab所遇到的問題,並且你是如何解決這個問題的。




    2012年12月3日 星期一

    Lab 31 Programming in DOM

    1. Open KompoZer
    2. Based on the code as in

    http://www.scottandrew.com/weblog/articles/dom_4 ,
    write a code to generate the table of 9*9 products. (九九乘法表)

    Hint: The javascript code should be enclosed by script tags.

    Q:請描述至少一個你做這個lab所遇到的問題,並且你是如何解決這個問題的。




    Lab 30 Create Image using DOM

    1. Open KompoZer
    2. Hand code a javascript that loads an image from Internet based on
    the DOM model.
    3. Take a look at the sample code that shows how window.onload to load the image.
    4. Use a button to load the image. Try how onclick works.





    Q:請描述至少一個你做這個lab所遇到的問題,並且你是如何解決這個問題的。
    A:程式碼輸入錯誤

    Lab 29 Hand code a form

    Before you do this lab, you must understand what is CGI(Common Gateway Interface)  and Form.

    1. So please search the answer and post your opinion in your blog.
    2. Hand code a HTML or use KompoZer 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.




    通用網關介面Common Gateway Interface/CGI)是一種重要的網際網路技術,可以讓一個客戶端,從網頁瀏覽器向執行在網路伺服器上的程序,請求數據。CGI 描述了客戶端和伺服器程序之間傳輸數據的一種標準。 (source:http://zh.wikipedia.org/wiki/%E9%80%9A%E7%94%A8%E7%BD%91%E5%85%B3%E6%8E%A5%E5%8F%A3)







    Q:請描述至少一個你做這個lab所遇到的問題,並且你是如何解決這個問題的。

    A:操作不流暢 

    Lab 28 Lab Form and Action




    • Dynamic pages, content generated by server-side programs.
    • CGI, Common Gateway Interface, for sending requests to server-side programs.



    static page
    Ex:
    http://www.google.com/

    dynamic page
    Ex:
    http://www.cna.com.tw/

    URL that sends a request by CGI
    Ex:
    http://maps.google.com/maps?q=24.9586,+121.2411
    "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 KompoZer HTML editor.
    3. Open a new empty HTML file.
    4. Paste the search box into this new file.

    5. Use KompoZer 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. Save your file on your computer. Run your HTML by Firefox. What do you get?

    8. Set method as "post"
    9. Run your HTML by Firefox. What do you get?









    Q:請描述至少一個你做這個lab所遇到的問題,並且你是如何解決這個問題的。

    A:無法了解題意。 請教助教。