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

Here should go questions about transforming XML with XSLT and FOP.
Zearin
Posts: 107
Joined: Mon Jul 30, 2007 11:31 pm
Location: College Park, MD, United States

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

Post 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.)
-- Zearin
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

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

Post 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
Post Reply