Dale face
Home
Journal Pages
Learning:
The Journey of a Lifetime
or
A Cloud Chamber of the Mind

Previous Page

Sunday June 17, 2007 9:00 am Lethbridge Sunrise 5:23 Sunset 21:41 Hours of daylight: 16:18

A. Morning Musings

9:00 am It is +10 C with a high forecast of +13 C.

Here are the news.

CBC Headline: Palestinian PM swears in emergency cabinet

Now 2 Palestinian governments: Hamas-controlled Gaza and Fatah-controlled West Bank. Palestinian Authority President Mahmoud Abbas swore in an emergency cabinet in the West Bank city of Ramallah on Sunday and outlawed the militia forces of the Hamas movement, deepening the violent rupture in Palestinian society. There is something very sad about this entire situation.

Canadian Headline: RCMP commissioner promises to do right by abused employees

RCMP employees who were treated badly for trying to reveal problems in the force's pension fund will be recognized and thanked, Commissioner Bev Busson says. This is a continuation of yesterday's story.

Australian Headline: (from The Australian): Nation's child abuse shame

This is the same headline as yesterday.

B. Actual/Notes

9:00 am I am continuing my efforts to learn XML, CSS, XHTML.

feather indicating this is a notebook

Technology 23

June 17

Technology Notes


9:05 am I want to step back from CSS for a moment and refresh my mind about the big picture of XML and stylesheets.


Here is a mind map of "SAMS Teach Yourself XML in 21 days" by Steven Holzner.

XML map

The last two sections do not appear useful to me, at least at the moment. There are two main dimensions to the topic: conceptual and software-dependent (i.e. Dreamweaver). That is, I need to understand what I am trying to do (which involves a large number of new concepts and terms) and then I need to learn how to accomplish the task using Dreamweaver. Unfortunately the book only discusses the first topic. Let's see how it goes by making a few notes on the first few chapters.

There is a neat option for downloading all of the code examples used in the book. The steps for doing this were easy to follow and I now have a file folder containing all of the examples. A promising start.

Part I Creating XML Documents

Well-formed documents obey a number of rules. To be valid, an XML document must specify a set of syntax rules, and XML processors can use these rules to check whether that document adheres to those rules. There are 2 ways of specifying the syntax of XML documents: by using document type declarations (DTDs) and XML schemas.

Chapter 1 Welcome to XML

"XML is all about storing your data. ... XML is not about displaying your data - it's about packaging that data to transport it easily." [p. 10]

"... the languages designed to let you store and handle text are called markup languages, and there are plenty of them out there." [p. 10]

One example of a markup language is HTML. The markup tells the browser how to interpret the data. The markup is made up of tags such as <HEAD>, <BODY>. However HTML is a very limited language and is no longer recommended for use in creating web pages. The real difficulty is creating a language that has enough tags to do the numerous different activities that one might want to do. The whole idea behind XML is to let you create your own markup.

"XML is meant for storing data, not displaying it." [p. 12]

"XML is a creation of the World Wide Web Consortium (W3C). ... XML version 1.0 is in recommendation form, and has been since October 6, 2000, which means its an established standard." [p. 13]

I have just checked the W3C web site ( www.w3.org ) and noted that XML version 1.1 is now in recommendation form since August 16, 2006.

All XML documents begin an XML declaration that specifies which version of XML is used in the rest of the document.

Using Dreamweaver, if one creates a new XML document, the first line of code is automatically created:

<?xml version="1.0" encoding="ISO-8859-1"?>

I will try changing this to version 1.1 when I have a good example in hand and see if it makes any difference.

Now that I have a line of code, it is time to look at the syntax.

<?xml?> is called a declaration (it declares which version of xml is being used) and has 2 attributes, version and encoding. Each attribute is given a value by using an equal symbol and then enclosing the value in double quotes.

An element is the fundamental unit that you use to hold your data. Elements always start with an opening tag and end with a closing tag. You create an element by pairing an opening tag with a closing tag. (e.g. <stuff>...</stuff>).

"You're free to make up your own element names in XML, and that's XML's whole power - the capability to create your own markup." [p. 15]

I just tried previewing the following XML file in both Firefox 2.0 and Safari 2.0.4. Safari worked fine, but Firefox gave an error message on xml version="1.1". Interesting.

<?xml version="1.1" encoding="ISO-8859-1"?>
<stuff>data</stuff>

I also tried using Microsoft Internet Explorer and it also failed to process the file: no error message but also no display. Clearly the world is not yet ready for version 1.1.


"An element's content can be made up of simple text or other elements. Like XML declarations, XML elements can support attributes. ... When you create an XML document, you must enclose all elements inside one overall element, called the root element. " [p. 16]

"Being able to create your own elements from scratch like this has advantages and disadvantages - you're not restricted to a predefined and limited set of tags, but on the other hand, a standard Web browser can understand HTML tags but will have no idea what to do with a user-defined tag." [p. 17]

You can store your data in an XML file and then display it using a separate document called a style sheet. Style sheets can be interpreted by most Web browsers. Thus one needs to learn to create 2 types of file: an XML file that contains the data and a style sheet file that reads the XML file and recodes it into XHTML which can be read by a Web browser.

"There are two kinds of style sheets you can use with XML documents - cascading style sheets (CSS), which you can also use with HTML documents and Extensible Stylesheet Language style sheets (XSL), designed to be used only with XML elements." [p. 18]

A style sheet file simply contains a few statements of the form selector {property1: value; property2: value}. The selector identifies the element that the declaration will apply to.

Here is a schematic image of what I have covered so far:

XML schematic

"An XML document actually can do more than just hold your data; it can let you specify the structure of your data as well." [p. 24]

"There are two main checks that XML processors make: checking that your document is well-formed and checking that it's valid. ... Informally, the main requirements [being well-formed] are that the document must contain one or more elements, and one element, the root element, must contain all of the other elements. In addition, each element must nest inside any enclosing properly. ... An XML document is valid if it adheres to the syntax you've specified for it, and you can specify that syntax in either a Document Type Definition (DTD) or an XML schema." [p. 25]

QUIZ

1. What's the main reason XML has become so popular in the last five years?

XML files are text files that can be easily sent over the Internet.

2. What are the four different types of specifications that W3C publishes?

notes, working drafts, candidate recommendations, recommendations

3. What's an XML element? What's an XML attribute?

An XML element is a name that begins with an opening tag and ends with an closing tag, and which may contain some data between them. Example: <name>Dale</name>.

An XML attribute is a property that may take specific values. Example: font-size="14".

4. What are some of the requirments for an XML document to be well-formed?

There must be at least one root element which contains all of the other elements. Every element must have both an opening and a closing tag. All tags must be properly nested within one another.

5. What are two XML constructs that let you specify an XML document's syntax so it can be checked for validity?

A Document Type Declaration (DTD) or an XML schema.

SUMMARY of the session:

12:30 PM This was a great session. I have on the screen, and the book, for 3 hours. This time through, it all made sense. Great. Making these notes acts as a good way for reviewing the material. The important point is that it all makes sense.

 

C. Plan

Immediate    
Literature Begin reading "Bel Canto" by Ann Patchett
1 hr
Technology Begin reviewing XML and CSS material
3 hr
Science Read & make notes for "The Canon" by Natalie Angier
1 hr
Later    
Technology Make notes for chap. 4 of "Switching to the Mac"  
  Learn how to attach a digital camera to my spotting scope  
  Burn backup of images onto DVD  
Mathematics Read & make notes on The Humongous Book of Calculus Problems  
  Write a paper on mathematics education  
  Continue reading "Algebra: Abstract and Concrete" by Frederick Goodman  
  Read "Symmetry" by David Wade  
  Make notes for "Mathematics: A Human Endeavor" ch 1  
  Read "Fearless Symmetry" chap 9: Elliptic Curves  
Model Trains Add ground cover to oil refinery diorama  
  Follow tutorial for version 8 of 3rd PlanIt  
  Continue assembly of coaling tower  
  Purchase DCC system  
History Begin reading "Maya"  
  Read Watson "Ideas"  
Philosophy Read & make notes for "Breaking the Spell"  
  Begin reading "How Are We To Live?" by Peter Singer  
Literature New York Times easy crossword puzzles  
GO Complete reading "Lessons in the Fundamentals of Go"  
Puzzles

The Orange Puzzle Cube: puzzle #10

Major Goals    
Learning Review week's pages each Sunday  
  Review all pages for the month at the end of each month  
Technology Review & edit iPhoto files for 2006  
Model Trains Become proficient with 3rd PlanIt software  
  Install DCC on model train layout  
GO Learn to play GO at something better than a beginner level  
Drawing Learn to draw!! (I keep saying this, yet I have yet to put a pencil to paper).  
Mathematics Continue to play with mathematics.  
Literature Continue to read Literature  
Bird Watching Continue to engage in bird watching activities.  

D. Reflection