twitter youtube
CALL: 01 - 685 3279

Open Data Primary Schools

Working on projects to do with the open data available in Ireland. First up is the data set on primary schools from the department of education.

1. Getting the Data


The data set is available from the Department of Education and Skills Ireland website. Click the primary schools link.

Click on the link for Primary Schools. This will download the file epl_primary_school_list_2010_2011.xls. An excel file containing details about all primary schools in Ireland.

2. Moving to Xml


Excel can be difficult to work with. So decided to convert the data in to an Xml file. First up I designed an Xml Schema to represent the data. This file is called primary.xsd.

3. Converting Excel to Xml


To convert the excel file to an Xml file. I used Apache POI in Java to access the Excel file.

I created a Java class to process the Excel file and store the data in an ArrayList. Here is that class.

I then created a Web Application to upload the Excel file. Web page to upload the file. A Java Servlet to read in the file details and process with the previous class. Then used a Jsp to display the data as Xml.

4. Validate the Xml against the Schema


To validate the Xml file change the root element from <schoolList> to the following.
<schoolList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="primary.xsd">
Wrote a basic SAX parser using JAXP to validate the Xml against the Schema.

5. Working with the Xml


To display the data is a visual format. I created an Xsl Style Sheet.

To link the Xml file with the style sheet add the following line to the Xml file before the element.
<?xml-stylesheet type="text/xsl" href="primary.xsl"?>

Here you can see the Xml and Xsl sheet combined to format the output.



Open Data