Wednesday, 31 March 2010

CMT3315 – Laboratory 08 – 18 November 09

Quick Questions

1.
a. You cannot rearrange the order with CSS

b. However you can specify items to be displayed on its own e.g. you can display the title on its own, or even the title and the judgement.

c. XML document(s) will specify which CSS file to use in the following format: -


2. A URL, is a type of URI that's used to describe the location of a specific document. A URL doesn't define the type of content to be found (texts, images, movies, etc.), it only says where and how to find it.

3.XML allows namespaces so that the elements and attributes do not clash as two different elements with the same name can be uniquely identified by having different namespaces allocated to them.
This helps when more than one programmer is working with the same piece of code as two people might use the same element name for two different purposes. Namespaces allows the programmer to specify what the element is used for, therefore reducing any risks of using the wrong element as the element will have been made with its own unique namespace.


Longer Questions

The following style sheet was used to display the poem along with the text of “Chapter 2: Volcanic winter” correctly: -


chapterHead{

display:block;

margin:1em;

color:"blue"; text-align:left;

font-family:"Platino",Times New Roman, serif;

font-style:italic;

font-weight:bold;

font-size:24px;

}

poem{

display:block;

margin:2em;

text-align:left;

font-family:"Platino",Times New Roman, serif;

font-weight:bold;

font-size:12px;

background-color:#FCFBC4;

}



Lecture Reflection-WEEK 8 – Xpath


XSLT and XPointer both operate with Xpath which is a language which addresses parts of a XML document. “XPath is a syntax used to describe parts of an XML document”. With XPath an XML document is treated as a hierarchy of nodes.
• The seven kinds of nodes in XPath are:
– root,
– element,
– attribute,
– text,
– namespace,
– processing-instruction,
– and comment.
The reason why we use XPath is because an XML document can act like a database for information and XPath is used to point to a certain node to retrieve that information. Bellow is an example of a book element being retrieved by using an XPath expression: -

/bookstock/book

XPath also provides the usage of conditions. Bellow is an example of a condition whereby the book element is received ONLY IF the name is “Moby Dick”: -

/bookstock/book[name()=“Moby Dick”]

http://www.ronnysmarket.com/
http://www.ronnysmarket.com/catalog/main

No comments:

Post a Comment