XML's not abstract enough.  Let's use XLIFF to encode XML to encode our document.


I received an XML file from a friend.  The idea is that some Way Cool Application emitted this file.  If we can produce input in this form, we can put data into the Way Cool App and bypass lots of error-prone pointy-clicky.

I though it would be an easy job of reverse engineering the schema from the XML.  Easy and fun.  Tools do this.

My preference is to go from source data to Python objects to XML.  It makes the schema easier to work with when it's real Python objects.  It allows value-add processing in the Python.  The mapping of sources and destinations to Python classes and attributes is trivial to change -- it's just an easy-to-change Python Strategy object.

Representation and Meta-Representation

But the file was XLIFF, not simple XML.  Each XLIFF <group> had an extension data type.  Every single one.  No built-in XLIFF type was used. 

So we have the application data -- in Python class definitions.

We have several representations: relational databases, XML documents.

And we have a meta-representation: an XLIFF document which describes an XML document which describes the Python objects.

The Workflow

So, we have some source data in the relational database representation.  We query that (via ORM) to create the Python objects.  We unwind them into XML structures.  We then transform the XML in XLIFF structures.

What a lot of fooling around to load an application from a database.


Posted: Saturday - March 14, 2009 at 07:36 PM
       

Author: Steven Lott
Technorati Tags:
Technorati Cosmos: Technorati Cosmos
Technorati Watchlist: Technorati Watchlist
Add this entry to: