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. 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. > 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. On the other hand if there is a real use case for full XSL we can always put it in a plugin and make the dependency optional. Regards, Jaap _______________________________________________ Mailing list: https://launchpad.net/~zim-wiki Post to : email@example.com Unsubscribe : https://launchpad.net/~zim-wiki More help : https://help.launchpad.net/ListHelp