On Thu, 5 Jul 2012 17:36:12 +0200
Jaap Karssenberg <jaap.karssenb...@gmail.com> wrote:

> On Wed, Jul 4, 2012 at 6:16 PM, Brian Allen Vanderburg II
> <brianvanderbu...@aim.com> wrote:
> > I checked out zim-next and looked through some of the code.  Since
> > the data that gets passed to the exporters is already a parse tree,
> > it seems there could be a couple simpler solutions for XML export:
> >
> > 1.  Plain export of the parse tree as xml (with a root namespace).
> > My site builder allows chaining the output of one transform into
> > another based on the root element namespace, so I could then write
> > a transform that would transform the Zim xml to my document xml
> > which then would be transformed to the html result.
> >
> > I am working on implementing a simple exporter for this and have
> > attached a file with the changes.
> 
> Looks fair. Only doubt I have is that the structure that you dump
> there is something I consider an internal format that may be changed
> at will when code needs that. For export format we should probably fix
> a schema and make sure we do not change the XML accidentally.

I only tested this as a concept to see if it would work.  I agree if it
were used a schema should be defined for the exported data.
 
> How would XHTML work for you? I think a XHTML export would be used by
> much more people than some zim specific XML. You can still transform
> it like XML if you want.

XHTML would work probably fine for my needs. I'm checking to see how
much manual change I would need to current HTML exports to use with some
XSL files.

> 
> > 2.  XSL transforms on the parse tree.  This would allow creating any
> > output xml by using an xsl transform on the parse tree.  I don't
> > think Python's built-in xml modules have xsl support.  lxml does
> > but that would add another dependency to zim.
> 
> I wonder if you really need full XSL. My guess is that you would want
> to keep the content in sequence and maybe just rename some elements,
> ignore some elements, and maybe filter the tree. Is that a fair
> assumption ?
> 
> In the pyzim-next tree there is a python API for doing transforms on
> the tree (still working on it, but taking shape), so maybe for
> advanced users a simple python script can do all these things.

That sounds interesting.  I'll have to check that out later.


Brian Allen Vanderburg II

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Mailing list: https://launchpad.net/~zim-wiki
Post to     : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp

Reply via email to