XML 2003 logo

An XML-based Web Site using XML Query and SVG

Abstract

A new language is emerging from the World Wide Web Consortium: XML Query. It is a way to manipulate collections of XML documents, regardless of how or where they are stored. The possibilities offered by this new language have not yet been explored as much as more established languages such as XSLT.

The author describes the conversion of a web site to use an XML Query-based templating mechanism. The original Web site used static HTML pages created from metadata files by a Perl script.

XML Query was chosen to discover how well it works as a Web site template tool, and also as an opportunity to gain practical experience with the language. The author describes the resulting architecture and compares it both to the original Perl-based one and to an intermediate one using XSLT transformations.

In the new architecture, XML Query expressions are embedded within HTML templates; XML Query is also used to power a search engine. A CGI script written in Perl acts as a wrapper to the XML Query engine. The Perl CGI script also controls a results cache, partly to help performance but also to facilitate instrumentation of performance, and performance measurements will be presented.

The search engine lets visitors to the site search by category and keyword, and results can be presented as text summaries, as pages of image thumb-nails, and also as interactive graphical image sets using SVG. The ability to generate SVG from XML Query is exploited in this part of the Web design.

The XML Query specification is not yet complete, and in particular does not include provisions for updating a database. Until then, the redesigned Web site has to use another method for updating the stored metadata, and the existing Perl CGI script was re-purposed and incorporated into the wrapper script already mentioned.

Three programming languages (in addition to XML, XHTML and SVG) were used in the creation of the Web site: Perl, XML Query and JavaScript. With the later addition of a relational database back end, SQL is to be added; there may also be PHP used.

The result is that the final Web site is not as easy to maintain as the author would like, but with updates in XML Query, the administrative tasks would be more neatly partitioned, so that no single programmer or contributor would need to know multiple programming languages.

Multiple implementations of XML Query were investigated during this project, and an open source one selected. Incompatibilities due to the status of the XML Query specification made this difficult. A detailed comparison of XML Query implementations is out of the scope of this paper, but the author will explain his criteria for selection.

The functioning Web site will be briefly demonstrated, and comments made in conclusion about strengths and weaknesses of this approach.

Keywords

»Database, »Perl, »WWW, »XML, »XQuery.

1. Waitlisted Paper

Since this talk was waitlisted, no paper was prepared for the proceedings.

Biography

XML Activity Lead
»W3C

Liam Quin is XML Activity Lead at the World Wide Web Consortium (W3C).