John W. Shipman | 18 May 05:06 2012

Announcing SOX: Sequential Output of XML

My CGI script that generates a huge XHTML table has been running
into storage limitations because it uses lxml to build the table.

So I build a Python module that applications can use to generate
any XML content as a stream, so you can generate arbitrarily
large XML files with a trivial amount of storage:

     http://www.nmt.edu/tcc/projects/sox/

Features:

- Like Fredrik Lundh's builder.py module, it takes very little
   code to generate a lot of XML.  If you're unfamiliar with this
   little gem, see here:

     http://effbot.org/zone/element-builder.htm

- The module insures that every start tag has a matching end tag.

Feel free to try this package out (Creative Commons BY-NC-ND
license).  I would greatly appreciate any feedback.

Best regards,
John Shipman (john <at> nmt.edu), Applications Specialist
New Mexico Tech Computer Center, Speare 146, Socorro, NM 87801
(575) 835-5735, http://www.nmt.edu/~john
   ``Let's go outside and commiserate with nature.''  --Dave Farber
_________________________________________________________________
Mailing list for the lxml Python XML toolkit - http://lxml.de/
lxml <at> lxml.de
(Continue reading)

Laurence Rowe | 18 May 14:06 2012
Picon

Re: Announcing SOX: Sequential Output of XML

On 18 May 2012 05:06, John W. Shipman <john <at> nmt.edu> wrote:
> My CGI script that generates a huge XHTML table has been running
> into storage limitations because it uses lxml to build the table.
>
> So I build a Python module that applications can use to generate
> any XML content as a stream, so you can generate arbitrarily
> large XML files with a trivial amount of storage:
>
>     http://www.nmt.edu/tcc/projects/sox/
>
> Features:
>
> - Like Fredrik Lundh's builder.py module, it takes very little
>   code to generate a lot of XML.  If you're unfamiliar with this
>   little gem, see here:
>
>     http://effbot.org/zone/element-builder.htm
>
> - The module insures that every start tag has a matching end tag.
>
> Feel free to try this package out (Creative Commons BY-NC-ND
> license).  I would greatly appreciate any feedback.

This sounds interesting, though the license you've picked seems to
prevent anyone actually using your software:

"No Derivative Works — You may not alter, transform, or build upon this work."

http://creativecommons.org/licenses/by-nc-nd/3.0/

(Continue reading)

kristian kvilekval | 18 May 19:44 2012
Picon

Re: Announcing SOX: Sequential Output of XML

On Thu, 2012-05-17 at 21:06 -0600, John W. Shipman wrote:
> My CGI script that generates a huge XHTML table has been running
> into storage limitations because it uses lxml to build the table.
> 
> So I build a Python module that applications can use to generate
> any XML content as a stream, so you can generate arbitrarily
> large XML files with a trivial amount of storage:
> 
>      http://www.nmt.edu/tcc/projects/sox/

I have been thinking about similar issues and wondering
about producing very large documents using generators.

The WSGI spec allows clients to return a generator allowing 
applications to generate partial content when it needs to sent.

It might be an interesting exercise to map your library to 
a protocol such that routines could return portions of
documents as elements to be iterated over.

> Features:
> 
> - Like Fredrik Lundh's builder.py module, it takes very little
>    code to generate a lot of XML.  If you're unfamiliar with this
>    little gem, see here:
> 
>      http://effbot.org/zone/element-builder.htm
> 
> - The module insures that every start tag has a matching end tag.
> 
(Continue reading)


Gmane