[Zope-CMF] Re: A better CMFworkflow - XML configuration

Karl Anderson karl@digicool.com
09 Jul 2001 15:59:39 -0700


Shane Hathaway <shane@digicool.com> writes:

> > If the XMLObject project was ready, we could even try this on existing
> > workflow tools without distracting them at all. It sounds like that will
> > someday provide XML (de)serialization.
> 
> I've written several XML (de)serialization routines (for other
> projects), and they all turned out to be a lot more work than I
> expected.  There must be a pattern out there that's easy to apply and
> extend.  Look, for example, at the implementation of PPML, the "Python
> Pickle Markup Language", in lib/python/Shared/DC/xml.  The
> implementation is much more complex than I would expect.

This is one of the intended benefits for ZDOM.

The idea is that Zope objects could provide a DOM interface, and XML
(de)serialization would be on top of that.

An XML representation based on a one-size-fits-all DOM interface would
likely be clunky for complex objects, but so far I've assumed that
this isn't a big deal - XML is made to be clunky :) and the question
is what tools could be used to translate this to usablility by the
time it reaches a human.  Subclasses of the DOM interface tailored to
object types?  DOM Traversal interfaces to filter out unwanted info?
Transforms to compartmentalize unwanted info into nodes that could be
collapsed in the interface? 

> Here's an off-topic thought: writing Python object <-> XML routines in
> Python is more complex than expected, and writing Python object <-> XML
> routines in XML (i.e. XSLT) is also complex, but maybe the "sweet spot"
> is in writing a short XML file that combines with a short Python file? 
> Somehow you'd put everything XMLish in the XML file and everything
> Pythonic in the module.  Hmm... :-)

I don't get this idea - what's the difference between Pythonic data
and XMLish data?  I think of XML as a wire format for hierarchical
information - look at the DOM or the Infoset to see how simple this
hierarchy has to be.  If your Python stuff fits that mold,
(de)serializing will be easy, else it will take effort.  So rather
than storing stuff as XML, where it's hard to reach, store it as
Python objects which are easily translatable to nodes, attributes,
etc..

-- 
Karl Anderson                          karl@digicool.com