More than a year ago I did a small extra exercise for my XML lecture.
Encouraged by a photo gallery done by Philip Guo a Ph.D candidate at Stanford, I started doing my own system, I took the challenge to write an open-source photo gallery based on XML technologies. I started the project on December 2006, the first version was finished by January 2007. (Un)fortunately in an accident I lost all file sources and I had to redo again my gallery system, from scratch. The new version was finished on May 2008.
This system, basically, is a graphic interface to exhibit pictures and meta-data attached to each one. In this new version there is a simple upper bar (number based) with links to open each picture and its meta-data, a central frame for pictures and a upper title for each gallery. This version has been set up to be integrated in space and style, directly on my blog. But as it is XML based, it can be adapted in style and functionality to another specific needs.
The concept was to generate XML documents to store information about my pictures and to transform these documents using XML-tools into web-pages to publish and share my pictures. I chose XML because is a light but powerful technology to arrange, organise and store different sort of data in a structured way. XML allows to separate completely content from structure, design and functionality in a versatile manner. I used here XML to document my photos and to add information related to them (a title, notes, dates). I used XML-tools to transform these documents into a web-page gallery, too.
The system consists of three files: a skeleton (XML), a document schema (XSD) and a transformation extensible stylesheet (XSL-T). I use Xalan as a XSLT processor, in order to process my XML files and doing so generate a HTML output file, that combine with a CSS and a Javascript! file are the final gallery.
XML files.
How to use it.
- <galleryFolder folder=”myFolder”/> the folder that contains all your pictures: *.jpg, *.gif or *.png
- <galleryName> Name of your gallery.
- <image>there you provide the file name, picture dimensions: width and height, a date, a title and a description.
- java -jar xalan.jar -in myXmlFile.xml -xsl processdrnn(simple).xslt -out myHtmlFile.html
Now, if you have all files on the right places, you should be able to open your HTML gallery file in the web browser. If you want you can change the CSS and the javascript! file to customise design and interaction, if you want to add new information then first you have to declare a new document structure in the Schema and then implement it in the XML file, otherwise the document is not valid and Xalan gives you an error during processing.
Perhaps is a lit bit difficult to write or fill up manually your XML files, then the next step should be to write an XML application to do automatically this XML files, but I don’t have enough time for this is a task.
Finally here are all needed files in *.rar and *.zip. Each compressed files contains a XML skeleton, the XML schema, a XSL-T file, a CSS file, a JS file. As well as a complete example, all pictures contained there were taken in a short trip I did to Minden in north Germany.
Example:
Any comment would be more than Welcome!
Many thanks to: Philip Guo and Rainer Müller.
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.
Category: Uncategorized |
Hey Ricardo!
Excellent project. Works very nice. I would like to take this project further and implement a small webapp (Flickr Style) with it. I am already planning some key features for it.
-thumbnails
-ajax implementation
If anyone is interested in cooperating in the development feel free to contact me.
I like the first picture very much : )
Hi Ricardo,
It is great to see you are still using XML technologies.
I like the design of your blog and also of the image gallery. Especially the container in grey at the bottom of each image (with title and description) looks fine.
If you questions concerning XSLT etc. do not hesitate to ask.
Kind regards
Rainer