[Mailman-Developers] email schemas

John Dennis jdennis at redhat.com
Thu Jul 6 17:30:08 CEST 2006


On Thu, 2006-07-06 at 10:55 -0400, emf wrote:
> Hans G. Ehrbar wrote:
> > If mailman would be able to write an xml representation of
> > each message to a separate file, that would be wonderful.
> > Then one would be able to use xlst stylesheets to make
> > custom archives.
> 
> I've looked into this a bit, and so far have found only a few 
> schema-like things for email, and the ones I've found make each header 
> an element. It seems to me like perhaps one would not want that 
> arbitrariness and would instead prefer something like:
> 
> <head>
> <to></to>
> <from></from>
> <x-header name="X-List-Id"></x-header>
> </head>
> 
> Where the standard headers are their own elements but the extended ones 
> have their names in an attribute.

I'm not sure I understand what the purpose is in treating the extended
fields differently, it seems like it would overly complicate the xml
navigation without any clear advantage. Anyone who is interested in the
value of an extended field will know it by name and ask for it by name
just like the defined fields. Here I'm assuming the query will be
performed via either by evaluating an XPath expression (either via xlst
or via a procedural call, e.g. libxml2), or by navigating a DOM tree via
a number of DOM libraries or via an event driven SAX parsing library. In
all these cases I would imagine uniformly accessing the field by it's
element name without special casing the element name would be the
desired approach.

I'm sure you realize this, but you'll want to preserve the ordering of
the mail header fields when you generate the XML document.

> Looking at a few python projects that display mail, they mostly seem to 
> use the email module and then pull out the parts they're interested in.
> 
> In order to provide a feed interface/ decent moderation interface, I 
> have to have something analogous to this; while I don't intend to write 
> each mail out as xml, there should be an url you can tickle to get out 
> an xml representation.

-- 
John Dennis <jdennis at redhat.com>
Red Hat Inc.



More information about the Mailman-Developers mailing list