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

Previous Page

Tuesday June 19, 2007 7:40 am Lethbridge Sunrise 5:23 Sunset 21:42 Hours of daylight: 16:19

A. Morning Musings

7:40 am It is +11 C with a high forecast of +25 C.

Here are the news.

CBC Headline: Suicide bomber report a Taliban 'PR move': Day

Public Safety Minister Stockwell Day says a report that foreign-trained suicide bombers have been dispatched to Canada is a public relations move by a terrorist group that knows it's losing the fight in Afghanistan. Day was responding to an unconfirmed ABC News report that teams of al-Qaeda and Taliban recruits have been sent to Canada, the United States and other countries to carry out suicide attacks. Once again, I am not sure this merits a new headline.

Canadian Headline: see above

Australian Headline: (from The Australian): Howard accuses Rudd of deception over productivity

Kevin Rudd was today accused of "deceiving" the public as the Howard Government seized on a leaked ALP document on productivity to attack the Opposition leader's economic credentials. The document advises Mr Rudd to ignore the latest national accounts figures - which show a rise in productivity of 0.6 per cent for the March quarter and 1.4 per cent in the December quarter - in favour of the May Budget, which forecast zero productivity growth for the year ahead. The media love politics.

B. Actual/Notes

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

feather indicating this is a notebook

Technology 25

June 19

Technology Notes


7:50 am I am pleased with my progress on XML over the last few days.


Part I Creating XML Documents

Chapter 1 Welcome to XML

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

XML schematic

Chapter 2 Creating XML Documents

Chapter 3 Creating Well-Formed XML Documents

1. Criteria for being well-formed

Here are the main criteria for an XML document to be well-formed:

  • Begin the document with an XML declaration
  • There must be at least one element (i.e. the root element)
  • Each element must contain both a beginning and an end tag
  • The root element must contain all of the other elements
  • The elements must be nested properly
  • Attribute names within a tag must be unique
  • Attribute values must be enclosed within quote symbols.
All of the above is familiar to me. So far so good.

2. Using XML Namespaces

In some cases one may be using files from different sources and these sources may use the same names for some tags causing confusion over which definition should be used. In order to prevent such a situtation from arising, the concept of a namespace was introduced. A namespace is a way of adding a prefix to a tag's name to ensure that it is unique within the XML file that is using tags from more than one source. Simple. Now for the procedure for doing this.

Note: A Uniform Resource Indicator (URI) is very similar to a URL but is intended to be a more general idea. At the moment the two might be considered to be identical.

xmlns:prefix="URI" (read as XML namespace ...)

Example:

xmlns:hr="http://www.ajax/human_resources"

This creates a prefix hr that may then be used to refer to any of the tags used by that source.

Here is an example of a line in an XML document that is using this prefix:

<hr:address> (address was the original tag name)

One may create a default namespace by not using a prefix. This then allows one to use the original tag names without having to add a prefix.

Example:

xmlns:"http://www.ajax/human_resources"

"Namespaces aren't used solely to avoid tag (and attribute) name conflicts - using a namespace also indicates to an XML processor what XML application you're using." [p. 105]

QUIZ

1. To be well-formed, what's the least number of elements an XML document can contain?

One.

2. Why is the following XML document not well-formed?

<?xml version = "1.0" standalone = "yes"?>

<employee>

<name>Frank</name>

<position>Chef</position>

</employee>

<employee>

<name>Ronnie</name>

<position>Chef</position>

</employee>

Answer: There is no root element.

3. Why is the following XML document not well-formed?

<?xml version = "1.0" standalone = "yes"?>

<employee>

<kitchen_staff>

<name language=en>Frank</name>

<new_hire />

<position language=en>Chef</position>

</employee

Answer: The two uses of the language attribute failed to put quotes around the value en .

4. How can you create a namespace named service whose URI is

http://www.superduperbigco.com/customer_service ?

Answer: xmlns:service="http://www.superduperbigco.com/customer_service"

5. How could you set the default namespace in a set of XML elements to the URI

http://www.superduperbigco.com/customer_returns

Answer: xmlns:"http://www.superduperbigco.com/customer_returns"

SUMMARY of the session:

9:10 am The only new material in this chapter was that of namespaces. I think I now have that under control.

 

C. Plan

Immediate    
Literature Begin reading "Dreaming Pachinko" by Isaac Adamson
1 hr
Technology Read & make notes for chap 3 of "Teach Yourself XML in 21 Days"
1 hr
  Use Dreamweaver to create a web page like this using CSS
6 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