Advanced Web Technologies

Blog posts as part of the BSc Internet Application Development programme to discuss my experience while working on the tasks that will be given during the Advanced Web Technologies module.

QUICK QUESTIONS

  1. One of the advantages claimed for the "extended links", that the W3C consortium intended to be part of the XLink language, was that the definition of a particular hyperlink could be located, not in the local resource (the document where the link starts), or the remote resource (the document where the link ends), but in a quite different "third party" document. Why might this be an advantage?

    This might be an advantage because the third-party document is independent from the document that has the link. A linkbase (also known as a link database) is a file that consists of a number of third-party links.[1]
  2. The XLink language provides an attribute for a hyperlink called show – it has several possible values. What is the effect of providing such a link with each of the following attribute values?
    show="replace"
    show="new"
    show="embed"

    Which of these three attribute values is the default?

    The show attribute in the XLink language is used to determine how the object will be displayed. The show attribute consists of the following values:[2]
    • show="new" - This value is used to open the page in a new window;
    • show="replace" - This value is used to replace the current page with the new page;
    • show="embed" - This value is used to put the target inside the current page or inline;
    • show="other" - This value is used to search for an alternative markup inside the page;[3]
    • show="none" - This value contains no instructions.
    The default value of the show attribute is replace.

LONGER QUESTIONS

  1. Here is an XML document:
    <?xml version="1.0"?>
    <!DOCTYPE memo SYSTEM memo.dtd">
    <?xml-stylesheet href="stylesheet02.css" type="text/css"?>
    <memo>
     <heading>memo 1334</heading>
     <date>date: 11 November 09</date>
     <time>time: 09:30</time>
     <sender>from: The Managing Director</sender>
     <addressee>to: Heads of all Departments</addressee>
     <message>I think we should be making wind-turbines. Have a look at this website. Tell me what you think. </message>
    </memo>


    The accompanying .dtd file looks like this:
    <?xml version= "1.0" ?>
    <!DOCTYPE memo [
    <!ELEMENT memo (heading, date, time, sender, addressee, message)>
    <!ELEMENT heading (#PCDATA)>
    <!ELEMENT date (#PCDATA)>
    <!ELEMENT time (#PCDATA)>
    <!ELEMENT sender (#PCDATA)>
    <!ELEMENT addressee (#PCDATA)>
    <!ELEMENT message (#PCDATA)>
    ]>

    At the point where the document says this website, there is supposed to be a hyperlink that
    takes the reader to the website:
    http://engineering.suite101.com/article.cfm/wind_power.

    1. Amend the document, so that the link is in fact there. Make any necessary changes to the .dtd file as well.

      The XML file will look like the following:
        1: <?xml version="1.0"?>    
        2: <!DOCTYPE memo SYSTEM memo.dtd">    
        3: <?xml-stylesheet href="stylesheet02.css" type="text/css"?>    
        4: <memo xmlns:xlink="http://www.w3.org/1999/xlink">    
        5:   <heading>memo 1334</heading>    
        6:   <date>date: 11 November 09</date>    
        7:   <time>time: 09:30</time>    
        8:   <sender>from: The Managing Director</sender>    
        9:   <addressee>to: Heads of all Departments</addressee>    
        10:  <message>I think we should be making wind-turbines. Have a look at <websiteLink xlink:type="simple" xlink:href="http://engineering.suite101.com/article.cfm/wind_power">this website</websiteLink> Tell me what you think. </message>    
        11: </memo>   
      

      The DTD file will look like the following:
       1:  <?xml version= "1.0" ?>   
       2:  <!DOCTYPE memo [   
       3:  <!ELEMENT memo (heading, date, time, sender, addressee, message)>   
       4:  <!ELEMENT heading (#PCDATA)>   
       5:  <!ELEMENT date (#PCDATA)>   
       6:  <!ELEMENT time (#PCDATA)>   
       7:  <!ELEMENT sender (#PCDATA)>   
       8:  <!ELEMENT addressee (#PCDATA)>   
       9:  <!ELEMENT message (#PCDATA)>   
       10: <!ATTLIST memo xmlns:xlink CDATA #FIXED “http://www.w3.org/1999/xlink”>   
       11: <!ATTLIST websiteLink    
       12:    xlink:type (simple | extended) "simple"   
       13:    xlink:href CDATA #REQUIRED>   
       14: ]>   
      
    2. Suppose that the heading of one of the sections in the target website is <A NAME="WE Elec Facts">Wind Energy Electricity Facts</A>, including the tags as shown. What changes would you have to make to the link in the managing director’s memo, to make the hyperlink finish at that point rather than at the wind_power document as a whole?

      To specify a part of a document rather than a whole document, XPointers should be used
      <websiteLink xlink:type="simple"
      xlink:href="http://engineering.suite101.com/article.cfm/wind_power
      #xpointer(name('WE Elec Facts'))">this website</websiteLink>
  2. Here is another XML document:
    <?xml version="1.0"?>
    <!DOCTYPE memo SYSTEM memo.dtd">
    <?xml-stylesheet href="stylesheet02.css" type="text/css"?>
    <memo>
     <heading>memo 1335</heading>
     <date>date: 11 November 09</date>
     <time>time: 09:45</time>
     <sender>from: The Managing Director</sender>
     <addressee>to: Heads of all Departments</addressee>
     <message>I think we should be making solar panels. Have a look at this website. Tell me what you think. </message>
    </memo>

    At the point where the document says this website, there is supposed to be a hyperlink that takes the reader to a suitable website. Find one, and amend the document, so that the link is in fact there. Is it necessary to make any changes to the .dtd file, or can we use the file as you amended it before?

    The <websiteLink> tag will consist the following:
    1:  <websiteLink xlink:type="simple" xlink:href="http://www.solarpages.co.uk/Solar-Panels-Information/">this website</websiteLink>  
    
    The .dtd file that have been amended before can still be used.

Question Sheet:

Question Sheet: Lab 10a

Sources:

[1] Xpath, XLink, XPointer, and XML: a practical guide to Web hyperlinking and transclusion - Pg 61
[2] http://webdesign.about.com/od/xlink/a/how-to-write-xlink.htm
[3] http://www.cafeconleche.org/books/bible2/chapters/ch19.html

0 comments:

Post a Comment