On 10/29/2013 01:12 AM, Jos? Antonio Rocha wrote: > 2013/10/29 Gregory Pittman <gpittman at iglou.com> > >> After delving into XSLT a bit, I decided to experiment with using it to >> transform SLA files. Once you modify your SLA file a bit, by adding a line >> and then changing the extension to .xml, you can then make an XSLT file to >> process it for a browser. >> >> Here is a wiki page where I give a small example of what you might do: >> >> http://wiki.scribus.net/**canvas/Scribus_files_as_XML<http://wiki.scribus.net/canvas/Scribus_files_as_XML> >> >> Greg >> > > Nice trick! > Someone can build a ebook with that. > > It looks to be even trickier than I thought, though. One of the issues is that in the Scribus file format, PAGEOBJECTs simply get appended as they are added. So you might have 50 pages, then if you add an object to page 1 at the very end of your design, it will be the last PAGEOBJECT in the file, with a reference to its proper page. Very hard to parse with XSLT.
So my thinking is that, odd as it seems, it may work better to generate a new XML file from a Python script inside of Scribus. In a sense, it would be this concept: http://wiki.scribus.net/canvas/Extracting_All_Text_from_a_Document but "on steroids" with a more complex output. This would allow for a less complex XSL stylesheet, since there could be purpose-built tags generated. Greg
