[XML-SIG] Python / XML / XSLT vs. Cocoon for website server side

Dave Kuhlman dkuhlman at cutter.rexx.com
Thu Aug 14 15:57:08 EDT 2003

On Thu, Aug 14, 2003 at 01:54:14PM -0700, Richard Johannesson wrote:
> I am laying out a new medium size website that I was hoping I could use
> Python / XML on the server side. This is a brand new site, no e-commerce at
> first, but will add later. Site will need the blog, wiki, group calendar,
> and other basic features. The size of site will initially about 50 pages,
> but should grow quickly to few thousand pages. Much of the content will be
> produced by users. So, main concern is being able to apply stylesheets to
> content to keep a consistent look.
> Key decisions:
>  - All HTML generation done via XSLT

You may also want to consider straight Python.  You could use
Python code that works from the XML DOM (e.g. minidom).  There are
also several solutions that will turn an XML document into a
specialized DOM where the classes (and the instances that form the
DOM tree) reflect the elements and tags in the XML source document.

>  - Have logic done in XSLT where possible

Ha. Ha. Ha.  Only a sick pervert would make a joke like that.

Can someone who has tried doing logic in XSLT stylesheets give a
bit of insight on how to do logic in XSLT?  My understanding is
that XSLT is good for recursive pattern matching and generation of
content from patterns/templates, but not good once you go beyond
that.  Can someone confirm that or show how complex logic is done
in XSLT stylesheets?  Would that logic be readable and

>  - Use Python for glue

Good idea.  Python *is* glue.  See "Glue It All Together With


>  - Use Postgresql for RDBMS

Good idea.  There are several implementations of the Python DB API
for PostgreSQL.  I'm using pyPgSQL myself.  It makes database
access via SQL pretty easy.

>  - Use FreeBSD for Servers
>  - Strict separation of content / presentation / logic
>  ? Need to figure out what XML (enabled) database can use from Python
> Here are the assumptions I'm making:
>  - XML to HTML transformations via XSLT will provide good platform
> independence. .Net, J2EE, Python all support XSLT. So, if required to move
> to different platform, this should be possible

Not to try to talk you out of XSLT, but there are other ways to
gain platform independence.  Python is one good way.

>  - XSLT/XML can generate just about any html page a CSS/template engine can

If you are saying that XSLT is a suitable tool for generating *any*
HTML from XML, I'd be skeptical.  My belief is that there are
complex transformations for which XSLT would *not* be suitable. 
Again, is there an XSLT expert that can give an evaluation here?

>  - Adding new content using XML/XSLT is less work than using ASP/PHP/JSP
> etc.
> Decided to stay away from J2EE / Jboss (overkill/long ramp-up time/slow
> development).
> I've been wondering how much extra work I'll have to do in Python if I don't
> use something like Cocoon. I guess it's possible to use Cocoon with Python.
> Would anyone recommend using Cocoon or some alternative?
> Is there much consulting work for XML/Python? Current customers are pretty
> much exclusively ASP / ASP.net.
> Thanks in advance for any feedback on the assumptions I'm making above, any
> comments about Cocoon, or what XML database Python supports.
> Regards,
> Richard
> _______________________________________________
> XML-SIG maillist  -  XML-SIG at python.org
> http://mail.python.org/mailman/listinfo/xml-sig


Dave Kuhlman
dkuhlman at rexx.com

More information about the XML-SIG mailing list