[plt-scheme] Serializing objects as XML

From: James Thorpe (james at thorpeweb.com)
Date: Wed Feb 13 06:04:31 EST 2008

Can someone point me in the right direction please?

I have an application that needs to process XML data based on its
content according to some arbitrary rules that will be defined at runtime.

For example: if element Type is 'ABC and element Amount is 100 then call
function foo.

I have a couple of requirements that guide what I am attempting to do.

1. I want to do this with the simplest syntax I can since the rules will
be defined by people without a deep knowledge of scheme

Ideally something like
    (if (and
            (eq? Type 'ABC)
            (= Amount 100))

2. This solution needs to be reasonably fast as there may be up to
100,000 XML documents to apply the rules to.

My first (and current) approach is to create a number of classes and
reify the XML as objects and the serialize back to XML when I need to.
This executes quickly and the resulting object syntax is palatable but I
have found no easy way to undertake the conversion between object and
XML.  Does anyone know of a library which can handle this task or do I
need to start coding some macros?

Is there a better way?


Posted on the users mailing list.