Geofunctions is an open-source project which aims to provide geographic processing capabilites to the XSLT and XQuery languages.
Extensible Stylesheet Language for Transformations is a language for transforming XML documents. It has a rich document addressing model which facilitates access to XML document content. XSLT is itself an XML vocabulary, allowing XSLT programs to be managed as data. The declarative nature of the language lends itself to functional programming. With version 2 of the XSLT language, the ease of use of the language has taken a giant leap forward.
XSLT is a minimalist language. The editors of the XSLT specification have taken the design decision to keep the core function set small, while encouraging extensions to the language by implementations. A well known forum for the specification of language extensions is exslt.org.
XSLT 2 provides facilities which allows stylesheet developers to write their own stylesheet functions. This greatly reduces the need for extension functions. That is not to say such functions are not needed, and useful. An example of such a useful extension function library is the standard EXSLT math library.
Among other things, Geofunctions is an integration of the Java Topology Suite (JTS) with the Saxon 9.0 XSLT 2 processor. GeoFunctions provides a set of XSLT sytlesheet functions (and templates) wrapping the underlying JTS functions of the same name. JTS is an implementation of the Open Geospatial Consortium Simple Features Access specification of an abstract interface for geographic data types. These types include Geometry, GeometryCollection, Point, LineString, Polygon, MultiPolygon, MultiLineString, MultiPoint.
The most prevalent "vector" geographic data format available today is the shapefile. Files encoded in GML tend to be less common. As a result, few geography-literate programmers have experience with XSLT. One goal of Geofunctions is to change that situation. One step in this direction is to make XSLT a viable choice for geographic programmers when processing shapefiles. Thus, Geofunctions provides a set of "shapefile" parsers, which allow the developer to invoke saxon over a shapefile, and, by providing an XSLT stylesheet coded to the "canonical" GML form of the shapefile as returned by the parser, to process shapefiles using XSLT, possibly XQuery, and Geofunctions.