In this lecture I will discuss character encoding, an issue which arose form the workshop last week. It turns out that the essential problem here is the same as the problem which namespaces try to solve - how to mix data from multiple sources (here in multiple languages).
Then we do a bit of revision on XML structures and well-formedness, introducing the XML diagrammer in QSEE.
Then I look at the basics of XPath, a language for selecting parts of a XML document.
This leads into the continuation of last week's worksheet, extending the PHP script with the means to enter a place name and get the formatted forecast for that area.
Friday, 2 February 2007
Thursday, 1 February 2007
Workshop 2 - continuing with the weather feed.
Last week you wrote a PHP script using SimpleXML to fetch an RSS feed from the BBC and formatted a page to display the forecast which was embedded in the RSS.
You noted that the way detailed weather data was handled by the three feeds (The Weather Channel, BBC and Yahoo) were very different and illustrate the point that merely using XML doesn't solve problems of communicating complex data. We also encountered problems with namespaces and attributes with the Yahoo feed. However the worksheet is about the BBC feed so we will avoid this problem for the moment.
In the last part of the work sheet, it asks you to parameterise the script so it can be used for different locations, identified by name This is a problem because the feeds are identified by an id internal to the BBC.
To solve this problem you can add your own data file which contains pairs of Place names and the corresponding BBC code. This data could be held in any of several forms - as a simple text file, as a MYSQL table but for this part of the course, you will create a small XML file to hold these pairs and then use a bit of XPath to find the matching record.
We will cover the basics of XPath in the lecture and how it is used in SimpleXML.
Next week we will be looking at creating more complex XML - kml files to create overlays for Google Earth. In preparation, please take a look at the introduction to GoogleEarth in this blog.
You noted that the way detailed weather data was handled by the three feeds (The Weather Channel, BBC and Yahoo) were very different and illustrate the point that merely using XML doesn't solve problems of communicating complex data. We also encountered problems with namespaces and attributes with the Yahoo feed. However the worksheet is about the BBC feed so we will avoid this problem for the moment.
In the last part of the work sheet, it asks you to parameterise the script so it can be used for different locations, identified by name This is a problem because the feeds are identified by an id internal to the BBC.
To solve this problem you can add your own data file which contains pairs of Place names and the corresponding BBC code. This data could be held in any of several forms - as a simple text file, as a MYSQL table but for this part of the course, you will create a small XML file to hold these pairs and then use a bit of XPath to find the matching record.
We will cover the basics of XPath in the lecture and how it is used in SimpleXML.
Next week we will be looking at creating more complex XML - kml files to create overlays for Google Earth. In preparation, please take a look at the introduction to GoogleEarth in this blog.
Thursday, 25 January 2007
Term 2 Schedule
| week no | Topics | Lecturer | |
|---|---|---|---|
| 13 | 26 Jan | Recap on XML, trees, Simple XML, intro to workshop, RSS, namespaces | CW |
| 14 | 2 Feb | XPath, XML structures | CW |
| 15 | 9 Feb | XML and Google Earth | CW |
| 16 | 16 Feb | XML Schemas, schema creation and induction | CW |
| 17 | 23 Feb | XQuery and XML databases | CW |
| 18 | 2 March | XSLT , Schema driven input | CW |
| 19 | 9 March | Triples, RDF | MB |
| 20 | 16 March | Ontologies | MB |
| 21 | 23 March | Preparation for Revision | CW/MB |
| 25 | 20 April | Multimodal - Voice + XML, Visualisation | CW |
| 26 | 27 April | XML in business | CW |
| 27 | 4 May | Revision |
Coursework 1 marked
Coursework 1 is ready for collection. At the back is a feedback sheet showing the breakdown of marks by section. Section 2 has been broken into three parts for the report, for the site and its functionality and for the way in which is was implemented in PHP, CSS and HTML. There are also comments on the coursework itself.
Marks range from 55 to 75 with an average of 65.
Generic feedback is here and will be handed out in the lecture.
Marks range from 55 to 75 with an average of 65.
Generic feedback is here and will be handed out in the lecture.
Tuesday, 23 January 2007
Workshop 1 Term 2 - RSS and PHP
A voice message (2 min 16 secs)
In this workshop we will continue the work looking with PHP and the SimpleXML class by using this approach to transform data from an RSS feed (a weather feed from the BBC).
You will also compare three sources of data - from the Weather Channel,. Yahoo and the BBC to identify differences in both structure and content of these data sources, and explore the reasons for these differences.
You will also be introduced to the notion of namespaces and the basics of location data, in preparation for work with Google Earth in the next workshop
In this workshop we will continue the work looking with PHP and the SimpleXML class by using this approach to transform data from an RSS feed (a weather feed from the BBC).
You will also compare three sources of data - from the Weather Channel,. Yahoo and the BBC to identify differences in both structure and content of these data sources, and explore the reasons for these differences.
You will also be introduced to the notion of namespaces and the basics of location data, in preparation for work with Google Earth in the next workshop
Monday, 22 January 2007
Lecture Week 14
In the lecture this Friday we will cover the following topics:
- A recap of trees, XML and the Simple XML interface in PHP
- an overview of the schedule for this term
- outline of the coursework for this term
- introduction to the workshop on RSS
Thursday, 18 January 2007
Google Earth
A brief message from the module leader:
This term , we will be studying a number of XML 'vocabularies' or languages. One which has received a great deal of attention is kml - keyhole mark-up language. Keyhole Corp was acquired by Google in 2004 and their software is the basis of GoogleEarth (GE). kml is the XML language which defines user additions called 'overlays' to the base digital imagery. A kml file is created when you create placemarks and other features in GE and save them as a file. kml is the plain text format, and kmz is a zip compressed format. These files can then be shared by providing a link on a web site, or adding to a GE community site. Moreover kml files can now be accessed by GoogleMap.
Where location data for a subject of interest is available from another source, kml can be generated dynamically using a server-side script such as PHP or XQuery. This is the aspect which we will be exploring in tutorials.
Resources
This term , we will be studying a number of XML 'vocabularies' or languages. One which has received a great deal of attention is kml - keyhole mark-up language. Keyhole Corp was acquired by Google in 2004 and their software is the basis of GoogleEarth (GE). kml is the XML language which defines user additions called 'overlays' to the base digital imagery. A kml file is created when you create placemarks and other features in GE and save them as a file. kml is the plain text format, and kmz is a zip compressed format. These files can then be shared by providing a link on a web site, or adding to a GE community site. Moreover kml files can now be accessed by GoogleMap.
Where location data for a subject of interest is available from another source, kml can be generated dynamically using a server-side script such as PHP or XQuery. This is the aspect which we will be exploring in tutorials.
Resources
- kml tutorial and reference
- GoogleEarth Community
- OgleEarth blog by Stefan Geens
- A GoogleTech Talk
- Using GoogleEarth - blog by John Gardiner, a GE developer (and keen mountain biker)
- KoKae - a GE tutorial from Richard Treves, a geographer at Southhampton University
- kml Schema
- A generated kml map of entertainment places in Bristol - view in Google Map
Subscribe to:
Posts (Atom)