[silva-dev] Silva XML import/export machinery

eric casteleijn eric at infrae.com
Tue May 23 15:38:37 CEST 2006


Luthiger Stoll Benno wrote:
> Hello
> 
> What is the appropriate approach to implement Silva XML import/export for custom content types (using Silva 1.4)?
> According to the discussion on this list on year ago, I have to implement import and export handlers and then I have to register them in the extension's __init__.py.
> 
> In Silva/silvaxml, there's another approach implemented. However, the README discourage strongly to go that way. It states, that "...the API is soon to be replaced by a more generic and developer-friendly one." So, where are we at the moment and what will be the future concerning Silva XML import/export?

Hmmm, the readme may be out of date, I'll look into that. The way to go 
is create your own sax handlers and producers and register them. This 
may sound more daunting than it actually is, since Silva and Sprout 
provide handy base classes which do a lot of the work. If you look at 
the silvaxml directory of SilvaDocument, you can see how an extension 
can register its own handlers and producers, but since SilvaDocument is 
something of a special case, and rather complicated, a simpler example 
may be in order. SilvaDLCMS now also uses the new import/export 
infrastructure, so have a look at the dlcms_xml directory in the trunk 
version of that, for a relatively simple example.

Silva's own export and import classes may be good examples as well.

cheers,

eric



More information about the silva-dev mailing list