Page 1 of 1

Reverse-generating from a TOC (Table of Contents)?

Posted: Tue Jul 21, 2009 8:48 pm
by Zearin
There are plenty of existing tools to scan an XML document and generate a Table of Contents according to the document's structure. (Specifically, I'm talking about DocBook 5—but it could be something else too.)

I'm wondering if anybody knows of an XSL stylesheet that will do the reverse: use a TOC to generate a document skeleton.
  1. Does something like this already exist?
  2. If not, does anyone know how to do this? (DocBook is desired most of all, but if this can be done in an abstract way that can be reused for any XML dialect, even better.)

Re: Reverse-generating from a TOC (Table of Contents)?

Posted: Mon Jul 27, 2009 5:12 pm
by sorin_ristache
Hello,

I think a stylesheet for generating a document from a Table of Contents does not exist. I think it can be developed using XSLT 2.0. Starting from the XML document containing the Table of Contents a stylesheet can generate the XML files for DocBook 5 or for other desired schema using xsl:result-document elements.

I think there is no standard format for the XML file containing the Table of Contents so you have to decide that format before creating the XSLT stylesheet.


Regards,
Sorin