XPY 0.1.0 released

Juan David Ibáñez Palomar j-david@noos.fr
Fri, 06 Dec 2002 17:08:32 +0100


Download from http://sourceforge.net/projects/lleu/


XPY stands for XPath PYthon, it is a tool to transform XML documents to
something else. It is inspired by XSLT, the main difference is that the
transformation language is Python.
 
First the XML document is loaded as an extended DOM tree, where each node
has new methods that begin with the prefix 'xpy_', these methods define
a higher level API used to transform the tree.
 
We will call this extended tree an XPY tree. Once it is loaded it can be
transformed with the standard DOM API or with the XPY one.
 
The XPY API lets to use XPath expressions to match nodes in the tree, then
Python functions are applied to these nodes. We will call rules to these
Python functions, following the terminology from XSLT.
 
Typically there are one or more templates (XML documents) which are
transformed by rules (Python functions) using the XPY API. To generate the
final tree these rules use data that could be stored in a database, for
example. So we have three different elements: the presentation, the logic
and the content, achieving a better separation between them than most
tools. Each element is implemented using the best posible way: a general
purpose programming language for the logic, Python; a description language
for the presentation, XHTML for example; and a database for the content (a
relational database, the ZODB, etc..).
 
The main advantage of this separation is scalability, it is possible to
refactor the code without limits, unlike the most commonly used template
languages; and the source looks much more like the final result.


Best regards,

-- 
J. David Ibáñez, http://www.j-david.net
Software Engineer / Ingénieur Logiciel / Ingeniero de Software